Skip to content

API overview

The MedFlow API lets you manage the pieces of a Workflow (diagrams and care pathways, triggers, and queries), start runs by firing a trigger, and follow run status. Every request authenticates with an API key.

EnvironmentBase URL
Productionhttps://api.medflow.care
Staginghttps://api-staging.medflow.care

All paths in this reference are relative to the base URL above. The auth headers in each example read your key from $MEDFLOW_API_KEY in your shell.

bash
curl "https://api-staging.medflow.care/v1/me" \
  -H "Authorization: Bearer $MEDFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

The key is scoped to a tenant and workspace and may carry scopes. See Authentication to request a key.

Breaking changes ship under a new major prefix (/v2). Additive changes stay on /v1.

When you fire a trigger or deliver webhook data, send an Idempotency-Key header (or idempotencyKey in the body) so retries do not create duplicates. Reusing a key with the same body returns the original result. Reusing it with a different body returns 409.

The same key is how you trace what a request produced. Every run created from it carries the key, so GET /v1/runs?idempotencyKey=… lists the runs a single fire or delivery started. Use one key per real-world event.

You can send an X-Request-Id on each call, or let MedFlow generate one. The same id comes back in the response header and appears in audit events, so it is worth quoting when you contact support.

json
{
  "error": "<string>",
  "code": "<string> | null",
  "requestId": "<string>"
}
StatusTypical cause
400Validation / missing fields
401Auth missing or invalid
403Authenticated but missing scope or permission
404Unknown id for this tenant
409Idempotency or state conflict
429Rate limit
500Unexpected server error
IDMeans
idDiagram id, blueprint or instance (Diagrams)
runIdPathway run. Also the id of the pathway instance for that run
sourceIdBlueprint id a run or instance was copied from
triggerIdHow work starts
queryIdFind query
nodeIdStep on a pathway
automationIdAutomated action on a node

Naming convention: diagrams return their own id as id. Triggers, queries, runs, and webhooks return their own id as {resource}Id (triggerId, queryId, runId, webhookId). When one resource references another it uses the referenced id name, so a trigger and a run both carry sourceId (the blueprint they came from).

AreaBase pathDocs
Search (Find)/v1/searchSearch
Queries/v1/queriesQueries
Diagrams/v1/diagramsDiagrams
Triggers/v1/triggersTriggers
Runs/v1/runsRuns
Webhooks/v1/webhooksWebhooks
MetricsMetrics (read API in development)
Full path listEndpoint index
Status valuesAutomation status
SecuritySecurity
Service statusstatus.medflow.care