Skip to main content
POST
/
v1
/
integrations
/
{provider}
/
connect
Connect integration
curl --request POST \
  --url https://api.example.com/v1/integrations/{provider}/connect \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "credentialId": "<string>",
  "redirectUrl": "<string>"
}
'

Overview

Activates an integration for your tenant. For OAuth-based integrations, this initiates the OAuth authorization flow and returns a redirect URL. For API key integrations, this activates the previously stored credentials. Emits an integration.connected event on success. Required role: admin

Request headers

Authorization
string
required
JWT Bearer token. Format: Bearer <your-jwt>.

Path parameters

provider
string
required
The integration provider to connect. Example: github, datadog, pagerduty.

Request body

credentialId
string
Required for api_key providers. The credential ID from Store credentials.
redirectUrl
string
Required for oauth2 providers. The URL CauseFlow redirects back to after the user authorizes the OAuth application.

Response

Returns 200 OK. For OAuth providers:
{
  "authorizationUrl": "https://github.com/login/oauth/authorize?client_id=...&state=...",
  "state": "oauth_state_token_for_csrf_validation"
}
For API key providers:
{
  "integrationId": "int_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "provider": "datadog",
  "status": "connected",
  "connectedAt": "2024-04-01T10:05:00Z"
}

Error responses

StatusError codeDescription
400validation_errorMissing required fields for this provider
401unauthorizedMissing or invalid JWT
403forbiddenCaller lacks admin role
404credential_not_foundReferenced credentialId does not exist
409already_connectedThis provider is already connected to your tenant

Examples

# OAuth provider (GitHub)
curl https://api.causeflow.ai/v1/integrations/github/connect \
  -X POST \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{ "redirectUrl": "https://app.example.com/integrations/callback" }'

# API key provider (Datadog)
curl https://api.causeflow.ai/v1/integrations/datadog/connect \
  -X POST \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{ "credentialId": "crd_01HX9VTPQR3KF8MZWBYD5N6JCE" }'

List integrations

View all active integrations

Store credentials

Store API key credentials before connecting