Skip to main content

Responses

Encryption and Decryption

1Kosmos's API responses are encrypted using Elliptic Curve Digital Signature Agorithm (ECDSA) to ensure secure data transmission.

ID Verification Request and Responses

The response displays the generated session URL in the encrypted format. After the document verification API execution is successful, click the Visualization tab in the response to view the result in the decrypted format. Otherwise, you can use your own helper that is compatible with ECDSA to view the result in the decrypted format.

Create Session API

This API is used to create a session for a specific document type. You can generate a session with one of the supported documents.

You can create sessions for one of the following documents:

  • Passport
  • Driving License
  • ID card

Request Body

The request body of the create session API must be in JSON format and should include the following parameters.

Field NameRequired FieldTypeDescription
dvcIDYesstringThe workflow name
tenantDNSYesstringSpecify the tenant name
communityNameYesstringSpecify your community name
documentTypeYesstringSpecify the document type for which you want to generate a session
usernameNostringSpecify the user for whom the session is created
firstnameNostringSpecify the first name of the user for whom the session is created
lastnameNostringSpecify the last name of the user for whom the session is created
uidNointegerA unique identifier which help in mapping the session ID to the user performing the verification

Response

The response is displayed in the decrypted format:

Sample Success Response

note

If you pass an incorrect dvcID to your request body, you would encounter the 404 Not Found error. The following screenshot illustrates the same:

Scenario1: Incorrect dvcID

If you fail to pass the dvcID to your request body, you would encounter the 400 Bad Request error. The following screenshot illustrates the same:

Scenario 2: dvcID is blank

ID Verification Status

1Kosmos's ID Verification has the following types of statuses:

  • Session Status
    • Pending
    • In Progress
    • Completed
    • Expired
    • Declined
  • Verification Status
    • Failed
    • Passed
    • Not performed

The table below outlines the scenarios in which each session status is shown:

When athe session status will be
Session has been created for a user and has not yet started the verification processPending
User clicks on the consent check box and hit “Let’s get started”In Progress
User submits the document and gives selfie (if session is configured for selfie)Completed
Session has expiredExpired
User click the Decline button on the Welcome screenDeclined

Poll API

The /result API displays the complete session details along with the verification status in encrypted format. To view the results in the decrypted format, click the Visualization tab in the response section when you run this API in your postman. Otherwise, you can use your own helper that is compatible with ECDSA to view the result in the decrypted format.

Request Body

The request body of the Poll API must be in JSON format and should include the following parameters:

Field NameRequired FieldTypeDescription
dvcIDYesstringThe workflow name
sessionIDYesstringEnter the session id generated in the create session API

Response

The following section outlines the different statuses and corresponding responses returned during the execution of the Poll API:

note

Personally identifiable information (PII) is returned only once for each unique session ID. Any subsequent calls to the Poll API using the same session ID will not include PII data.

  • When pii_retention_off = false and pii_retention_ttl = -1, PII data is retained until the first Poll API call is received after the session is completed; it is then deleted immediately.
  • When pii_retention_off = false and pii_retention_ttl = 0, PII data is retained for 7 days and is available via the Poll API during this period; it is deleted afterward.
  • When pii_retention_off = false and pii_retention_ttl > 0, PII data is retained for the specified number of seconds and is accessible through the Poll API within that timeframe; after that, it is deleted.
  • When pii_retention_off = true, PII data is deleted immediately upon session completion and is not returned in any subsequent Poll API responses.

Sample Encrypted Response

Sample Decrypted Response

Decrypted Response parameters

The following parameters are returned in the response:

ParameterTypeDescription
sessionResultstringStatus of the verification result. Displays the status as In Progress.
sessionIDstringsession ID.

Poll API (V3) Response with Selfie Verification

The following table outlines the response parameters returned when the selfie capture flow is enabled during Poll API execution.

Sample Encrypted Response

Sample Decrypted Response