Skip to main content

Introduction

n8n provides a comprehensive REST API that allows you to programmatically manage workflows, executions, credentials, and other resources. The API is designed to be intuitive and follows RESTful principles.

Base URL

The API is accessible at your n8n instance URL:

API Versions

n8n currently supports:
  • Public API (v1): /api/v1/* - Designed for external integrations
  • Internal API: Used by the n8n frontend application
This documentation focuses on the Public API endpoints that are stable and recommended for external use.

Core Resources

The n8n API provides access to these core resources:

Workflows

Create, read, update, and delete workflows. Activate and deactivate workflow automation.
Learn more about Workflows API →

Executions

Monitor workflow executions, check their status, and manage running workflows.
Learn more about Executions API →

Credentials

Manage credentials used by workflow nodes for authentication.
Learn more about Credentials API →

API Features

Pagination

List endpoints support cursor-based pagination:
Use the nextCursor value in subsequent requests:

Filtering

Many endpoints support filtering by various parameters:

Response Format

All API responses use JSON format:

Error Handling

The API uses standard HTTP status codes:

Error Response Format

Rate Limiting

n8n implements rate limiting to ensure fair usage:
  • IP-based limits: 1000 requests per 5 minutes
  • Key-based limits: Varies by endpoint and operation
Exceeding rate limits returns a 429 Too Many Requests status code.

Scopes and Permissions

API keys can have specific scopes that control access:
  • workflow:read - Read workflow data
  • workflow:create - Create new workflows
  • workflow:update - Update existing workflows
  • workflow:delete - Delete workflows
  • workflow:execute - Execute workflows
  • credential:read - Read credentials
  • credential:create - Create credentials
  • credential:update - Update credentials
  • credential:delete - Delete credentials
  • execution:read - Read execution data
  • execution:list - List executions
Learn more about API Authentication →

Getting Started

1

Generate an API Key

Navigate to Settings → API in your n8n instance and create a new API key with the required scopes.
2

Make Your First Request

Use the API key to authenticate your requests:
3

Explore the API

Browse the documentation for specific endpoints and try different operations.

Best Practices

Only grant the minimum required scopes to your API keys. This follows the principle of least privilege and enhances security.
Always check HTTP status codes and handle errors appropriately in your application.
For transient errors (5xx), implement exponential backoff retry logic.
Cache workflow and credential data when appropriate to reduce API calls.
For real-time updates, consider using n8n’s webhook functionality instead of polling.

Next Steps

Authentication

Learn how to authenticate API requests

Workflows

Manage workflows via API

Executions

Monitor and control workflow executions

Credentials

Manage credentials programmatically