Skip to main content
Create ProcessPOST

Create a Human Token process from your back-end and get the humanToken in data.humanToken.

Markdown

Human Token runs on the Human API POST /client/v1/process endpoint. With the API Only flows (api+humantoken, api+liveness+humantoken and api+liveness+humantoken+revalidation), the process is created and finished in a single call: the response already carries the result in data.humanToken. With the Human Token Journey flows (humantoken and humantoken+revalidation), the response carries the process id, a token and the journey link, and the result is available after the user completes the journey. The +revalidation flows require a references array with a previously obtained humanToken for revalidation.

Flows​

Human Token runs in two integration models:

  • API Only — your back-end sends the selfie in imageBase64.
  • Human Token Journey — the user goes through the Unico journey on Web and returns to your callbackUri.
FlowCapabilitiesPossible resultIntegration components
required
Example
api+humantokenHuman TokenPROCESS_STATE_FINISHEDPROCESS_STATE_FAILEDAPI
api+liveness+humantokenLivenessHuman TokenPROCESS_STATE_FINISHEDPROCESS_STATE_FAILEDAPI
api+liveness+humantoken+revalidationLivenessHuman TokenRevalidationPROCESS_STATE_FINISHEDPROCESS_STATE_FAILEDAPI
humantokenLivenessHuman TokenPROCESS_STATE_CREATEDPROCESS_STATE_FINISHEDPROCESS_STATE_FAILEDPROCESS_STATE_CANCELEDAPIWeb
humantoken+revalidationLivenessHuman TokenRevalidationPROCESS_STATE_CREATEDPROCESS_STATE_FINISHEDPROCESS_STATE_FAILEDPROCESS_STATE_CANCELEDAPIWeb

Endpoint​

EnvironmentURL
ProductionPOST https://humantoken.unico.app/client/v1/process

Request​

Headers
HeaderValue
x-unico-accesskey<your_access_key> (see Authentication)
Content-Typeapplication/json
Body parameters
FieldTypeRequiredDescription
flowstringyesHuman Token flow: api+humantoken, api+liveness+humantoken, api+liveness+humantoken+revalidation (API Only) or humantoken, humantoken+revalidation (Human Token Journey). See Flows.
imageBase64stringAPI OnlyThe selfie, captured by your front-end and sent directly, in base64. PNG, JPEG or WebP, up to 800 KB. Follow the Capture Standard.
callbackUristringHuman Token JourneyURL the user is redirected to after the journey ends.
companyBranchIdstringnoBranch identifier. When provided, the process uses the configuration of the specified branch.
referencesarrayRevalidation flowsArray of reference objects. Required for +revalidation flows. Each object has referenceType (REFERENCE_TYPE_HUMAN_TOKEN) and referenceContent (the previously obtained humanToken value).

Responses​

200 OK
FieldTypeDescription
idstring (UUID)Process identifier. Use it to fetch the process again via Get Process.
statestringProcess state — see Interpreting the result. Only in the API Only flows.
tokenstringToken of the created process, you can use this to open Journey SDK experience. Only in the Human Token Journey flows (humantoken, humantoken+revalidation).
linkstringURL of the Human Token Journey: send the user to it. Only in the Human Token Journey flows (humantoken, humantoken+revalidation).
data.​humanToken.​valuestringStable, opaque identifier of the face (up to 100 characters). The same person always resolves to the same value. Only in the API Only flows (non-revalidation).
data.​humanTokenMatchstring"true" if the selfie matches the referenced humanToken, "false" otherwise. Only in the +revalidation API Only flow.
Interpreting the result
stateMeaningWhat to do
PROCESS_STATE_FINISHEDdata.humanToken.value filled: real person, with a Human Token.Look up value in your records: if it exists, it is a returning user or a possible duplicate; if not, it is a new person.
PROCESS_STATE_FINISHEDNo data.humanToken, or an empty value: inconclusive.Treat it as inconclusive. Never store or match an empty value; retry the process or reject, per your business rules.
PROCESS_STATE_FAILEDThe identification process failed.Retry the process or reject it, per your business rules.
PROCESS_STATE_CREATEDProcess created.Wait. Fetch the result later with Get Process.
PROCESS_STATE_CANCELEDThe process was canceled.Create a new process, if the user still needs to be verified.
warning

Always check that data.humanToken.value is not empty before using it.

Error Codes​

note

The HTTP status returned when the access key in the x-unico-accesskey header is missing or invalid is still being confirmed. See Authentication.

CodeMessageDescription
3invalid flowWhen the specified flow does not exist.
3INVALID_IMAGEWhen the image is not valid base64, or looks like an injection attempt.
3IMAGE_TOO_LARGEWhen the image exceeds the maximum size of 800 KB.
3UNSUPPORTED_IMAGE_FORMATWhen the image format is not PNG, JPEG or WebP.
3MISSING_IMAGEWhen the image is required for this flow and was not sent.
3INVALID_REQUESTWhen the request body is null or cannot be interpreted.
9monthly process limit of <monthly_limit> reached for this tenantWhen the monthly usage limit has been reached.
9PROCESS_FAILEDWhen the process reached a terminal failure while being created.

For the full list of codes of this endpoint, see the Human API Create Process reference.

What's next​

  • Store the humanToken value alongside your user record to recognize the same person on later Human Token calls.
  • To fetch the process again, for auditing or support, use Get Process.