Skip to main content
POST
/
v1
/
models
/
{model_id}
/
datasets
Associate Dataset With Model
curl --request POST \
  --url https://api.cuadra.ai/v1/models/{model_id}/datasets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "datasetId": "<string>",
  "usageType": "rag",
  "datasetSnapshotId": "550e8400-e29b-41d4-a716-446655440003",
  "priority": 0
}
'
{
  "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"
}

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 a dataset with a model.

datasetId
string
required

ID of the dataset to associate with the model

Required string length: 1 - 255
Example:

"550e8400-e29b-41d4-a716-446655440001"

usageType
string
default:rag

How the dataset is used with the model. Currently only 'rag' (Retrieval Augmented Generation) is supported.

Required string length: 1 - 20
Example:

"rag"

datasetSnapshotId
string | null

Specific dataset version to pin. If null, the model will always use the latest version (dynamic). If set, the model is pinned to that version.

Maximum string length: 255
Example:

"550e8400-e29b-41d4-a716-446655440003"

priority
integer
default:0

Priority for this dataset when multiple datasets are associated. Higher priority datasets are searched first. Range: 0-100.

Required range: 0 <= x <= 100
Examples:

0

1

10

Response

Successful Response

Schema for model-dataset association response.

modelId
string
required

ID of the model

Example:

"550e8400-e29b-41d4-a716-446655440000"

datasetId
string
required

ID of the associated dataset

Example:

"550e8400-e29b-41d4-a716-446655440001"

usageType
string
required

How the dataset is used

Example:

"rag"

priority
integer
required

Priority for this dataset

Examples:

0

1

10

createdAt
string<date-time>
required

When the association was created

Example:

"2025-10-18T06:33:19Z"

updatedAt
string<date-time>
required

When the association was last updated

Example:

"2025-10-18T06:33:19Z"

datasetSnapshotId
string | null

Specific dataset snapshot ID (null = use latest, value = pinned)