Create Connection
/v1/graphs/{graph_id}/connectionsPart of Connections.
QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — POST /oauth/init returns a link_token for Plaid Link. A bank feed (Mercury, Plaid) names the entity its accounts book to (entity_id, the group parent when omitted) and is refused (409) when that entity has no chart of accounts or is the one QuickBooks keeps; QuickBooks is refused (409) when the group parent's books are already native.
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 |
|---|---|---|
graph_idrequired | string | Graph Id |
Request body
Required, application/json.
| Field | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
providerrequired | string | Connection provider type One of: | |||||||||||||||
entity_idoptional | string | Entity identifier. Required for QuickBooks. Constraints: at least 1 character | |||||||||||||||
quickbooks_configoptional | QuickBooksConnectionConfig | QuickBooks-specific connection configuration. QuickBooksConnectionConfig fields
| |||||||||||||||
external_configoptional | ExternalConnectionConfig | External-integration connection configuration.
Registers a source namespace for an integration the platform does not
run: the connection is registration + telemetry, not execution config.
The platform holds no credentials for the external source — the
integration authenticates to its own source and writes here through
the public API, stamping ExternalConnectionConfig fields
| |||||||||||||||
mercury_configoptional | MercuryConnectionConfig | Mercury bank-feed connection configuration.
A bank feed is native accounting: the entity its accounts land on must
already have a chart of accounts and must not be the one QuickBooks keeps
(the group parent, while QuickBooks is connected). Over OAuth (the hosted
default) the connection is created MercuryConnectionConfig fields
| |||||||||||||||
plaid_configoptional | PlaidConnectionConfig | Plaid bank-feed connection configuration.
A bank feed is native accounting: the entity its accounts land on must
already have a chart of accounts and must not be the one QuickBooks keeps
(the group parent, while QuickBooks is connected). The connection is
created PlaidConnectionConfig fields
|
Example request
curl -X POST "https://api.robosystems.ai/v1/graphs/{graph_id}/connections" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "quickbooks"
}'Responses
201 Successful Response
| Field | Type | Description |
|---|---|---|
connection_idrequired | string | Unique connection identifier |
providerrequired | string | Connection provider type |
entity_idoptional | string | Entity identifier |
statusrequired | string | Connection status |
created_atrequired | string (date-time) | string | Creation timestamp |
updated_atoptional | string (date-time) | string | Last update timestamp |
last_syncoptional | string (date-time) | string | Last sync timestamp |
write_policyoptional | string | Source-of-truth write policy: 'native' (RoboSystems is authoritative; no outbound write-back) or 'qb_authoritative' (QuickBooks is authoritative; RoboSystems-originated entries publish to QB). Set via the write-policy endpoint. |
source_nameoptional | string | External-provider registered source slug — the value the integration stamps on the events it emits. Null for platform providers. |
metadatarequired | object | Provider-specific metadata |
| Status | Meaning |
|---|---|
| 400 | Invalid request |
| 401 | Authentication required |
| 403 | Access denied |
| 404 | Resource not found |
| 409 | Connection already exists for this provider |
| 422 | Validation Error |
| 429 | Rate limit exceeded |
| 500 | Internal server error |