Skip to main content
PATCH
/
upload
/
update_text
Update Markdown
curl --request PATCH \
  --url https://api.usecortex.ai/upload/update_text \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "<content>",
  "file_id": "CortexDoc1234",
  "tenant_metadata": {},
  "document_metadata": {}
}'
{
  "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.

Sample Request

curl --request PATCH \
  --url 'https://api.usecortex.ai/upload/update_text?source_id=CortexDoc1234&tenant_id=tenant_1234&sub_tenant_id=sub_tenant_4567' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "<string>",
  "tenant_metadata": {},
  "document_metadata": {}
}'
Update or create text 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

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

Query Parameters

source_id
string
required

The source ID of the document to update

Example:

"CortexDoc1234"

tenant_id
string
required

Unique identifier for the tenant/organization

Example:

"tenant_1234"

sub_tenant_id
string
default:""

Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.

Example:

"sub_tenant_4567"

Body

application/json
content
string
required

The text or markdown content to upload

Example:

"<content>"

file_id
string | null
default:""

Optional file ID for the uploaded content. If not provided, will be generated automatically.

Example:

"CortexDoc1234"

tenant_metadata
object | null

JSON string containing tenant-level document metadata (e.g., department, compliance_tag)

Example: > "{"department":"Finance","compliance_tag":"GDPR"}"

document_metadata
object | null

JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.

Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"

Response

Successful Response

file_id
string
required

Unique identifier for the file being processed

Example:

"CortexDoc1234"

message
string
required

Status message indicating document parsing scheduled or update completed

success
boolean
default:true
Example:

true

I