Connections

Create connection

Creates a pending connection and returns a connect_url for the user to open. Authentication happens with the provider, never through this API, so no credential is ever sent here. Poll GET /connection/{id} until the status is active. The caller becomes owner_user_id. Optional shares grants access at creation time: absent or [] makes a private connection, reachable only by its owner, and needs only connection:create; any non-empty shares additionally needs connection:share, because a shared connection hands its account to other members the instant it is created. Connecting through an org-owned connector nobody shared with the caller answers 403 connector_not_shared (read can_use on the connector row to know in advance); a connector an admin restriction blocks is a different 403, flagged restricted on the connector. A connector that needs the organization's own OAuth app (byoa: true), has none added yet and offers no API-key option answers 409 oauth_app_required before anything is written, so no pending connection is left behind. details carries connector_slug, can_configure_oauth_app and setup_path (/connectors/{slug}, the connector page where the app is added; null when the caller may not add one, so tell them to ask an admin). Read connect_blocked on GET /connector/{slug} to know in advance.

post/connection

Request

  • Base URL: https://api.elaichi.ai
  • URL: https://api.elaichi.ai/connection
  • Auth: HTTP bearer

Headers

X-Organization-Idstring

Target organization (org_…). Required for cookie/session auth on org-scoped routes; optional for API tokens, which carry their organization, and rejected when it names a different one.

Request body

connector_slugstring required

From GET /connector — a slug, not an id.

redirect_uristring

App-relative path to return the user to after the connect flow. Absolute URLs are ignored.

namestring

Defaults to a connector-derived name.

Response

Created

connect_urlstring uri required

Where the person authenticates with the provider. Hand it to them as a link; Elaichi never accepts a password or API key for a third-party system through this API. Single-use and short-lived; mint another with reconnect. When they finish, the provider returns them to Elaichi and the status becomes active.

direct_connect_urlstring uri nullable required

The same one-time session as connect_url, but it goes straight to the provider's sign-in instead of the hosted connect page, so the person skips the page. Non-null only when the connector has exactly one auth method, that method is a redirect (OAuth), and it has no form fields or permissions_text; those are the cases where the hosted page would show nothing but a Connect button. Open it top-level in a popup or a new tab, never in an iframe. null means use connect_url; so does a lookup that failed or took longer than 1.5 seconds.

Changes

No recorded changes to this operation across all 1 revision of this API.