Create Document
Create a new identity document from ScanXtract data
POST /di/document/
Query parameters
| Param | Required | Type | Description |
|---|---|---|---|
docType | Yes | string | Document type key (e.g. ADHAR). See Documents for values. |
email | One of email/phone | string | Email address of the document owner |
phone | One of email/phone | string | Phone number without country code (e.g. 6123456780) |
countryCode | Yes, with phone | string | Country code without + (e.g. 91) |
fullName | No | string | Full name of the document owner. Used when a new user account is created. |
accessRemark | No | string | Access remark. Returned as accessRemark by Read Document. |
childAccountId | No | string | Child 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.
| Field | Type | Description |
|---|---|---|
idNumber | string | Document number. Used to build documentNumberMasked and uniqueIdentifierHashed. |
expiry | string | null | Expiry date (YYYY-MM-DD) |
scannedImages | array | Images from ScanXtract. Each has imageUrl and faceLandmark, and optionally keywords and keyString. |
fullName | string | Name on the document |
firstName | string | null | First name |
lastName | string | null | Last name |
nameMatchPercentage | number | From ScanXtract |
dob | string | null | Date of birth (YYYY-MM-DD) |
yearOfBirth | string | Year of birth |
gender | string | Gender |
userPhotoURL | string | null | User photo URL |
userPhotoURI | string | null | User photo URI |
careOf | string | null | Care of |
address | string | null | Address |
manualFields | object | null | Manually 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
| Field | Type | Description |
|---|---|---|
createdBy | string | Account ID of the organisation that created the document |
deleteTime | string | null | Deletion time, or null |
account_id | string | Account ID of the document owner |
accountType | string | Owner account type (user) |
sid | object | Document type (SID): _id, name, logoUrl, keyName, photos and isSystemApproved. photos lists the expected images; testKeywords is only present on some. |
documentNumberMasked | string | Masked document number (e.g. P1XXX56AA for a passport). Omitted when the body has no idNumber. |
uniqueIdentifierHashed | string | Hash of the document number. Omitted when the body has no idNumber. |
verificationTime | string | null | Verification time, or null |
scanXtractRequestId | string | null | Always null from this endpoint |
faceMatchStatus | string | null | Always null from this endpoint |
_id | string | Document ID. Use this as document_id in Read Document. |
createTime | string | Creation time (ISO 8601) |
lastUpdateTime | string | Last update time (ISO 8601) |
__v | integer | Internal 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"
}| Status | Message | Cause |
|---|---|---|
400 | Please provide a valid docType | docType is missing or not a supported value |
400 | Input required: Please provide either an email address or a phone number | Neither email nor phone is sent |
400 | Please provide country code | phone is sent without countryCode |
400 | JSON 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. |
401 | Error: Token Missing | Authorization header is missing |
401 | HttpException: Invalid Token ID | tokenId header is missing |
401 | HttpException: Wrong/Invalid Authorisation | Secret key is wrong |
401 | HttpException: No record found with the provided Token ID | tokenId does not match any account |
500 | Internal server error | childAccountId is not a child account of your organisation |
See the API Reference for the full interactive spec.
Updated 17 days ago
Did this page help you?