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

# Create a connection

> Creates one item. The body's type picks what is created: domain, caller_id, pool, webhook, test. Requires write access. This operation can change workspace data or trigger an external side effect; review the request before sending it and do not retry blindly after a timeout.



## OpenAPI

````yaml /openapi.json post /api/v1/public/connections
openapi: 3.1.0
info:
  description: >-
    Customer-facing API for managing outreach, leads, conversations, voice
    agents, knowledge bases, analytics, and webhooks.
  title: Sendora Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.sendora.ai
security: []
tags:
  - description: Leads, lead lists, importing, enriching and finding new prospects.
    name: Leads
  - description: Build, run and measure outreach, and enroll leads.
    name: Campaigns
  - description: Read and send messages, and manage who must not be contacted.
    name: Conversations
  - description: >-
      Voice and chat agents, their tools, knowledge bases, voices and website
      widgets.
    name: Agents
  - description: >-
      Start calls, and manage phone numbers, SMS registration, sending accounts
      and email domains.
    name: Calls and numbers
  - description: Webhooks, jobs, analytics and the Copilot assistant.
    name: Platform
  - description: Manage client workspaces, plans and branding.
    name: Agency
paths:
  /api/v1/public/connections:
    post:
      tags:
        - Calls and numbers
      summary: Create a connection
      description: >-
        Creates one item. The body's type picks what is created: domain,
        caller_id, pool, webhook, test. Requires write access. This operation
        can change workspace data or trigger an external side effect; review the
        request before sending it and do not retry blindly after a timeout.
      operationId: create_api_v1_public_connections_post
      parameters:
        - in: header
          name: X-API-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - in: header
          name: Authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              discriminator:
                mapping:
                  caller_id: '#/components/schemas/ConnectionCallerIdCreate'
                  domain: '#/components/schemas/ConnectionDomainCreate'
                  pool: '#/components/schemas/ConnectionPoolCreate'
                  test: '#/components/schemas/ConnectionTestCreate'
                  webhook: '#/components/schemas/ConnectionWebhookCreate'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/ConnectionDomainCreate'
                - $ref: '#/components/schemas/ConnectionCallerIdCreate'
                - $ref: '#/components/schemas/ConnectionPoolCreate'
                - $ref: '#/components/schemas/ConnectionWebhookCreate'
                - $ref: '#/components/schemas/ConnectionTestCreate'
              title: Body
        required: true
      responses:
        '201':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '401':
          description: The X-API-Key header is missing, invalid, expired, or revoked.
        '402':
          description: >-
            The workspace is suspended for billing, or the request would exceed
            a plan or usage limit.
        '403':
          description: >-
            The key is valid but lacks the required scope, or the workspace has
            no active plan, lacks the entitlement, or has this feature turned
            off or view-only.
        '410':
          description: The workspace behind this key has been deleted.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          description: >-
            An unexpected Sendora error occurred. Retry only if the operation is
            safe to repeat.
        '503':
          description: >-
            An entitlement or billing check is temporarily unavailable. Retry
            after the Retry-After interval.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >-
            curl -X POST 'https://api.sendora.ai/api/v1/public/connections' -H
            "X-API-Key: $SENDORA_API_KEY" -H "Content-Type: application/json" \
              -d '{"domain_name":"example","type":"example"}'
        - label: Python
          lang: python
          source: >-
            import requests


            url = 'https://api.sendora.ai/api/v1/public/connections'

            headers = {'X-API-Key': '$SENDORA_API_KEY'}

            response = requests.post(url, headers=headers, json={'domain_name':
            'example', 'type': 'example'})

            response.raise_for_status()

            print(response.json())
        - label: JavaScript
          lang: javascript
          source: >-
            const response = await
            fetch("https://api.sendora.ai/api/v1/public/connections", {
              method: "POST",
              headers: { 'X-API-Key': process.env.SENDORA_API_KEY, 'Content-Type': 'application/json' },
              body: JSON.stringify({"domain_name": "example", "type": "example"}),
            });

            if (!response.ok) throw new Error(await response.text());

            console.log(await response.json());
        - label: Go
          lang: go
          source: >-
            req, err := http.NewRequest("POST",
            "https://api.sendora.ai/api/v1/public/connections",
            bytes.NewBufferString(`{"domain_name": "example", "type":
            "example"}`))

            if err != nil { log.Fatal(err) }

            req.Header.Set("X-API-Key", os.Getenv("SENDORA_API_KEY"))

            req.Header.Set("Content-Type", "application/json")

            resp, err := http.DefaultClient.Do(req)

            if err != nil { log.Fatal(err) }

            defer resp.Body.Close()
components:
  schemas:
    ConnectionCallerIdCreate:
      properties:
        display_label:
          anyOf:
            - maxLength: 80
              type: string
            - type: 'null'
          description: Display label returned by the Sendora API.
          title: Display Label
        method:
          default: call
          description: Method returned by the Sendora API.
          pattern: ^(call|sms)$
          title: Method
          type: string
        phone_e164:
          description: Phone e164 returned by the Sendora API.
          maxLength: 20
          minLength: 8
          title: Phone E164
          type: string
        type:
          const: caller_id
          description: 'Must be caller_id: this body is for a caller ID'
          title: Type
          type: string
      required:
        - phone_e164
        - type
      title: ConnectionCallerIdCreate
      type: object
    ConnectionDomainCreate:
      properties:
        domain_name:
          description: A domain you already own
          maxLength: 253
          minLength: 3
          title: Domain Name
          type: string
        type:
          const: domain
          description: 'Must be domain: this body is for a email domain'
          title: Type
          type: string
      required:
        - domain_name
        - type
      title: ConnectionDomainCreate
      type: object
    ConnectionPoolCreate:
      properties:
        channel:
          description: Channel returned by the Sendora API.
          enum:
            - email
            - sms
            - voice
            - linkedin
            - whatsapp
          title: Channel
          type: string
        name:
          description: Name returned by the Sendora API.
          maxLength: 120
          minLength: 1
          title: Name
          type: string
        strategy:
          default: least_used
          description: Strategy returned by the Sendora API.
          enum:
            - least_used
            - round_robin
            - weighted
            - sticky_by_lead
          title: Strategy
          type: string
        type:
          const: pool
          description: 'Must be pool: this body is for a sender pool'
          title: Type
          type: string
      required:
        - name
        - channel
        - type
      title: ConnectionPoolCreate
      type: object
    ConnectionTestCreate:
      properties:
        account_ids:
          description: >-
            The assigned sender accounts, each an `id` from List or read
            connections (type connected).
          items:
            type: string
          maxItems: 50
          minItems: 1
          title: Account Ids
          type: array
        mailbox_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 'Placement only: the kinds of test inbox to use'
          title: Mailbox Types
        name:
          anyOf:
            - maxLength: 120
              type: string
            - type: 'null'
          description: Name returned by the Sendora API.
          title: Name
        test:
          description: >-
            blacklist checks the sending domain and IP against block lists;
            placement sends to test inboxes and reports where the mail lands
          enum:
            - blacklist
            - placement
          title: Test
          type: string
        type:
          const: test
          description: >-
            Must be test: this body is for a deliverability test (blacklist or
            inbox placement)
          title: Type
          type: string
      required:
        - test
        - account_ids
        - type
      title: ConnectionTestCreate
      type: object
    ConnectionWebhookCreate:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Description returned by the Sendora API.
          title: Description
        event_types:
          description: Event types returned by the Sendora API.
          items:
            type: string
          title: Event Types
          type: array
        type:
          const: webhook
          description: 'Must be webhook: this body is for a webhook endpoint'
          title: Type
          type: string
        url:
          description: Url returned by the Sendora API.
          format: uri
          maxLength: 2083
          minLength: 1
          title: Url
          type: string
      required:
        - url
        - event_types
        - type
      title: ConnectionWebhookCreate
      type: object
    HTTPValidationError:
      properties:
        detail:
          description: Detail returned by the Sendora API.
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      required: []
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          description: Loc returned by the Sendora API.
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          description: Msg returned by the Sendora API.
          title: Message
          type: string
        type:
          description: Type returned by the Sendora API.
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Customer API key created in the Sendora dashboard.
      in: header
      name: X-API-Key
      type: apiKey

````

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