Create an interface
const url = 'https://example.com/api/v1/interfaces';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"component":"example","interface_type":"example","label":"example","node":"example","params":"example"}'};
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/interfaces \ --header 'Content-Type: application/json' \ --data '{ "component": "example", "interface_type": "example", "label": "example", "node": "example", "params": "example" }'Creates an interface owned by a component (or a server-hosted one, which needs an all-scoped grant), named by its protocol; the optional label is the only identity string an operator types, and is where what the connection is FOR goes. The create scope cascades through the owning component. Gated by interface:create.
Request Body required
Section titled “Request Body required ”object
A URL to the JSON Schema for this object.
Owning component, by name or id; omit for a server-hosted interface (needs an all-scoped grant)
An interface_type name (the protocol); the interface is named by it, unique within the component
What an operator reads in lists (Control processor). Settable here because the name is derived from the type, so it says how the device is reached and never what the connection is for
Node placement, by name or id
Endpoint/target settings (jsonb)
Responses
Section titled “ Responses ”Created
object
A URL to the JSON Schema for this object.
The owning component name; absent for a server-hosted interface
The owning component’s id; the stable form of component
The interface’s surrogate id (the address)
The interface_type name (the protocol)
The interface_type’s uuid, the stable form of interface_type
The friendly string an operator reads, and the only identity string an operator types here: the name is derived from the type. Absent when unset, and a surface with none renders the name verbatim
The derived name (its protocol), unique within the owning component
The node placement name, if assigned
The placed node’s id; the stable form of node
The endpoint/target settings (jsonb)
Example
{ "$schema": "/api/v1/schemas/InterfaceBody.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"}