Templates

Templates are JSON envelopes wrapping .ws definitions with variable schemas. All endpoints scoped to your org.

List

GET/api/templates

List templates

Returns all templates available to your organization.

Register

POST/api/templates

Register template

Create a new template with a variable schema and .ws source.

Request body:

json
{
  "name": "demo-card",
  "description": "Simple demo card",
  "version": "1.0.0",
  "variables": [
    { "name": "title", "type": "string", "required": true, "example": "Hello World" },
    { "name": "subtitle", "type": "string", "required": false, "default": "" }
  ],
  "defaults": { "mood": "confident", "aspect": "16:9" },
  "source": "define template demo-card [5s]\n  background: dark\n  show \"{title}\"\n    size: display"
}

Get

GET/api/templates/:name

Get template

Returns the full template envelope including variable schema and source.

Delete

DELETE/api/templates/:name

Delete template

Removes a template by name.

Next Steps