POST
/
fetch
/
fetch_content
cURL
curl --request POST \
  --url https://api.usecortex.ai/fetch/fetch_content \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'accept: <accept>' \
  --data '{
  "file_id": "file_123456",
  "tenant_id": "tenant_456",
  "sub_tenant_id": "subtenant_123"
}'
{
  "CortexDocb7a1db714c9c473bbd8ff81ec17ba2811750936047": "https://cortex-local-sources-prod.s3.amazonaws.com/ToayuCogoBdxZVoZQ1ft8ZoRzCO2/FindrMasterCollectionMemoriesPreprod/123/local_source/CortexDocb7a1db714c9c473bbd8ff81ec17ba2811750936047?..."
}

📋 Functionality

  • Extracts user credentials and organization details from the API key
  • Validates the file access permissions for the specified tenant
  • Creates secure access tokens for file retrieval
  • When return_content is true: Returns the actual file content directly
  • When return_content is false: Generates time-limited download URLs for the requested file
  • Returns downloadable URLs that can be used to access the file content

Sample Request

curl --location 'https://api.usecortex.ai/fetch/fetch_content' \
  --header 'Authorization: Bearer {API_KEY}' \
  --header 'accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "file_id": "{FILE_ID}",
    "tenant_id": "{TENANT_ID}",
    "sub_tenant_id": "{SUB_TENANT_ID}",
    "return_content": true
  }'

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

Body

application/json

Response

200
application/json

Returns a JSON object with file IDs as keys and their corresponding download URLs as values

The response is of type object.