TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation allows you to create a single attachment in the system. It is useful when you want to programmatically add files or references to notes, tasks, opportunities, companies, or persons within your workflow. For example, you might use this node to upload a document related to a task or attach an image to a note automatically as part of a larger automation process.

Properties

Name Meaning
Depth Determines how much nested related object information to include in the response: 0 (only primary object), 1 (primary + directly related objects), or 2 (primary + directly related + their related objects).
Note Id The identifier of the note to which the attachment will be linked.
Task Id The identifier of the task to which the attachment will be linked.
Author Id The identifier of the author who created the attachment.
Name The name of the attachment.
Type The type/category of the attachment (e.g., file type or custom classification).
Full Path The full path or location reference of the attachment file.
Opportunity Id The identifier of the opportunity to which the attachment will be linked.
Company Id The identifier of the company to which the attachment will be linked.
Person Id The identifier of the person to which the attachment will be linked.

Output

The output JSON contains the details of the newly created attachment object. Depending on the Depth parameter, it may include nested related objects up to two levels deep. This typically includes metadata such as attachment ID, name, type, associated entities (note, task, etc.), author information, and file path details.

If binary data is involved (e.g., actual file content), it would be represented separately in the binary output field, but this node primarily handles metadata and references rather than raw binary uploads.

Dependencies

  • Requires an API key credential for authenticating with the external Twenty API service.
  • The node uses the Twenty API base URL configured via credentials.
  • No additional environment variables are explicitly required beyond standard API authentication setup.

Troubleshooting

  • Missing Required IDs: If you do not provide at least one of the entity IDs (noteId, taskId, opportunityId, companyId, personId), the attachment may fail to link properly. Ensure you specify the correct target entity.
  • Invalid Depth Value: Using a depth value outside 0, 1, or 2 may cause unexpected responses or errors.
  • Authentication Errors: Verify that the API key credential is correctly configured and has sufficient permissions.
  • Attachment Metadata Issues: Ensure that fields like name, type, and fullPath are correctly formatted and valid according to the API's expectations.

Common error messages usually relate to invalid parameters or authentication failures. Checking the input properties and credential configuration typically resolves these issues.

Links and References

Discussion