Overview
This node provides a generic interface to interact with REST APIs by performing common CRUD operations on any specified resource. It is useful when you want to integrate with an API that does not have a dedicated n8n node or when you need a flexible way to create, retrieve, update, or delete records dynamically.
Typical use cases include:
- Creating new records in an external system by sending JSON data.
- Retrieving single or multiple records from an API.
- Updating existing records by specifying their ID and update data.
- Deleting records by ID.
- Adding custom HTTP headers or query parameters for advanced API requests.
For example, you can use this node to create a new user in a CRM system by specifying the "users" resource and providing the user data as JSON.
Properties
| Name | Meaning |
|---|---|
| Dados | JSON data used to create a new record (required for create operation). |
| Opções Adicionais | Additional options including: |
| - Headers Customizados | Custom HTTP headers to send with the request (JSON object). |
| - Query Parameters | Query parameters to add to the URL (JSON object). |
| - Timeout | Request timeout in milliseconds (default 30000 ms). |
| - Continuar Em Erro | Whether to continue workflow execution if an error occurs (boolean). |
Note: The properties above are shown specifically for the "Criar" (create) operation under the "Default" resource.
Output
The node outputs an array of items where each item contains a json field holding the response data from the API call.
- For the create operation, the output JSON corresponds to the newly created record returned by the API.
- If the API returns multiple records (in other operations), each record is output as a separate item.
- 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 exception.
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 endpoint.
- The node expects the base URL and authentication details to be set up in the credentials.
Troubleshooting
Common issues:
- Invalid JSON in the "Dados" property will cause parsing errors.
- Incorrect resource name or operation may lead to API errors or unexpected responses.
- Network timeouts if the API server is slow or unreachable.
- Missing or invalid API credentials will result in authentication failures.
Error messages:
"Operação desconhecida: <operation>": Means the specified operation is not supported; verify the operation name.- Errors from the API will be included in the output if "Continuar Em Erro" is enabled; otherwise, they will stop execution.
Resolutions:
- Ensure JSON inputs are valid.
- Double-check resource and operation names.
- Verify API credentials and network connectivity.
- Adjust timeout settings if necessary.