Actions26
Overview
The "Cleanup" operation under the "Messages" resource allows users to delete messages that are older than a specified number of days within a given project. This is useful for maintaining data hygiene, managing storage, and ensuring compliance with data retention policies by automatically removing outdated message records.
Practical examples include:
- Automatically deleting chat or notification messages older than 30 days in a messaging project.
- Cleaning up logs or message history in projects where message data is only relevant for a limited time.
- Managing storage costs by removing old messages in projects with high message volume.
Properties
| Name | Meaning |
|---|---|
Delete messages older than this many days (daysBefore) |
The threshold in days; messages older than this value will be deleted. This is a required numeric input. |
Project Slug (projectSlug) |
Identifier of the project where the cleanup operation will be performed. This is a required string input. |
Output
The node outputs JSON data representing the result of the cleanup operation. Typically, this would include information such as the number of messages deleted or a status confirmation from the API.
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential for authentication with the GateKit API.
- The node makes an HTTP DELETE request to the endpoint
/api/v1/projects/{projectSlug}/messages/cleanupwith a query parameter specifying thedaysBeforevalue. - The
projectSlugmust correspond to an existing project in the GateKit system.
Troubleshooting
Common issues:
- Providing an invalid or non-existent
projectSlugwill likely result in an error indicating the project was not found. - Omitting the
daysBeforeparameter or providing a non-numeric value may cause validation errors. - Insufficient permissions or invalid API credentials can cause authorization errors.
- Providing an invalid or non-existent
Error messages and resolutions:
- "Project not found": Verify that the
projectSlugis correct and that the project exists. - "Invalid parameter 'daysBefore'": Ensure that
daysBeforeis provided and is a valid number. - "Unauthorized" or "Authentication failed": Check that the API key credential is correctly configured and has necessary permissions.
- "Project not found": Verify that the
Links and References
- GateKit API Documentation (general reference for API endpoints and usage)
- n8n documentation on HTTP Request Node (for understanding how routing and requests work)