Skip to main content

Get Purpose

Returns the list of available purposes. Use the _id of the chosen purpose when creating a form.

API Endpoint

Endpoint URL: GET https://api.trential.dev/verification/api/1.0/purposes

Try it out →

Request

No request body or query parameters required.

cURL

curl -X GET 'https://api.trential.dev/verification/api/1.0/purposes' \
-H 'x-api-key: YOUR_API_KEY'

Response

If the request is successful, the response will be as follows:

{
"code": 0,
"message": "Success",
"data": {
"total": 4,
"list": [
{
"_id": "657ab9ba7c8741f1f8bc3376",
"name": "BGV",
"createdAt": "2023-12-14T08:15:54.654Z",
"updatedAt": "2023-12-14T08:15:54.654Z"
},
{
"_id": "65a04aacf8016bfc639b5618",
"name": "Compliance",
"createdAt": "2023-12-14T08:15:54.654Z",
"updatedAt": "2023-12-14T08:15:54.654Z"
},
{
"_id": "65a04ab8f8016bfc639b5678",
"name": "Availing Service",
"createdAt": "2023-12-14T08:15:54.654Z",
"updatedAt": "2023-12-14T08:15:54.654Z"
},
{
"_id": "657ab9ac7c8741f1f8bc3372",
"name": "KYC",
"createdAt": "2023-12-14T08:15:40.349Z",
"updatedAt": "2023-12-14T08:15:40.349Z"
}
]
}
}
Success Response
  • code (integer): Status code indicating the result of the request. 0 indicates success.
  • message (string): Description of the result. Success indicates the request was successful.
  • data (object): Contains list of all purpose

Below is the error response

{
"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.