|
Download docs/api/pagination.md from Jeice/n8n-docs-v2: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/datasets/Jeice/n8n-docs-v2/resolve/main/docs/api/pagination.md
- Command line
-
hf download hf://datasets/Jeice/n8n-docs-v2/docs/api/pagination.md
-
curl -L -o pagination.md https://huggingface.co/datasets/Jeice/n8n-docs-v2/resolve/main/docs/api/pagination.md
1.66 kB
| #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4 | |
| description: Pagination in n8n's public REST API. | |
| contentType: howto | |
| # API pagination | |
| The default page size is 100 results. You can change the page size limit. The maximum permitted size is 250. | |
| When a response contains more than one page, it includes a cursor, which you can use to request the next pages. | |
| For example, say you want to get all active workflows, 150 at a time. | |
| Get the first page: | |
| ```shell | |
| # For a self-hosted n8n instance | |
| curl -X 'GET' \ | |
| '<N8N_HOST>:<N8N_PORT>/<N8N_PATH>/api/v<version-number>/workflows?active=true&limit=150' \ | |
| -H 'accept: application/json' \ | |
| -H 'X-N8N-API-KEY: <your-api-key>' | |
| # For n8n Cloud | |
| curl -X 'GET' \ | |
| '<your-cloud-instance>/api/v<version-number>/workflows?active=true&limit=150' \ | |
| -H 'accept: application/json' \ | |
| -H 'X-N8N-API-KEY: <your-api-key>' | |
| ``` | |
| The response is in JSON format, and includes a `nextCursor` value. This is an example response. | |
| ```js | |
| { | |
| "data": [ | |
| // The response contains an object for each workflow | |
| { | |
| // Workflow data | |
| } | |
| ], | |
| "nextCursor": "MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA" | |
| } | |
| ``` | |
| Then to request the next page: | |
| ```bash | |
| # For a self-hosted n8n instance | |
| curl -X 'GET' \ | |
| '<N8N_HOST>:<N8N_PORT>/<N8N_PATH>/api/v<version-number>/workflows?active=true&limit=150&cursor=MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA' \ | |
| -H 'accept: application/json' | |
| # For n8n Cloud | |
| curl -X 'GET' \ | |
| '<your-cloud-instance>/api/v<version-number>/workflows?active=true&limit=150&cursor=MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA' \ | |
| -H 'accept: application/json' | |
| ``` | |