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

# roark phone-number create

> Buy a phone number

Buys a number from the carrier for this project: the one named by e164, or one Roark picks to match autoPick (trying the next match if the carrier has just sold one). Free inside the plan allowance; past it, the first month of rent is charged now and monthly after that.

```bash Synopsis theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
roark phone-number create [options]
```

> [!NOTE]
>
> Calls `POST /v1/phone-number`

## Options

**--e164** `string`

The number to buy, in E.164 format, from a search result. Give this or autoPick.

**--auto-pick** `object`

What the number Roark picks should look like. Roark buys the first matching number the carrier will sell, preferring the area code and falling back to a nearby one.

**--auto-pick.country** `string`

ISO 3166-1 alpha-2 country of the number: US or CA. One of `US`, `CA`

**--auto-pick.number-type** `string`

LOCAL for a number in an area code, `TOLL_FREE` for one from the shared US and Canada toll-free pool. One of `LOCAL`, `TOLL_FREE`

**--auto-pick.area-code** `string`

Three-digit area code, or a toll-free prefix such as 800. When it has no numbers, nearby ones are returned instead, flagged bestEffort.

**--auto-pick.contains** `string`

Digits or letters the number must contain (1 to 7, \* matches any digit).

**--country** `string`

The country of the number given by e164 (default: US). An auto-picked number uses autoPick.country. One of `US`, `CA`

**--name** `string`

A label for the number.

**--agent-id** `string`

The agent to assign the number to.

**--expect-free** `switch`

Whether you expect this number to be free (from the allowance). The purchase is refused with 409 if that has changed since you checked.

**--expect-monthly-rent-micros** `integer`

The monthly rent you expect for a paid number, in micros (from the allowance). The purchase is refused with 409 if that has changed since you checked.

## Example

```bash theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
roark phone-number create
```

Every command also takes the [global options](https://docs.roark.ai/cli-reference/overview.md#global-options) and sets one
of the [exit codes](https://docs.roark.ai/cli-reference/overview.md#exit-codes).


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