Skip to content
Dashboard
Theme
Theme

Start connecting an end user to a provider

POST /v1/pipes/connections: Start connecting an end user to a provider.

View Markdown

POST /v1/pipes/connections

Returns the hosted connect_url to send the end user to (valid 10 minutes, usable once). The flow is the authorization code grant with PKCE (S256); its state is bound to this environment, organization and user. After the provider answers, the end user returns to return_url (one of the environment’s registered redirect URIs) with pipe_connection and status (connected or error) query parameters. One connection exists per provider, organization and user; connecting again reuses it.

Scope
pipes:write
Auth
Secret key (sk_…)
Since
1.1
  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • provider string Required

    max length 64

  • organization_id string Required

  • user_id string Required

    min length 1 · max length 256

  • return_url string Required

    One of the environment’s registered redirect URIs.

    max length 2048

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/pipes/connections" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "okta",
"organization_id": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"user_id": "user_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"return_url": "https://app.acme.com/callback"
}'
Response 201
{
"object": "pipe_connect_session",
"connection": {
"object": "pipe_connection",
"id": "pipe_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"provider": "okta",
"organization_id": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"user_id": "user_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"state": "pending",
"scopes": [
"organizations:read"
],
"last_error": "saml_signature_invalid",
"connected_at": "2026-01-15T09:30:00Z",
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z"
},
"connect_url": "https://app.acme.com/callback",
"expires_at": "2026-01-15T09:30:00Z"
}