***

title: create
slug: /reference/python/rest/phone-numbers/create
description: Purchase a phone number.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Purchase a phone number. The exact keyword arguments depend on the number being
purchased (typically obtained from a prior `search()` call).

<EndpointSchemaSnippet endpoint="POST /api/relay/rest/phone_numbers" />

## **Response Example**

<EndpointResponseSnippet endpoint="POST /api/relay/rest/phone_numbers" />

## **Example**

```python {13}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

# Purchase the first available number from a search
available = client.phone_numbers.search(areacode="512", max_results=1)
numbers = available.get("data", [])
if numbers:
    purchased = client.phone_numbers.create(number=numbers[0]["number"])
    print("Purchased:", purchased["number"])
```