Skip to content

Create a domain

POST
/v2/clients/{client_id}/domains
curl --request POST \
--url https://pie.streamline.enterprises/v2/clients/client-1/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "domain_id": "south_australia", "features": [ { "name": "route", "json_schema": { "type": "string", "enum": [ "Adelaide to Sydney", "Sydney to Adelaide" ] }, "mandatory": true }, { "name": "competitor_count", "json_schema": { "type": "integer", "minimum": 0, "maximum": 20 }, "mandatory": false }, { "name": "advertising_spend", "json_schema": { "type": "number", "minimum": 0, "maximum": 100 }, "mandatory": false }, { "name": "on_demand", "json_schema": { "type": "boolean" }, "mandatory": false }, { "name": "weekly_demand", "json_schema": { "type": "array", "items": { "type": "number", "minimum": 0 }, "minItems": 7, "maxItems": 7 }, "mandatory": false }, { "name": "origin_destination_pair", "json_schema": { "type": "array", "prefixItems": [ { "type": "string" }, { "type": "string" } ], "items": false, "minItems": 2, "maxItems": 2 }, "mandatory": false }, { "name": "market_ref", "json_schema": { "oneOf": [ { "type": "string", "enum": [ "spot", "auction" ] }, { "type": "integer", "minimum": 0 } ] }, "mandatory": false } ] }'
client_id
required
string
Example
client-1
Media type application/json
object
domain_id

Optional; server may generate if omitted

string
features

Optional feature definitions for this domain. Features with mandatory=true are enforced on service initialization.

Array<object>
object
name
required
string
Example
route
json_schema
required

JSON Schema Draft 2020-12 document for this feature’s value. Standard keywords apply; use default for the value applied when the caller omits this feature. Values are validated against this schema at service init/update. Arrays use type with items; fixed-length tuple shapes use prefixItems with items: false; unions use oneOf / anyOf as in the spec.

object
Example
{
"type": "string",
"enum": [
"Adelaide to Sydney",
"Sydney to Adelaide"
]
}
mandatory
required
boolean
Example
true
Example
{
"name": "route",
"json_schema": {
"type": "string",
"enum": [
"Adelaide to Sydney",
"Sydney to Adelaide"
]
},
"mandatory": true
}
Example
{
"domain_id": "south_australia",
"features": [
{
"name": "route",
"json_schema": {
"type": "string",
"enum": [
"Adelaide to Sydney",
"Sydney to Adelaide"
]
},
"mandatory": true
},
{
"name": "competitor_count",
"json_schema": {
"type": "integer",
"minimum": 0,
"maximum": 20
},
"mandatory": false
},
{
"name": "advertising_spend",
"json_schema": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"mandatory": false
},
{
"name": "on_demand",
"json_schema": {
"type": "boolean"
},
"mandatory": false
},
{
"name": "weekly_demand",
"json_schema": {
"type": "array",
"items": {
"type": "number",
"minimum": 0
},
"minItems": 7,
"maxItems": 7
},
"mandatory": false
},
{
"name": "origin_destination_pair",
"json_schema": {
"type": "array",
"prefixItems": [
{
"type": "string"
},
{
"type": "string"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
},
"mandatory": false
},
{
"name": "market_ref",
"json_schema": {
"oneOf": [
{
"type": "string",
"enum": [
"spot",
"auction"
]
},
{
"type": "integer",
"minimum": 0
}
]
},
"mandatory": false
}
]
}

Domain registered

Media type application/json
object
client_id
required
string
domain_id
required
string
domain_uuid
required
string format: uuid
status
required
string
Allowed values: not_ready active
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"client_id": "client-1",
"domain_id": "south_australia",
"domain_uuid": "550e8400-e29b-41d4-a716-446655440000",
"status": "active",
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:00:00Z"
}

Validation error — malformed input, invalid path parameters, or request that fails syntactic validation.

Media type application/json
object
success
required
boolean
message
required

Human-readable error message

string
Example
{
"success": false
}

Missing or invalid Authorization bearer token, expired token, or token rejected by the authorization layer (e.g. API Gateway JWT authorizer or application validation).

Media type application/json
object
success
required
boolean
message
required

Human-readable error message

string
Example
{
"success": false
}

Authenticated caller lacks the permission required for this operation.

Media type application/json
object
success
required
boolean
message
required

Human-readable error message

string
Example
{
"success": false
}

Requested resource was not found.

Media type application/json
object
success
required
boolean
message
required

Human-readable error message

string
Example
{
"success": false
}

Semantically invalid request — e.g. domain not active, no model assigned, feature contract mismatch, or invalid feature definitions.

Media type application/json
object
success
required
boolean
message
required

Human-readable error message

string
Example
{
"success": false
}