Actions52
- ApiKeys Actions
- Auth Actions
- Identities Actions
- Members Actions
- Messages Actions
- Platform Logs Actions
- Platforms Actions
- Projects Actions
- Webhooks Actions
Overview
The "Messages Cleanup" operation in this node allows users to delete messages older than a specified number of days within a given project. This is useful for maintaining data hygiene, managing storage limits, or complying with data retention policies by automatically removing outdated message records.
Practical examples include:
- Automatically cleaning up chat history older than 30 days in a messaging project.
- Removing old notification logs to free up space in a project that handles high message volumes.
- Periodic maintenance tasks to ensure compliance with privacy regulations by deleting old messages.
Properties
| Name | Meaning |
|---|---|
Delete messages older than this many days (daysBefore) |
Number of days; messages older than this will be deleted. Required. |
Project (project) |
Identifier of the project where the cleanup operation will be performed. Required. |
Output
The output JSON will typically contain the response from the API indicating the result of the cleanup operation. This may include information such as the number of messages deleted or a success confirmation. The exact structure depends on the API's response but generally confirms the cleanup action.
This node does not output binary data.
Dependencies
- Requires an API key credential for authentication to the messaging platform's API.
- Needs the base URL of the API configured in the credentials.
- The node sends a DELETE HTTP request to the endpoint
/api/v1/projects/{project}/messages/cleanupwith a query parameter specifying the age threshold (daysBefore).
Troubleshooting
Common issues:
- Providing an invalid or missing project identifier will cause the API call to fail.
- Specifying a non-numeric or negative value for
daysBeforemay result in errors or no action. - Insufficient permissions associated with the API key can prevent deletion.
Error messages and resolutions:
- Unauthorized / Authentication failed: Check that the API key credential is correctly set and has necessary permissions.
- Invalid parameter: Verify that
daysBeforeis a positive number andprojectis correctly specified. - Resource not found: Confirm that the project exists and the project ID is correct.
Links and References
- Refer to the messaging platform's official API documentation for details on the message cleanup endpoint.
- n8n documentation on how to configure API key credentials and use HTTP request nodes for similar operations.