apyhub
Back
▣ VERIFICATION KIT

Validate Saudi National ID & Iqama API

What it does

The Saudi ID validation API checks a Saudi National ID or Iqama number. Send the number in value and get back valid, the cleaned-up number and the reasons when it fails.

The check runs on the number itself. It must have 10 digits and start with 1 (citizen, National ID) or 2 (resident, Iqama). The last digit must pass the official checksum. Spaces, dashes and Arabic-Indic digits are cleaned up first, so ١٠٠٠٠٠٠٠٠٨ works.

A valid result also tells you the holder type. id_type is citizen or resident, and document is National ID or Iqama (residence permit). Failed checks list codes in problems, such as must_be_10_digits, must_start_with_1_or_2 or checksum_failed.

Teams use the Saudi ID validation API in KYC and onboarding forms. It also helps with Iqama checks in HR systems and data cleanup.

This is a format and checksum check. It catches typos and made-up numbers but does not confirm that the ID is registered with the Saudi government.

To check many IDs at once, use the Batch Validate MENA IDs API. For the next KYC step, screen names with the Sanctions Screening API.

POST
Saudi ID and Iqama
https://api.eu.apyhub.com/odelyo/validate-saudi-national-id/saudi-ids

QUICKSTART

GUIDE

Quickstart

Validate a single value by sending it in a JSON body.

curl -X POST "https://api.eu.apyhub.com/odelyo/validate-saudi-national-id/saudi-ids" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":"1000000008"}'

What you'll get back

Returns a JSON object with data (the validation result) and meta (request id and version). Below is the real response for the request above.

{
  "data": {
    "valid": true,
    "input": "1000000008",
    "normalized": "1000000008",
    "problems": [],
    "type": "citizen",
    "id_type": "citizen",
    "document": "National ID"
  },
  "meta": {
    "request_id": "req_415f5ebc93e84b40",
    "version": "v1"
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Validates a Saudi ID or Iqama number provided in the request body and returns the validation result in a JSON response. The response includes a data field and a meta object with request metadata.

Request Body

ParameterTypeMandatoryDescription
valueStringYesThe Saudi ID or Iqama value to validate. Length must be between 1 and 64 characters.

Response

Returns a JSON object with a data object holding the validation result and a meta object with the request_id and API version. Invalid values still return 200 with valid: false and the reasons in problems. Requests with a missing or wrong-type field return 422 with an error object.

ParameterTypeDescription
dataObjectThe validation result.
data.validBooleantrue if the value passes all checks for its format.
data.inputStringThe value you sent.
data.normalizedStringThe value after cleanup: spaces and separators removed and Arabic-Indic digits converted to Latin digits.
data.problemsString ArrayProblem codes when the value is not valid, e.g. checksum_failed, must_be_14_digits. Empty when valid.
data.typeStringID type: citizen (National ID, starts with 1) or resident (Iqama, starts with 2).
data.id_typeStringSame as type: citizen or resident.
data.documentStringDocument name, e.g. National ID or Iqama (residence permit).
metaObjectRequest details.
meta.request_idStringUnique id of this request, useful for support.
meta.versionStringAPI version, e.g. v1.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.