Complete a staged document upload
Accepts a PDF previously PUT to the signed uploadUrl from create-deal and enqueues document processing. Idempotency-Key is required and enforced server-side for safe retries. When object storage reports a file size, uploads over the limit return 413 with error code UPLOAD_ERROR; if size metadata is unavailable the check is skipped. When the pending document recorded a declared size and storage reports a size, a different size returns 409 UPLOAD_MISMATCH and the upload is not claimed. When the pending document recorded a sha256, the staged bytes are hashed and must match that digest before the upload is claimed. The object is not downloaded when no sha256 was declared.
Requires the api_deals_create scope.
Authorization
bearerAuth Bearer token using a Clai API key secret (clai_live_*).
In: header
Path Parameters
| Name | Type | Description |
|---|---|---|
orgIdrequired | string | Organization ID the key is operating in |
documentIdrequired | string | Staged document ID returned from create-deal Format uuid |
Header Parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Keyrequired | string | Required client-supplied idempotency key for safe complete-upload retries Length 1 <= length |
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
| Name | Type | Description |
|---|---|---|
bodyrequired | object |
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.goclai.com/api/v1/orgs/org_2abc123/document-uploads/550e8400-e29b-41d4-a716-446655440000/complete" \ -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440001" \ -H "Content-Type: application/json" \ -d '{}'{
"documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",
"flowId": "ccd52024-9c9c-4751-993a-9d75a778bf9d",
"collectionId": "string",
"status": "awaiting_upload",
"updatedAt": "2019-08-24T14:15:22Z",
"pollAfterMs": 2000,
"error": "invalid_pdf",
"errorMessage": "string",
"detection": {
"outcome": "detected",
"participantCount": 0,
"signatureFieldCount": 0
},
"canFindSignatures": true
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}GETGet staged document upload status
Polls processing status for a staged PDF upload after complete has been called. Poll until status is ready or failed; when finished, the response includes detection with outcome, participantCount, and signatureFieldCount. Returns pollAfterMs as a suggested client backoff. Requires the `api_deals_create` scope.
POSTFind where people sign on an uploaded document
Scans a ready upload for signers and signature fields. Runs only when upload status reports `canFindSignatures: true`. Detected signers and fields land on the document directly. Returns the upload status; poll the upload status until it is `ready` or `failed`. Idempotency-Key is required. Requires the `api_deals_create` scope.