Create Form
A form defines which verification checks are required for a candidate. Create a form once and reuse it across multiple candidates by referencing its ID in the Create Profile step.
API Endpoint
Endpoint URL: POST https://api.trential.dev/verification/api/1.0/ekyc-forms
Request
To create a form, send a POST request with the following JSON payload:
{
"name": "Demo form 2",
"purpose": "657ab9ba7c8741f1f8bc3376",
"expiry": 1717093800,
"verifications": [
{
"name": "bgv-employment",
"skipAllowed": true
},
{
"name": "bgv-twelfth",
"skipAllowed": true
},
{
"name": "bgv-degree",
"skipAllowed": true
}
],
"userPaymentRequired": false,
"type": "diy",
"sharing": {
"visibility": "public"
}
}
cURL
curl -X POST 'https://api.trential.dev/verification/api/1.0/ekyc-forms' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "Demo form 2",
"purpose": "657ab9ba7c8741f1f8bc3376",
"expiry": 1717093800,
"verifications": [
{ "name": "bgv-employment", "skipAllowed": true },
{ "name": "bgv-twelfth", "skipAllowed": true },
{ "name": "bgv-degree", "skipAllowed": true }
],
"userPaymentRequired": false,
"type": "diy",
"sharing": { "visibility": "public" }
}'
Parameters
- name (string):The name of the form(Required)
- purpose (ID): The unique ID for the purpose of the form.(use get purpose api)(Required)
- expiry (Number): The expiration time of form as a Unix timestamp(optional)
- verifications (Array): List of verifications to include in the form(Required)
- name (string): The name of verification, accepted values:-
- bgv-tenth (10th education check)
- bgv-twelfth (12th education check)
- bgv-degree (Any degree/marsheet check)
- bgv-employment (Employment check)
- bgv-criminal
- bgv-cibil
- bgv-local-address-digital
- bgv-local-address-postal
- bgv-permanent-address-digital
- bgv-permanent-address-postal
- bgv-global-database-check
- bgv-social-media
- bgv-degree-with-marksheet
- bgv-professional-reference-check
- bgv-police-verification
- pan
- gst
- bank-account
- upi
- cin
- din
- voter-id
- employment-check
- face-match
- aadhaar
- dl
- liveness
- passport
- form26as
- skipAllowed (boolean): // User can skip this verification(Required)
- name (string): The name of verification, accepted values:-
- userPaymentRequired (boolean): If want payment from user make it true otherwise false(Required)
- type (string): The form type is DIY, accepted values:- (Required)
- diy
- sharing.visibility (string): The form is publicly visible, accepted values:- (Required)
- public
- private
Response
If the form is valid, the response will be as follows:
{
"code": 0,
"message": "Success",
"data": {
"_id": "664dc505f7675bad1a822371",
"name": "Demo form 2",
"purpose": "657ab9ba7c8741f1f8bc3376",
"expiry": 1717093800,
"verificationList": [
{
"name": "bgv-degree",
"mode": "manual",
"skipAllowed": true,
"marksheetRequired": false
},
{
"name": "bgv-employment",
"mode": "manual",
"skipAllowed": true
},
{
"name": "bgv-twelfth",
"mode": "manual",
"skipAllowed": true
}
],
"sharing": {
"mode": []
},
"archived": false,
"type": "diy",
"userPaymentRequired": false,
"createdAt": "2024-05-22T10:12:21.702Z",
"updatedAt": "2024-05-22T10:12:21.702Z"
}
}
Success Response
- code (integer): Status code indicating the result of the request.
0indicates success. - message (string): Description of the result.
Successindicates the form was successfully created. - data (object): Contains additional data related to the request.
- _id (string): A unique identifier for the form, used during candidate add and init verification.
If the form req is invalid, the response will be as follows:
{
"message": "Error message",
"code": -1
}
Error Response
- message (string): Description of the error(s) encountered. This field provides detailed information about the specific validation issues.
- code (integer): Status code indicating the result of the request.
-1indicates a failure due to invalid form data.