Begin a document upload
Starts an upload on an existing deal package, or reuses its pending upload. No Idempotency-Key is required. Returns 201 when a new pending document row is created and 200 when an existing awaiting_upload row is reused with a freshly minted signed URL.
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 |
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
| Name | Type | Description |
|---|---|---|
dealIdrequired | string | Format uuid |
packageIdrequired | string | Format uuid |
filerequired | object | |
namerequired | string | Length 1 <= length <= 255 |
sizerequired | integer | Range 0 < value <= 52428800 |
contentTyperequired | "application/pdf" | |
sha256 | string | Pattern ^[a-f0-9]{64}$ |
Response Body
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" \ -H "Content-Type: application/json" \ -d '{ "dealId": "f480fdfe-5c44-458b-b537-f3d9f40f9678", "packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc", "file": { "name": "string", "size": 1, "contentType": "application/pdf" } }'{
"documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",
"flowId": "ccd52024-9c9c-4751-993a-9d75a778bf9d",
"fileName": "string",
"uploadUrl": "http://example.com",
"expiresAt": "2019-08-24T14:15:22Z"
}{
"documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",
"flowId": "ccd52024-9c9c-4751-993a-9d75a778bf9d",
"fileName": "string",
"uploadUrl": "http://example.com",
"expiresAt": "2019-08-24T14:15:22Z"
}{
"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": {}
}
}GETList package document uploads
Lists a package's document uploads, newest first. Each item includes the poll status fields plus fileName. Requires the `api_deals_create` scope.
GETGet a submission
Returns one submission owned by the API key's bound user. Requires api_deals_list or api_deals_create. The body never includes signing links. activeParticipantIds lists the current signing group; later groups stay queued until that group finishes. Requires one of `api_deals_list` or `api_deals_create`.