Create a domain
const url = 'https://pie.streamline.enterprises/v2/clients/client-1/domains';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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 } ] }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Example
client-1Request Body required
Section titled “Request Body required ”object
Optional; server may generate if omitted
Optional feature definitions for this domain. Features with mandatory=true are enforced on service initialization.
object
Example
routeJSON 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" ]}Example
trueExample
{ "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 } ]}Responses
Section titled “ Responses ”Domain registered
object
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.
object
Human-readable error message
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).
object
Human-readable error message
Example
{ "success": false}Authenticated caller lacks the permission required for this operation.
object
Human-readable error message
Example
{ "success": false}Requested resource was not found.
object
Human-readable error message
Example
{ "success": false}Semantically invalid request — e.g. domain not active, no model assigned, feature contract mismatch, or invalid feature definitions.
object
Human-readable error message
Example
{ "success": false}