cURL
Deliveries
Get a Delivery JSON Schema
Retrieve a delivery JSON schema by its unique identifier. Delivery JSON schemas define the structure and validation rules for task responses.
GET
cURL
Authentication
Authentication
Every request sent to Scale’s API requires authentication. In short, your API Key is the Bearer token. See the Authentication section for more details.
Overview
Retrieves a delivery JSON schema by its unique identifier. Delivery JSON schemas define the structure and validation rules for task responses in customer applications.Use Cases
- Validate delivery data: Ensure your delivery data conforms to the expected structure
- Data integration: Understand the structure of delivery data for integration purposes
Response
Returns a JSON object containing the complete schema definition including:id- Unique MongoDB ObjectId identifier for the schemaname- Human-readable name of the schemacreatedBy/updatedBy- User IDs of creators/updaterscreatedAt/updatedAt- Timestampsjson- Stringified JSON Schema definition containing validation rules and structure
The
json field contains a stringified JSON Schema that needs to be parsed before use. Parse it with JSON.parse() in JavaScript or json.loads() in Python.Error Responses
- 400 Bad Request:
- Missing
schema_idparameter - Malformed
schema_id(invalid MongoDB ObjectId format)
- Missing
- 404 Not Found: Schema with the specified ID does not exist
- 401 Unauthorized: Invalid or missing authentication token
Example Code
Retrieve a Schema by ID
Retrieve a Schema by ID
Validating Data with the Schema
Once you retrieve a schema, you can use it to validate task data:Validate Task Data Against Schema (Python)
Validate Task Data Against Schema (Python)
Integration with Deliveries
Schemas are referenced in delivery objects and can be used to validate the structure of task responses. When working with deliveries, you can:- Retrieve the delivery using
/v2/delivery - Extract the
schema_idfrom the delivery metadata - Fetch the full schema definition using
/v2/schema - Validate task responses against the schema
Schema IDs are immutable once created. If you need to modify a schema, you must create a new schema version with a new ID.
Authorizations
Your API Key is the Bearer token. See the Authentication section to learn how to access your key.
Query Parameters
The unique MongoDB ObjectId of the delivery JSON schema.
Example:
"507f1f77bcf86cd799439011"
Response
Delivery JSON schema retrieved successfully.
The delivery JSON schema object

