Complete an insight document upload

POST
/api/v1/orgs/{orgId}/insights/document-uploads/{documentId}/complete

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
AuthorizationBearer <token>

Bearer token using a Clai API key secret (clai_live_*).

In: header

Path Parameters

NameTypeDescription
orgId
required
string

Organization ID the key is operating in

documentId
required
string
Formatuuid

Header Parameters

NameTypeDescription
Idempotency-Key
required
string

Required client-supplied idempotency key for safe complete-upload retries

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
fileName
required
string
Length1 <= length
folderIdstring | null
Formatuuid

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": {}
  }
}