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 designed to be flexible and can be used to create, retrieve, update, delete, or list records from an API endpoint by specifying the resource name and operation type.

For the Delete operation specifically, the node deletes a record identified by its ID from the given resource. This is useful in scenarios where you need to remove data entries programmatically, such as deleting a user account, removing a product from inventory, or clearing outdated records.

Practical example:
You have an API managing customer data under the resource "customers". Using this node with the Delete operation, you can delete a customer by providing their unique ID, automating cleanup tasks or integrating deletion into larger workflows.

Properties

Name Meaning
ID The unique identifier of the record to delete.
Opções Adicionais Additional options for the request:
- Headers Customizados Custom HTTP headers to include in the request (JSON format).
- Query Parameters Additional 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 an error occurs during this operation (boolean).

Output

The output is a JSON object representing the response from the API after attempting to delete the specified record. If the API returns an array, each element is output as a separate item; otherwise, the single JSON response is output.

If the operation fails and the option to continue on error is enabled, the output will contain an error object with the error message and details.

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 API being accessible and supporting standard RESTful DELETE operations on the specified resource.
  • Uses a helper class internally to make HTTP requests with support for custom headers, query parameters, and timeouts.

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 issues or incorrect API credentials will cause authentication or connection failures.
    • API rate limits or permission restrictions might block deletion requests.
  • Error messages:

    • "Operation unknown": Indicates an unsupported operation was selected; ensure "delete" is chosen.
    • API error responses are passed through; check the error message and details in the output.
    • Timeout errors if the API does not respond within the specified timeout period.
  • Resolutions:

    • Verify the ID and resource names are correct and exist in the API.
    • Check API credentials and permissions.
    • Adjust timeout settings if necessary.
    • Enable "Continuar Em Erro" to allow workflow continuation despite errors and handle them downstream.

Links and References

Discussion