TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation updates a single API key object in the connected service. It allows users to modify properties such as the API key's name, expiration date, and revocation date by specifying the unique identifier of the API key to update. This is useful for managing API keys dynamically, for example, to extend their validity, revoke access, or rename keys for better organization.

Practical examples include:

  • Revoking an API key that is no longer needed or compromised.
  • Extending the expiration date of an API key for continued access.
  • Renaming an API key to reflect new usage or ownership.

Properties

Name Meaning
Id The unique identifier of the API key object to update.
Depth Level of nested related objects to include in the response: 0 (primary only), 1 (primary + direct), 2 (primary + direct + nested).
Revoked At The date when the API key was revoked, effectively disabling it from that time onward.
Expires At The expiration date of the API key, after which it will no longer be valid.
Name The name assigned to the API key, used for identification or organizational purposes.

Output

The output JSON contains the updated API key object reflecting the changes made. Depending on the depth parameter, the response may include related nested objects up to two levels deep. The structure typically includes fields like the API key's id, name, expiration and revocation dates, and potentially related entities depending on depth.

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential or similar authentication token configured in n8n to authorize requests to the external service.
  • The node uses a base URL and headers preset for JSON communication with the Twenty API.
  • The operation depends on the external Twenty API being available and accessible.

Troubleshooting

  • Invalid Id: If the provided API key ID does not exist, the node will likely return an error indicating the resource was not found. Verify the ID is correct.
  • Authentication Errors: Missing or invalid API credentials will cause authorization failures. Ensure the API key credential is properly set up.
  • Date Format Issues: The revokedAt and expiresAt fields expect string dates. Incorrect formats may cause validation errors. Use ISO 8601 date strings.
  • Depth Parameter Misuse: Setting an unsupported depth value might result in unexpected responses or errors. Use only 0, 1, or 2 as specified.

Links and References

Discussion