Complete an insight document upload
Commits the uploaded bytes after PUT to uploadUrl. Poll GET on the document until status is processed or failed.
Requires the api_insights_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 | 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 |
|---|---|---|
fileNamerequired | string | Length 1 <= length |
folderId | string | null | Format uuid |
Response Body
application/json
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/insights/document-uploads/497f6eca-6276-4993-bfeb-53cbbbba6f08/complete" \ -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \ -H "Content-Type: application/json" \ -d '{ "fileName": "string" }'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"folderId": "5b6379a4-2a6c-4085-b184-45838a3b8e7e",
"sizeBytes": 0,
"createdAt": "2019-08-24T14:15:22Z",
"status": "pending",
"stage": "string",
"failureKind": "transient",
"documentType": "Purchase",
"contractStatus": "draft",
"extracted": {
"parties": [
{
"role": "string",
"name": "string",
"entityType": "individual",
"contactInfo": {
"email": "string",
"phone": "string",
"address": "string"
},
"representedBy": "string"
}
],
"address": "string",
"keyDates": [
{
"type": "string",
"value": "string"
}
],
"amounts": [
{
"type": "string",
"value": "string",
"period": "string"
}
],
"keyTerms": [
"string"
]
},
"pollAfterMs": 1
}{
"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": {}
}
}{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}POSTBegin an insight document upload
Mints a document id and a signed URL. PUT the raw bytes to uploadUrl. Do not send file bytes to this endpoint. No Idempotency-Key is required (completeInsightDocumentUpload requires Idempotency-Key). Requires the `api_insights_create` scope.
GETList contacts
Returns a cursor-paginated list of contacts the API key user can see in the organization: contacts they created and contacts on deals they can read. Filter with search and status; sort with sort and dir. Requires the `api_contacts_list` scope.