Begin an insight document upload

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

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.

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

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
fileName
required
string
Length1 <= length
size
required
integer
Range0 < value <= 52428800
contentType
required
"application/pdf"
folderIdstring
Formatuuid

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/insights/document-uploads" \  -H "Content-Type: application/json" \  -d '{    "fileName": "string",    "size": 1,    "contentType": "application/pdf"  }'
{
  "documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",
  "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": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}