---
title: "Exchange access code"
method: GET
path: "/oauth2/{appId}/exchange/{code}"
tags: ["OAuth"]
---

# Exchange access code

`GET /oauth2/{appId}/exchange/{code}`

Exchanges an authorization code for an API key.

## Path parameters

- `appId` string, uuid, required
- `code` string, required

## Response `200`

The object was successfully returned.

- StringResponse — Represents a default generic response for API endpoints.
  - `success` boolean, required — Indicates whether the operation or response was successful.
  - `message` string, nullable — A descriptive message providing additional context or information about the response.
  - `code` string, nullable — The error code (if there was an error) to use when referencing the error
  - `data` string, nullable — Represents the data associated with a response.

## Other responses

- `401` — The OAuth2 client secret or access code is invalid
- `403` — The OAuth2 client secret or access code is invalid
- `404` — The OAuth2 application ID was not found

---

[API](https://skmtc.net/komerza/apis/komerza-api.md) · [All operations](https://skmtc.net/komerza/apis/komerza-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/komerza/komerza-api/revisions/060e78bc7f80/schema)
