> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convocore.ai/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
    description: EU Node.js API server
  - url: https://na-gcp-api.vg-stuff.com/v3
    description: NA Node.js API server
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:
                  type: array
                  items:
                    type: string
                    enum:
                      - sms
                      - voice
                  default:
                    - voice
                    - sms
              required:
                - number
              additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  phoneNumber:
                    type: string
                  phoneNumberSid:
                    type: string
                  message:
                    type: string
                required:
                  - phoneNumber
                  - phoneNumberSid
                  - message
                additionalProperties: false
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````