# Ask to buy a number

`POST /phone/purchases` · Rivier · voice

Ask to buy a number. Nothing is bought: this records the price and waits for a person to confirm it.

- Scope: voice:write
- Mcp: rivier_phone_purchase_request
- Graphql: Mutation.voicePhonePurchaseRequest
- Sdk: voice.phonePurchase.request
- Cli: voice phone purchase request

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "number": {
      "type": "string",
      "pattern": "^\\+\\d{6,15}$"
    },
    "country": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2
    },
    "type": {
      "type": "string",
      "enum": [
        "local",
        "mobile",
        "toll-free"
      ]
    },
    "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "number",
    "country",
    "label"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/phone/purchases' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "number": "string",
  "country": "string",
  "label": "string"
}'
```
