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

# Release Phone Number

> Free a number you allocated, only while it still carries your reference

Unassigns a number you took with [Allocate Phone Number](https://docs.voicy.co/api-reference/phone-number-allocate.md),
**only if it still carries the `reference` you pass**. The check and the unassign are one
step, so a late or repeated release can never free a number that has since been allocated
to someone else: it answers `released: false` and changes nothing.

Once released, the number is free again and can be allocated to anyone. Its last call date
keeps counting, so `min_idle_days` on the next allocation holds it back for as long as you ask.

## Body Parameters

**phone\_number** `string` *required*

The number in E.164.

**reference** `string` *required*

The reference the number was allocated with. [List Phone Numbers](https://docs.voicy.co/api-reference/phone-number-list.md)
returns it as `allocation_ref`.

## Response

**phone\_number** `string`

The number in E.164.

**released** `boolean`

`true` when the number was unassigned; `false` when it was not on your account, was already released, or carries a different reference.

```bash cURL theme={null}
curl -X POST https://api.voicy.co/functions/v1/phone-number-release \
  -H "Authorization: Bearer voicy_sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "phone_number": "+972771234567", "reference": "user-1234" }'
```

```javascript JavaScript theme={null}
const result = await (await fetch('https://api.voicy.co/functions/v1/phone-number-release', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer voicy_sk_live_xxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ phone_number: '+972771234567', reference: 'user-1234' }),
})).json();
```

```python Python theme={null}
import requests
result = requests.post(
    "https://api.voicy.co/functions/v1/phone-number-release",
    headers={'Authorization': 'Bearer voicy_sk_live_xxx'},
    json={'phone_number': '+972771234567', 'reference': 'user-1234'},
).json()
```

```json 200 OK theme={null}
{
  "phone_number": "+972771234567",
  "released": true
}
```

```json 400 Bad Request theme={null}
{
  "status": "error",
  "message": "phone_number is required and must be E.164 (e.g. +972771234567)"
}
```

```json 429 Too Many Requests theme={null}
{
  "status": "error",
  "message": "Too many requests: this API key is limited to 600 requests per minute. Retry after 23 seconds."
}
```


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