---
title: "Handle Oauth Callback"
method: POST
path: "/v1/platforms/callback"
tags: ["platforms"]
---

# Handle Oauth Callback

`POST /v1/platforms/callback`

## Request

- Base URL: `https://api.theagentc.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.theagentc.io/v1/platforms/callback`
- Auth: HTTP bearer

Handle the OAuth callback from the platform.

Exchanges the authorization code for access + refresh tokens,
fetches the user's profile, and saves credentials to the brand.

## Request body

- CallbackRequest: OAuth callback parameters (from platform redirect).
  - `code` string, required: Authorization code from the platform
  - `state` string, required: CSRF state to verify
  - `brand_id` string, uuid, required: Brand being connected
  - `platform` string, required: Platform being connected
  - `redirect_uri` string, required: Same redirect_uri used in connect

## Response `200`

Successful Response

- CallbackResponse: Result of completing OAuth flow.
  - `success` boolean, required
  - `platform` string, required
  - `account_username` string, nullable
  - `message` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/theagentc/apis/the-agent-c-api.md) · [All operations](https://skmtc.dev/theagentc/apis/the-agent-c-api/llms.txt) · [OpenAPI document](https://skmtc.dev/theagentc/apis/the-agent-c-api/revisions/1c9868b44584?raw)
