Browse the API reference

Create Connection

post/v1/graphs/{graph_id}/connections

Part 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) is refused (409) beside a live QuickBooks connection or on a graph with no chart of accounts.

Authentication

Authenticate in any one of these ways — not all of them:

  • API key in the X-API-Key header.
  • Bearer token in the Authorization header.

Path parameters

NameTypeDescription
graph_idrequiredstringGraph Id

Request body

Required, application/json.

FieldTypeDescription
providerrequiredstring

Connection provider type

One of: quickbooks, external, mercury, plaid

entity_idoptionalstring

Entity identifier. Required for QuickBooks.

quickbooks_configoptionalQuickBooksConnectionConfig

QuickBooks-specific connection configuration.

QuickBooksConnectionConfig fields
FieldTypeDescription
realm_idoptionalstring

QuickBooks Realm ID

refresh_tokenoptionalstring

OAuth refresh token

external_configoptionalExternalConnectionConfig

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 ``source_name`` on everything it emits.

ExternalConnectionConfig fields
FieldTypeDescription
source_namerequiredstring

Source slug the integration stamps on the events it emits (lowercase letters, digits, '-', '_'; must start with a letter). Unique per graph among live connections.

display_nameoptionalstring

Human-readable label for the connections UI.

mercury_configoptionalMercuryConnectionConfig

Mercury bank-feed connection configuration. A bank feed is native accounting: the graph must already have a chart of accounts and no live QuickBooks connection. Over OAuth (the hosted default) the connection is created ``pending_oauth`` and activated by the callback. ``api_key`` — a personal **read-only** Mercury token — connects at once without a browser round-trip, but only on deployments that turn on ``MERCURY_API_KEY_CONNECTIONS_ENABLED`` (self-hosted and local); the hosted product refuses it.

MercuryConnectionConfig fields
FieldTypeDescription
since_dateoptionalstring (date)

First day of the backfill (ISO 8601). Defaults to 1 January of last year. Incremental syncs never look back before it.

include_treasuryoptionalboolean

Capture treasury-account activity alongside checking/savings.

Default: true

api_keyoptionalstring

A personal read-only Mercury API token, for deployments that allow the api_key credential mode. Omit to connect over OAuth.

plaid_configoptionalPlaidConnectionConfig

Plaid bank-feed connection configuration. A bank feed is native accounting: the graph must already have a chart of accounts and no live QuickBooks connection. The connection is created ``pending_oauth``; ``POST /oauth/init`` returns a ``link_token`` for Plaid Link, and the ``public_token`` Link hands back completes it through ``POST /oauth/callback/plaid`` (as ``code``). One connection per institution login; a graph can hold several.

PlaidConnectionConfig fields
FieldTypeDescription
since_dateoptionalstring (date)

First day of the backfill (ISO 8601), and how much history Plaid is asked to pull for the new Item (at most two years). Defaults to 1 January of last year.

Example request

curl
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

FieldTypeDescription
connection_idrequiredstring

Unique connection identifier

providerrequiredstring

Connection provider type

entity_idoptionalstring

Entity identifier

statusrequiredstring

Connection status

created_atrequiredstring (date-time) | string

Creation timestamp

updated_atoptionalstring (date-time) | string

Last update timestamp

last_syncoptionalstring (date-time) | string

Last sync timestamp

write_policyoptionalstring

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_nameoptionalstring

External-provider registered source slug — the value the integration stamps on the events it emits. Null for platform providers.

metadatarequiredobject

Provider-specific metadata

StatusMeaning
400Invalid request
401Authentication required
403Access denied
404Resource not found
409Connection already exists for this provider
422Validation Error
429Rate limit exceeded
500Internal server error