TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation allows users to create multiple API keys in bulk via the Twenty API. It is useful when you need to programmatically generate several API keys at once, for example, when onboarding multiple applications or services that require individual authentication tokens. This can streamline workflows where managing many API keys manually would be cumbersome.

Practical examples include:

  • Automatically provisioning API keys for new users or clients.
  • Generating a batch of keys for different environments (development, staging, production).
  • Integrating with CI/CD pipelines that require temporary or rotating API keys.

Properties

Name Meaning
Depth Determines how much related nested information is included in the response:
- 0: Only the primary API key objects.
- 1: Primary objects plus their directly related objects.
- 2: Includes related objects of those related objects as well.
Body JSON object representing the API key(s) to create. Typically includes fields like name (the name of the API key) and expiresAt (expiration timestamp). The body must be valid JSON describing one or more API keys.

Output

The output contains a JSON field with the created API key objects. Depending on the depth parameter, this JSON may include nested related objects associated with each API key. The structure reflects the API's response, typically including details such as the key's ID, name, expiration date, and any related metadata.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the Twenty API service.
  • Needs an API authentication token or API key credential configured in n8n to authorize requests.
  • The node uses the base URL and headers set from the credentials, expecting JSON content type.

Troubleshooting

  • Invalid JSON in Body: If the JSON provided in the "Body" property is malformed, the request will fail. Ensure the JSON syntax is correct.
  • Authentication Errors: Missing or invalid API credentials will cause authorization failures. Verify that the API key credential is correctly set up.
  • Depth Parameter Misuse: Setting an unsupported depth value might result in unexpected responses or errors. Use only 0, 1, or 2 as specified.
  • API Limits or Quotas: Creating many API keys at once might hit rate limits imposed by the API provider. Check API documentation for limits and handle retries accordingly.

Links and References

Discussion