OAuth Callback
/v1/graphs/{graph_id}/connections/oauth/callback/{provider}Part of Connections.
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. Plaid: pass Link's public_token as code; a bank already connected to the graph is refused (409 DUPLICATE_BANK_CONNECTION).
Authentication
Authenticate in any one of these ways — not all of them:
- API key in the
X-API-Keyheader. - Bearer token in the
Authorizationheader.
Path parameters
| Name | Type | Description |
|---|---|---|
providerrequired | string | OAuth provider name |
graph_idrequired | string | Graph Id |
Request body
Required, application/json.
| Field | Type | Description |
|---|---|---|
coderequired | string | Authorization code from the OAuth provider (Plaid: the public_token Link returned) |
staterequired | string | OAuth state for verification |
realm_idoptional | string | QuickBooks-specific realm ID |
erroroptional | string | OAuth error if authorization failed |
error_descriptionoptional | string | OAuth error details |
Example request
curl -X POST "https://api.robosystems.ai/v1/graphs/{graph_id}/connections/oauth/callback/{provider}" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "string",
"state": "string"
}'Responses
200 Successful Response
| Field | Type | Description |
|---|---|---|
successrequired | boolean | Whether the connection was established |
messagerequired | string | Human-readable outcome of the exchange |
connection_idrequired | string | Connection the authorization was linked to |
auto_sync_task_idoptional | string | Task id of the initial sync started after connecting, or null when no sync was kicked off |
| Status | Meaning |
|---|---|
| 400 | Invalid request |
| 401 | Authentication required |
| 403 | Access denied |
| 404 | Resource not found |
| 422 | Validation Error |
| 429 | Rate limit exceeded |
| 500 | Internal server error |