API Key Permission Management

Define which resources and actions each API key can access.

Using only the necessary permissions reduces the impact if a credential is compromised.

📘

By the end of this guide, you will know how to configure permissions when creating or updating an API key.

How permissions work

When creating or editing a key through the web interface, or through the API in the case of subaccounts, define the permissions array.

Each item contains:

FieldDescriptionExample
nameResource that can be accessedPAYMENT, TRANSFER
scopeAllowed access levelREAD, READ_WRITE

The available scopes are:

ScopeAccess
READAllows read operations, such as GET
READ_WRITEAllows read and write operations, such as POST, PUT, and DELETE
⚠️

Define permissions explicitly

If accessTokenConfig or permissions are not sent, the key will be created with all permissions in the READ_WRITE scope.

We recommend applying the principle of least privilege and granting only the resources your integration needs.

Defining permissions may become mandatory in future updates.

Create a key with permissions

When you create a subaccount, send the accessTokenConfig object.

Endpoint

POST /v3/accounts

Request example

{
  "name": "Integrated Subaccount",
  "email": "[email protected]",
  "cpfCnpj": "12345678000199",
  "...": "...",
  "accessTokenConfig": {
    "name": "Financial Integration Key",
    "permissions": [
      {
        "name": "PAYMENT",
        "scope": "READ_WRITE"
      },
      {
        "name": "TRANSFER",
        "scope": "READ"
      },
      {
        "name": "WEBHOOK",
        "scope": "READ_WRITE"
      }
    ]
  }
}

In this example, the key will be able to:

  • view and manage charges;
  • view transfers, without creating or changing them;
  • view and manage Webhooks.

Response example

{
  "object": "account",
  "id": "8de2fa50-589e-4a95-a545-e6bd6e1ed71a",
  "...": "...",
  "accessToken": {
    "id": "3e9d4210-4948-4829-a0f0-c06b69ce2fa3",
    "name": "Financial Integration Key",
    "enabled": true,
    "expirationDate": null,
    "dateCreated": "2026-01-14 09:51:37",
    "permissions": [
      {
        "name": "PAYMENT",
        "scope": "READ_WRITE"
      },
      {
        "name": "TRANSFER",
        "scope": "READ"
      },
      {
        "name": "WEBHOOK",
        "scope": "READ_WRITE"
      }
    ],
    "projectedExpirationDateByLackOfUse": null,
    "apiKey": "$aact_hmlg_....l"
  }
}

Check the accessToken.permissions object to confirm the permissions assigned to the key.


Update an existing key

You can also change the permissions of existing subaccount API keys.

See Subaccount API key management.

📘

In the update endpoints, send only the permissions array in the body.


Insufficient permission error

When a key tries to access a resource without the required permission, the API returns 403 Forbidden.

Example:

{
  "errors": [
    {
      "code": "insufficient_permission",
      "description": "The provided API key does not have the required permissions. Check that the key has the FINANCIAL_TRANSACTION:READ scope to access the requested resource"
    }
  ]
}

To fix it:

  1. identify the permission indicated in the message;
  2. check the key's current permissions;
  3. update the scope or use another authorized key;
  4. avoid granting permissions that are not needed.

Available permissions

The table below maps the resources shown in the Asaas interface to the names used by the API.

ResourcePermissionRelated endpoint
CustomersCUSTOMERCreate new customer
NotificationsCUSTOMER_NOTIFICATIONUpdate notifications in batch
ChargesPAYMENTCreate new charge
Charge refundsPAYMENT_REFUNDRefund charge
ChargebackCHARGEBACKCreate chargeback dispute
InstallmentsINSTALLMENTCreate installment
SubscriptionsSUBSCRIPTIONCreate new subscription
Static QR CodePIX_CREDITCreate static QR Code
Payment linkPAYMENT_LINKCreate payment link
CheckoutCHECKOUTCreate new Checkout
Credit cardCREDIT_CARDTokenize credit card
AnticipationsANTICIPATIONRequest anticipation
Anticipation settingsANTICIPATION_CONFIGUpdate automatic anticipation
Charge guaranteeESCROWClose charge guarantee
Escrow Account configurationESCROW_CONFIGCreate default Escrow Account configuration
Serasa credit checkCREDIT_BUREAUPerform credit check
Serasa negative credit reportingPAYMENT_DUNNINGCreate negative credit reporting
Tax informationFISCAL_INFOCreate or update tax information
InvoicesINVOICESchedule invoice
QR Code paymentPIX_DEBITPay a QR Code
Pix key managementPIX_ADDRESS_KEYCreate a Pix key
Recurrence managementPIX_RECURRINGCancel a recurrence
Pix transactionsPIX_TRANSACTIONList transactions
Automatic PixPIX_AUTOMATICCreate Automatic Pix authorization
TransfersTRANSFERMake a transfer
Bill paymentBILLCreate bill payment
Mobile phone top-upMOBILE_PHONE_RECHARGERequest top-up
Statement and financial informationFINANCIAL_TRANSACTIONRetrieve statement
Account informationACCOUNT_INFOUpdate business data
Invoice page informationPAYMENT_CHECKOUT_CONFIGCustomize invoice page
WebhooksWEBHOOKCreate new Webhook
SubaccountsSUB_ACCOUNTCreate subaccount
Account documentsACCOUNT_DOCUMENTSend documents

Next steps


Did this page help you?