Create model
const url = 'https://pie.streamline.enterprises/v2/models';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Price recommendation","description":"Domain-level price model","metadata":{"team":"pricing"},"handlers":{"training":{"type":"lambda","arn":"arn:aws:lambda:us-west-2:123456789012:function:train","version":"1"},"inference":{"type":"lambda","arn":"arn:aws:lambda:us-west-2:123456789012:function:infer"}}}'};
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/models \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Price recommendation", "description": "Domain-level price model", "metadata": { "team": "pricing" }, "handlers": { "training": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:train", "version": "1" }, "inference": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:infer" } } }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Optional model id. If omitted, the server assigns a new UUIDv7.
object
object
object
object
Target ECS task to run, in the form <cluster>/<task_definition>. <cluster> is the ECS cluster short name (no / in the name); full cluster ARNs cannot be encoded unambiguously in this field. <task_definition> is the task family (optionally family:revision).
object
Which in-process implementation to run (registered in the API).
object
object
Target ECS task to run, in the form <cluster>/<task_definition>. <cluster> is the ECS cluster short name (no / in the name); full cluster ARNs cannot be encoded unambiguously in this field. <task_definition> is the task family (optionally family:revision).
object
Which in-process implementation to run (registered in the API).
Example
{ "training": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:train-model", "version": "1" }, "inference": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:infer-model" }}Typed input/output contracts per handler type. Controls which subscriptions become stale when handlers change. Contract fields are JSON Schema Draft 2020-12 documents.
object
object
JSON Schema Draft 2020-12 document for the payload accepted by this handler. When set on inference, direct inference requests validate input against this schema before dispatch. Stored event-subscription payloads are validated against the target’s schema for the action (warnings-only on mismatch).
object
JSON Schema Draft 2020-12 document for the handler’s successful output on job completion. Mismatches are logged as warnings but do not fail completion (external handlers may diverge).
object
object
JSON Schema Draft 2020-12 document for the payload accepted by this handler. When set on inference, direct inference requests validate input against this schema before dispatch. Stored event-subscription payloads are validated against the target’s schema for the action (warnings-only on mismatch).
object
JSON Schema Draft 2020-12 document for the handler’s successful output on job completion. Mismatches are logged as warnings but do not fail completion (external handlers may diverge).
object
Example
{ "name": "Price recommendation", "description": "Domain-level price model", "metadata": { "team": "pricing" }, "handlers": { "training": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:train", "version": "1" }, "inference": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:infer" } }}Responses
Section titled “ Responses ”Model created
object
object
object
object
object
object
object
Target ECS task to run, in the form <cluster>/<task_definition>. <cluster> is the ECS cluster short name (no / in the name); full cluster ARNs cannot be encoded unambiguously in this field. <task_definition> is the task family (optionally family:revision).
object
Which in-process implementation to run (registered in the API).
object
object
Target ECS task to run, in the form <cluster>/<task_definition>. <cluster> is the ECS cluster short name (no / in the name); full cluster ARNs cannot be encoded unambiguously in this field. <task_definition> is the task family (optionally family:revision).
object
Which in-process implementation to run (registered in the API).
Typed input/output contracts per handler type. When set, subscription staleness is driven by changes to these schemas rather than the handlers field. Contract fields are JSON Schema Draft 2020-12 documents.
object
object
JSON Schema Draft 2020-12 document for the payload accepted by this handler. When set on inference, direct inference requests validate input against this schema before dispatch. Stored event-subscription payloads are validated against the target’s schema for the action (warnings-only on mismatch).
object
JSON Schema Draft 2020-12 document for the handler’s successful output on job completion. Mismatches are logged as warnings but do not fail completion (external handlers may diverge).
object
object
JSON Schema Draft 2020-12 document for the payload accepted by this handler. When set on inference, direct inference requests validate input against this schema before dispatch. Stored event-subscription payloads are validated against the target’s schema for the action (warnings-only on mismatch).
object
JSON Schema Draft 2020-12 document for the handler’s successful output on job completion. Mismatches are logged as warnings but do not fail completion (external handlers may diverge).
object
object
Example
{ "version": { "status": "pending" }, "model": { "id": "model_price_reco_v1", "name": "Price recommendation", "description": "Domain-level price model", "handlers": { "training": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:train", "version": "1" }, "inference": { "type": "lambda", "arn": "arn:aws:lambda:us-west-2:123456789012:function:infer" } }, "handler_contracts": null, "metadata": { "team": "pricing" }, "status": "active" }}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}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}