Create Document

Create a new identity document from ScanXtract data

POST /di/document/

Query parameters

ParamRequiredTypeDescription
docTypeYesstringDocument type key (e.g. ADHAR). See Documents for values.
emailOne of email/phonestringEmail address of the document owner
phoneOne of email/phonestringPhone number without country code (e.g. 6123456780)
countryCodeYes, with phonestringCountry code without + (e.g. 91)
fullNameNostringFull name of the document owner. Used when a new user account is created.
accessRemarkNostringAccess remark. Returned as accessRemark by Read Document.
childAccountIdNostringChild account ID

If no user exists with the given email or phone, one is created. The phone is stored as country code + number (e.g. 916123456780).

Body

The JSON body is the document data. Most of it comes from the ScanXtract result. It is stored as sent and returned as documentData by Read Document. Fields are not validated.

FieldTypeDescription
idNumberstringDocument number. Used to build documentNumberMasked and uniqueIdentifierHashed.
expirystring | nullExpiry date (YYYY-MM-DD)
scannedImagesarrayImages from ScanXtract. Each has imageUrl and faceLandmark, and optionally keywords and keyString.
fullNamestringName on the document
firstNamestring | nullFirst name
lastNamestring | nullLast name
nameMatchPercentagenumberFrom ScanXtract
dobstring | nullDate of birth (YYYY-MM-DD)
yearOfBirthstringYear of birth
genderstringGender
userPhotoURLstring | nullUser photo URL
userPhotoURIstring | nullUser photo URI
careOfstring | nullCare of
addressstring | nullAddress
manualFieldsobject | nullManually entered fields

Example request

curl --request POST 'https://api.qidpro.xyz/di/document/?fullName=Rahul%20Sharma&email=user%40example.com&phone=6123456780&countryCode=91&docType=ADHAR&accessRemark=Identity%20verification' \
  --header 'Authorization: Bearer your-secret-key' \
  --header 'tokenId: your-token-id' \
  --header 'Content-Type: application/json' \
  --data '{
    "idNumber": "XXXXXXXX2804",
    "expiry": null,
    "scannedImages": [
      {
        "imageUrl": "c975e4082c1.png",
        "faceLandmark": [
          { "x": 36, "y": 94 },
          { "x": 98, "y": 94 },
          { "x": 98, "y": 168 },
          { "x": 36, "y": 168 }
        ]
      },
      {
        "imageUrl": "ea46c9193b.png",
        "faceLandmark": null
      }
    ],
    "fullName": "Rahul Sharma",
    "firstName": null,
    "lastName": null,
    "nameMatchPercentage": 100,
    "dob": "1995-04-12",
    "yearOfBirth": "1995",
    "gender": "Male",
    "userPhotoURL": null,
    "userPhotoURI": null,
    "careOf": null,
    "address": "S/O: Ramesh Kumar, 12 MG Road, Indiranagar, Bengaluru, Karnataka, 560038",
    "manualFields": null
  }'

Example response

Status 201 Created:

{
  "createdBy": "66a9b3cdc784371e2fe15634",
  "deleteTime": null,
  "account_id": "66b3172e38534634dd1303f2",
  "accountType": "user",
  "sid": {
    "_id": "63c145cb20926fed9d12568a",
    "name": "Aadhaar",
    "logoUrl": "810d926f693.png",
    "keyName": "ADHAR",
    "photos": [
      {
        "name": "Front",
        "testKeywords": "MALE|FEMALE|TRANSGENDER|पुरुष|जन्म",
        "faceCheck": 2
      },
      {
        "name": "Back",
        "testKeywords": "",
        "faceCheck": 0
      }
    ],
    "isSystemApproved": true
  },
  "documentNumberMasked": "XXXXXXXX2804",
  "uniqueIdentifierHashed": "d5913090c8c4fb6cfa4f1c76b504e7537fd86b8e461a61b142555632d666798d03ded16e6a997596f5b210a0d051ed85ef70897fd3a58a5443e8497c5327f1c0bbf6ebf8fc625379fa7dfd34e1bf9e690d432f6293caa1476179b13b5961856239392e665ad9f153c9c49d012aaa57aa9aa6eff4e4781d30a80c18a59faea22f",
  "verificationTime": null,
  "scanXtractRequestId": null,
  "faceMatchStatus": null,
  "_id": "66b3174a38534634dd13040b",
  "createTime": "2026-11-10T11:44:43.139Z",
  "lastUpdateTime": "2026-11-10T11:44:43.139Z",
  "__v": 0
}

Response fields

FieldTypeDescription
createdBystringAccount ID of the organisation that created the document
deleteTimestring | nullDeletion time, or null
account_idstringAccount ID of the document owner
accountTypestringOwner account type (user)
sidobjectDocument type (SID): _id, name, logoUrl, keyName, photos and isSystemApproved. photos lists the expected images; testKeywords is only present on some.
documentNumberMaskedstringMasked document number (e.g. P1XXX56AA for a passport). Omitted when the body has no idNumber.
uniqueIdentifierHashedstringHash of the document number. Omitted when the body has no idNumber.
verificationTimestring | nullVerification time, or null
scanXtractRequestIdstring | nullAlways null from this endpoint
faceMatchStatusstring | nullAlways null from this endpoint
_idstringDocument ID. Use this as document_id in Read Document.
createTimestringCreation time (ISO 8601)
lastUpdateTimestringLast update time (ISO 8601)
__vintegerInternal version

Creating the same document again for the same user does not fail. It creates a new document with a new _id.

Errors

Errors return this shape:

{
  "statusCode": 400,
  "message": "Please provide a valid docType",
  "timestamp": "2026-11-10T11:45:18.365Z",
  "path": "/di/document/?fullName=Rahul%20Sharma&email=user%40example.com",
  "requestId": "a3ed35cc-fdd4-4bfb-b984-e07671ae61d8"
}
StatusMessageCause
400Please provide a valid docTypedocType is missing or not a supported value
400Input required: Please provide either an email address or a phone numberNeither email nor phone is sent
400Please provide country codephone is sent without countryCode
400JSON parse error (e.g. Expected property name or '}' in JSON at position 1 (line 1 column 2))Body is not valid JSON. This response has errorCode and error ("Bad Request") and no requestId.
401Error: Token MissingAuthorization header is missing
401HttpException: Invalid Token IDtokenId header is missing
401HttpException: Wrong/Invalid AuthorisationSecret key is wrong
401HttpException: No record found with the provided Token IDtokenId does not match any account
500Internal server errorchildAccountId is not a child account of your organisation

See the API Reference for the full interactive spec.


Did this page help you?