OpenWA icon

OpenWA

Interact with OpenWA WhatsApp API Gateway

Actions164

API Key → Create

AI-generated

Summary

Create a new API key with a required friendly name and optional restrictions such as allowed chats, IPs, sessions, expiration time, and access role. The operation requires an admin key credential. Restrictions with no value are refused rather than dropped to prevent creating broader keys accidentally.

Inputs

  • Name (required) — A friendly name for the new API key, used to identify it.
  • Fields — Optional restrictions applied to the API key that limit its usage, including Allowed Chats (restrict to specific chat IDs, groups as ...@g.us, contacts as ...@c.us, or bare phone numbers; accepts comma-separated list, JSON array, or expression resolving to an array), Allowed IPs (restrict to certain IP addresses), Allowed Sessions (restrict to session UUIDs, not session names, as a comma-separated list, JSON array, or expression), Expires At (dateTime when the key expires), and Role (permission level granted: Admin, Operator, or Viewer). Empty fields or unresolved expressions are refused with detailed error messages to prevent silent misconfiguration.

Output shape

a single record containing the new API key's plaintext token, which is returned exactly once upon creation

The API key's plaintext value is returned only once upon creation; it cannot be retrieved later. It is essential to capture and store this key during workflow execution to use it subsequently. The operation requires that the credential used to perform it is itself an admin key, or it will be rejected.

Links

Discussion