Feel free to reach techsupport@surepass.io for any technical support or guidance.
Authorization header as Bearer TOKEN.https://sandbox.surepass.apphttps://kyc-api.surepass.app| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer token for API authentication. Format: Bearer <JWT_TOKEN> |
| Content-Type | Yes | Must be set to multipart/form-data for file upload |
| Parameter | Type | Required | Description |
|---|---|---|---|
| recipe_id | string | Yes | Unique identifier of the recipe to which the attachment will be added. This must be an existing recipe ID obtained from the Recipe Builder API. |
| file | file | Yes | The attachment file to be processed and added to the recipe. Supported formats include images (JPEG, PNG) and PDF documents. The file should represent a variation or example of the document type the recipe is designed to process. |
| Parameter | Type | Description |
|---|---|---|
| data | object | Container object holding the updated recipe information |
| data.recipe_id | string | Unique identifier of the recipe that was updated |
| data.keys | object | Updated field schema showing data types for each extractable field. Keys represent field names, values indicate data types (str, int, float, bool, etc.) |
| data.description | string | AI-generated description of the document type and its contents based on the attached file |
| data.model | string/null | Model configuration used for processing (null indicates default model) |
| data.name | string | Human-readable name assigned to the recipe schema |
| data.created_at | string | Date when the recipe was originally created (ISO 8601 format: YYYY-MM-DD) |
| data.tag | string | Category or classification tag assigned to the recipe (e.g., "general", "financial", "identity") |
| data.preference_type | string | Processing preference setting that affects extraction behavior (e.g., "latency" for faster processing, "accuracy" for more precise extraction) |
| data.pages | array | Array of page numbers for PDF documents. Empty array for image files. |
| data.use_pdf | boolean | Indicates whether the recipe processes PDF documents (false for image-based recipes) |
| data.doc_url | string/null | URL to the stored attachment document. Null if not yet processed or unavailable. |
| status_code | integer | HTTP status code (200 for success) |
| success | boolean | Indicates if the request was successful |
| message | string | Human-readable message describing the result |
| message_code | string | Machine-readable code for the result status |
{
"data": {
"recipe_id": "recipe_fxwFeY",
"keys": {
"name": "str",
"member_id": "int",
"phone": "str",
"address": "str"
},
"description": "The image displays a student ID card from the Ingoude Academy. It includes details like name, member ID, phone number, and address.",
"model": null,
"name": "Student ID Card Details",
"created_at": "2025-05-14",
"tag": "general",
"preference_type": "latency",
"pages": [],
"use_pdf": false,
"doc_url": null
},
"status_code": 200,
"success": true,
"message": "Success",
"message_code": "success"
}keys object shows the updated field schema with inferred data typesdescription field provides AI-generated context about the documentpages array indicates the attachment is an image file rather than a PDFuse_pdf field helps identify the document format being processed{
"data": null,
"status_code": 404,
"success": false,
"message": "Recipe not found",
"message_code": "recipe_not_found"
}curl --location --request POST 'https://kyc-api.surepass.app/api/v1/ai-playground/add-attachment' \
--header 'Authorization: Bearer <token>' \
--form 'file=@""' \
--form 'recipe_id="rec_veh_reg_12345"'{
"data": {
"recipe_id": "recipe_fxwFeYqwpVzjunaDbAEM",
"keys": {
"name": "str",
"member_id": "int",
"phone": "str",
"address": "str"
},
"description": "The image displays a student ID card from the Ingoude Academy. It includes details like name, member ID, phone number, and address.",
"model": null,
"name": "Student ID Card Details",
"created_at": "2025-05-14",
"tag": "general",
"preference_type": "latency",
"pages": [],
"use_pdf": false,
"doc_url": null
},
"status_code": 200,
"success": true,
"message": "Success",
"message_code": "success"
}