# Remove a number from the do-not-call list

`DELETE https://api.morevoice.ai/v1/dnc/{phone}`

Calls to the number are allowed again (marketing calls still need consent and the registry). Needs a live key.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `dnc_delete`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `phone` | `string` | yes | The number (URL-encode the `+` as `%2B`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |
| `Idempotency-Key` | `string` | no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |

## Responses

### 200 OK

OK Returns `DeletedDncEntry`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"dnc_entry"` | — |
| `phone` | `string` | — |
| `deleted` | `true` | — |

Example:

```json
{
  "deleted": true,
  "object": "dnc_entry",
  "phone": "+972501234567"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 409 Conflict

The request conflicts with the object's state, or the Idempotency-Key was reused with other parameters. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const deletedDncEntry = await mv.dnc.delete("+972501234567");
console.log(deletedDncEntry);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

deleted_dnc_entry = client.dnc.delete("+972501234567")
print(deleted_dnc_entry)
```

**cURL**

```sh
curl -X DELETE https://api.morevoice.ai/v1/dnc/%2B972501234567 \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```
