Feel free to reach techsupport@surepass.io for any technical support or guidance.
use_pdf flag.Authorization header as Bearer <YOUR_JWT_TOKEN>.https://sandbox.surepass.apphttps://kyc-api.surepass.app⚠️ Important: Never share or expose your JWT token in client-side code or public repositories. Use environment variables to manage tokens securely.
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token for authentication. Format: Bearer <YOUR_JWT_TOKEN> |
Content-Type | Conditional | Must be multipart/form-data when sending a binary file upload. For base64 or link inputs, use application/json. |
file, base64, or url must be provided per request. These are mutually exclusive input methods.| Parameter | Type | Required | Description |
|---|---|---|---|
file | File (binary) | One of file / base64 / url | The PAN card image or PDF file to be masked. Send as multipart/form-data with content type application/octet-stream. |
base64 | String | One of file / base64 / url | Base64-encoded string of the PAN card image or PDF. Send as a JSON body field. |
link | String | One of file / base64 / link | Publicly accessible URL pointing to the PAN card image or PDF. Send as a JSON body field. |
use_pdf | String | Conditional | Set to "true" when the input document (via any method) is a PDF. Omit for image inputs. |
POST /api/v1/ocr/pan-masking
Authorization: Bearer <YOUR_JWT_TOKEN>
Content-Type: application/json
{
"base64": "<BASE64_ENCODED_IMAGE_OR_PDF_STRING>",
"use_pdf": "true"
}POST /api/v1/ocr/pan-masking
Authorization: Bearer <YOUR_JWT_TOKEN>
Content-Type: application/json
{
"link": "https://example.com/pan_card.jpg"
}| Parameter | Type | Description |
|---|---|---|
data | Object | Container object holding the result payload. |
data.client_id | String | A unique identifier for this masking request, prefixed with pan_masking_. Used for tracking and support. |
data.masked_image | String (URL) | A pre-signed AWS S3 URL pointing to the masked version of the uploaded document. This URL is time-limited. |
status_code | Integer | HTTP-equivalent status code for the operation (e.g., 200 for success). |
success | Boolean | true if the masking operation completed successfully; false otherwise. |
message | String | null | Human-readable message providing additional context. null on success. |
message_code | String | Machine-readable status code. Value is "success" on successful completion. |
{
"data": {
"client_id": "pan_masking_rcyHuMgNbdnzdJvvyDdL",
"masked_image": "https://aadhaar-kyc-docs.s3.amazonaws.com/pan_masking_rcyHuMgNbdnzdJvvyDdL/masked_1777119672507.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY5K3QRM5KVPBYKKE%2F20260425%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=d77d480bc37a33a07d72cabpc8054d424d728605968ad05a3d2cc538ee45ac0c"
},
"status_code": 200,
"success": true,
"message": null,
"message_code": "success"
}{
"data": null,
"status_code": 401,
"success": false,
"message": "Authentication credentials were not provided or are invalid.",
"message_code": "unauthorized"
}Authorization header is missing, malformed, or the JWT token is invalid or expired. Ensure you are using the correct token for the target environment (sandbox vs. production).masked_image URL is time-limited. Download and store the masked image in your own secure storage immediately after receiving the response — do not rely on the S3 URL for long-term access.422 Unprocessable Entity error is returned, prompt the user to re-upload a clearer image rather than showing a generic error — include actionable guidance.curl --location 'https://kyc-api.surepass.app/api/v1/ocr/pan-masking' \
--header 'Authorization: Bearer <token>' \
--form 'file=""'{
"data": {
"client_id": "pan_masking_rcyHuMgNbdnzdJvvyDdL",
"masked_image": "https://aadhaar-kyc-docs.s3.amazonaws.com/pan_masking_rcyHuMgNbdnzdJvvyDdL/masked_1777119672507.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY5K3QRM5KVPBYKKE%2F20260425%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=d77d480bc37a33a07d72cabpc8054d424d728605968ad05a3d2cc538ee45ac0c"
},
"status_code": 200,
"success": true,
"message": null,
"message_code": "success"
}