Public REST API
The API is not available during the Cloud free trial. Self-hosted instances have it from the start.
Create an API key#
- Log in to n8n.
- Go to Settings > n8n API.
- Select Create an API key.
- Set a Label and an Expiration.
- On Enterprise, choose the Scopes the key is allowed to use.
- Copy the key. It is shown once.
Authenticate#
Send the key in the X-N8N-API-KEY header on every request:
curl -X GET \
'https://<your-instance>/api/v1/workflows?active=true' \
-H 'accept: application/json' \
-H 'X-N8N-API-KEY: <your-api-key>'Self-hosted instances use <N8N_HOST>:<N8N_PORT>/<N8N_PATH>/api/v1/.... Cloud instances use your instance URL.
/api/v1/workflowsList workflows on the instance. Use this to find a workflow's ID before acting on it.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
Return only active or only inactive workflows
Comma-separated tag names to filter by
Results per page, up to 250
Cursor from a previous response, for the next page
curl -X GET \
'https://<your-instance>/api/v1/workflows?active=true&limit=50' \
-H 'accept: application/json' \
-H 'X-N8N-API-KEY: <your-api-key>'/api/v1/executionsList executions, newest first. This is how you monitor runs from outside n8n.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
Filter by error, success, or waiting
Only executions of this workflow
Include the data that passed through each node
Results per page, up to 250
curl -X GET \
'https://<your-instance>/api/v1/executions?status=error&limit=20' \
-H 'accept: application/json' \
-H 'X-N8N-API-KEY: <your-api-key>'/api/v1/workflows/{id}/activateActivate a workflow so its trigger starts firing. The inverse is /deactivate.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
The workflow ID
curl -X POST \
'https://<your-instance>/api/v1/workflows/1234/activate' \
-H 'accept: application/json' \
-H 'X-N8N-API-KEY: <your-api-key>'Pagination#
List endpoints are cursor-paginated. A response containing nextCursor has more results; pass it as cursor on the following request. When nextCursor is absent, you have reached the end.
Do not build pagination on offsets — executions are being written while you page, and an offset walk will skip records.
Errors#
| Status | Meaning |
|---|---|
401 |
Missing, invalid, or expired API key |
403 |
The key lacks the scope for this operation |
404 |
No such workflow or execution |
Related#
- Security and credentials — key scoping and rotation
- Handle errors — reacting to failed executions