OTP

Send an OTP

Sends a 6-digit code to the recipient over WhatsApp. The code is delivered to the end user only — it is never in the response. Keep the returned id and pass it back to /v1/otp/verify as requestId, along with the code the user typed.

Scope required: otp:send.

Cost. Each successful send deducts 5 DA from your balance. If WhatsApp rejects the message, this call returns 422 and the 5 DA is refunded before the response is sent — a failed delivery never costs you anything.

Rate limits. 5 sends per recipient per hour, 200 sends per account per hour. Either returns 422 BUSINESS_RULE_VIOLATION.

Defaults. ttlSeconds = 300 (range 60–900), maxAttempts = 5 (range 1–10), language = "en" (en | fr | ar). Out-of-range values are rejected with 422 — they are not clamped.

On success the returned status is always SENT, with sentAt and expiresAt populated.

post/v1/otp/send

Request

  • Base URL: https://api.dzverify.com
  • URL: https://api.dzverify.com/v1/otp/send
  • Auth: API key in header X-API-Key

Request body

recipientstring required

Phone number in international format, starting with + and country code (e.g. +213612345678).

language'en' | 'fr' | 'ar'

Language of the WhatsApp message. One of en, fr, ar.

ttlSecondsinteger

How long the code stays valid. 60–900 seconds. Default 300 (5 min).

maxAttemptsinteger

Maximum verify attempts before the request is locked. 1–10. Default 5.

Example request

{
  "recipient": "+213612345678",
  "language": "en",
  "ttlSeconds": 300,
  "maxAttempts": 5
}

Response

OTP sent. Status is SENT, with sentAt and expiresAt.

successtrue required
messagestring

Short status message (e.g. "OTP sent", "OTP verified").

Example response

{
  "data": {
    "id": "01HZX5N7M4J2K8Q4R0T5V7Y9AB",
    "recipient": "+213612345678"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.