> ## Documentation Index
> Fetch the complete documentation index at: https://cntillion.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an auth connection

> Stores the connection's secret, and the values of its token request headers, encrypted; they are never returned. `type` picks the fields: `oauth2_client_credentials`, `basic`, `bearer` or `oauth2_jwt`. A name the workspace already uses, ignoring case, is refused with `409 AUTH_CONNECTION_NAME_TAKEN`, and a signing key that can't sign with the chosen `algorithm` with `400 INVALID_AUTH_CONNECTION`. A workspace holds up to 50 auth connections, and one more is refused with `409 AUTH_CONNECTION_LIMIT_REACHED`. To sign in with it from a tool, put its `id` in the tool's `configuration.authConnectionId`, or `configuration.page.authConnectionId` for a web form's link request. Needs a Full access key.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/auth-connections
openapi: 3.1.0
info:
  title: Centillion Labs API
  description: >-
    The public API of Centillion Labs: agents, their branches and versions,
    knowledge, tools and the secrets they send, chat, conversations, contacts,
    campaigns, batch calls, agent testing, issues and Helpdesk.
  version: 2.0.0
servers:
  - url: https://app.cntillion.com
security:
  - workspaceApiKey: []
  - workspaceApiKeyHeader: []
tags:
  - name: Agents
    description: Create, read, change, clone and delete agents.
  - name: Branches and versions
    description: Branches, drafts, immutable versions, merges, publishing and traffic.
  - name: Workflow and voice
    description: A branch's workflow and its voice settings.
  - name: Tools
    description: 'Workspace tools: HTTP, client, MCP server and code tools.'
  - name: Secrets
    description: >-
      Named credentials, such as an API key, that HTTP tools and MCP servers
      send as a header by naming the secret's id in
      `configuration.secretHeaders`. A value is encrypted when saved and never
      returned. A new value reaches every tool and published agent that uses the
      secret on its next call, with nothing to publish, and a secret can be
      deleted only once no tool and no published agent sends it.
  - name: Auth connections
    description: >-
      How the workspace's tools sign in to an API, kept once and named by id in
      an HTTP tool's or an MCP server's `configuration.authConnectionId` (or
      `configuration.page.authConnectionId` for a web form's link request).
      Secrets are encrypted when saved and never returned. A change reaches
      every tool and published agent that uses the connection on its next call,
      and a connection can be deleted only once nothing signs in with it.
  - name: Knowledge sources
    description: What an agent knows, and training it on that.
  - name: Chat
    description: Talk to an agent from your own systems.
  - name: Conversations
    description: Conversations, their messages, feedback and analysis.
  - name: Leads and contacts
    description: The leads and contacts an agent collected.
  - name: Contacts and enrollments
    description: Upsert contacts and enroll them in always-open campaigns.
  - name: Batch calls
    description: Outbound call batches, their recipients and their runs.
  - name: Campaigns
    description: >-
      Managed outbound calling: campaigns that call each lead within calling
      windows and retry, call back or redirect as their lead policy allows,
      their leads, calls and attention items, and the workspace's campaign
      settings.
  - name: WhatsApp
    description: WhatsApp templates and template messages.
  - name: Agent testing
    description: Workspace tests, agent suites, execution, and results.
  - name: Issues
    description: >-
      Issues an agent raised or a teammate flagged about how it behaves: triage,
      comment, merge and resolve.
  - name: Helpdesk
    description: Helpdesk tickets, their messages, teams and statuses.
  - name: Status
    description: Whether the API is up.
paths:
  /api/v2/auth-connections:
    post:
      tags:
        - Auth connections
      summary: Create an auth connection
      description: >-
        Stores the connection's secret, and the values of its token request
        headers, encrypted; they are never returned. `type` picks the fields:
        `oauth2_client_credentials`, `basic`, `bearer` or `oauth2_jwt`. A name
        the workspace already uses, ignoring case, is refused with `409
        AUTH_CONNECTION_NAME_TAKEN`, and a signing key that can't sign with the
        chosen `algorithm` with `400 INVALID_AUTH_CONNECTION`. A workspace holds
        up to 50 auth connections, and one more is refused with `409
        AUTH_CONNECTION_LIMIT_REACHED`. To sign in with it from a tool, put its
        `id` in the tool's `configuration.authConnectionId`, or
        `configuration.page.authConnectionId` for a web form's link request.
        Needs a Full access key.
      operationId: createAuthConnection
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAuthConnectionRequest'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAuthConnectionResponse'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '413':
          $ref: '#/components/responses/Error413'
        '415':
          $ref: '#/components/responses/Error415'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '504':
          $ref: '#/components/responses/Error504'
components:
  schemas:
    CreateAuthConnectionRequest:
      oneOf:
        - type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 100
              description: >-
                A name that is unique in the workspace, ignoring case, such as
                `Orders API`.
            provider:
              description: >-
                Who issues the credentials, such as `GitHub` or `Orders API`.
                Shown beside the name.
              type: string
              maxLength: 100
            type:
              type: string
              const: oauth2_client_credentials
            tokenUrl:
              type: string
              maxLength: 2048
              format: uri
              description: The HTTPS address access tokens are requested from.
            clientId:
              type: string
              minLength: 1
              maxLength: 500
            scopes:
              default: []
              description: The scopes to request. Left empty, none are named.
              maxItems: 50
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 200
                pattern: ^[\x21\x23-\x5B\x5D-\x7E]+$
            extraParams:
              default: {}
              description: >-
                Extra form fields for the token request, such as `{"audience":
                "https://api.example.com"}`.
              type: object
              propertyNames:
                type: string
                minLength: 1
                maxLength: 100
              additionalProperties:
                anyOf:
                  - type: string
                    maxLength: 2000
                  - type: number
                  - type: boolean
            basicAuthInHeader:
              default: false
              description: >-
                Send the client ID and secret in an HTTP Basic `Authorization`
                header instead of the request body.
              type: boolean
            clientSecret:
              type: string
              minLength: 1
              maxLength: 8192
              description: The client secret. It is encrypted and never returned.
            tokenHeaders:
              default: {}
              description: >-
                Headers sent with each token request, such as an API key the
                token endpoint asks for. Their values are encrypted and never
                returned; on an update, an empty value keeps the stored one.
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: string
                minLength: 1
                maxLength: 8192
          required:
            - name
            - type
            - tokenUrl
            - clientId
            - clientSecret
          additionalProperties: false
        - type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 100
              description: >-
                A name that is unique in the workspace, ignoring case, such as
                `Orders API`.
            provider:
              description: >-
                Who issues the credentials, such as `GitHub` or `Orders API`.
                Shown beside the name.
              type: string
              maxLength: 100
            type:
              type: string
              const: basic
            username:
              type: string
              minLength: 1
              maxLength: 500
            password:
              type: string
              minLength: 1
              maxLength: 8192
              description: The password. It is encrypted and never returned.
          required:
            - name
            - type
            - username
            - password
          additionalProperties: false
        - type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 100
              description: >-
                A name that is unique in the workspace, ignoring case, such as
                `Orders API`.
            provider:
              description: >-
                Who issues the credentials, such as `GitHub` or `Orders API`.
                Shown beside the name.
              type: string
              maxLength: 100
            type:
              type: string
              const: bearer
            token:
              type: string
              minLength: 1
              maxLength: 8192
              description: >-
                The API key or access token, sent as `Authorization: Bearer
                <token>`. It is encrypted and never returned.
          required:
            - name
            - type
            - token
          additionalProperties: false
        - type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 100
              description: >-
                A name that is unique in the workspace, ignoring case, such as
                `Orders API`.
            provider:
              description: >-
                Who issues the credentials, such as `GitHub` or `Orders API`.
                Shown beside the name.
              type: string
              maxLength: 100
            type:
              type: string
              const: oauth2_jwt
            tokenUrl:
              type: string
              maxLength: 2048
              format: uri
              description: The HTTPS address the signed assertion is exchanged at.
            scopes:
              default: []
              description: The scopes to request. Left empty, none are named.
              maxItems: 50
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 200
                pattern: ^[\x21\x23-\x5B\x5D-\x7E]+$
            tokenType:
              default: access_token
              description: Which field of the token response is sent as the Bearer token.
              type: string
              enum:
                - access_token
                - id_token
            algorithm:
              default: HS256
              type: string
              enum:
                - HS256
                - HS384
                - HS512
                - RS256
                - RS384
                - RS512
                - PS256
                - PS384
                - PS512
            keyId:
              description: Sent as the assertion's `kid`.
              type: string
              maxLength: 200
            expirationSeconds:
              default: 3600
              description: How long each signed assertion is valid.
              type: integer
              minimum: 30
              maximum: 86400
            issuer:
              type: string
              minLength: 1
              maxLength: 1000
            audience:
              type: string
              minLength: 1
              maxLength: 1000
            subject:
              type: string
              minLength: 1
              maxLength: 1000
            extraClaims:
              default: {}
              description: More claims for the signed assertion.
              type: object
              propertyNames:
                type: string
                minLength: 1
                maxLength: 100
              additionalProperties:
                $ref: '#/components/schemas/JsonValue'
            secretKey:
              type: string
              minLength: 1
              maxLength: 16000
              description: >-
                The JWT signing key: the shared secret for HS algorithms, or a
                PEM private key for RS and PS. It is encrypted and never
                returned.
          required:
            - name
            - type
            - tokenUrl
            - issuer
            - audience
            - subject
            - secretKey
          additionalProperties: false
    CreateAuthConnectionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/WorkspaceAuthConnection'
      required:
        - data
    JsonValue:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
    WorkspaceAuthConnection:
      type: object
      properties:
        id:
          type: string
          description: >-
            What a tool names the connection by: an `HTTP_TOOL` or an
            `MCP_SERVER` in `configuration.authConnectionId`, a `BROWSER_FORM`
            in `configuration.page.authConnectionId`.
        name:
          type: string
        provider:
          description: Who issues the credentials, or `null` when not given.
          type:
            - string
            - 'null'
        type:
          type: string
          enum:
            - oauth2_client_credentials
            - basic
            - bearer
            - oauth2_jwt
          description: How the connection signs in. It never changes.
        settings:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: oauth2_client_credentials
                tokenUrl:
                  type: string
                  maxLength: 2048
                  format: uri
                  description: The HTTPS address access tokens are requested from.
                clientId:
                  type: string
                  minLength: 1
                  maxLength: 500
                scopes:
                  default: []
                  description: The scopes to request. Left empty, none are named.
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 200
                    pattern: ^[\x21\x23-\x5B\x5D-\x7E]+$
                extraParams:
                  default: {}
                  description: >-
                    Extra form fields for the token request, such as
                    `{"audience": "https://api.example.com"}`.
                  type: object
                  propertyNames:
                    type: string
                    minLength: 1
                    maxLength: 100
                  additionalProperties:
                    anyOf:
                      - type: string
                        maxLength: 2000
                      - type: number
                      - type: boolean
                basicAuthInHeader:
                  default: false
                  description: >-
                    Send the client ID and secret in an HTTP Basic
                    `Authorization` header instead of the request body.
                  type: boolean
                tokenHeaderNames:
                  default: []
                  type: array
                  items:
                    type: string
              required:
                - type
                - tokenUrl
                - clientId
                - scopes
                - extraParams
                - basicAuthInHeader
                - tokenHeaderNames
            - type: object
              properties:
                type:
                  type: string
                  const: basic
                username:
                  type: string
                  minLength: 1
                  maxLength: 500
              required:
                - type
                - username
            - type: object
              properties:
                type:
                  type: string
                  const: bearer
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  const: oauth2_jwt
                tokenUrl:
                  type: string
                  maxLength: 2048
                  format: uri
                  description: The HTTPS address the signed assertion is exchanged at.
                scopes:
                  default: []
                  description: The scopes to request. Left empty, none are named.
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 200
                    pattern: ^[\x21\x23-\x5B\x5D-\x7E]+$
                tokenType:
                  default: access_token
                  description: >-
                    Which field of the token response is sent as the Bearer
                    token.
                  type: string
                  enum:
                    - access_token
                    - id_token
                algorithm:
                  default: HS256
                  type: string
                  enum:
                    - HS256
                    - HS384
                    - HS512
                    - RS256
                    - RS384
                    - RS512
                    - PS256
                    - PS384
                    - PS512
                keyId:
                  description: Sent as the assertion's `kid`.
                  type: string
                  maxLength: 200
                expirationSeconds:
                  default: 3600
                  description: How long each signed assertion is valid.
                  type: integer
                  minimum: 30
                  maximum: 86400
                issuer:
                  type: string
                  minLength: 1
                  maxLength: 1000
                audience:
                  type: string
                  minLength: 1
                  maxLength: 1000
                subject:
                  type: string
                  minLength: 1
                  maxLength: 1000
                extraClaims:
                  default: {}
                  description: More claims for the signed assertion.
                  type: object
                  propertyNames:
                    type: string
                    minLength: 1
                    maxLength: 100
                  additionalProperties:
                    $ref: '#/components/schemas/JsonValue'
              required:
                - type
                - tokenUrl
                - scopes
                - tokenType
                - algorithm
                - expirationSeconds
                - issuer
                - audience
                - subject
                - extraClaims
          description: >-
            What the connection keeps in the clear, by `type`. Its client
            secret, password, token or signing key is never returned, and client
            credentials list their token request headers in `tokenHeaderNames`
            without the values.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
          description: The last time anything about the connection changed.
        usage:
          type: object
          properties:
            tools:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
                  - name
              description: The workspace's tools that sign in with it, by name.
            agents:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
                  - name
              description: >-
                Published agents whose live version signs in with it, by name. A
                tool moved to another connection since it was last published
                still counts here until it is published again.
          required:
            - tools
            - agents
          description: What signs in with the connection, which stops a delete.
      required:
        - id
        - name
        - provider
        - type
        - settings
        - createdAt
        - updatedAt
        - usage
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable code, such as `NOT_FOUND`.
            message:
              type: string
              description: What went wrong, for a person.
            details:
              description: More about the failure, on some endpoints.
          required:
            - code
            - message
      required:
        - error
  responses:
    Error400:
      description: The request is invalid. `error.message` names the first problem.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error401:
      description: No valid workspace API key was sent.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error403:
      description: The key or the workspace's plan does not allow this request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error404:
      description: The endpoint, or a record it names, was not found in this workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error409:
      description: The record changed since it was read, or its state does not allow this.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error413:
      description: The request body is too large.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error415:
      description: The request body is not of a media type this endpoint accepts.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error429:
      description: Too many requests. Wait for `Retry-After` seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error500:
      description: The request could not be completed. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Error504:
      description: The request took too long. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    workspaceApiKey:
      type: http
      scheme: bearer
      bearerFormat: cl_api_...
      description: >-
        A workspace API key from Workspace settings > API keys, sent as
        `Authorization: Bearer cl_api_...`. A Read only key can call the GET
        endpoints; every other method needs a Full access key.
    workspaceApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        The same workspace API key, for a gateway that keeps `Authorization` for
        itself.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.