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

# Create number with SIP gateways

> Registers numbers from your own SIP trunk and attaches an inbound and an outbound gateway to them in one call. Numbers already on your account are reused.

<Note>
This is only for numbers on your own SIP trunk. Numbers bought in the [dashboard](https://app.zeroruntime.ai/) are set up for you.
</Note>




## OpenAPI

````yaml /api-reference/rest/openapi.yaml post /v2/sip/phone-numbers
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v2/sip/phone-numbers:
    post:
      tags:
        - Phone numbers
      summary: Create number with SIP gateways
      description: >
        Registers numbers from your own SIP trunk and attaches an inbound and an
        outbound gateway to them in one call. Numbers already on your account
        are reused.


        <Note>

        This is only for numbers on your own SIP trunk. Numbers bought in the
        [dashboard](https://app.zeroruntime.ai/) are set up for you.

        </Note>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - phoneNumbers
                - inbound
                - outbound
              properties:
                name:
                  type: string
                  example: Support SIP
                phoneNumbers:
                  type: array
                  items:
                    type: string
                  description: E.164 numbers, with the `+`.
                  example:
                    - '+14155550100'
                    - '+14155550101'
                isShared:
                  type: boolean
                  default: true
                  description: >-
                    `true` creates one inbound and one outbound gateway for all
                    the numbers. `false` creates a separate pair per number. It
                    can't be changed later: detach and create again instead.
                mediaEncryption:
                  $ref: '#/components/schemas/MediaEncryption'
                inbound:
                  type: object
                  required:
                    - sipRegion
                  properties:
                    sipRegion:
                      $ref: '#/components/schemas/SipRegion'
                outbound:
                  type: object
                  required:
                    - address
                    - sipRegion
                  properties:
                    address:
                      type: string
                      example: sip.my-carrier.com
                    sipRegion:
                      $ref: '#/components/schemas/SipRegion'
                    transport:
                      $ref: '#/components/schemas/Transport'
                    auth:
                      $ref: '#/components/schemas/SipAuth'
            example:
              name: Support SIP
              phoneNumbers:
                - '+14155550100'
                - '+14155550101'
              isShared: true
              mediaEncryption: disable
              inbound:
                sipRegion: auto
              outbound:
                address: sip.my-carrier.com
                sipRegion: us002
                transport: tls
                auth:
                  username: sip-user
                  password: s3cr3t
      responses:
        '201':
          description: Numbers registered and gateways attached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                message: Phone Number with SIP Configured Created Successfully
        '400':
          $ref: '#/components/responses/Message'
        '409':
          description: A number was attached concurrently. Nothing was written. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                message: >-
                  One or more phone numbers were attached to a gateway
                  concurrently. Please retry.
components:
  schemas:
    MediaEncryption:
      type: string
      enum:
        - enable
        - disable
      default: disable
    SipRegion:
      type: string
      enum:
        - auto
        - us002
        - in002
      description: '`auto` stores no region and lets us pick.'
    Transport:
      type: string
      enum:
        - udp
        - tcp
        - tls
      default: tls
    SipAuth:
      type: object
      description: Stored only when both fields are present.
      properties:
        username:
          type: string
        password:
          type: string
    Message:
      type: object
      properties:
        message:
          type: string
  responses:
    Message:
      description: Request failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Message'
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

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