Skip to main content
Version: v3

Get your users' consent

Cloud only

Consent applies to the cloud API only.

You need end-user consent to verify a document with the cloud API. Every request to /api/v3/verify must carry a consent part. If it's missing, the request is rejected and no verification is performed.

Consent is scoped to an end user and to a duration, not to a single request. You declare who gave consent (userId) and how long it's valid (durationDays), and each request registers a consent record against that user.

Structure​

Consent is defined as the following structure:

consent.json
{
"userId": "<your-id-for-the-end-user>",
"durationDays": 365,
"givenOn": "2026-07-31T09:00:00Z",
"note": "User agreed to identity verification terms.",
"customerContext": {
"customerId": "<your-customer-id>",
"transactionId": "<your-transaction-id>"
}
}

Two fields are required:

  • userId: Your own unique identifier for the end user granting the consent. This is the field that ties consent records to a person in your system, so keep it stable across requests for the same end user.
  • durationDays: How long the consent stays valid. The expiry date is calculated from it, so pick a duration that matches the retention period stated in your own privacy notice.

The rest are optional:

  • givenOn: When the end user granted the consent.
  • note: The consent statement, agreement text, or notes associated with the consent. Use it to record what the end user actually agreed to.
  • customerContext.customerId: Your own identifier for the customer entity the consent belongs to.
  • customerContext.transactionId: Your own identifier for the transaction the consent was collected for.

Send the consent as a text form value named consent, containing the JSON object. Unlike configuration, it can't be sent as a file part.

curl https://us-east.verify.microblink.com/api/v3/verify \
--request POST \
--header 'Authorization: Basic <credentials>' \
--form 'imageFirstSide=@front_id.jpg' \
--form 'imageSecondSide=@back_id.png' \
--form 'consent={
"userId": "<your-id-for-the-end-user>",
"durationDays": 365
}'
Regions

Code examples here use the us-east region. Use the appropriate region for your deployment.