TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation creates a new association between a message and a message channel within a messaging system. It is useful for linking messages to specific channels, threads, or external identifiers from messaging providers. This can help organize messages contextually, track message flow direction (incoming or outgoing), and maintain relationships between messages and their channels or threads.

Practical examples include:

  • Associating an incoming customer support message with the correct support channel.
  • Linking outgoing notifications to their respective message channels for tracking.
  • Creating references between messages and threads using external IDs from third-party messaging platforms.

Properties

Name Meaning
Depth Determines how much related nested data to include in the response: 0 = only primary object; 1 = primary plus directly related objects; 2 = primary plus related objects and their related objects.
Message External Id The identifier of the message as provided by the external messaging provider.
Message Channel Id The internal identifier of the message channel to associate the message with.
Message Id The internal identifier of the message to be associated.
Direction The direction of the message relative to the channel: either "INCOMING" or "OUTGOING".
Message Thread External Id The identifier of the message thread from the external messaging provider, used to associate the message with a specific thread.

Output

The node outputs JSON data representing the newly created message-channel-message association object. The structure includes the primary association details and, depending on the Depth property, may include nested related objects such as linked messages, channels, or threads.

If binary data were involved (not indicated here), it would typically represent attachments or media related to the message, but this node focuses on JSON metadata associations only.

Dependencies

  • Requires an API key credential to authenticate requests to the Twenty API service.
  • The node uses the Twenty API base URL configured via credentials.
  • No additional external dependencies are indicated beyond the Twenty API.

Troubleshooting

  • Common issues:

    • Missing or invalid API authentication token will cause authorization errors.
    • Providing incorrect or non-existent message or channel IDs will result in not found or validation errors.
    • Incorrect Depth values outside the allowed range (0, 1, 2) may cause unexpected responses or errors.
  • Error messages:

    • Authorization errors: Ensure the API key credential is correctly set up and has necessary permissions.
    • Validation errors: Check that all required fields (e.g., messageId, messageChannelId) are provided and valid.
    • Not found errors: Verify that referenced messages, channels, or threads exist in the system.

Links and References

Discussion