---
title: "Exchange device user_code for an API key"
method: POST
path: "/api/cli/auth/exchange-code"
tags: ["CLI Auth"]
---

# Exchange device user_code for an API key

`POST /api/cli/auth/exchange-code`

## Request

- Base URL: `https://slidesfly.com`
- URL: `https://slidesfly.com/api/cli/auth/exchange-code`
- Auth: none required

## Request body

- object
  - `user_code` string, required
  - `state` string, required
  - `code_verifier` string, required

## Response `200`

API key issued

- ApiKeyExchangeSuccess
  - `ok` unknown, required
  - `data` object, required
    - `api_key` string, required
    - `prefix` string, required

## Other responses

- `401`: Missing or invalid credentials
- `429`: Rate limited

---

[API](https://skmtc.dev/slidesfly/apis/slidesfly-http-api.md) · [All operations](https://skmtc.dev/slidesfly/apis/slidesfly-http-api/llms.txt) · [OpenAPI document](https://skmtc.dev/slidesfly/apis/slidesfly-http-api/revisions/9da38f802ead?raw)
