---
title: "OAuth Callback"
method: POST
path: "/v1/graphs/{graph_id}/connections/oauth/callback/{provider}"
tags: ["Connections"]
---

# OAuth Callback

`POST /v1/graphs/{graph_id}/connections/oauth/callback/{provider}`

## Request

- Base URL: `https://api.robosystems.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.robosystems.ai/v1/graphs/{graph_id}/connections/oauth/callback/{provider}`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Completes the OAuth authorization flow after provider redirect. Exchanges the authorization code for tokens, stores them, and triggers an initial sync. This is a redirect target — not typically called directly. QuickBooks: only the company that built the graph's books may connect to them; another company is refused (409 OTHER_COMPANY_BOOKS) before any token is issued. Plaid: pass Link's public_token as `code`; a bank already connected to the graph is refused (409 DUPLICATE_BANK_CONNECTION).

## Path parameters

- `provider` string, required: OAuth provider name
- `graph_id` string, required

## Request body

- OAuthCallbackRequest: OAuth callback parameters.
  - `code` string, required: Authorization code from the OAuth provider (Plaid: the public_token Link returned)
  - `state` string, required: OAuth state for verification
  - `realm_id` string, nullable: QuickBooks-specific realm ID
  - `error` string, nullable: OAuth error if authorization failed
  - `error_description` string, nullable: OAuth error details

## Response `200`

Successful Response

- OAuthCallbackResponse: Result of completing an OAuth authorization flow.
  - `success` boolean, required: Whether the connection was established
  - `message` string, required: Human-readable outcome of the exchange
  - `connection_id` string, required: Connection the authorization was linked to
  - `auto_sync_task_id` string, nullable: Task id of the initial sync started after connecting, or null when no sync was kicked off

## Other responses

- `400`: Invalid request
- `401`: Authentication required
- `403`: Access denied
- `404`: Resource not found
- `422`: Validation Error
- `429`: Rate limit exceeded
- `500`: Internal server error

---

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