Skip to main content
POST
/
v1
/
models
/
{model_id}
/
datasets
/
batch
Batch Associate Datasets With Model
curl --request POST \
  --url https://api.cuadra.ai/v1/models/{model_id}/datasets/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "datasets": [
    {
      "datasetId": "<string>",
      "usageType": "rag",
      "datasetSnapshotId": "550e8400-e29b-41d4-a716-446655440003",
      "priority": 0
    }
  ]
}
'
{
  "created": [
    {
      "createdAt": "2025-10-18T06:33:19Z",
      "datasetId": "550e8400-e29b-41d4-a716-446655440001",
      "modelId": "550e8400-e29b-41d4-a716-446655440000",
      "priority": 0,
      "updatedAt": "2025-10-18T06:33:19Z",
      "usageType": "rag"
    }
  ],
  "skipped": []
}

Authorizations

Authorization
string
header
required

JWT token from Stytch B2B authentication (magic link, SSO, or M2M)

Headers

Idempotency-Key
string | null

Path Parameters

model_id
string
required

Model ID

Example:

"model_abc123"

Body

application/json

Schema for associating multiple datasets with a model in a single request.

datasets
ModelDatasetCreate · object[]
required

List of datasets to associate with the model (max 50 per request)

Required array length: 1 - 50 elements
Example:
[
  {
    "datasetId": "550e8400-e29b-41d4-a716-446655440001",
    "priority": 0,
    "usageType": "rag"
  }
]

Response

Successful Response

Response for batch dataset association creation.

created
ModelDatasetOut · object[]
required

Successfully created associations

skipped
Skipped · object[]

Datasets that were skipped (already associated)

Example:
[
  {
    "datasetId": "550e8400-e29b-41d4-a716-446655440002",
    "reason": "Already associated with this model"
  }
]