---
title: "Complete OAuth flow and store Google Earth Engine credentials."
method: POST
path: "/api/v1/user/me/gee-oauth/callback"
---

# Complete OAuth flow and store Google Earth Engine credentials.

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

**Authentication**: JWT token required
**Authorization**: Any authenticated user
**Content-Type**: application/json

**Request Body Schema**:
```json
{
  "code": "authorization_code_from_google",
  "state": "state_token_from_initiate_call"
}
```

**Required Fields**:
- `code`: Authorization code received from Google OAuth callback
- `state`: State token from the initiate call for CSRF protection

**Response Schema**:
```json
{
  "message": "GEE OAuth credentials saved successfully"
}
```

**Error Responses**:
- `400 Bad Request`: Missing code/state, invalid code, or JSON parsing error
- `401 Unauthorized`: JWT token required or invalid
- `404 Not Found`: User not found
- `500 Internal Server Error`: Failed to exchange code or save credentials

## 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)
