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

# Buy a Twilio number

> Purchase a new Twilio phone number from the platform and assign it to your workspace.

## Example Request

```json theme={null}
{
  "number": "+14155551234",
  "agentId": "your-agent-id",
  "capabilities": ["voice", "sms"]
}
```

<Note>
  Use `/utils/twilio/available-numbers` first to discover purchasable numbers.
</Note>

<Warning>
  Requires an available phone-number slot on your plan. The endpoint will return a `INTERNAL_SERVER_ERROR` with a friendly upgrade message if you've exceeded your slot quota.
</Warning>


## OpenAPI

````yaml POST /utils/buy-twilio-number
openapi: 3.0.3
info:
  title: Convocore OpenAPI
  description: Full API reference for Convocore
  version: 1.0.4
servers:
  - url: https://eu-gcp-api.vg-stuff.com/v3
security: []
paths:
  /utils/buy-twilio-number:
    post:
      tags:
        - Voices
      summary: Buy a Twilio number
      description: >-
        Purchases a new Twilio phone number from the platform's Twilio account
        and assigns it to the workspace. Requires an available phone-number slot
        on your plan.
      operationId: v2Audio-buyTwilioNumber
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                number:
                  type: string
                  description: >-
                    The phone number to buy with the plus & without spaces,
                    example: +1234567890
                agentId:
                  type: string
                  description: >-
                    The agent id to assign the number to, could be empty if you
                    want to assign an agent later.
                capabilities:
                  $ref: '#/components/schemas/array_3b916e0f'
              required:
                - number
              additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/phoneNumber_phoneNumberSid_message_b74dbc'
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  schemas:
    array_3b916e0f:
      type: array
      items:
        type: string
        enum:
          - sms
          - voice
      default:
        - voice
        - sms
    phoneNumber_phoneNumberSid_message_b74dbc:
      type: object
      properties:
        phoneNumber:
          type: string
        phoneNumberSid:
          type: string
        message:
          type: string
      required:
        - phoneNumber
        - phoneNumberSid
        - message
      additionalProperties: false
    message_11569e:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      additionalProperties: false
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  $ref: '#/components/schemas/message_11569e'
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````