TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation updates a single attachment object in the connected service. It allows modifying various fields of an existing attachment by specifying its unique identifier. This is useful when you need to correct or enhance metadata related to attachments such as files linked to notes, tasks, companies, or other entities.

Common scenarios include:

  • Updating the name or type of an attachment after it has been uploaded.
  • Changing the association of an attachment from one note or task to another.
  • Modifying the file path or author information for better organization or tracking.

For example, if you have an attachment linked to a task but realize it should be linked to a different note, you can update the noteId and taskId fields accordingly.

Properties

Name Meaning
Id The unique identifier of the attachment object to update (required).
Depth Level of nested related objects to include in the response: 0 (primary only), 1 (directly related), 2 (two levels deep).
Note Id Identifier of the note associated with the attachment.
Task Id Identifier of the task associated with the attachment.
Author Id Identifier of the author who created the attachment.
Name The name of the attachment.
Type The type/category of the attachment.
Full Path The full file path of the attachment.
Opportunity Id Identifier of the opportunity associated with the attachment.
Company Id Identifier of the company associated with the attachment.
Person Id Identifier of the person associated with the attachment.

Output

The output JSON contains the updated attachment object reflecting all changes made during the update operation. The structure includes all standard fields of an attachment such as its id, name, type, associations (note, task, company, etc.), author, and file path.

If the node supports binary data for attachments, it would typically represent the actual file content or metadata about the file, but this operation focuses on updating metadata rather than handling binary content directly.

Dependencies

  • Requires an API key credential or similar authentication token configured in n8n to access the external service's API.
  • The base URL and headers are set according to the credentials provided.
  • The node depends on the external service's API supporting update operations for attachments.

Troubleshooting

  • Missing or invalid Id: The update operation requires a valid attachment ID. Ensure the ID is correctly specified; otherwise, the API will return an error indicating the resource was not found.
  • Authentication errors: If the API key or token is missing or invalid, the request will fail with an authentication error. Verify that credentials are properly configured.
  • Invalid field values: Providing incorrect types or invalid references (e.g., non-existent noteId or taskId) may cause the API to reject the update. Double-check IDs and field formats.
  • Depth parameter misuse: Setting an unsupported depth value might lead to unexpected responses or errors. Use only 0, 1, or 2 as defined.
  • Network issues: Connectivity problems can cause timeouts or failed requests. Check network settings and API availability.

Links and References

  • Refer to the external service’s API documentation for detailed information on attachment objects and update operations.
  • Consult n8n documentation on how to configure API credentials and use HTTP request nodes for custom integrations.

Discussion