Skip to main content

Authentication

All Partner API requests require a Bearer token in the Authorization header. Partner API keys are provisioned by the OpenCX team — they are separate from org-level API keys.
Authorization: Bearer YOUR_PARTNER_API_KEY
Base URL: https://api.open.cx

Create Org

Create a new organization for one of your customers.
POST /partner/v1/orgs

Request body

FieldTypeRequiredDescription
namestringYesDisplay name for the org.
external_idstringNoYour internal ID for this customer. Must be unique per partner — duplicates return 409.
websitestringNoCustomer’s website URL.
languagestringNoDefault language code (e.g. "en", "es", "de"). Defaults to "en".
ai_instructionsstringNoThe AI profile — system prompt that defines the agent’s personality, knowledge scope, and behavior. Overrides your partner-level default if set.
integrationsobjectNoAuto-connect integrations during creation. See below.

Integrations

Pass integration credentials in the integrations object to auto-connect them during org creation. Credentials are validated against the live third-party API — invalid credentials cause the request to fail with a 400.
{
  "integrations": {
    "fareharbor": {
      "app_key": "...",
      "user_key": "...",
      "default_company_shortname": "..."
    }
  }
}
More integrations will be added to the partner provisioning API over time. For integrations not yet supported here, use the org-level dashboard or API after creation.

Response

201 Created
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Acme Tours",
  "widget_token": "f8e7d6c5b4a39281...",
  "external_id": "customer-12345"
}
FieldTypeDescription
idstringThe org UUID. Use this to manage the org via other OpenCX APIs.
namestringThe org name as provided.
widget_tokenstringWidget embed token. Pass this to the chat widget.
external_idstring | nullYour external ID, echoed back.

Error responses

StatusConditionBody
400Invalid request body, or integration credentials failed validation.{ "statusCode": 400, "message": "..." }
401Missing, invalid, or revoked API key.{ "statusCode": 401, "message": "..." }
409An org with this external_id already exists for your partner.{ "statusCode": 409, "message": "Org with external_id \"...\" already exists" }

Examples

curl -X POST https://api.open.cx/partner/v1/orgs \
  -H "Authorization: Bearer YOUR_PARTNER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Tours",
    "external_id": "customer-12345",
    "language": "en",
    "ai_instructions": "You are a support agent for Acme Tours. Help customers with bookings and questions."
  }'

List Orgs

List all organizations created by your partner account.
GET /partner/v1/orgs

Query parameters

ParameterTypeDefaultDescription
limitnumber50Number of orgs to return (1–100).
offsetnumber0Number of orgs to skip (for pagination).

Response

200 OK
{
  "data": [
    {
      "id": "a1b2c3d4-...",
      "name": "Acme Tours",
      "widget_token": "f8e7d6c5b4a3...",
      "external_id": "customer-12345",
      "created_at": "2026-03-15T10:30:00.000Z"
    }
  ],
  "total": 142
}

Examples

curl "https://api.open.cx/partner/v1/orgs?limit=10&offset=0" \
  -H "Authorization: Bearer YOUR_PARTNER_API_KEY"

Create Org API Key

Create an API key for a specific org. The returned key authenticates requests to the OpenCX Public API (crawling, training, contacts, etc).
POST /partner/v1/orgs/:orgId/api-keys

Request body

FieldTypeRequiredDescription
namestringNoA label for the key (e.g. "Production"). Defaults to "Default".

Response

201 Created
{
  "api_key_id": "key-uuid-here",
  "api_key": "eyJhbGciOi..."
}
FieldTypeDescription
api_key_idstringThe key’s UUID.
api_keystringThe JWT API key. Use this as Bearer token for org-level API calls.
The full API key is only returned once — store it securely. If lost, create a new one.

Examples

curl -X POST https://api.open.cx/partner/v1/orgs/ORG_ID/api-keys \
  -H "Authorization: Bearer YOUR_PARTNER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Production" }'

Error responses

StatusCondition
401Invalid or revoked partner API key.
403Org does not belong to this partner.

Invite User to Org

Send a dashboard invitation to a user. The invited user receives an email with a link to create their account and join the org.
POST /partner/v1/orgs/:orgId/invitations

Request body

FieldTypeRequiredDescription
emailstringYesEmail address to invite.
role_idsstring[]NoArray of role UUIDs to assign. Defaults to admin if omitted.

Response

200 OK
{
  "data": { "success": true }
}

Error responses

StatusCondition
400Email already has an active invitation, or is already a member of the org.
401Invalid or revoked partner API key.
403Org does not belong to this partner.

Examples

curl -X POST https://api.open.cx/partner/v1/orgs/ORG_ID/invitations \
  -H "Authorization: Bearer YOUR_PARTNER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]" }'

Idempotency

Use external_id to prevent duplicate orgs. If you call POST /partner/v1/orgs twice with the same external_id, the second call returns 409 Conflict. This makes it safe to retry org creation without risk of duplicates. Use GET /partner/v1/orgs to find the existing org.
The external_id uniqueness constraint is scoped to your partner account. Different partners can use the same external_id values.