Begin 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.
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 |
|---|---|---|
fileNamerequired | string | Length 1 <= length |
sizerequired | integer | Range 0 < value <= 52428800 |
contentTyperequired | "application/pdf" | |
folderId | string | Format uuid |
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": {}
}
}POSTCreate an insight folder
Creates a folder in the Insights workspace. Returns 201 for a new folder and 200 when a folder with the same name already exists under the parent. Requires the `api_insights_create` scope.
POSTComplete 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.