Aigency icon

Aigency

Interact with Aigency API

Overview

This node interacts with the Aigency API to perform various user-related operations, including managing messages, subscriptions, capabilities, and retrieving user data. The "Delete Last Messages" operation specifically deletes a specified number of the most recent messages for a given user session.

Common scenarios where this node is beneficial include:

  • Cleaning up recent chat or message history in an application.
  • Managing user sessions by removing outdated or unwanted messages.
  • Automating message lifecycle management in conversational AI or messaging platforms.

For example, you might use the "Delete Last Messages" operation to remove the last 50 messages from a user's current session to reset the conversation context.

Properties

Name Meaning
User ID Numeric identifier of the user whose messages are being managed or queried.
Limit Maximum number of messages to delete (or retrieve) in the operation. Must be at least 1.
Session ID Identifier of the user session from which messages will be deleted or retrieved.

Output

The output is a JSON object containing the result of the API call. For the "Delete Last Messages" operation, the json field typically contains confirmation details about the deletion, such as the number of messages deleted or a success status.

If an error occurs during the operation, the output JSON will contain an error field describing the issue.

The node does not output binary data.

Dependencies

  • Requires access to the Aigency API endpoint.
  • Needs an API key credential and API URL configured either via n8n credentials or environment variables (AIGENCY_API_KEY and AIGENCY_API_URL).
  • The node uses HTTP POST requests with JSON-RPC 2.0 protocol to communicate with the API.

Troubleshooting

  • Missing Credentials: If the API key or URL is not set, the node throws an error instructing to configure these either in the n8n UI or environment variables.
  • API Errors: If the API returns an error (e.g., invalid user ID, session ID not found), the node outputs the error message. Enabling "Continue On Fail" allows processing subsequent items despite errors.
  • Invalid Limits: Setting the limit below 1 may cause validation issues; ensure the limit is at least 1.
  • Network Issues: Connection failures to the API endpoint will result in errors; verify network connectivity and API availability.

Links and References

Discussion