Skip to main content
PATCH
/
upload
/
update_document
Update File
curl --request PATCH \
  --url https://api.usecortex.ai/upload/update_document \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'tenant_metadata=<string>' \
  --form 'document_metadata=<string>' \
  --form file=@example-file
{
  "file_id": "CortexDoc1234",
  "message": "<string>",
  "success": true
}
Hit the Try it button to try this API now in our playground. It’s the best way to check the full request and response in one place, customize your parameters, and generate ready-to-use code snippets.

Examples

  • API Request
  • TypeScript
  • Python (Sync)
curl --request PATCH \
  --url 'https://api.usecortex.ai/upload/update_document?source_id=CortexDoc1234&tenant_id=tenant_1234&sub_tenant_id=sub_tenant_4567' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: multipart/form-data' \
  --form 'tenant_metadata={}' \
  --form 'document_metadata={}' \
  --form file=@example-file
Update or create document content, performing an upsert operation where new entries are created for non-existent source_id values.

Error Responses

All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.

Authorizations

Authorization
string
header
required

Query Parameters

source_id
string
required
Example:
tenant_id
string
required
Example:
sub_tenant_id
string
default:""
Example:

Body

multipart/form-data
file
file
required
tenant_metadata
string | null
document_metadata
string | null

Response

file_id
string
required
Example:
message
string
required
success
boolean
default:true
Example: