Skip to main content
Standalone On a Standalone instance you can author and import your own protocols. A protocol is a JSON document validated against the Link protocol meta-schema (link-protocol-v1) at import time; a document that does not conform is rejected.
Custom protocols require a Standalone instance. A Bundled instance is locked to serving its Specter instance’s backends. See Protocols for the concept.
The meta-schema is JSON Schema (draft 2020-12) and is served by every instance:

Top-level structure

A protocol document has these fields (additionalProperties is false — unknown top-level keys are rejected):
FieldRequiredDescription
$schemayesReference to the meta-schema: https://developer.hellgate.io/schemas/link-protocol/v1
$idyesCanonical URI identifying this protocol. Backends reference the protocol by this URI; it is the join key.
nameyesHuman-readable protocol name.
versionyesVersion identifier (a string, for example 1.0.0).
actionsyesMap of action name → Action. At least one action is required.
componentsnoReusable schemas referenced via $ref (see Components).

Actions

actions is keyed by action name. Names may use dot notation to namespace related operations (for example notify.chargeback). Each action is an object (additionalProperties: false):
FieldRequiredDescription
methodyesHTTP method: POST, GET, PUT, PATCH, or DELETE. Callers must invoke with this method.
descriptionyesHuman-readable description of the action.
requestyesThe input definition — monomorphic or discriminated.
responsesyesOutput definitions keyed by HTTP status (see Responses).
requirednoWhether backends must implement this action. Defaults to false.

Requests

request is one of two shapes.

Monomorphic — a single schema

The request is a single JSON Schema:

Discriminated — a polymorphic union

A discriminator field selects a named variant. Each variant is a JSON Schema:
FieldRequiredDescription
discriminatoryesA JSONPath expression pointing to the discriminator field, for example $.credential.type.
variantsyesMap of discriminator value → JSON Schema. At least one variant.
required_variantsnoVariant names backends must implement. Each must exist in variants.
Backends implement a discriminated action by its action.variant key (for example assess.pan). See Backends.

Responses

responses is keyed by HTTP status code (a string matching ^[1-5][0-9]{2}$), with at least one entry. Each entry nests the schema under contentapplication/jsonschema:
Backend response mappings target these status codes and are validated against the corresponding schema at backend-write time — see Backends.

Components

components.schemas holds reusable schemas referenced from anywhere in the protocol via a JSON Pointer $ref (for example #/components/schemas/Transaction):

Supported JSON Schema keywords

Schemas (in requests, responses, and components) are JSON Schema. The meta-schema explicitly lists the supported keywords; full validation is delegated to a JSON Schema validator (draft 2020-12): type, const, enum, properties, required, additionalProperties, items, oneOf, anyOf, allOf, $ref, description, format, minimum, maximum, minLength, maxLength, pattern.

Complete example

A minimal but valid protocol with one discriminated assess action and shared components:

Import and validation

Import a protocol you authored on a Standalone instance — by URL or by posting the document directly. Requires admin:protocols:write.
At import, Link validates the document against the meta-schema and rejects anything non-conforming. A Standalone instance also lifts the restriction that limits a Bundled instance to its Specter protocols, so your own $id is accepted. Once imported, Link generates an OpenAPI 3.1 specification for the protocol — see Protocols.

Next steps

Backends

Bind your protocol to a real provider with mapping rules.

Protocols

The protocol concept — actions, variants, and versioning.