API key events

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",
  "account": {
    "id": "47ed0d25-f9fb-4b35-b23a-d8895caf92b7",
    "ownerId": null
  },
  "accessToken": {
    "id": "175027c1-029c-41e5-8b9a-e289b9788c33",
    "name": "API Key Name",
    "enabled": false,
    "dateCreated": "2026-05-19 12:25:15",
    "disableReason": "MANUAL",
    "expirationDate": null,
    "projectedExpirationDateByLackOfUse": null
  }
}

Valores possíveis do disableReason:

ValorCenário
MANUALManual disabling via web panel or API
LACK_OF_USEAutomatic inactivity-related disabling (lifecycle)
🚧

  • With the addition of new products and features to Asaas, it's possible that new attributes will be included in the Webhook. It's very important that your code is prepared to avoid generating exceptions if Asaas returns new attributes not handled by your application, as this could cause interruptions in the synchronization queue.
    • We will send an email and notify you on our Discord server when new fields are added to the Webhook. The notification will be sent to the email address defined in the webhook settings.