TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation allows you to create a new connected account within the system. It is useful for integrating external messaging or social media providers by linking their accounts through access tokens and other authentication details. Typical use cases include setting up user accounts from various providers, managing authentication tokens, and syncing account data.

For example, you might use this node to connect a user's Twitter or Facebook account by providing the provider name, access token, and handle (username or email). This enables further automation workflows that interact with these connected accounts.

Properties

Name Meaning
Depth Determines how much related nested data to include in the response: 0 returns only the primary object; 1 includes directly related objects; 2 includes related objects of those related objects.
Handle The account handle such as an email, username, or phone number identifying the connected account.
Provider The name of the account provider (e.g., Twitter, Facebook, Slack).
Access Token The access token used to authenticate with the messaging or social provider.
Refresh Token The refresh token used to renew the access token when it expires.
Last Sync History Id Identifier for the last synchronization event, useful for incremental syncs.
Auth Failed At Timestamp or indicator of when authentication last failed for this account.
Handle Aliases Alternative handles or aliases associated with the account.
Scopes JSON array defining the scopes or permissions granted to the connected account.
Account Owner Id Identifier of the owner of the connected account, typically a user ID in your system.

Output

The node outputs a JSON object representing the newly created connected account. This includes all the properties sent during creation plus any additional metadata returned by the API, such as unique IDs, timestamps, and nested related objects depending on the Depth parameter.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential to authenticate requests to the external service.
  • The base URL and headers are configured via credentials and environment variables.
  • The node uses an OpenAPI specification internally to build request properties and handle routing.

Troubleshooting

  • Invalid or expired access token: If the access token is invalid or expired, the API will reject the creation request. Ensure tokens are current and refresh tokens are used properly.
  • Missing required fields: The provider and handle fields are essential. Omitting them will cause errors.
  • Incorrect JSON format for scopes: The scopes property expects valid JSON. Malformed JSON will cause parsing errors.
  • Authentication failures: The authFailedAt field can help diagnose when authentication issues occurred.
  • API rate limits or connectivity issues: Network problems or hitting API limits may cause failures; check API status and credentials.

Links and References

  • Refer to the external service’s API documentation for details on required fields and authentication.
  • Use JSON validators to ensure the Scopes input is correctly formatted.
  • Consult n8n documentation on how to configure API credentials and environment variables.

Discussion