API_KEY='live_...'
BATCH_ID='batch_123'
curl --request POST \
--url "https://api.scale.com/v2/batch/metadata" \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"batch_id": "'$BATCH_ID'",
"metadata": {
"priority": "high",
"dataset_version": "v1.2"
}
}'{
"id": "batch_123",
"name": "Batch Name Example",
"project": "project_123",
"created_at": "2022-07-25T07:32:34.318Z",
"status": "completed",
"callback": "https://example.com/callback",
"metadata": {},
"completed_at": "2022-07-26T07:32:34.318Z"
}{
"status_code": 500,
"error": "An error has occurred."
}Set Batch Metadata
Update the metadata for a Batch.
API_KEY='live_...'
BATCH_ID='batch_123'
curl --request POST \
--url "https://api.scale.com/v2/batch/metadata" \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"batch_id": "'$BATCH_ID'",
"metadata": {
"priority": "high",
"dataset_version": "v1.2"
}
}'{
"id": "batch_123",
"name": "Batch Name Example",
"project": "project_123",
"created_at": "2022-07-25T07:32:34.318Z",
"status": "completed",
"callback": "https://example.com/callback",
"metadata": {},
"completed_at": "2022-07-26T07:32:34.318Z"
}{
"status_code": 500,
"error": "An error has occurred."
}Authentication
Authentication
Required query parameters
You are expected to provide one of the following:- Batch ID (
batch_id) - Batch Name (
batch_name)
Authorizations
Your API Key is the Bearer token. See the Authentication section to learn how to access your key.
Body
Custom metadata for the entity.
A unique identifier for the batch.
"batch_abc123"
The name of the batch.
"My Scale Batch"
Whether to deep merge the provided metadata with existing metadata. If false, replaces the entire metadata object. If true, performs a deep merge and replaces existing keys with new values.
Response
Batch metadata updated successfully.
A unique identifier for the batch.
"batch_abc123"
The name of the batch.
"My Scale Batch"
A timestamp formatted as an ISO 8601 date-time string.
Status of the batch.
staging, in_progress, completed, paused, cancelled Custom metadata for the entity.
UTC timestamp when the batch was completed.
Callback URL or email for the entity upon completion.
"https://example.com/callback"

