---
title: "Exchange a Google desktop code for tokens"
method: POST
path: "/v1/auth/google/desktop/exchange"
tags: ["auth"]
---

# Exchange a Google desktop code for tokens

`POST /v1/auth/google/desktop/exchange`

## Request

- Base URL: `https://api.smartloop.ai`
- URL: `https://api.smartloop.ai/v1/auth/google/desktop/exchange`
- Auth: none declared

## Request body

- object
  - `code` string, required
  - `state` string, required

## Response `200`

Signed in

- TokenPair
  - `access_token` string, required
  - `refresh_token` string, required
  - `token_type` 'bearer', required

## Other responses

- `400`: Invalid or expired desktop sign-in state
- `422`: Validation error

---

[API](https://skmtc.dev/smartloop/apis/smartloop-platform-api.md) - [All operations](https://skmtc.dev/smartloop/apis/smartloop-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smartloop/apis/smartloop-platform-api/revisions/17a787eabbe8?raw)
