API reference

KYE Protocol™ State API — State Machines + Events + Registry

8 operations · state.openapi.yaml

KYE Protocol™ State API: try the first operations

Demo data

You learn: What a call to this API sends and gets back. You can: Send a request.

API client · List state machines visible to the authenticated tenant

Request
GET /api/v1/state-machines
Response 200
{
  "data": [
    {
      "created_at": "2026-10-01T09:00:00Z",
      "created_by": "<created_by>",
      "entity_class": "<entity_class>",
      "locked_at": "2026-10-01T09:00:00Z",
      "machine_id": "<machine_id>",
      "schema_version": "kye.state.machine.v1",
      "states": [
        {
          "description": "<description>",
          "kind": "initial",
          "name": "<name>",
          "obligations": [
            "<obligations>"
          ]
        }
      ],
      "tenant_scope": "<tenant_scope>"
    }
  ]
}
How this widget is built
Demonstrates
KYE™ API
Components
  • The OpenAPI 3.1 contract
  • Request and response examples from the contract
Flow
Request → response, from the published contract. Architecture diagram
Used on
Servers
https://api.kyeprotocol.com
Version
3.0.0
Source
state.openapi.yaml

Endpoints for creating and managing declarative state machines, firing state transition events, querying the State Registry, and listing state transitions.

state-machines

GET/api/v1/state-machinesList state machines visible to the authenticated tenant

Auth: bearerAuth

Parameters

nameintypedescription
tenant_idquerystring
entity_classquerystring
scopequerystring

Responses

  • 200 List of state machines
POST/api/v1/state-machinesCreate a tenant-scoped state machine (or extension)

Auth: bearerAuth

Request body (required)

fieldtypedescription
entity_class requiredstring
tenant_scopestring
states requiredarray

Responses

  • 201 Created
POST/api/v1/state-machines/from-libraryDerive a tenant state machine from a State Library entry

Auth: bearerAuth

Request body (required)

fieldtypedescription
library_id requiredstringkye:state-library:<sector>.<name>.v<n>
tenant_id requiredstring
tightened_guardsarray
added_statesarray

Responses

  • 201 Derived machine created
GET/api/v1/state-machines/{machine_id}Get a state machine by ID

Auth: bearerAuth

Parameters

nameintypedescription
machine_id requiredpathstring

Responses

  • 200 State machine
  • 404 Not found

state-events

GET/api/v1/state-eventsList state events (append-only log)

Auth: bearerAuth

Parameters

nameintypedescription
entity_idquerystring
machine_idquerystring
fromquerystring
toquerystring

Responses

  • 200 List of state events
POST/api/v1/state-eventsFire a state transition event for an entity

Auth: bearerAuth

Request body (required)

fieldtypedescription
entity_id requiredstringAny KYE™ entity URN
to_state requiredstringTarget state name
evidence_refsarray
decided_bystring

Responses

  • 201 Event fired and recorded
  • 422 Transition not permitted by machine

state-registry

GET/api/v1/state-registry/{tenant_id}Get the State Registry summary for a tenant

Auth: bearerAuth

Parameters

nameintypedescription
tenant_id requiredpathstring

Responses

  • 200 Registry envelope

state-transitions

GET/api/v1/state-transitionsList declared state transitions for a machine

Auth: bearerAuth

Parameters

nameintypedescription
machine_id requiredquerystring

Responses

  • 200 Transitions