POST
/
upload
/
upload_markdown
cURL
curl --request POST \
  --url https://api.usecortex.ai/upload/upload_markdown \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'accept: <accept>' \
  --data '{
  "content": "This is sample markdown content that will be processed and indexed.",
  "tenant_metadata": {
    "department": "Finance",
    "compliance_tag": "GDPR"
  },
  "document_metadata": {
    "title": "Q1 Report.pdf",
    "author": "Alice Smith"
  }
}'
{
  "success": true,
  "file_id": "CortexDocb7a1db714c9c473bbd8ff81ec17ba2811750936047"
}

📋 Functionality

  • Validates that content is provided and not empty
  • Generates a unique file ID for the uploaded content
  • Converts the text content to UTF-8 encoded bytes
  • Uploads the content as a .md file to S3 storage
  • Creates secure access tokens for processing
  • Triggers the ingestion pipeline for content processing and indexing
  • Returns the generated file ID for future reference

Sample Request

curl --location 'https://api.usecortex.ai/upload/upload_markdown?tenant_id={TENANT_ID}&sub_tenant_id={SUB_TENANT_ID}' \
  --header 'Authorization: Bearer {API_KEY}' \
  --header 'accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "content": "This is sample markdown content that will be processed and indexed.",
    "tenant_metadata": {
      "department": "Finance",
      "compliance_tag": "GDPR"
    },
    "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)

Content-Type
string
default:application/json
required

Request content type

accept
string
default:application/json
required

Response content type

Query Parameters

tenant_id
string

Tenant identifier

sub_tenant_id
string

Sub-tenant identifier

Body

application/json

Response

200
application/json

Upload success and generated file ID.

The response is of type object.