GateKit icon

GateKit

Universal messaging gateway - send messages across multiple platforms

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/cleanup with a query parameter specifying the daysBefore value.
  • The projectSlug must correspond to an existing project in the GateKit system.

Troubleshooting

  • Common issues:

    • Providing an invalid or non-existent projectSlug will likely result in an error indicating the project was not found.
    • Omitting the daysBefore parameter or providing a non-numeric value may cause validation errors.
    • Insufficient permissions or invalid API credentials can cause authorization errors.
  • Error messages and resolutions:

    • "Project not found": Verify that the projectSlug is correct and that the project exists.
    • "Invalid parameter 'daysBefore'": Ensure that daysBefore is provided and is a valid number.
    • "Unauthorized" or "Authentication failed": Check that the API key credential is correctly configured and has necessary permissions.

Links and References

Discussion