Start a component from a template
const url = 'https://example.com/api/v1/components:createFromTemplate';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"inputs":{"additionalProperty":"example"},"label":"example","location":"example","name":"example","outpost":"example","template":"kestrel-vroom"}'};
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://example.com/api/v1/components:createFromTemplate \ --header 'Content-Type: application/json' \ --data '{ "inputs": { "additionalProperty": "example" }, "label": "example", "location": "example", "name": "example", "outpost": "example", "template": "kestrel-vroom" }'Creates one component from a component template at a location: its product and the template’s declared values, and, when the inputs carry an address (host), its endpoint attached through the driver with the template’s preset under your inputs. A secret input names a secret you may bind (secret:bind), resolved as an attach resolves it. One transaction, every piece in your own scope with its own audit row carrying from_template; nothing points back at the template. Gated by component:create; declared values also need component:update and an attach endpoint:create. A location outside your location scope is a 404, an unknown template a 404, inputs with no address or an attach with no outpost a 422.
Request Bodyrequired
Section titled “ Request Bodyrequired ”object
A URL to the JSON Schema for this object.
Driver inputs laid over the template’s preset: the address (host) attaches the endpoint, a secret input names a secret you may bind (secret:bind)
object
The component’s label
The location the component sits in, by name or dotted path
The component’s name; minted as an unnamed create mints it when empty
The outpost the endpoint is placed on; needed when inputs carry an address
The component template, by name
Responses
Section titled “ Responses ”Created
object
A URL to the JSON Schema for this object.
Whether its endpoint attached from the inputs given; false means it is still to attach
The component’s name
The component’s id, the stable address a link to it uses
Its product
The template it came from; recorded in the audit detail only
Example
{ "$schema": "/api/v1/schemas/CreateComponentFromTemplateOutputBody.json"}default
Section titled “ default ”Error
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}