Docyrus Integrations & Connectors
Use third-party integrations from the terminal with docyrus connect. A connector (a.k.a. data provider) is a platform-defined external integration (identified by a slug, e.g. msgraph, twilio, meta) that bundles managed auth + a set of callable actions + data sources. You discover connectors and their actions, then run actions or make raw authenticated requests through the connector's provider auth — without handling tokens yourself.
Concepts (read first)
- Connector / data provider — the integration definition (
core_data_provider), addressed byslug. Holds the auth type, base URL, and the actions it exposes. - Action — a callable operation a connector exposes (
core_action), addressed by provider slug + actionkey(e.g.msgraph+sendEmailWithOutlook). HasinputJsonSchema/outputJsonSchema. - Connection — a tenant's stored credentials for a connector (
tenant_connection), or a per-user OAuth2 connection (tenant_connection_user). Connections hold the tokens/keys. - Connection account — an optional sub-account within a connection (e.g. one of several ad accounts / mailboxes), addressed by
--connectionAccountId. List the available ones (and their ids) withGET /v1/connectors/{slug}/connection-accounts— see Listing connection accounts.
⚠️ Connections are NOT created by this CLI. There is no
create-connectioncommand. Credentials/OAuth connections are set up in the Docyrus UI (OAuth flow) or via the raw API. This skill discovers and uses connectors; if no connection exists for a provider, the user must connect it first.
Workflow
-
Confirm auth. Every command needs an active session.
docyrus auth who --json # or: docyrus auth login -
Discover the connector you need and its slug:
docyrus connect list-connectors --q "twilio" --json docyrus connect get-connector twilio --json # → its actions[] and dataSources[] -
Confirm a connection exists for that provider (you need credentials to actually run):
docyrus connect list-connections twilio --json # → { tenantScope: [{id,name,...}], userScope: { connected, connectionId } }If
tenantScopeis empty anduserScope.connectedis false, stop and ask the user to connect the provider in the Docyrus UI first. -
List the connection's accounts when the provider has sub-accounts (mailboxes, ad accounts, WhatsApp numbers) — this is where a
connectionAccountIdcomes from:docyrus curl "/v1/connectors/meta/connection-accounts" --format json # → { data: [{ id, accountId, accountName, connectionId, userConnectionId, data, createdOn }], meta: {...} }An empty list is normal: accounts only exist after the tenant-accounts fetch has run for that connection.
-
Inspect the action's input schema before calling:
docyrus connect get-action twilio sendSms --json # → inputJsonSchema / outputJsonSchema / requestMethod -
Run the action (build
--paramsto match the input schema). Dry-run first to preview:docyrus connect run-action twilio sendSms -p '{"to":"+1555...","body":"Hi"}' --dryRun --json docyrus connect run-action twilio sendSms -p '{"to":"+1555...","body":"Hi"}' --jsonOr make a raw authenticated request when there's no action for what you need:
docyrus connect curl msgraph "/me/messages" -X GET --json
A full reference of every command, the data model, auth types, connection resolution, and gotchas is in references/connector-model-and-actions.md.
Command cheat-sheet
All commands need an active session; append --json. Connectors are addressed by slug, actions by slug + actionKey.
docyrus connect list-connectors [--q <kw>] [--limit 100] [--offset 0] # find connectors
docyrus connect get-connector <slug> # detail: actions[] + dataSources[]
docyrus connect list-connections <slug> # tenantScope[] + userScope{connected,connectionId}
docyrus connect get-action <slug> <actionKey> # input/output JSON schemas + requestMethod
docyrus connect run-action <slug> <actionKey> -p '<json>' [-c <connId>] [--connectionAccountId <id>] [-n]
docyrus connect curl <slug> <endpoint> [-X <method>] [-d '<json>'] [--headers '<json>'] [-c <connId>] [--connectionAccountId <id>]
run-action:-p/--paramsis a JSON object matching the action'sinputJsonSchema(server-validated — AJV, 400 on mismatch).-n/--dryRunpreviews the request client-side without sending. Connection selectors (-c/--connectionId,--connectionAccountId) are sent as headers.curl:<endpoint>is a relative path (appended to the connection/provider base URL) or an absolutehttp…URL (used verbatim).-Xsets the HTTP method (defaultGET);-d/--headersare JSON. The provider auth header is injected automatically.
Listing connection accounts
Sub-accounts live on the Docyrus API, not on the connect group — there is no connect list-connection-accounts subcommand. Reach the endpoint with the top-level docyrus curl (Docyrus API paths, not provider paths):
docyrus curl "/v1/connectors/{slug}/connection-accounts" --format json
docyrus curl "/v1/connectors/msgraph/connection-accounts?connectionId=<uuid>&q=sales&limit=50" --format json
Query params: connectionId (uuid — matches a tenant or user connection), q (matches account name or provider account id), limit (100), offset (0). Response is { data: [...], meta: { total, limit, offset } }; unknown slug → 404.
| Field | Meaning |
|---|---|
id | The value to pass as --connectionAccountId (header x-connection-account-id, or connectionAccountId in a connect curl body). |
accountId / accountName | The account's id and display name at the provider — not Docyrus ids. |
connectionId / userConnectionId | Which connection the account came through; exactly one is set. |
data | The provider payload captured for the account at fetch time (shape is provider-specific). |
- Accounts are discovered, not created here. They are written when the tenant-accounts fetch runs for a connection (
GET /v1/external/data-providers/{dataProviderId}/tenants— note that route takes the provider id, not the slug). A connection that has never been refreshed simply has no accounts, and archived accounts are never returned. - Visibility follows the connection. Accounts reached through a tenant connection are visible to the whole tenant; accounts reached through a user's OAuth2 connection are visible only to that user — so an empty list can also mean "they belong to someone else's connection".
Critical rules
- Connectors = slug; actions = slug + key. There is no connector id or action id in these commands. Get the slug from
list-connectors, the actionkeyfromget-connector/get-action. - Connections are not created here.
list-connectionsonly reads. If none exists, the provider must be connected via the Docyrus UI / OAuth flow (or the raw API) beforerun-action/curlcan authenticate. Treat an emptytenantScope+userScope.connected:falseas "not connected yet." - Connection auto-selection: with no
--connectionId, the tenant's first connection for that provider is used. For OAuth2authorization_codeproviders,--connectionIdis ignored and the current user's connection (or a shared one) is used. Pass--connectionIdonly to disambiguate among multiple tenant connections. run-action --paramsmust be a JSON object (not an array/primitive) — the CLI rejects otherwise — and is validated server-side against the action'sinputJsonSchema(400"Action input validation failed"with AJV errors).run-actionneeds theAutomations.Runscope; read commands needConnectors.Read.All. A session that can list connectors may not be allowed to run actions.curlis an RPC passthrough (PUT /connectors/{slug}with the endpoint in the body) — you pass the external method via-X, not the API method. An absolute endpoint bypasses the connector's base URL.- Never invent a
connectionAccountId. It is theidof aconnection-accountsrow, not the provider's own account id (accountId) and not a connection id. List them first when the provider has sub-accounts. - Always
--dryRunarun-actionfirst when the side effect is real (sending email/SMS, posting data) to confirm the resolved request before executing. - The action must exist and be active (provider
slug+ actionkey,status=1) — otherwise 404.
Test / validate
Read commands are safe to run anytime; action runs have real side effects (gate with --dryRun).
- Discover round-trip:
list-connectors→ pick a slug →get-connector <slug>shows itsactions[]→get-action <slug> <key>shows the input schema. Confirms the connector + action exist and what params they need. - Connection check:
list-connections <slug>— confirm a usable connection (tenantScopenon-empty oruserScope.connected:true) before attempting a run. - Account check (only when the run targets a sub-account):
docyrus curl "/v1/connectors/<slug>/connection-accounts" --format json— take theidof the intended row as--connectionAccountId. - Dry-run:
run-action <slug> <key> -p '<params>' --dryRunreturns{ dryRun:true, method, path, headers, body }and sends nothing — verify the params/connection resolve as expected. - Execute only when the dry-run looks right and the side effect is intended; inspect the returned
{ data, status }.
References
- references/connector-model-and-actions.md — Full command reference (args/flags/paths), the connector/connection/account/action data model, the supported auth types, how
run-actionresolves a connection (tenant vs per-user OAuth2),run-actionvscurlmechanics, and the gotchas (header-vs-body selectors, scopes, connection creation outside the CLI). - docyrus-automation-design — the
external-action/http-requestautomation nodes that run connectors inside a workflow. docyrus-app-ai-tools — app-scoped AI tools. docyrus-cli-app — the full CLI command index. docyrus-platform →references/integrations-and-events.md— the integrations/events concept overview.