API key events

Receive notifications to monitor all actions and state changes that occur on your API keys, increasing the security and operational visibility of your account

With these events, you can be notified in real-time if a key is created, enabled, disabled, or deleted, even if the action is performed directly through the web interface. This is especially useful for parent accounts that manage sub-accounts and need to ensure the integrity of their integrations.

The events that Asaas notifies are:

  • ACCESS_TOKEN_CREATED - A new API key has been generated.
  • ACCESS_TOKEN_ENABLED - A disabled API key has been re-enabled.
  • ACCESS_TOKEN_DISABLED - An API key has been disabled, either manually or by our automatic lifecycle.
  • ACCESS_TOKEN_DELETED - An API key has been permanently deleted.
  • ACCESS_TOKEN_EXPIRING_SOON - An API key will expire soon due to inactivity. This event is not triggered for keys with a manually set expiration date.
  • ACCESS_TOKEN_EXPIRED - An API key has been permanently expired due to inactivity or due to manual configuration.

Example JSON to be received [POST]

The notification consists of a POST containing a JSON, as in this example:

{
  "id": "evt_6561b631fa5580caadd00bbe3b858607&9193",
  "event": "ACCESS_TOKEN_CREATED",
  "dateCreated": "2024-10-16 11:11:04",
  "accessToken": {
    "id": "175027c1-029c-41e5-8b9a-e289b9788c33",
    "name": "API Key Name",
    "expirationDate": "2024-06-12"
  }
}