Skip to main content

Flow API

Complete API reference for Rynko Flow. All endpoints are under the /api/flow/ prefix.

Authentication

All endpoints (except the Review portal) require an API key:

Authorization: Bearer YOUR_API_KEY

API keys are scoped to a workspace. All operations return data for the workspace associated with the key.


Gates

Create Gate

POST /api/flow/gates
FieldTypeRequiredDescription
namestringYesGate name (max 255 chars)
descriptionstringNoDescription (max 1000 chars)
validationModestringNovariables (default) or freetext
schemaobjectNoObjectSchema format (see Gates > Schema)
freetextConfigobjectNoRequired when validationMode is freetext
businessRulesarrayNoBusiness rule definitions (max 20)
renderModestringNonone (default), rynko, or custom_api
renderTemplateIdstringNoTemplate ID for rynko render mode
renderConfigobjectNoRender configuration (e.g., { "format": "pdf" })
approvalModestringNoauto (default) or manual
approvalConfigobjectNoApprovers and timeout (required when manual)
deliveryChannelsarrayNoWebhook delivery targets
maxSubmissionsPerMinuteintegerNoRate limit (1-1000)
notificationModestringNoimmediate or digest (default)
notificationDigestMinutesintegerNoDigest interval in minutes (1-60, default 5)
circuitBreakerEnabledbooleanNoEnable circuit breaker (default true)
maxFailuresintegerNoFailures before circuit opens (default 5)
cooldownSecondsintegerNoCircuit open duration in seconds (min 60, default 300)

Example:

curl -X POST https://api.rynko.dev/api/flow/gates \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Order Validation",
"schema": {
"type": "object",
"properties": {
"orderId": { "type": "string", "required": true },
"amount": { "type": "number", "required": true, "min": 0 }
}
}
}'

Response (201):

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"shortId": "fgate_a1b2c3d4",
"slug": "order-validation",
"name": "Order Validation",
"status": "active",
"validationMode": "variables",
"schema": { ... },
"schemaVersion": 1,
"createdAt": "2026-03-04T10:00:00Z"
}

List Gates

GET /api/flow/gates
ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger25Results per page (1-100)
searchstringSearch by name
statusstringactive, paused, or archived
sortBystringcreatedAtcreatedAt, name, or updatedAt
sortOrderstringdescasc or desc

Get Gate

GET /api/flow/gates/:id

The :id parameter accepts UUID, shortId (fgate_xxx), or slug.


Update Gate

PUT /api/flow/gates/:id

Same fields as Create Gate, all optional. Additionally accepts:

FieldTypeDescription
statusstringactive, paused, or archived
note

To update schema and business rules, use the dedicated Update Schema endpoint instead.


Delete Gate

DELETE /api/flow/gates/:id

Soft-deletes the gate. Returns 204.


Update Gate Schema

PUT /api/flow/gates/:id/schema

Creates a new schema version.

FieldTypeRequiredDescription
schemaobjectYesObjectSchema format
businessRulesarrayNoUpdated business rules

Import Schema from Template

POST /api/flow/gates/:id/import-schema
FieldTypeRequiredDescription
templateIdstringYesTemplate UUID, shortId (etpl_xxx), or slug

Copies the template's variables into the gate schema as a new version.


List Schema Versions

GET /api/flow/gates/:id/versions

Returns all schema versions for the gate, ordered by version number.


Test Gate (Dry Run)

POST /api/flow/gates/:id/test

Validates the request body against the gate's schema and business rules without creating a run or consuming quota.

Request body: Raw JSON payload (the data to validate).

Response (200):

{
"valid": true,
"durationMs": 4.2,
"steps": [
{
"name": "Schema Validation",
"status": "pass",
"durationMs": 1.1,
"errors": null
},
{
"name": "Rule name here",
"ruleId": "rule_xxx",
"status": "pass",
"durationMs": 0.3,
"expression": "amount > 0"
}
]
}

Step status values: pass, fail, error, skipped.


Validate (Create Run)

POST /api/flow/gates/:id/validate

Validates the request body and creates a run. This is the primary submission endpoint.

Request body: Raw JSON payload.

Success response (200):

{
"success": true,
"runId": "...",
"shortId": "frun_xxx",
"status": "validated",
"validation_id": "v_abc123...",
"validated_payload": { ... },
"layers": {
"schema": "pass",
"business_rules": "pass"
}
}

Failure response (422):

{
"success": false,
"status": "validation_failed",
"error": {
"code": "VALIDATION_FAILED",
"message": "...",
"layer": "schema",
"details": [
{ "field": "email", "message": "Invalid email format", "code": "format" }
]
},
"layers": { "schema": "fail", "business_rules": "skipped" }
}

Rate limited (429): Returns retryAfter in seconds.


Runs

Submit Run

POST /api/flow/gates/:gateId/runs
FieldTypeRequiredDescription
payloadanyYesJSON object (variables mode) or string (freetext mode)
metadataobjectNoCustom metadata stored on the run

List Runs

GET /api/flow/runs
GET /api/flow/gates/:gateId/runs
ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger25Results per page (1-100)
statusstringFilter by run status
sourcestringmcp or rest
sortBystringcreatedAtcreatedAt or status
sortOrderstringdescasc or desc

Get Run

GET /api/flow/runs/:id

Returns the full run record including input payload, validation result, render artefact URL, approval status, and delivery status.


Approvals

List Pending Approvals

GET /api/flow/approvals

Returns pending approvals for the authenticated user.


Approve

POST /api/flow/approvals/:id/approve
FieldTypeRequiredDescription
commentstringNoApproval comment (max 1000 chars)

Returns { "success": true, "decision": "approved" }.

Returns 409 if already decided.


Reject

POST /api/flow/approvals/:id/reject
FieldTypeRequiredDescription
commentstringNoRejection reason (max 1000 chars)

Returns { "success": true, "decision": "rejected" }.

Returns 409 if already decided.


Deliveries

Get Run Deliveries

GET /api/flow/runs/:id/deliveries

Returns all delivery records for a run, including delivery attempts.


Retry Failed Delivery

POST /api/flow/deliveries/:id/retry

Re-enqueues a failed delivery attempt. Returns { "success": true, "message": "Retry enqueued" }.

Returns 404 if delivery not found. Returns 409 if delivery is already completed.

Webhook Payload Format

Delivered webhooks include:

{
"event": "flow.run.completed",
"run": {
"id": "...",
"shortId": "frun_xxx",
"status": "...",
"inputPayload": { ... },
"artefactUrl": "..."
},
"gate": {
"id": "...",
"name": "...",
"slug": "..."
},
"timestamp": "2026-03-04T10:00:00Z"
}

Webhook Headers

HeaderDescription
Content-Typeapplication/json
User-AgentRynko-Flow/1.0
X-Rynko-Signaturev1={HMAC-SHA256 hex}
X-Rynko-TimestampUnix timestamp
X-Rynko-Event-IdRun ID
X-Rynko-Event-Typeflow.run.completed

Verify the signature: HMAC-SHA256(secret, "{timestamp}.{body}").

Retry Policy

  • 4xx responses: Not retried (permanent client error)
  • 5xx responses or network errors: Retried up to 3 times
  • Retry delays: 30 seconds, 2 minutes, 10 minutes

Review (External Approvers)

These endpoints are public — no API key required. Authentication uses magic link tokens.

Authenticate

POST /api/flow/review/authenticate
FieldTypeRequiredDescription
tokenstringYesMagic link token from email
emailstringYesApprover's email (identity challenge)

Response (200):

{
"reviewToken": "eyJ...",
"expiresIn": 7200
}

Use the reviewToken as Bearer token for subsequent review endpoints.


Review Inbox

GET /api/flow/review/inbox

Auth: Authorization: Bearer REVIEW_TOKEN

Returns pending approvals for the review token holder.


Get Review Approval

GET /api/flow/review/approvals/:id

Auth: Authorization: Bearer REVIEW_TOKEN

Returns approval details with full run context.


Approve (Review)

POST /api/flow/review/approvals/:id/approve

Auth: Authorization: Bearer REVIEW_TOKEN

FieldTypeRequiredDescription
commentstringNoApproval comment (max 1000 chars)

Reject (Review)

POST /api/flow/review/approvals/:id/reject

Auth: Authorization: Bearer REVIEW_TOKEN

FieldTypeRequiredDescription
commentstringNoRejection reason (max 1000 chars)

POST /api/flow/review/resend
FieldTypeRequiredDescription
tokenstringYesOriginal magic link token
emailstringYesApprover's email address

Rate limited to prevent abuse.


Analytics

All analytics endpoints require API key authentication and return data scoped to the workspace. See Analytics for detailed response formats.

EndpointDescriptionExtra Parameters
GET /api/flow/analytics/overviewWorkspace summaryperiod, gateId
GET /api/flow/analytics/run-outcomesRun outcome distributionperiod, gateId
GET /api/flow/analytics/throughputTime-series throughputperiod, granularity, gateId
GET /api/flow/analytics/validation-errorsFailure rates by gateperiod, gateId
GET /api/flow/analytics/approval-metricsApproval rates and timesperiod, gateId
GET /api/flow/analytics/infra-healthCircuit breaker and delivery healthperiod, gateId
GET /api/flow/analytics/gate-metricsPer-gate run countsperiod, gateId
GET /api/flow/analytics/billing-summaryCurrent period usage
GET /api/flow/analytics/combined-timelineCombined Flow + Render timelineperiod, granularity
GET /api/flow/analytics/team-overviewTeam-level cross-workspace dataperiod
GET /api/flow/analytics/plansAvailable Flow plans
GET /api/flow/analytics/credit-packsAvailable credit packs

Common parameters: period (7d, 30d, 90d), granularity (day, week, month).


Error Codes

CodeHTTP StatusDescription
FLOW.GATE_NOT_FOUND404Gate not found
FLOW.GATE_PAUSED409Gate is not active
FLOW.GATE_VALIDATION_FAILED422Schema/rule definitions invalid
FLOW.RUN_NOT_FOUND404Run not found
FLOW.APPROVAL_NOT_FOUND404Approval record not found
FLOW.APPROVAL_ALREADY_DECIDED409Decision already recorded
FLOW.DELIVERY_NOT_FOUND404Delivery record not found
FLOW.DELIVERY_ALREADY_COMPLETED409Cannot retry completed delivery
FLOW.TEMPLATE_NOT_FOUND404Template not found for schema import
FLOW.TEMPLATE_HAS_NO_VARIABLES422Template has no variables to import
ERR_FLOW_RUN_003503Circuit breaker open
ERR_FLOW_RUN_004429Rate limit exceeded
ERR_FLOW_RUN_005413Payload exceeds 1 MB

Plans and Limits

FreeStarterGrowthScale
Monthly price$0$29$79$149
Runs/month5002,00015,00050,000
Max gates31050Unlimited
Max approvers/gate51025Unlimited
Artefact retention3 days5 days5 days5 days
Content limit50K chars100K chars200K chars500K chars

Annual billing saves ~20%. Teams with both Render and Flow subscriptions get an additional 20% bundle discount.

Credit Packs (one-time)

PackRunsPricePer Run
Micro100$10$0.10
Small500$40$0.08
Medium1,000$70$0.07
Large2,500$150$0.06