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

# Phone Numbers

> Provision and manage US phone numbers for your agents.

# Phone Numbers

Each agent can have **one active phone number**. Numbers cost a flat
provisioning fee, deducted from your balance.

## Buy a number

<CodeGroup>
  ```python theme={null}
  number = client.numbers.buy(
      agent_id=agent.id,
      country="US",
      number_type="local",
      area_code="415",
  )
  ```

  ```javascript theme={null}
  const number = await client.numbers.buy({
      agentId: agent.id,
      country: "US",
      numberType: "local",
      areaCode: "415",
  });
  ```
</CodeGroup>

| Field         | Notes                                                     |
| ------------- | --------------------------------------------------------- |
| `agent_id`    | Agent to assign the number to (required)                  |
| `country`     | Currently `US`                                            |
| `number_type` | `local` or `tollfree`                                     |
| `area_code`   | Preferred 3-digit US area code (e.g. `212`, `415`, `310`) |

## List and reassign

<CodeGroup>
  ```python theme={null}
  client.numbers.list()
  client.numbers.get(number.id)
  client.numbers.reassign(number.id, agent_id=other_agent.id)
  ```

  ```javascript theme={null}
  await client.numbers.list();
  await client.numbers.get(number.id);
  await client.numbers.reassign(number.id, { agentId: otherAgent.id });
  ```
</CodeGroup>

<Note>
  Reassigning moves the number to another agent. The target agent must not
  already have an active number. Deleting an agent detaches (but does not
  release) its number.
</Note>
