Skip to content
Constaia
ma_cnie

Moroccan national electronic ID card (CNIE)

Moroccan electronic national ID card (CNIE, 2020 model) with chip and TD1 MRZ, in Arabic and French.

Category
Identity
Country
Morocco
Fields it extracts
13 fields
Cost
1 credit
ma_cniespecimen
Document number
First name
Last name
Sex
Nationality
Date of birth
Issue date
Expiration date
Issuing country

What it checks

  • MRZ ICAO 9303. Check digits of the machine readable zone.
  • MRZ vs printed data. The MRZ matches the visible data.
  • National identifiers. Official checksum or format of the number (NIF, CPF, CURP, RUT, SSN…).ma_cnie
  • Holder. Name, number or date of birth match what you expect.
  • Age. Minimum or maximum age from the date of birth.
  • Validity. Not expired on the reference date.

Fields it extracts

  • Document numberdocument_number
  • First namefirst_name
  • Last namelast_name
  • Sexsex
  • Nationalitynationality
  • Date of birthbirth_date
  • Issue dateissue_date
  • Expiration dateexpiry_date
  • Issuing countryissuing_country
  • Mrzmrz
  • Place of birthbirth_place
  • Addressaddress
  • Can numbercan_number

Sample request

curl https://api.constaia.com/v1/analyze \
  -H "Authorization: Bearer $CONSTAIA_API_KEY" \
  -F "file=@document.pdf" \
  -F 'options={
    "expect": "ma_cnie",
    "checks": {
      "not_expired": true,
      "holder": {
        "full_name": "Carmen Especimen Ruiz"
      }
    },
    "storage": "none"
  }'

Sample response

Fictitious data. Shortened response.

200 OK · application/json
{
  "id": "an_01J9Z3K8QW4T6Y2B7N5M1R0PXC",
  "object": "analysis",
  "status": "completed",
  "livemode": false,
  "document": {
    "type": "ma_cnie",
    "label": "Moroccan national electronic ID card (CNIE)",
    "confidence": 0.97
  },
  "verdict": {
    "expected": [
      "ma_cnie"
    ],
    "match": true,
    "status": "valid",
    "reasons": [
      {
        "code": "type_match",
        "severity": "info",
        "message": "The document is: Moroccan national electronic ID card (CNIE)."
      }
    ]
  },
  "fields": {
    "document_number": {
      "value": "BE123456",
      "confidence": 0.99,
      "validated": true
    },
    "first_name": {
      "value": "YOUSSEF",
      "confidence": 0.98,
      "validated": null
    },
    "last_name": {
      "value": "SPECIMEN",
      "confidence": 0.97,
      "validated": null
    },
    "sex": {
      "value": "M",
      "confidence": 0.96,
      "validated": null
    },
    "nationality": {
      "value": "MAR",
      "confidence": 0.99,
      "validated": null
    },
    "birth_date": {
      "value": "1985-07-30",
      "confidence": 0.98,
      "validated": null
    },
    "issue_date": {
      "value": "2023-03-15",
      "confidence": 0.97,
      "validated": null
    },
    "expiry_date": {
      "value": "2033-03-14",
      "confidence": 0.96,
      "validated": null
    },
    "issuing_country": {
      "value": "MAR",
      "confidence": 0.99,
      "validated": null
    },
    "mrz": {
      "value": "IDMARBE123456<0<<<<<<<<<<<<<<<\n8507309M3303148MAR<<<<<<<<<<<4\nSPECIMEN<<YOUSSEF<<<<<<<<<<<<<",
      "confidence": 0.98,
      "validated": null
    },
    "birth_place": {
      "value": "CASABLANCA",
      "confidence": 0.97,
      "validated": null
    }
  },
  "checks": [
    {
      "code": "mrz_checksums",
      "passed": true,
      "message": "The MRZ check digits are correct."
    },
    {
      "code": "mrz_matches_visual",
      "passed": true,
      "message": "The MRZ matches the printed data."
    },
    {
      "code": "id_number",
      "passed": true,
      "message": "id_number"
    }
  ],
  "warnings": [],
  "storage": {
    "mode": "none",
    "file_deleted_at": "2026-09-29T10:00:02Z",
    "expires_at": null
  },
  "usage": {
    "credits": 1,
    "pages": 1
  }
}

FAQ

Does Constaia prove that the document is authentic?

No. It checks the type, the consistency of the data and your rules, and flags signals such as a possible edit or a photo of a screen. That does not prove authenticity.

Is a copy of the document kept?

Only if it needs review: then it's kept encrypted until someone decides and for 24 hours after that (configurable). Otherwise it's deleted as soon as the analysis ends. You can choose never to keep it.

Other documents

And for the record…

Create your free account and validate your first document in five minutes. No credit card required.