Skip to content

Decrees

Decrees represent external interventions such as policy changes or sudden events. This REST API stores decree records and broadcasts their submission to event subscribers. Submitting a decree does not apply its payload to the simulation engine or schedule it for a later tick.

All decree endpoints require authentication. API keys need the stated scope. Scope checks do not apply to JWT callers. API keys access their own organization’s simulations. JWT callers need organization membership or ownership of a personal simulation.

Replace <api-key> and <simulation-id> with your key and simulation UUID. The example capability_jump payload illustrates stored data. The endpoint does not validate or execute that domain event.

POST /v1/simulations/{id}/decrees

Stores a decree for an accessible simulation and emits a decree event. The endpoint does not require the simulation to be active. Successful responses support an Idempotency-Key, subject to the idempotency limitations.

Scope required (API key): simulation:write

ParameterTypeDescription
iduuidSimulation ID
FieldTypeRequiredDescription
typestringYesNonempty decree type identifier
payloadobjectYesFree-form decree data

Unknown top-level fields return 400 VALIDATION_ERROR. Both endpoints can return 401, 403, 404, 429, or 500. Invalid submit bodies return 400, and conflicting idempotency keys return 409. See HTTP Status Codes for shared errors.

{
"id": "d1e2f3a4-1111-4111-8111-111111111111",
"simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "capability_jump",
"payload": {
"target": "frontier_model",
"magnitude": 0.4
},
"createdAt": "2025-06-15T10:35:00.000Z"
}
Terminal window
curl -X POST "https://api.anankelabs.io/v1/simulations/<simulation-id>/decrees" \
-H "X-Api-Key: <api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "capability_jump",
"payload": {"target": "frontier_model", "magnitude": 0.4}
}'
GET /v1/simulations/{id}/decrees

Returns a paginated list of all decrees submitted to a simulation.

Scope required (API key): simulation:read

ParameterTypeDescription
iduuidSimulation ID
ParameterTypeDefaultDescription
limitinteger50Results per page, clamped to 1 to 200
offsetinteger0Pagination offset, clamped to 0 or greater
orderstring"asc"Creation-time order: "asc" or "desc"

limit and offset use integer parsing. Zero or an unparseable limit uses 50. An unparseable offset uses 0. Only order=desc selects descending order. All other values select ascending order.

{
"data": [
{
"id": "d1e2f3a4-1111-4111-8111-111111111111",
"simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "capability_jump",
"payload": {
"target": "frontier_model",
"magnitude": 0.4
},
"createdAt": "2025-06-15T10:35:00.000Z"
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 1
}
}
Terminal window
curl "https://api.anankelabs.io/v1/simulations/<simulation-id>/decrees?order=desc" \
-H "X-Api-Key: <api-key>"