API Overview
The Wireflow REST API runs your AI workflows from code: authenticate with an sk- key, start a run, then poll or get a webhook with the result.
The Wireflow REST API runs your AI workflows from code. You authenticate with an API key, start a run with the input values you want, and get the result by polling the execution or by receiving a signed webhook when it finishes.
Base URL
https://www.wireflow.ai/api/v1
Authentication
Every request needs an API key as a Bearer token in the Authorization header. Create keys in Settings > API Keys in the Wireflow dashboard. A key starts with sk- and is shown only once.
Authorization: Bearer YOUR_API_KEY
A new key starts read-only (workflows:read and executions:read). To run workflows, add the workflows:execute scope, or pick Full access when you create the key. See Authentication for every scope. To check which account a key acts as, call GET /api/v1/me.
API access is on every plan, including Free. Runs still use credits.
Quick Start
Run a workflow you saved in the editor by sending only its input values. The examples read your key from the WIREFLOW_API_KEY environment variable.
1. Start the run.
curl -X POST https://www.wireflow.ai/api/v1/workflows/YOUR_WORKFLOW_ID/run \
-H "Authorization: Bearer $WIREFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs": {"node-prompt": "A cat wearing a top hat"}}'
Response 202 Accepted:
{
"data": {
"executionId": "exec_789",
"status": "running",
"poll": "/api/v1/workflows/executions/exec_789/poll"
}
}
2. Poll until it finishes.
curl https://www.wireflow.ai/api/v1/workflows/executions/exec_789/poll \
-H "Authorization: Bearer $WIREFLOW_API_KEY"
Response when the run is done:
{
"status": "COMPLETED",
"result": {
"nodeRuns": [
{
"nodeId": "node-1",
"status": "COMPLETED",
"output": {
"images": [{ "url": "https://cdn.wireflow.ai/..." }]
}
}
]
}
}
Keep polling while status is RUNNING or PENDING. COMPLETED and FAILED are the normal endings, and CANCELLED and TIMEOUT can also appear. To skip polling, add a webhook block to the run request and Wireflow POSTs the result to your server (Webhooks). To list a workflow's input ids first, GET the same /run URL (Run Workflows).
How do I call a Wireflow workflow from Python and poll until it finishes?
Use the requests library: POST the input values to /api/v1/workflows/{id}/run, put https://www.wireflow.ai in front of the poll path it returns, and GET that URL every 2 seconds until status is COMPLETED, FAILED, CANCELLED or TIMEOUT.
import os
import time
import requests
HOST = "https://www.wireflow.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['WIREFLOW_API_KEY']}"}
# 1. Start the run
res = requests.post(
f"{HOST}/api/v1/workflows/YOUR_WORKFLOW_ID/run",
headers=HEADERS,
json={"inputs": {"node-prompt": "A cat wearing a top hat"}},
)
res.raise_for_status()
poll_url = HOST + res.json()["data"]["poll"]
# 2. Poll until the run ends
while True:
res = requests.get(poll_url, headers=HEADERS)
if res.status_code == 429:
time.sleep(int(res.headers.get("Retry-After", "5")))
continue
res.raise_for_status()
run = res.json()
if run["status"] in ("COMPLETED", "FAILED", "CANCELLED", "TIMEOUT"):
break
time.sleep(2)
if run["status"] != "COMPLETED":
raise RuntimeError(run.get("error") or run["status"])
print(run["result"]["nodeRuns"])
The key needs the workflows:execute and executions:read scopes, or Full access. For a wait that grows between polls, webhooks instead of polling, and saving the output files, see check when a run is finished and get the output files back.
Which endpoint to use
| You have | Call | Who pays |
|---|---|---|
| A workflow you own, saved in the editor | POST /workflows/{id}/run with input values |
The API key owner |
| A workflow you can edit, and the full graph in your request | POST /workflows/{id}/execute with nodes and edges |
The API key owner (a board in a team folder bills the team's credit pool) |
| A published app | POST /apps/{slug}/execute |
The API key owner, not the app creator |
| A community template with API execution turned on | POST /templates/{slugOrId}/execute |
You, never the template author |
| An AI agent | The MCP connector at https://www.wireflow.ai/api/mcp |
The connected account |
If the balance is too low, a run is refused with 402:
{
"error": "Insufficient credits. Required: 10, Available: 3",
"insufficientCredits": true,
"requiredCredits": 10,
"availableCredits": 3,
"breakdown": [
{ "nodeId": "node-1", "nodeLabel": "Text to Image", "credits": 10 }
]
}
Response shapes
All responses return JSON, but the envelope differs by route family. These are the shapes as they exist today; treat them as stable.
| Route family | Success shape |
|---|---|
List, create, update (for example GET /workflows, POST /workflows, PUT /workflows/{id}) |
{ "data": ..., "meta": {...} }. meta carries pagination, and on graph writes the lint warnings, migrations and diagnostics |
Get a workflow (GET /workflows/{id}), poll an execution (GET /workflows/executions/{id}/poll) |
The bare resource object, no envelope |
Catalogs (GET /nodes, GET /models) |
{ "version": 1, "count": N, "nodes": [...] } (or "models") |
Errors come in two shapes. Many routes return an error object with type, message and code:
{
"error": {
"type": "invalid_request_error",
"message": "Workflow not found",
"code": "not_found"
}
}
Others return a flat { "error": "message" }, sometimes with extra fields. Write your client against the shape of each route you call, not one assumed global envelope. See Errors.
Request IDs
Every response includes an X-Request-Id header. Include it when you contact support so the request can be traced quickly.
Rate Limits
Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers. When you go over a limit, the API returns 429 Too Many Requests. Wait the number of seconds in the Retry-After header, then retry with backoff.
Some routes have their own limits:
| Route | Limit |
|---|---|
POST /apps/{slug}/execute |
20 requests per minute per API key |
POST /templates/{slugOrId}/execute |
120 executions per hour per account and 100 per hour per template |
POST /media/upload-url |
10GB of upload URLs per account in a rolling hour |
POST and PUT /workflows |
1,500 edges and a 4 MB request body per workflow |
Retries and idempotency
A call that starts a run can return a 500 even though the run started. Before you retry, check GET /workflows/{id}/executions for that run. A retry of /execute always starts and bills a second run, because /execute does not deduplicate on an Idempotency-Key header. /run does: send the same Idempotency-Key on the retry and it replays the original run.
Discovery
- OpenAPI spec:
/openapi.json, OpenAPI 3.1 with every public operation. Also linked from/.well-known/api-catalog. - Node catalog:
GET /api/v1/nodes, no key needed. Every node with its ports, config keys, options, defaults and pricing. Use it to build graphs. - Model catalog:
GET /api/v1/models, no key needed. Every model with its credit cost. - MCP server card:
/.well-known/mcp/server-card.json
SDKs & Libraries
There is no official SDK. The Wireflow API is standard REST with Bearer-token auth and JSON bodies, so any HTTP client works: curl, fetch, axios, Python requests and so on. For AI agents, the MCP connector is the packaged client.
Resources
| Section | Description |
|---|---|
| Authentication | API keys, scopes and best practices |
| Run Workflows | Run a saved workflow by passing only its inputs |
| Run one model | Run one AI model through the API without building a workflow |
| Workflows | Create, list, update and delete workflows |
| Executions | Execute workflows and poll for results |
| Webhooks | Get a signed POST when a run finishes, instead of polling |
| Apps API | Call a published app with an API key; the caller pays |
| Media Uploads | Put a local file on the Wireflow CDN to use as an input |
| Nodes | The node catalog for building graphs |
| Rate Limits | Rate-limit headers and how to handle 429 |
| Errors | Error format, types and status codes |
| API troubleshooting | Why a request fails, with the cause, fix and check for each error |
| What changed, by date | Dated changes to the docs, the models and upload limits |
Next steps
- Authentication
Create API keys, configure scopes, and authenticate requests to the Wireflow API.
- Run a workflow from your app
To run an AI workflow from your app, send its inputs to POST /api/v1/workflows/{id}/run with your API key, poll the run, then download each output file.
- Polling or webhooks
Know when an AI image or video job is done: poll the run until a final status, or add a webhook to /run and get a signed POST when it ends.
- Errors
Error response format, error types, and HTTP status codes for the Wireflow API.
Related
- Run endpoint
Run any workflow you own as an API: send only its input values to POST /api/v1/workflows/{id}/run, then poll or get a webhook with the result.