Overview
This node provides a generic interface to interact with REST APIs by allowing users to specify the resource and operation they want to perform. It supports common CRUD operations such as creating, retrieving (single or multiple), updating, and deleting records on any API resource. This flexibility makes it useful for integrating with APIs that do not have dedicated n8n nodes or for quickly prototyping API interactions.
A typical use case is when you want to fetch multiple records from an API endpoint, optionally limiting the number of results or fetching all available data. For example, you could retrieve all users from a user management API or get a limited set of products from an e-commerce API.
Properties
| Name | Meaning |
|---|---|
| Retornar Todos | Whether to return all results or only up to a given limit. |
| Limite | Maximum number of results to return if not returning all. |
| Opções Adicionais | Additional options including: |
| - Headers Customizados | Custom HTTP headers to send with the request. |
| - Query Parameters | Additional query parameters to add to the URL. |
| - Timeout | Request timeout in milliseconds. |
| - Continuar Em Erro | Whether to continue workflow execution on error instead of stopping. |
Output
The node outputs JSON data representing the response from the API call:
- For "Get Many" operation, the output is an array of JSON objects, each corresponding to one record retrieved from the API.
- Each item in the output is paired with the input item index it originated from.
- If the API returns a single object, it is output as a single JSON object.
- In case of errors and if "Continuar Em Erro" is enabled, the output will contain an error object with message and details instead of throwing an error.
The node does not output binary data.
Dependencies
- Requires an API key credential configured in n8n to authenticate requests.
- Uses a helper class internally to make HTTP requests to the specified API endpoints.
- No external libraries beyond those bundled with n8n are required.
Troubleshooting
Common issues:
- Incorrect resource or operation names may cause unknown operation errors.
- Malformed JSON in input fields like "Dados" or "Query Parameters" can cause parsing errors.
- API timeouts if the "Timeout" value is too low or network issues occur.
- Permission errors if the API key lacks rights for the requested operation.
Error messages:
"Operação desconhecida: <operation>"indicates an unsupported operation was selected.- JSON parsing errors usually indicate invalid JSON input in properties like "Dados" or "Query Parameters".
- Network or authentication errors will be returned from the API and included in the error details if "Continuar Em Erro" is enabled.
To resolve errors:
- Verify the resource and operation names are correct.
- Ensure JSON inputs are valid.
- Check API credentials and permissions.
- Adjust timeout settings if necessary.