---
title: "Complete GEE OAuth flow without requiring a JWT — for clients (e.g. the QGIS"
method: POST
path: "/api/v1/gee-oauth/callback"
---

# Complete GEE OAuth flow without requiring a JWT — for clients (e.g. the QGIS

`POST /api/v1/gee-oauth/callback`

plugin) that open the browser but cannot receive the Google redirect directly.

The user ID is resolved from the ``state`` parameter via the reverse mapping
written by the initiate endpoint, so no authentication header is needed.

**Content-Type**: application/json

**Request Body**:
- ``code`` (str, required): Authorization code from Google
- ``state`` (str, required): CSRF state token from the initiate call

**Response**:
```json
{
  "data": {
    "status": "connected",
    "gee_google_email": "user@gmail.com",
    "client_type": "qgis_plugin"
  }
}
```

``client_type`` reflects the originating client (``"qgis_plugin"`` or ``null``)
and is used by the callback page to show a context-appropriate success message.

**Error Responses**:
- ``400``: Missing/invalid code or state
- ``404``: User not found
- ``500``: Token exchange or save failure

## Request body

- object

## Response `200`

Success

- object

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/trends/apis/trends-earth-api.md) · [All operations](https://skmtc.dev/trends/apis/trends-earth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trends/trends-earth-api/revisions/6bdbc0b84666/schema)
