Skip to main content

Set Process Document

Sets the identification document (CPF, CURP, SSN or other duiType) on a process that was created without one. Once set, the document is immutable.

Only available for processes whose Custom Flow allows creation without a document — i.e., processes in the AWAITING_FOR_DOCUMENT state.

Endpoint

EnvironmentURL
ProductionPOST https://api.idcloud.unico.app/client/v1/process/{processId}/document
SandboxPOST https://api.idcloud.uat.unico.app/client/v1/process/{processId}/document

Request

Headers
HeaderValue
AuthorizationBearer <access_token> (see Authentication)
Content-Typeapplication/json
Path parameters
FieldTypeRequiredDescription
processIdstringyesProcess ID returned in process.id at creation.
Body parameters
FieldTypeRequiredDescription
duiTypeenumyesDocument type. Values: DUI_TYPE_BR_CPF, DUI_TYPE_MX_CURP, DUI_TYPE_US_SSN. This endpoint supports a subset of the document types accepted by Create Process — Custom Flows that allow optional document creation are currently validated against this narrower list.
duiValuestringyesDocument number, without formatting. Maximum 320 characters (accommodates encoded or composite identifiers; standard document numbers such as CPF or CURP are significantly shorter).

Example

curl -X POST https://api.idcloud.unico.app/client/v1/process/abc-123/document \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"duiType": "DUI_TYPE_BR_CPF",
"duiValue": "12345678901"
}'

Responses

200 OK
{
"process": {
"id": "abc-123",
"person": {
"duiType": "DUI_TYPE_BR_CPF",
"duiValue": "12345678901"
}
}
}
FieldTypeDescription
process.idstringProcess identifier.
process.person.duiTypestringDocument type set on the process.
process.person.duiValuestringDocument value set on the process.
400 Bad Request

Returned when the request payload is malformed, required fields are missing, or the process state does not allow the operation.

401 Unauthorized

Bearer token missing, expired, or invalid. See Authentication.

404 Not Found

Process not found.

429 Too Many Requests

Rate limit reached. When your system receives an HTTP 429 error, you must implement mechanisms to prevent cascading failures and avoid worsening the restriction.

Best practices:

  • Cool-down period (backoff): Immediately halt or throttle subsequent requests from your system. Do not continuously retry failed requests in a tight loop.
  • Queueing & throttling: Buffer or queue outgoing requests on your end to control the traffic flow before re-sending them.
  • Exponential backoff with jitter: When retrying, increase the waiting time exponentially between attempts (e.g., 1 s, 2 s, 4 s, 8 s) and add a small random delay ("jitter") to prevent a herd effect where all queued requests retry at the exact same millisecond.
warning

Continuously hitting a rate-limited endpoint without backing off can prolong the restriction period and severely impact your system's operational throughput. Properly throttling requests on your side ensures a smoother, more resilient integration.

For default limits, increase requests and additional details, see Rate Limits.

Error Codes

CodeMessageDescription
3process id is invalidWhen the process id is invalid.
3dui_type is requiredWhen the document type is not provided.
3dui_value is requiredWhen the document number is not provided.
3dui_value exceeds maximum lengthWhen the document number exceeds the maximum character limit.
9process is not awaiting for documentWhen the specified process does not accept document submission.
9process expiredWhen the specified process has expired.
9document already set, cannot be modifiedWhen the process already has a linked document.
9process already finishedWhen the process has already been finalized.
9flow does not allow optional documentWhen the document is mandatory for the flow executed by the process.

What's next

  • After setting the document, the process continues its pipeline. Call Get Process to fetch the result, or wait for the webhook.