# Check numbers before calling

`POST https://api.morevoice.ai/v1/dnc/check`

For each number: your do-not-call list, recorded consent and the national registry, combined into `callable` for the purpose. Read-only.

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

Operation ID: `dnc_check`.

## Parameters

### 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. |

## Request body

Required, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `phones` | `string[]` | yes | Up to 100 numbers. |
| `purpose` | `"service" \| "marketing" \| "survey"` | yes | The call's purpose. `marketing` requires recorded consent and a national-registry clearance (Israeli numbers); every purpose respects your do-not-call list. |

Example:

```json
{
  "phones": [
    "+972501234567",
    "0527654321"
  ],
  "purpose": "marketing"
}
```

## Responses

### 200 OK

OK Returns `DncCheck`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"dnc_check"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `purpose` | `"service" \| "marketing" \| "survey"` | — |
| `results` | `object[]` | — |

Example:

```json
{
  "livemode": true,
  "object": "dnc_check",
  "purpose": "marketing",
  "results": [
    {
      "callable": true,
      "consent": true,
      "input": "+972501234567",
      "org_dnc": false,
      "phone": "+972501234567",
      "reasons": [],
      "registry": {
        "cached": true,
        "checked_at": "2026-11-01T08:00:00.000Z",
        "status": "clear"
      },
      "valid": true
    }
  ]
}
```

### 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`.

### 413 Payload Too Large

The request body is larger than the endpoint accepts, or has more parts or files than it takes. Returns `ErrorEnvelope`.

### 415 Unsupported Media Type

The request body's Content-Type is not one the endpoint takes. 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 dncCheck = await mv.dnc.check({
	phones: [
		"+972501234567",
		"0527654321",
	],
	purpose: "marketing",
});
console.log(dncCheck);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

dnc_check = client.dnc.check({
    "phones": [
        "+972501234567",
        "0527654321",
    ],
    "purpose": "marketing",
})
print(dnc_check)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/dnc/check \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "phones": [
    "+972501234567",
    "0527654321"
  ],
  "purpose": "marketing"
}'
```
