Skip to main content

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

Try it out →

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)
    1. name (string): The name of verification, accepted values:-
      1. bgv-tenth (10th education check)
      2. bgv-twelfth (12th education check)
      3. bgv-degree (Any degree/marsheet check)
      4. bgv-employment (Employment check)
      5. bgv-criminal
      6. bgv-cibil
      7. bgv-local-address-digital
      8. bgv-local-address-postal
      9. bgv-permanent-address-digital
      10. bgv-permanent-address-postal
      11. bgv-global-database-check
      12. bgv-social-media
      13. bgv-degree-with-marksheet
      14. bgv-professional-reference-check
      15. bgv-police-verification
      16. pan
      17. gst
      18. bank-account
      19. upi
      20. cin
      21. din
      22. voter-id
      23. employment-check
      24. face-match
      25. aadhaar
      26. dl
      27. liveness
      28. passport
      29. form26as
    2. skipAllowed (boolean): // User can skip this verification(Required)
  • userPaymentRequired (boolean): If want payment from user make it true otherwise false(Required)
  • type (string): The form type is DIY, accepted values:- (Required)
    1. diy
  • sharing.visibility (string): The form is publicly visible, accepted values:- (Required)
    1. public
    2. 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. 0 indicates success.
  • message (string): Description of the result. Success indicates 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. -1 indicates a failure due to invalid form data.