Markdown
Agent Operations API Reference
Plain Markdown for agents, CLIs, MCP clients, and readers who want a copyable text version.
# Agent Operations API Reference
Canonical: https://docs.flowrelay.app/reference/api/
Markdown: https://docs.flowrelay.app/reference/api.md
The Agent Operations API is the canonical machine-access contract for FlowRelay. The API, CLI, and MCP are access surfaces over this one contract; they do not grant separate authority. Use the generated effect model to distinguish reads, handoffs, previewed actions, and direct resource creation.
## Choose what you need
- [Start here](#start-here): Read the live manifest and complete the minimum setup before authenticated calls.
- [Authenticate and read](#authenticate-and-read): Use the scoped grant model and choose the smallest read for the job.
- [Plan changes](#plan-changes): Preview state-changing work and use the correct request lane before execution.
- [Diagnose and check availability](#diagnose-and-check-availability): Use the error, schema, mission, and availability contracts instead of guessing.
## Start here
Read the live manifest and complete the minimum setup before authenticated calls.
### Start with the manifest
Use the manifest before authenticated calls, and reread it before reusing cached capability URLs or operation names. It identifies the live edition (Shopify Flow), capability URLs, safety boundaries, the OpenAPI location, the docs index, the CLI reference, the MCP reference, and current public docs pointers.
- Route: GET /agent/v1/manifest; Use it for: Edition identity, capability metadata, docs URLs, and safety boundaries.
- Route: GET /agent/v1/plan-usage; Use it for: Exact usage meters, remaining capacity, enforcement state, and retry guidance before loops or high-volume work.
- Route: https://docs.flowrelay.app/llms.txt; Use it for: Canonical human and Markdown docs discovery.
- Route: https://docs.flowrelay.app/reference/openapi/agent-operations.openapi.json; Use it for: Exact request and response contract discovery.
- Route: https://docs.flowrelay.app/setup/trigger-variants-and-event-mapping/; Use it for: Product meaning for triggerVariant, resourceIdPath, relatedResourceIdPath, and mapping fields.
- Route: https://docs.flowrelay.app/agent-access/agent-mission-playbooks/; Use it for: Translate an operator mission into context reads, allowed actions, and escalation boundaries.
- Route: https://docs.flowrelay.app/agent-access/setup-with-an-agent/; Use it for: Guide a new endpoint setup through inventory, one endpoint, one synthetic handoff proof, plan fit, and monitoring cadence.
- Route: https://docs.flowrelay.app/agent-access/endpoint-swap-plan/; Use it for: Guide an existing sender or receiver lane migration through inventory, one safe pilot, operator approval, rollback, and cutover planning.
- Route: https://docs.flowrelay.app/agent-access/support-and-expansion-requests/; Use it for: Choose the right lane for support issues, future-edition expansion demand, and missing FlowRelay feature requests.
- Route: https://docs.flowrelay.app/agent-access/availability-and-refusals/; Use it for: Explain whether an action is available, blocked, human-only, or outside the current edition.
### Get set up
Start with public discovery, then add a merchant-authorized Agent Access bearer token for operational reads and approved action previews.
#### Read the public manifest
Confirms Shopify Flow edition identity, docs URLs, capability metadata, and safety boundaries.
```sh
curl https://api.flowrelay.app/agent/v1/manifest
```
#### Inspect the OpenAPI contract
Use this for exact request and response shapes before calling authenticated routes.
```sh
curl https://docs.flowrelay.app/reference/openapi/agent-operations.openapi.json
```
#### Read mapping semantics
Use this before creating or editing an endpoint through API, CLI, or MCP.
```sh
https://docs.flowrelay.app/setup/trigger-variants-and-event-mapping/
```
#### Read mission playbooks
Use this to map the operator's goal to context reads, safe actions, and escalation.
```sh
https://docs.flowrelay.app/agent-access/agent-mission-playbooks/
```
#### Read availability guidance
Use this before assuming a listed capability can be executed.
```sh
https://docs.flowrelay.app/agent-access/availability-and-refusals/
```
#### Read plan usage
Check usage meters before broad reads, polling, or repeated action previews.
```sh
curl -H "Authorization: Bearer $FLOWRELAY_AGENT_TOKEN" https://api.flowrelay.app/agent/v1/plan-usage
```
#### Read scoped event history
Requires a merchant-authorized Agent Access grant token.
```sh
curl -H "Authorization: Bearer $FLOWRELAY_AGENT_TOKEN" "https://api.flowrelay.app/agent/v1/events?limit=25"
```
## Authenticate and read
Use the scoped grant model and choose the smallest read for the job.
### Authentication model
Authenticated Agent Operations use merchant-authorized grant tokens supplied at request time. Public examples must never include real bearer tokens, grant tokens, session values, authentication headers, Shopify tokens, or private endpoint material; use placeholder environment variables such as $FLOWRELAY_AGENT_TOKEN.
- Signal: scope; How to use it: Confirms whether the grant permits the read, preview, or execution.
- Signal: actor; How to use it: Preserves human or authorized-agent attribution.
- Signal: refusal; How to use it: Explains why an action is outside authority or unsafe.
### Generated operation effect matrix
This matrix is generated from Agent Operations OpenAPI schema version 2026-06-17. read_only returns facts; handoff_only returns or prepares a human-owned next step; preview_or_execute uses the preview, confirmation, and execute controls; create_resource records a new resource directly when its request is accepted.
- Route and method: GET /agent/v1/manifest; Operation ID: getAgentOperationsManifest; Required scopes: None; Access: public; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/reference/api/
- Route and method: GET /agent/v1/setup-state; Operation ID: getSetupState; Required scopes: setup:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/getting-started/first-event/
- Route and method: GET /agent/v1/plan-usage; Operation ID: getPlanUsage; Required scopes: setup:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/operate/usage-limits/
- Route and method: GET /agent/v1/billing-handoff; Operation ID: getBillingHandoff; Required scopes: setup:read; Access: agent_grant; Effect: handoff_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/reference/api/
- Route and method: GET /agent/v1/grant; Operation ID: getCurrentAgentGrant; Required scopes: None; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/agent-access/grants-and-scopes/
- Route and method: GET /agent/v1/event-result; Operation ID: getLatestEventResult; Required scopes: event:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/operate/receipts/
- Route and method: GET /agent/v1/events; Operation ID: listEvents; Required scopes: event:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/operate/event-history/
- Route and method: GET /agent/v1/events/{eventId}; Operation ID: getEventDetail; Required scopes: event:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/operate/receipts/
- Route and method: GET /agent/v1/reliability/tenant; Operation ID: getTenantReliabilityHealth; Required scopes: event:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/operate/event-history/
- Route and method: GET /agent/v1/reliability/destination; Operation ID: getDestinationReliabilityHealth; Required scopes: event:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/operate/event-history/
- Route and method: GET /agent/v1/endpoints/{endpointId}; Operation ID: getEndpointDetail; Required scopes: setup:read; Access: agent_grant; Effect: read_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/setup/endpoints/
- Route and method: POST /agent/v1/endpoints/{endpointId}/edit-intents; Operation ID: createEndpointEditIntent; Required scopes: setup:read, endpoint:write; Access: agent_grant; Effect: preview_or_execute; Confirmation: Required; Docs URL: https://docs.flowrelay.app/setup/trigger-variants-and-event-mapping/
- Route and method: POST /agent/v1/endpoints/{endpointId}/delete-intents; Operation ID: createEndpointDeleteIntent; Required scopes: setup:read, endpoint:delete; Access: agent_grant; Effect: preview_or_execute; Confirmation: Required; Docs URL: https://docs.flowrelay.app/reference/action-intents/
- Route and method: POST /agent/v1/endpoints/{endpointId}/secret-rotation-intents; Operation ID: createSecretRotationIntent; Required scopes: setup:read, secret:rotate; Access: agent_grant; Effect: preview_or_execute; Confirmation: Required; Docs URL: https://docs.flowrelay.app/reference/action-intents/
- Route and method: POST /agent/v1/endpoints/{endpointId}/test-intents; Operation ID: createEndpointTestIntent; Required scopes: setup:read, endpoint:test; Access: agent_grant; Effect: handoff_only; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/getting-started/first-event/
- Route and method: POST /agent/v1/endpoints; Operation ID: createEndpoint; Required scopes: setup:read, endpoint:write; Access: agent_grant; Effect: create_resource; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/setup/trigger-variants-and-event-mapping/
- Route and method: POST /agent/v1/events/{eventId}/replay-intents; Operation ID: createReplayIntent; Required scopes: event:read, replay:execute; Access: agent_grant; Effect: preview_or_execute; Confirmation: Required; Docs URL: https://docs.flowrelay.app/recover/replay/
- Route and method: POST /agent/v1/diagnostics-share-intents; Operation ID: createDiagnosticsShareIntent; Required scopes: setup:read, event:read, diagnostics:create; Access: agent_grant; Effect: preview_or_execute; Confirmation: Required; Docs URL: https://docs.flowrelay.app/recover/diagnostics/
- Route and method: POST /agent/v1/support-request-intents; Operation ID: createSupportRequestIntent; Required scopes: setup:read, support:request; Access: agent_grant; Effect: preview_or_execute; Confirmation: Required; Docs URL: https://docs.flowrelay.app/agent-access/support-and-expansion-requests/
- Route and method: POST /agent/v1/expansion-requests; Operation ID: createExpansionRequest; Required scopes: expansion:request; Access: agent_grant; Effect: create_resource; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/agent-access/support-and-expansion-requests/
- Route and method: POST /agent/v1/feature-requests; Operation ID: createFeatureRequest; Required scopes: expansion:request; Access: agent_grant; Effect: create_resource; Confirmation: Not required; Docs URL: https://docs.flowrelay.app/agent-access/support-and-expansion-requests/
### Reads
Read routes return safe facts (setup, event history, receipts, diagnostics, plan usage, and grant status) without exposing raw private material unless the grant explicitly authorizes that surface.
- Read area: Setup and endpoints; Purpose: Explain how the sender, Source label, trigger variant, default or resolved event type, authentication mode, and Shopify Flow trigger are configured.
- Read area: Events and receipts; Purpose: Find what FlowRelay accepted, where the handoff stopped, and what recovery options exist. Delivered means FlowRelay handed the trigger to Shopify Flow. It does not mean downstream Shopify Flow branches, app calls, fulfillment changes, emails, or later systems completed.
- Read area: Diagnostics and plan state; Purpose: Prepare redacted support collaboration and understand usage safeguards.
## Plan changes
Preview state-changing work and use the correct request lane before execution.
### Action previews
Only preview_or_execute operations use the full preview, confirmation, idempotency, metering, audit, and refusal lifecycle. Use it for replay, diagnostics sharing, endpoint edit, secret rotation, endpoint deletion, and support request preview/submit. Endpoint creation and expansion or feature requests are direct create_resource operations; endpoint creation executes immediately and returns the new endpoint secret once. Endpoint-test intent is handoff_only and does not send signed traffic for the operator.
### Request lanes
Use the structured request lanes when the agent needs human support, wants to record future-edition demand, or finds a missing FlowRelay capability. Support uses request-specific preview and submit states with consent and idempotency; the API does not claim that submit is bound to a persisted matching preview record. Expansion and feature requests are direct create_resource operations with expansion:request scope. All three record product-state signals without creating a commitment, priority, or timeline.
- Route: POST /agent/v1/support-request-intents; Effect: preview_or_execute; Use it for: Previewing or submitting an active help or recovery request with consent, redaction, and safe support context.
- Route: POST /agent/v1/expansion-requests; Effect: create_resource; Use it for: Recording non-binding demand for future platform, native-edition, trigger-lane, multi-store, or event-reliability expansion.
- Route: POST /agent/v1/feature-requests; Effect: create_resource; Use it for: Recording non-binding requests for missing FlowRelay capabilities inside the current product surface, not support tickets, expansion requests, or generic wishlists.
## Diagnose and check availability
Use the error, schema, mission, and availability contracts instead of guessing.
### Errors and schemas
Use support codes and generated schemas for exact fields. The prose docs explain product meaning; the generated OpenAPI contract explains exact request and response shape. Endpoint create and edit work should pair the OpenAPI schema with the trigger variants and event mapping reference.
### Mission and availability
When an agent receives a goal rather than a specific route, use the mission playbooks before tool use. When a route exists but may be blocked by scope, usage, target state, safety, or product boundary, use the availability and refusals guide before retrying.
## Example Surface
- `curl https://api.flowrelay.app/agent/v1/manifest`
- `curl -H "Authorization: Bearer $FLOWRELAY_AGENT_TOKEN" https://api.flowrelay.app/agent/v1/plan-usage`
- `curl -H "Authorization: Bearer $FLOWRELAY_AGENT_TOKEN" https://api.flowrelay.app/agent/v1/events?limit=25`
- `POST /agent/v1/endpoints`
- `POST /agent/v1/events/{eventId}/replay-intents`
- `POST /agent/v1/feature-requests`
## Safety Boundary
Do not share endpoint secrets, authentication headers, HMAC values, tokens, raw event bodies, customer records, Shopify sessions, store passwords, or database URLs in public examples.
FlowRelay