POST
/
upload
/
upload_document
curl --request POST \
  --url https://api.usecortex.ai/upload/upload_document \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file=document.pdf \
  --form 'custom_metadata={"author":"John Doe","department":"Sales","tags":["contract","Q1"]}'
{
  "message": "Document uploaded successfully",
  "document_id": "doc_123456"
}

Uploads a document (e.g., PDF, DOCX) for processing and indexing.

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 'custom_metadata="{CUSTOM_METADATA}"'

🔐 Headers

  • Authorization: Bearer token
  • accept: application/json

🧾 Parameters

  • tenant_id (string, required): Tenant identifier (query parameter)
  • sub_tenant_id (string, optional): Sub-tenant identifier (query parameter)
  • file (UploadFile, required): Document file (form data)
  • custom_metadata (string, optional): Metadata string (form data)

Authorizations

Authorization
string
header
required

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

Query Parameters

tenant_id
string
required

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.

POST
/
upload
/
upload_document
curl --request POST \
  --url https://api.usecortex.ai/upload/upload_document \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file=document.pdf \
  --form 'custom_metadata={"author":"John Doe","department":"Sales","tags":["contract","Q1"]}'
{
  "message": "Document uploaded successfully",
  "document_id": "doc_123456"
}

Uploads a document (e.g., PDF, DOCX) for processing and indexing.

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 'custom_metadata="{CUSTOM_METADATA}"'

🔐 Headers

  • Authorization: Bearer token
  • accept: application/json

🧾 Parameters

  • tenant_id (string, required): Tenant identifier (query parameter)
  • sub_tenant_id (string, optional): Sub-tenant identifier (query parameter)
  • file (UploadFile, required): Document file (form data)
  • custom_metadata (string, optional): Metadata string (form data)

Authorizations

Authorization
string
header
required

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

Query Parameters

tenant_id
string
required

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.