<!-- Generated from the canonical 99 Digital API documentation. Do not edit this file. -->

Canonical page: https://docs.99digital.co.il/partners-api/whatsapp/step-1-register-a-number/register-number

# Register a number

`POST https://partners.99digital.co.il/api/whatsapp/registerNumber`

This API allows you to add a number to your account, in order to use the Step 2: Onboarding API.

In order to use the number, we must verify the number. You can request the
verification code by SMS or by a phone call. This is part 1 of
[Step 1: Register a number](https://docs.99digital.co.il/partners-api/whatsapp/step-1-register-a-number);
part 2 is [Verify a number](https://docs.99digital.co.il/partners-api/whatsapp/step-1-register-a-number/verify-number).

**Important remarks**

- The number you wish to register must not be installed on any WhatsApp
  phone: it must be a new number. If you wish to onboard a number as
  [coexistence](https://docs.99digital.co.il/whatsapp-api/information/coexistence) (meaning you want
  to keep using the WhatsApp mobile app, and not register it as a new
  number), jump to
  [Step 2: Onboarding](https://docs.99digital.co.il/partners-api/whatsapp/step-2-onboarding).
- Do not attempt to request a code more than 3 times, or Facebook might
  block the request for 1 hour to avoid abuse (reason 24).
- If you want to use a phone call, please make sure you are able to dial
  the number yourself and that the number does not have an IVR operator.
  Make sure that a call can go through smoothly and that you are able to
  answer the phone call. The phone call will be received from a foreign
  country code or an unknown number: make sure those numbers are not
  blocked on your phone.
- Registered phone numbers will wait in your account for 90 days. During
  this time you must create an account with that number. If you did not
  create an account with that phone number, after 90 days you will have to
  register the number again.
- You can register and keep up to 500 numbers in your account waiting to
  be connected.

This process is a two-part process:

- **Part 1:** you register the number by asking for the verification
  code. After submitting the registerNumber API (this page), you will get
  an SMS or a phone call with a 6-digit verification code.
- **Part 2:** you verify the code you received with
  [Verify a number](https://docs.99digital.co.il/partners-api/whatsapp/step-1-register-a-number/verify-number).
  Now the number is verified and belongs to you.

## Settings

| Setting | Value |
| --- | --- |
| URL | `https://partners.99digital.co.il/api/whatsapp/registerNumber` |
| Method | JSON via POST |
| Header | `Authorization: Bearer {{access_token}}` — the access token can be received from the [Access Token](https://docs.99digital.co.il/partners-api/settings/access-token) API. |

Requires the **Add new number** permission (Verified Numbers).

## Body

| Parameter | Description / Example | Maximum length | Remarks | Mandatory |
| --- | --- | --- | --- | --- |
| `whatsapp` | The WhatsApp number you wish to register | 20 | Use the country code and the number, digits only, without `+`. For example: `972501234567` | Yes |
| `method` | `1` for SMS; `2` for a phone call (a number, not a string) | 1 | If both options are available for your number, we recommend using SMS, as it is a more stable way and not based on answering a phone call. | Yes |
| `language` | The language code — see the `language` table below (a number, not a string) | 1 | The language of the SMS / voice call that brings the verification code. (For SMS, in some cases, the code will be sent in English regardless of what was selected in `language`.) | Yes |
| `comment` | A free text for you to use along with the number registration. You get it back as `comment` in [Get Registered numbers](https://docs.99digital.co.il/partners-api/whatsapp/get-registered-numbers). | 100 | Numbers and letters only (spaces, hyphens, underscores and parentheses are accepted too). | No |

`language` values:

| Language name | Code to use |
| --- | --- |
| Hebrew | 1 |
| English | 2 |
| Arabic | 3 |
| Russian | 4 |
| Spanish | 5 |
| Chinese | 6 |
| Hindi | 7 |
| Thai | 8 |
| French | 9 |

## Response

```json
{
  "status": "OK",
  "whatsapp": "972501234567",
  "reason": 1
}
```

## Response explained

| Parameter | Description |
| --- | --- |
| `status` | OK or FAIL. "OK" means the SMS or phone call has been sent. "FAIL" means error. |
| `whatsapp` | The WhatsApp number. |
| `reason` | The status explanation — see the table below. |

| Reason | Explanation |
| --- | --- |
| 1 | Not FAIL: the status is OK. |
| 2 | Wrong credentials: the `Authorization` header is missing or not `Bearer <token>`, or this endpoint doesn't accept the token's type (account-scoped and onboarding tokens are rejected). |
| 3 | The access token does not exist or has expired. Please generate another one with the [Access Token](https://docs.99digital.co.il/partners-api/settings/access-token) API. |
| 4 | The WhatsApp number is empty or wrong (digits only, up to 20). |
| 5 | `method` is empty or wrong (1 or 2). |
| 6 | `language` is empty or wrong (1 to 9). |
| 7 | The number you are trying to verify has already been verified by you. |
| 8 | The number you are trying to verify is not a new WhatsApp number. The number might be used by another WhatsApp API business or by the WhatsApp app, or the number you provided is not a valid phone number. |
| 9 | Error trying to send the verification code, please try again later. |
| 15 | Unknown error, please contact support. Also returned when the request body is not valid JSON. |
| 24 | You requested the code too many times. Please try again in 1 hour. |
| 27 | The comment length is too long, or the comment is invalid. |

## Authentication

`Authorization: Bearer <token>` header — `Bearer ` followed by your access token. Create the token with [Access Token](https://docs.99digital.co.il/partners-api/settings/access-token), from the client id and client secret in your partners dashboard. It is valid for one hour.

## Request body

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `whatsapp` | string | Yes | The WhatsApp number you wish to register. Use the country code and the number, digits only (up to 20), without `+`. For example: `972501234567`. The number must be a new number, not installed on any WhatsApp phone. Max length: 20. Pattern: `^[0-9]{1,20}$`. Example: `972501234567`. |
| `method` | integer | Yes | How to send the verification code: 1 for SMS, 2 for a phone call — a number, not a string. If both options are available for your number, we recommend using SMS, as it is a more stable way and not based on answering a phone call. For a phone call, make sure you can dial the number yourself, that it has no IVR operator, and that calls from a foreign country code or an unknown number are not blocked. One of: `1` — SMS — the 6-digit code is sent by SMS (recommended); `2` — Phone call — the 6-digit code is read in a phone call. Make sure you are able to answer it. Example: `1`. |
| `language` | integer | Yes | The language of the SMS / voice call that brings the verification code — a number, not a string. (For SMS, in some cases, the code will be sent in English regardless of what was selected in `language`.) One of: `1` — Hebrew; `2` — English; `3` — Arabic; `4` — Russian; `5` — Spanish; `6` — Chinese; `7` — Hindi; `8` — Thai; `9` — French. Example: `1`. |
| `comment` | string | No | A free text for you to use along with the number registration, up to 100 characters. Numbers and letters only (spaces, hyphens, underscores and parentheses are accepted too). You get it back as `comment` in [Get Registered numbers](https://docs.99digital.co.il/partners-api/whatsapp/get-registered-numbers). Max length: 100. Example: `Reserved number for client A`. |

### Example: SMS

Send the code by SMS, in Hebrew.

```json
{
  "whatsapp": "972501234567",
  "method": 1,
  "language": 1
}
```

### Example: Phone call

Send the code by a phone call, in English. Make sure you can answer the call.

```json
{
  "whatsapp": "972501234567",
  "method": 2,
  "language": 2
}
```

### Example: With comment

Add a comment of your own to the registered number.

```json
{
  "whatsapp": "972501234567",
  "method": 1,
  "language": 2,
  "comment": "Reserved number for client A"
}
```

## Responses

### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `status` | string | (one of: OK) OK means the SMS or the phone call with the verification code has been sent. Always `OK`. |
| `whatsapp` | string | (one of: OK) The WhatsApp number. Example: `972501234567`. |
| `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. |
| `status` | string | (one of: FAIL) FAIL means error — the request was not carried out. `reason` says why. Always `FAIL`. |
| `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Wrong credentials: the `Authorization` header is missing or not `Bearer <token>`, or this endpoint doesn't accept the token's type (account-scoped and onboarding tokens are rejected); `3` — The access token does not exist or has expired. Please generate another one with the [Access Token](https://docs.99digital.co.il/partners-api/settings/access-token) API; `4` — The WhatsApp number is empty or wrong: digits only, up to 20; `5` — `method` is empty or wrong: 1 or 2; `6` — `language` is empty or wrong: 1 to 9; `7` — The number you are trying to verify has already been verified by you; `8` — The number you are trying to verify is not a new WhatsApp number: it might be used by another WhatsApp API business or by the WhatsApp app, or the number you provided is not a valid phone number; `9` — Error trying to send the verification code, please try again later; `15` — Unknown error, please contact support. Also returned when the request body is not valid JSON; `24` — You requested the code too many times. Please try again in 1 hour; `27` — The comment length is too long, or the comment is invalid. |

#### Example: OK

The verification code has been sent.

```json
{
  "status": "OK",
  "whatsapp": "972501234567",
  "reason": 1
}
```

#### Example: Reason 7

You have already verified this number.

```json
{
  "status": "FAIL",
  "reason": 7
}
```

#### Example: Reason 8

The number is not a new WhatsApp number, or not a valid phone number.

```json
{
  "status": "FAIL",
  "reason": 8
}
```

#### Example: Reason 24

You requested the code too many times. Try again in 1 hour.

```json
{
  "status": "FAIL",
  "reason": 24
}
```

### 403 — Permission denied (HTTP 403). The access token is valid, but the partners dashboard user it was created for doesn't have the permission this endpoint needs. An admin of your partner account can enable it in the user's permissions.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `status` | string | FAIL — the request was not carried out. Always `FAIL`. |
| `reason` | integer | Always 403. Always `403`. |
| `error` | string | "Permission denied" — the user of this access token lacks the permission this endpoint needs. Always `Permission denied`. |

#### Example

```json
{
  "status": "FAIL",
  "reason": 403,
  "error": "Permission denied"
}
```
