POST
/
upload
/
upload_document
cURL
curl --request POST \
  --url https://api.usecortex.ai/upload/upload_document \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --header 'accept: <accept>' \
  --form file=@example-file \
  --form 'tenant_metadata={"department":"Finance","compliance_tag":"GDPR"}' \
  --form 'document_metadata={"title":"Q1 Report.pdf","author":"Alice Smith"}'
{
  "message": "Document uploaded successfully",
  "document_id": "doc_123456"
}

Sample Request

curl --location 'https://api.usecortex.ai/upload/upload_document?tenant_id={TENANT_ID}&sub_tenant_id={SUB_TENANT_ID}' \
--header 'accept: application/json' \
--header 'Authorization: Bearer {API_KEY}' \
--form 'file=@"{FILE}"' \
--form 'tenant_metadata="{\"department\":\"Finance\",\"compliance_tag\":\"GDPR\"}"' \
--form 'document_metadata="{\"title\":\"Q1 Report.pdf\",\"author\":\"Alice Smith\"}"'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token (Firebase token)

accept
string
default:application/json
required

Response content type

Query Parameters

tenant_id
string

Tenant identifier

sub_tenant_id
string

Sub-tenant identifier

Body

multipart/form-data

Response

200
application/json

Document uploaded and indexed successfully

The response is of type object.