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

# List Phone Numbers

> List all phone numbers in your account

Retrieve all phone numbers provisioned in your account with their current configuration.

## Request Body

<ParamField body="limit" type="integer" default={50}>
  Maximum numbers to return. Max: 100.
</ParamField>

<ParamField body="offset" type="integer" default={0}>
  Number of records to skip for pagination.
</ParamField>

<ParamField body="agent_id" type="string">
  Filter by assigned voice agent UUID.
</ParamField>

<ParamField body="text_agent_id" type="string">
  Filter by assigned text agent UUID.
</ParamField>

<ParamField body="is_active" type="boolean">
  Filter by active status.
</ParamField>

## Response

<ResponseField name="numbers" type="array">
  Array of phone number objects.
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of phone numbers in account.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.magpipe.ai/functions/v1/list-phone-numbers \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.magpipe.ai/functions/v1/list-phone-numbers',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({}),
    }
  );

  const { numbers, total } = await response.json();
  console.log(`You have ${total} numbers`);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.magpipe.ai/functions/v1/list-phone-numbers',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json',
      },
      json={}
  )

  data = response.json()
  print(f"You have {data['total']} numbers")
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "numbers": [
      {
        "id": "a1b2c3d4-5678-9012-3456-789012345678",
        "phone_number": "+16045551234",
        "friendly_name": "Main Line",
        "agent_id": "550e8400-e29b-41d4-a716-446655440000",
        "agent_name": "Sarah - Receptionist",
        "text_agent_id": "660e8400-e29b-41d4-a716-446655440001",
        "text_agent_name": "SMS Handler",
        "capabilities": {
          "voice": true,
          "sms": true,
          "mms": true
        },
        "is_active": true,
        "created_at": "2024-01-10T10:00:00Z"
      },
      {
        "id": "b2c3d4e5-6789-0123-4567-890123456789",
        "phone_number": "+16045559999",
        "friendly_name": "Support Line",
        "agent_id": null,
        "agent_name": null,
        "text_agent_id": null,
        "text_agent_name": null,
        "capabilities": {
          "voice": true,
          "sms": true,
          "mms": false
        },
        "is_active": true,
        "created_at": "2024-01-12T14:00:00Z"
      }
    ],
    "total": 2
  }
  ```
</ResponseExample>
