Skip to main content
PATCH
/
upload
/
update_embeddings
Update Embeddings
curl --request PATCH \
  --url https://api.usecortex.ai/upload/update_embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "embeddings": {
    "CortexEmbeddings123_0": [
      0.123413,
      0.655367,
      0.987654,
      0.123456,
      0.789012
    ],
    "CortexEmbeddings123_1": [
      0.123413,
      0.655367,
      0.987654,
      0.123456,
      0.789012
    ]
  }
}'
{
  "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_embeddings?tenant_id=tenant_1234&sub_tenant_id=sub_tenant_4567' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "embeddings": {
    "CortexEmbeddings123_0": [
      0.123413,
      0.655367,
      0.987654,
      0.123456,
      0.789012
    ],
    "CortexEmbeddings123_1": [
      0.123413,
      0.655367,
      0.987654,
      0.123456,
      0.789012
    ]
  }
}'

Requirements

  • Maximum dimensions: 2000 rows × 3024 columns; i.e. 2000 chunks with a maximum dimension of 3024
  • Format: Dictionary with chunk IDs as keys and embedding arrays as values. These chunk IDs should match the ones that you got on inserting the embeddings.
  • Batch constraint: All chunk IDs must belong to the same batch/source
  • Chunk ID format: Must be valid strings in format {batch_id}_{index}
  • Consistency: All embedding vectors must have the same dimension
  • Values: All embedding values must be numeric (int or float)

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

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
embeddings
object

The embeddings of source you want to index

Example:
{
"CortexEmbeddings123_0": [
0.123413,
0.655367,
0.987654,
0.123456,
0.789012
],
"CortexEmbeddings123_1": [
0.123413,
0.655367,
0.987654,
0.123456,
0.789012
]
}

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