Drafts
Available from Phase 3
/api/v1/sets/{ref}/draftAn app token (sk_live_, sk_test_, pk_live_), a browser token (a 5-minute ES256 JWT) or an agent token (sa_live_).
In: header
Path Parameters
1 <= lengthResponse Body
application/json
application/json
curl -X GET "https://example.com/api/v1/sets/string/draft"{ "schemaVersion": 1, "model": "string", "input": { "schema": { "property1": "string", "property2": "string" }, "adapter": { "id": "string", "config": null }, "redactPaths": [ "string" ], "maxStateTokens": 1 }, "checks": [ { "id": "string", "when": { "all": [ null ] } } ], "stages": [ { "id": "string", "when": { "all": [ null ] }, "stateFrom": "input", "questions": { "property1": { "type": "noul", "instructions": "string", "criteria": { "true": "string", "false": "string", "property1": "string", "property2": "string" }, "meta": { "label": "string", "description": "string", "templateId": "string", "property1": null, "property2": null } }, "property2": { "type": "noul", "instructions": "string", "criteria": { "true": "string", "false": "string", "property1": "string", "property2": "string" }, "meta": { "label": "string", "description": "string", "templateId": "string", "property1": null, "property2": null } } } } ], "policies": { "property1": { "type": "noul", "gating": true, "relevantWhen": { "all": [ null ] }, "noul": { "trueAt": 0, "falseAt": 0, "reviewMargin": 0 }, "actions": { "high": { "kind": "auto", "handler": "string", "config": null }, "medium": { "kind": "auto", "handler": "string", "config": null }, "low": { "kind": "auto", "handler": "string", "config": null } } }, "property2": { "type": "noul", "gating": true, "relevantWhen": { "all": [ null ] }, "noul": { "trueAt": 0, "falseAt": 0, "reviewMargin": 0 }, "actions": { "high": { "kind": "auto", "handler": "string", "config": null }, "medium": { "kind": "auto", "handler": "string", "config": null }, "low": { "kind": "auto", "handler": "string", "config": null } } } }, "composites": [ { "id": "string", "kind": "weighted", "terms": [ { "q": "string", "weight": 1, "option": "string" } ], "policy": { "type": "composite", "gating": true, "levelThresholds": { "high": 0, "medium": 0 }, "actions": { "high": { "kind": "auto", "handler": "string", "config": null }, "medium": { "kind": "auto", "handler": "string", "config": null }, "low": { "kind": "auto", "handler": "string", "config": null } } } } ], "routes": [ { "when": { "all": [ null ] }, "output": "string" } ], "defaultRoute": "string", "savings": { "comparatorModel": "string", "estOutputTokensPerQuestion": 0, "kind": "decision" }, "onUnavailable": "fallback"}/api/v1/sets/{ref}/draftAn app token (sk_live_, sk_test_, pk_live_), a browser token (a 5-minute ES256 JWT) or an agent token (sa_live_).
In: header
Path Parameters
1 <= lengthHeader Parameters
Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.
1 <= lengthThe draft ETag (its spec_hash).
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PUT "https://example.com/api/v1/sets/string/draft" \ -H "If-Match: string" \ -H "Content-Type: application/json" \ -d '{ "schemaVersion": 1, "model": "string", "input": { "schema": { "property1": "string", "property2": "string" } }, "stages": [ { "id": "string", "questions": { "property1": { "type": "noul", "instructions": "string", "meta": { "label": "string", "property1": null, "property2": null } }, "property2": { "type": "noul", "instructions": "string", "meta": { "label": "string", "property1": null, "property2": null } } } } ], "policies": { "property1": { "type": "noul", "gating": true, "noul": { "trueAt": 0, "falseAt": 0, "reviewMargin": 0 }, "actions": { "high": { "kind": "auto" }, "medium": { "kind": "auto" }, "low": { "kind": "auto" } } }, "property2": { "type": "noul", "gating": true, "noul": { "trueAt": 0, "falseAt": 0, "reviewMargin": 0 }, "actions": { "high": { "kind": "auto" }, "medium": { "kind": "auto" }, "low": { "kind": "auto" } } } } }'{ "etag": "string"}/api/v1/sets/{ref}/draft/validateAn app token (sk_live_, sk_test_, pk_live_), a browser token (a 5-minute ES256 JWT) or an agent token (sa_live_).
In: header
Path Parameters
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/api/v1/sets/string/draft/validate" \ -H "Content-Type: application/json" \ -d '{ "property1": "string", "property2": "string" }'{ "errors": [ { "path": "string", "rule": "string", "severity": "error", "message": "string" } ], "warnings": [ { "path": "string", "rule": "string", "severity": "error", "message": "string" } ]}Bandwise is an independent product built on TypeSafe's System One models. It is not TypeSafe's documentation. For the System One models themselves, see docs.typesafe.ai.