Manage API keys
Airwallex uses your API keys to authenticate API requests. Your API key and Client ID are used to obtain an access token, which authorizes access to Airwallex APIs.
The Airwallex API suite includes both organization-level and account-level API resources. You can generate API keys for accessing API resources at the organization-level, account-level, or both. For information on organization and accounts, see Global Entity Management.
Scoped API keys (previously called restricted API keys) are the only type of API key you can create. Admin API keys are deprecated and can no longer be created. If you still use one, see Admin API keys for what is changing and how to migrate.
Learn how to create and manage your scoped API keys using the Developer app in the Airwallex web app. Developer app access requires the Owner, Admin, or Developer user role.
Before you create or use API keys in production, read API key best practices for guidance on least privilege, network restrictions, secure storage, and rotation.
Scoped API keys
Scoped API keys (previously called restricted API keys) provide secure, limited access to specific Airwallex APIs for an organization and/or account(s). You can specify which Airwallex APIs each scoped API key can access, including the permitted action (Read or Write) for each resource. By using scoped API keys, you can minimize risk when developing or operating microservices. For example, you might use scoped API keys to connect only with Online Payments shopping platform plugins.
Scopes correspond to resource names in Airwallex APIs. Scopes with Read permissions allow access to GET endpoints, while Write permissions allow access to both GET and POST endpoints. Scoped API keys are available for select APIs only. See API key scopes for the full catalog of available scopes.
Create a scoped API key
Follow these steps to create scoped API keys:
Your organization must have at least one active account before you can create an API key. If your organization has no active accounts, API key creation is unavailable and the web app displays: “You are unable to create API keys because your organization has no active accounts.”
- Log in to the Airwallex web app and select Settings > Developer > API keys.
- Click New scoped API key.
- Enter a name for the scoped key in the API key name field.
- Configure the desired scope for this API key based on the type of access you need:
- Organization-level only: To access organization-level resources (for example, Billing APIs), go to Organization-level permissions and select the API resources with Read and/or Write permissions you want to enable.
- Account-level only: To access account-level resources (for example, Payments APIs), go to Account-level permissions and:
- From the Account(s) dropdown, select one or more accounts or click Select all.
- In the Resources section, select the API resources with Read and/or Write permissions you want to enable.
- Both organization and account-level: To access both organization and account-level resources (for example, Billing and Payment APIs), configure both:
- Go to Organization-level permissions and specify the resources the API key can access at the organization level.
- Go to Account-level permissions and specify the resources the API key can access for each account.
- Click Create to generate the scoped API key.
- Copy the API key and store it securely, as you will not be able to view it again in the web app.

Create an access token using a scoped API key
To authenticate API requests using a scoped key, first create an access token by calling Obtain an access tokenAPI endpoint and providing the required header fields. This returns a bearer token that allows you to access Airwallex APIs in scope for the organization or account.
The access token remains valid for 30 minutes and should be reused for all API calls during that period. Do not call the authentication endpoint before each API request—store and reuse the token until it expires.
Header fields include:
x-api-key: Your scoped API key.x-client-id: Your client ID for this key.x-login-as: (Optional) The target account ID. See the scenarios below for when this header is required or optional.
1curl -X POST https://api.sandbox.airwallex.com/api/v1/authentication/login \2 -H 'Content-Type: application/json' \3 -H 'x-api-key: {{YOUR_SCOPED_API_KEY}}' \4 -H 'x-client-id: {{YOUR_CLIENT_ID}}' \5 -H 'x-login-as: {{YOUR_TARGET_ACCOUNT_ID}}'
Important considerations for the x-login-as header
Scoped API keys belong to an organization. The x-login-as header determines which account the access token is authorized for. Whether you need it depends on the permissions on the key and how many accounts it is linked to:
- Not required: If the key has organization-level permissions only, or is linked to exactly one account, omit the
x-login-asheader. The token includes the permissions granted to the key (organization-level, that account's permissions, or both). - Required for account access: If the key is linked to multiple accounts, include the
x-login-asheader when you need account-level permissions. The token then includes that account's permissions and any organization-level permissions granted to the key. If omitted, account-level permissions are not included. The token includes only organization-level permissions if the key has them, or no permissions if the key is account-only.
The table below shows which permissions the access token includes, depending on whether you send the x-login-as header.
| Key permissions | Accounts linked | x-login-as | Permissions without x-login-as | Permissions with x-login-as |
|---|---|---|---|---|
| Organization and account | Multiple | Required for account access | Organization-level only | Selected account and organization-level |
| Organization and account | Single | Not required | Account-level and organization-level | Account-level and organization-level |
| Organization only | — | Not required | Organization-level only | — |
| Account only | Single | Not required | Account-level only | Account-level only |
| Account only | Multiple | Required | None | Selected account |
Where to find your account ID: In the Airwallex web app, go to Settings > Account details. Your account ID is displayed in the Account Information section. Note that your account ID is different from your organization ID. The organization ID identifies your top-level organization, while the account ID identifies a specific account within that organization. When using the x-login-as header, provide the account ID (not the organization ID). For more information on how organizations and accounts are structured, see Global Entity Management.
Regenerate a scoped API key
You can regenerate scoped API keys if you've lost the API key or suspect it has been compromised. Regenerating your scoped key will overwrite your old key, and you will no longer be able to use the old key to connect to Airwallex APIs. Your Client ID will remain unchanged.
Follow these steps to regenerate your scoped API key for your Airwallex organization or account(s).
- Log in to the Airwallex web app and select Settings > Developer > API keys.
- Click the three dots (…) next to your scoped API key, and choose Regenerate.
- Enter your login password.
- Copy the new API key and store it securely, as you will not be able to view it again in the web app.
In addition to regenerating a scoped key, you can perform the following actions by clicking the three dots (…) next to the scoped key. All actions require you to enter your login password.
- Duplicate API key: Allows you to duplicate an existing scoped key to create a new one with the same scope.
- Edit API key: Allows you to edit the scope of the scoped key - this will not change the API key secret.
- Delete API key: Allows you to delete a scoped key.

Admin API keys
Admin API keys are deprecated. You can no longer create an admin API key, and Airwallex is progressively withdrawing the ability to regenerate existing ones. Migrate your integrations to scoped API keys.
Admin API keys grant unrestricted access to all Airwallex APIs for the organization or account they were issued to. An admin key issued to an organization cannot access resources at the account level, and an account admin key cannot be used across multiple accounts.
Because their permissions cannot be limited, Airwallex is retiring admin API keys:
- You cannot create an admin API key. The option to generate an admin key is no longer available in the Airwallex web app, for any organization or account.
- Regeneration is being withdrawn progressively. The Regenerate option may already be unavailable for your organization. Once it is withdrawn, an admin key that you lose or that is compromised cannot be replaced, so you would need a scoped API key to restore access.
- Existing admin API keys continue to work for now. Airwallex will contact affected organizations before withdrawing support.
Migrate from an admin API key to a scoped API key
If an integration still authenticates with an admin API key, migrate it to a scoped key:
- Identify which Airwallex APIs the integration calls and which accounts it operates on, then find the matching scopes in API key scopes.
- Create a scoped API key that grants only those scopes, with Read or Write access as each resource requires.
- Update your integration with the new API key and the Client ID shown for that key. Each scoped key has its own Client ID, so you must replace both values, not just the key.
- A scoped key belongs to an organization rather than a single account. If your admin key was issued to an account, review Important considerations for the
x-login-asheader to confirm whether your requests now needx-login-as. - Test the integration against the new credentials. A
403response usually means a scope is missing rather than a bad key. See the FAQ. - Remove the admin API key from your secret store and from every system that used it.
If an API your integration depends on does not yet have a scope you can select, contact your Airwallex account manager or Airwallex support before you decommission the admin key.
Secure your API keys
API keys authenticate and authorize actions on your Airwallex account, so keep them secure and private. For guidance on scoped keys, IP whitelisting, secure storage, and rotation, see API key best practices.
Notifications
You will receive email notifications for the following webhook events:
- Scoped API key
- Create key
- Regenerate key
- Duplicate an existing key
- Edit scope of an existing key
- Delete a key
- Admin API key
- Regenerate key, where regeneration is still available for your organization
FAQ
Can I still create an admin API key?
No. Admin API keys are deprecated and the option to generate one has been removed from the Airwallex web app. Create a scoped API key instead, and grant it only the scopes your integration needs.
What happens to the admin API key I already use?
It continues to work for now, but Airwallex is retiring admin keys progressively and will contact affected organizations before withdrawing support. Regeneration is being withdrawn first, so plan your migration to scoped API keys rather than waiting for the key to fail.
I'm getting 401 with correct credentials
Your access token has likely expired — check expires_at and obtain a new one by calling Obtain an access tokenAPI. Confirm you are sending the token from that response in Authorization: Bearer <token>, not your raw API key.
Which header carries the token?
Use Authorization: Bearer <token> on every API call. x-client-id and x-api-key are used only on /authentication/login to obtain the token.
I have a valid token but get 403
The token authenticates you, but your API key's scopes may not cover the endpoint or account. Check the endpoint's required scope against API key scopes, and confirm the x-login-as account is authorized for the key.
Do I need a new token for every request?
No. Reuse the token until expires_at.
Can I use the same credentials in sandbox and production?
No. Client IDs and API keys are environment-specific — use each environment's own credentials and base URL.