Skip to content

Request approval gate

POST
/v1/actions/hospitality.action.request_approval_gate/apply
curl --request POST \
--url https://api.aerandil.com/v1/actions/hospitality.action.request_approval_gate/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "branch": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "params": { "approval_strategy": "any_one", "context_snapshot": "example", "eligible_principal_ids": [ "example" ], "eligible_role_refs": [ "example" ], "excluded_principal_ids": [ "example" ], "expires_at": "2026-04-15T12:00:00Z", "external_reference": "example", "gate_key": "example", "notification_target": "in_product", "required_approval_count": 1, "risk_tier": "read_only" }, "return_modified": false }'

Open a durable approval_gate for a workflow step or for a standalone action. Inserts the gate in requested status (or notified when a notification_target is supplied), links it to the guarded step run when applicable, transitions the step to waiting_for_approval, and freezes the proposal §4.4.2 canonical context hash. Validators (commit 10): approval_gate_eligible_decider shape, quorum_valid, agent_cannot_satisfy_human_gate setup, expiry coherence.

Effects: create hospitality.approval_gate; modify hospitality.workflow_step_run; link hospitality.link.approval_gate_for_workflow_step_run; link hospitality.link.approval_gate_for_federated_output; modify hospitality.workflow_run; link hospitality.link.approval_gate_for_automation; link hospitality.link.approval_gate_for_federated_analysis_definition; link hospitality.link.approval_gate_for_owner_statement; link hospitality.link.approval_gate_for_property_budget; link hospitality.link.approval_gate_for_purpose_grant.

Media typeapplication/json
object
branch

Apply against an open branch’s overlay view instead of the canonical (main) plane. The action’s writes land in the branch’s copy-on-first-write overlay, its events in the branch’s own stream, and the invocation is journaled for merge-by-replay. Branch writes are action-only, so this is the write-side entry point to a branch (POST /v1/branches forks one).

string format: uuid
params
required
object
approval_strategy
required
How the gate combines decisions
string
Allowed values: any_one all quorum role_based ordered_chain separation_of_duties
context_snapshot
required
Frozen, redacted facts shown to approvers
eligible_principal_ids
Exact eligible principals (Principal::stable_id() shape)
Array<string>
eligible_role_refs
Staff roles / groups that may approve
Array<string>
excluded_principal_ids
Requesting agent / author / conflicted principals
Array<string>
expires_at
Gate timeout
string format: date-time
external_reference
Slack ts, Linear issue id, PMS task id, email thread id, etc.
string
gate_key
required
Stable within the workflow run or action correlation id
string
notification_target
Where the gate notification surfaced
string
Allowed values: in_product slack linear email pms_task webhook other
required_approval_count
Required for approval_strategy = quorum
integer
risk_tier
required
Risk tier of the guarded step / action
string
Allowed values: read_only internal_write guest_message money_movement identity_or_fraud clinical_or_regulated other_high_risk
return_modified

When true, the response carries modified_objects and modified_links projections — the engine reads the event log inside the same transaction so the projection observes the handler’s own writes.

boolean

Action applied. modified_objects and modified_links populated when return_modified: true was supplied.

Media typeapplication/json
ApplyActionResponse

Envelope returned by the Aerandil action engine. correlation_id ties every event emitted by this invocation; modified_objects and modified_links project the events the handler emitted (per the action’s declared effects); warnings carries any non-blocking soft-validator observations.

object
correlation_id
required

Per-invocation correlation id; matches events.correlation_id for every event this action appended.

string format: uuid
modified_links
required

Links established or removed by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
from_id
required
string format: uuid
from_type
required
string
kind
required
Allowed values: linked
link_type
required
Allowed values: hospitality.link.approval_gate_for_workflow_step_run hospitality.link.approval_gate_for_federated_output hospitality.link.approval_gate_for_automation hospitality.link.approval_gate_for_federated_analysis_definition hospitality.link.approval_gate_for_owner_statement hospitality.link.approval_gate_for_property_budget hospitality.link.approval_gate_for_purpose_grant
to_id
required
string format: uuid
to_type
required
string
modified_objects
required

Objects created, modified, or soft-deleted by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
id
required
string format: uuid
kind
required
Allowed values: created modified
object_type
required
Allowed values: hospitality.approval_gate hospitality.workflow_step_run hospitality.workflow_run
warnings

Non-blocking soft-validator observations emitted during this invocation (e.g. comp-authority over-limit, recipe pour-cost over sell-price). Absent when no warnings were emitted.

Array<object>
object
message
required

Human-readable summary, suitable for logging or operator-UI surfacing.

string
object_type
required

Object type the warning was raised against.

string
property

Property the warning anchors to, when a single field is the locus. Absent for multi-field rules.

string
rule
required

Stable kebab-case rule identifier (e.g. comp-authority-over-limit).

string
Example
{
"modified_links": [
{
"kind": "linked",
"link_type": "hospitality.link.approval_gate_for_workflow_step_run"
}
],
"modified_objects": [
{
"kind": "created",
"object_type": "hospitality.approval_gate"
}
]
}

Conflict — concurrent modification or unique constraint violation.

Validation error — parameter validation or business-rule violation.