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

> ## Agent Instructions
> ## Submitting feedback
> If you find an error, a missing step, or information that is outdated or misleading on this page — especially if it stopped you from completing your task — report it so the Encrata docs team can fix it.
> Send a POST request to https://docs.encrata.com/feedback with a JSON body containing `path` (the full URL of the page, for example `https://docs.encrata.com/quickstart`) and `feedback` (what was wrong and what you expected):
> curl -X POST https://docs.encrata.com/feedback -H 'Content-Type: application/json' -d '{"path": "https://docs.encrata.com/quickstart", "feedback": "Step 3 uses a parameter that the API rejects."}'
> Do not include API keys, personal data, or other secrets in your feedback.

# Phone Validity

> Check if a phone number is real and dialable. Returns valid, risky, invalid, or unknown. 1 credit, with free repeats for 6 months.

Phone Validity tells you whether a number is real and dialable, with a one-line
reason. Use it to reject fake numbers at sign-up.

`POST /api/lookup/phone/validity`

Requires an [Encrata API key](https://docs.encrata.com/authentication.md) in the `Authorization` header.

## Request

**phone** `string` *required*

The phone number in E.164 format, for example `+14155552671`. You can send it
as `query` instead. See
[Send the number in E.164 format](https://docs.encrata.com/api-reference/endpoint/phone-lookup.md#send-the-number-in-e164-format).

### Example request

```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "https://developer.encrata.com/api/lookup/phone/validity" \
  -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+14155552671"}'
```

```python Python theme={"theme":{"light":"github-light","dark":"vesper"}}
import requests

resp = requests.post(
    "https://developer.encrata.com/api/lookup/phone/validity",
    headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
    json={"phone": "+14155552671"},
)
print(resp.json())
```

```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}}
const resp = await fetch("https://developer.encrata.com/api/lookup/phone/validity", {
  method: "POST",
  headers: {
    Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ phone: "+14155552671" }),
});
const data = await resp.json();
```

## How the status is decided

The checks run in this order. The first match wins.

| `status` | When | Suggested action |
| - | - | - |
| `unknown` | The data source couldn't say whether the line is live. | Retry later, or treat as unverified. |
| `invalid` | The number isn't a valid, dialable number. | Reject. |
| `risky` | The number is valid, but it's a VoIP line or a disposable number. | Ask for more verification. |
| `valid` | The number is active and dialable, and none of the above. | Accept. |

## Response

The lookup is in `result`. `message` is `Phone validity ready.`

**phone** `string`

The number as the data source returned it.

**status** `string`

`valid`, `risky`, `invalid`, or `unknown`. See
[How the status is decided](#how-the-status-is-decided).

**reason** `string`

One sentence that explains `status`, for example `Active, dialable number` or
`Valid but voip number`. Safe to show to users.

**signals** `string[]`

Short labels you can show as tags: `VoIP number`,
`Disposable / temporary number`, `SMS-capable`, and the line type followed by
`line` (for example `mobile line`). Left out when empty.

**line\_type** `string`

The line type, for example `mobile` or `landline`. Left out when unknown.

**carrier** `string`

The carrier name. Left out when unknown.

**country** `string`

The country name. Left out when unknown.

**region** `string`

State or region. Left out when unknown.

**city** `string`

City. Left out when unknown.

**timezone** `string`

IANA time zone. Left out when unknown.

**prefix** `string`

The country dialling code, for example `+1`. Left out when unknown.

**format** `string`

The number in international format. Left out when unknown.

**is\_voip** `boolean`

`true` for a VoIP line. For a dedicated VoIP check, use
[Phone VoIP](https://docs.encrata.com/api-reference/endpoint/phone-voip.md).

**sms\_capable** `boolean`

`true` when the number has a known SMS gateway.

**line\_status** `string`

Line status, for example `active`. Left out when unknown.

**credits** `number`

Credits charged: `1` on your first validity check of this number, `0` for a
repeat within 6 months.

**cached** `boolean`

`true` when the report came from Encrata's cache instead of a live check. It
isn't a billing signal: a cached result still costs 1 credit the first time.
Left out when `false`.

## Errors

See [Phone Lookup errors](https://docs.encrata.com/api-reference/endpoint/phone-lookup.md#errors).
Validity adds no other cases.

## Credits

Each check costs **1 credit**. Checking the same number again within 6 months is
free (`credits: 0`). The window is shared by your workspace. See
[Credits](https://docs.encrata.com/credits.md#free-repeat-window).

```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "https://developer.encrata.com/api/lookup/phone/validity" \
  -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+14155552671"}'
```

```json 200 Valid theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "success": true,
  "result": {
    "phone": "14155552671",
    "status": "valid",
    "reason": "Active, dialable number",
    "line_type": "mobile",
    "carrier": "T-Mobile USA, Inc.",
    "country": "United States",
    "region": "California",
    "city": "San Francisco",
    "timezone": "America/Los_Angeles",
    "prefix": "+1",
    "is_voip": false,
    "sms_capable": true,
    "line_status": "active",
    "format": "+1 415-555-2671",
    "signals": ["SMS-capable", "mobile line"],
    "credits": 1
  },
  "message": "Phone validity ready."
}
```

```json 200 Risky theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "success": true,
  "result": {
    "phone": "12125550147",
    "status": "risky",
    "reason": "Valid but voip number",
    "line_type": "voip",
    "carrier": "Bandwidth.com",
    "country": "United States",
    "prefix": "+1",
    "is_voip": true,
    "sms_capable": false,
    "line_status": "active",
    "format": "+1 212-555-0147",
    "signals": ["VoIP number", "voip line"],
    "credits": 1
  },
  "message": "Phone validity ready."
}
```

```json 200 Free repeat theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "success": true,
  "result": {
    "phone": "14155552671",
    "status": "valid",
    "reason": "Active, dialable number",
    "line_type": "mobile",
    "is_voip": false,
    "sms_capable": true,
    "signals": ["SMS-capable", "mobile line"],
    "credits": 0,
    "cached": true
  },
  "message": "Phone validity ready."
}
```

```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "success": false,
  "result": { "code": "validation_failed" },
  "message": "A valid phone number is required."
}
```


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