Generic API icon

Generic API

Node genérico para integração com APIs REST

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 flexible, custom API calls without writing code.

For the Delete operation specifically, the node deletes a record identified by its ID from the chosen resource. This is beneficial in scenarios such as removing outdated entries, cleaning up data, or automating deletion workflows in external systems.

Example use case:
You have a CRM system exposing a REST API and want to automatically delete contacts marked as inactive. Using this node, you specify the "contacts" resource and the "delete" operation, provide the contact ID, and the node will send the appropriate DELETE request to remove the contact.

Properties

Name Meaning
ID The unique identifier of the record to delete.
Opções Adicionais Additional options for the HTTP request:
- Headers Customizados Custom HTTP headers to include in the request (JSON format).
- Query Parameters Extra query parameters to append to the URL (JSON format).
- Timeout Request timeout in milliseconds (default 30000 ms).
- Continuar Em Erro Whether to continue workflow execution if this node encounters an error (boolean).

Output

The node outputs JSON data representing the response from the API after attempting to delete the record. Typically, this might be a confirmation message, status object, or empty response depending on the API's design.

If multiple items are processed, each output item corresponds to one input item, paired accordingly.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests.
  • Depends on the external REST API being accessible and supporting standard HTTP methods.
  • Uses a helper class internally to construct and send HTTP requests with customizable headers, query parameters, and timeout settings.

Troubleshooting

  • Common issues:

    • Invalid or missing ID parameter will cause the API to reject the request.
    • Incorrect resource name or endpoint path may result in 404 Not Found errors.
    • Network timeouts if the API server is slow or unreachable.
    • Authentication failures if the API key credential is invalid or expired.
  • Error messages:

    • "Operation unknown: delete" — indicates an unsupported operation was selected; ensure "delete" is chosen.
    • API error responses are passed through; check the error field in the output JSON if continueOnFail is enabled.
    • Timeout errors can be resolved by increasing the timeout value in additional options.
  • To handle errors gracefully, enable the "Continuar Em Erro" option to allow the workflow to continue even if deletion fails for some items.

Links and References

Discussion