# Create an API key

The [Business](/docs/api/business) and [Merchant](/docs/api/merchant) endpoints use a unified authentication model based on API keys and Ed25519 request signing.
This guide walks you through creating an API key in the API Console.
<!-- TODO: Re-add Crypto Exchange and Crypto Ramp endpoints when Crypto migration is complete -->
<!-- TODO: When Crypto migration is complete, restore the original wording: "The Revolut API uses a unified authentication model based on API keys and Ed25519 request signing." -->

:::details[Using a legacy authentication method?]
<!-- TODO: When Crypto migration is complete, restore the previous wording: "Previously, the Revolut API was divided into separate APIs, each with its own auth method. The new unified auth model replaces that." -->
Previously, Business and Merchant endpoints each used their own authentication method.
They now use the same API-key authentication.

For the interim period, the legacy method for Business endpoints is still supported so that you have time to switch to the new auth.
For reference, the legacy guide is:
- **Business endpoints**: OAuth 2.0 with client assertion JWT: [Make your first API request](/docs/guides/manage-accounts/get-started/make-your-first-api-request)
<!-- TODO: Remove Merchant legacy guide link before launch if MA is fully migrated
- **Merchant endpoints**: Static secret key: [Get started](/docs/guides/merchant/get-started)
-->
<!-- TODO: Re-add Crypto Exchange and Crypto Ramp legacy guides when Crypto migration is complete
- **Crypto Exchange endpoints**: Ed25519 signing (same mechanism as this guide, configured in the Revolut X web app): [API reference](/docs/api/revolut-x-crypto-exchange)
- **Crypto Ramp endpoints**: API key and signature: [API reference](/docs/api/crypto-ramp)
-->

**Where to find existing legacy keys:**
- **Merchant**: Existing API keys have been migrated to the API Console.
  You can find them alongside your new API keys.
- **Business**: Existing (legacy) API keys remain in the [Revolut Business app](https://business.revolut.com) under **Settings** -> **APIs** -> **Business API certificates**, and you can continue using them during the interim period, however, we encourage you to switch to the new auth model as soon as possible.
  If you don't have any legacy keys, this section is not displayed.
:::

:::details[Looking for an SDK key instead?]
If you have a Merchant account, the Merchant public key is pre-created for you in the API Console.
:::

## How it works

<!-- TODO: When Crypto migration is complete, restore the original wording: "The Revolut API authenticates requests using API keys created in the API Console." -->
The Business and Merchant endpoints authenticate requests using an API key created in the [API Console](https://developer.revolut.com/console).
A single API key can be configured to access both the Business and Merchant endpoints, depending on the products and permissions you select.

Every request includes an `Authorization` header with your **API key**.
Additionally, [some products and permissions make **request signing** mandatory](/docs/guides/api-console/signing-requirements) for the API key, which means that Production requests made with that key must include the `Revolut-Api-Timestamp` and `Revolut-Api-Signature` headers as an extra security layer on top of the API key.
If this is the case, the API Console shows an extra step for generating an Ed25519 pair of signing keys (public + private).
The public key is uploaded to the API Console, and the private key is used to [sign requests](/docs/guides/api-console/make-a-request).
If signing is not required, this step is skipped automatically.

:::note
A key created without a signing key pair can get one [added later](/docs/guides/api-console/manage-key-permissions#add-a-signing-key).
From then on, every Production request made with that key must be signed.
:::

You can have up to 50 active keys at any time.

## Before you begin

Before you start, make sure you have:

- A Revolut account ([Business](/docs/guides/manage-accounts/get-started/sign-up-for-revolut-business-account) and/or [Merchant](/docs/guides/merchant/get-started)) with access to the [API Console](https://developer.revolut.com/console).
  If you don't have an account yet, you can create one directly from the [API Console](https://developer.revolut.com/console).
- The **Manage API** permission on your account.
  Contact your account administrator if you don't have this permission.

## Create a new API key

### 1. Open the API Console

The **API Console** is a self-service dashboard where you can create and manage your API keys.
You can access it at [developer.revolut.com/console](https://developer.revolut.com/console).

:::note[Sandbox vs Production]
- The API Console lets you manage keys for both Sandbox and Production environments.
  Use the account switcher in the top right corner to select the right account.
- Sandbox accounts come with pre-generated full-access keys, so you can start testing immediately without generating your own key pair.
:::

### 2. Select products and permissions

1. In the [API Console](https://developer.revolut.com/console), navigate to :Key: **API keys** and click :Plus: **New** to start creating a new API key.

    ![API Console home screen](/img/api-console/api-auth/add-first-key.png)

2. Select the products that your integration requires – for example, **Accounts**, **Expenses**, **Transfers**, **Team**.

    ![Select products](/img/api-console/api-auth/select-products.png)

3. Assign the appropriate permission level:

    - **Read:** Retrieve data (e.g., list accounts, counterparties).
    - **Write:** Create or modify data (e.g., make transfers, update team members' roles). Includes **Read** permissions.
    - **None:** No access to this resource.

    ![Select permissions](/img/api-console/api-auth/select-permissions.png)

    You can set permissions for:
    - All products at once: using the controls in the top right corner
    - An entire product: e.g. **Team**
    - Each resource individually: e.g. **Roles**

    <!-- -->

    :::tip[Principle of least privilege]
    Only grant the permissions your integration needs.
    For example, if you only need to retrieve team member data, set **Team members** to **Read** and leave the rest as **None**.
    :::

    <!-- -->

4. Click **Continue**.

### 3. Generate signing keys (if required)

:::note
This step is present only for [keys that require signing](#how-it-works).
If this is not your case, continue to [Configure and create the key](#4-configure-and-create-the-key).
:::

Revolut uses Ed25519 asymmetric cryptography to sign API requests.
You need a public/private key pair – the **private key** is used to sign each request, and the **public key** is uploaded to the API Console to verify your signatures.

:::danger[Never share your private key]
Anyone with your private key can sign requests as if they were you — accessing accounts, initiating transfers, or taking any action your API key allows.
Your API key is the first layer of protection; signing adds an extra layer.
:::

You can generate the key pair in two ways:

- ![Generate keys manually]
  **Generate the key pair locally** and upload only the public key to the API Console.
  Revolut never has access to the private key you generated on your local machine – store it securely (e.g., as a secret in your CI/CD pipeline or secrets manager) and use it with your API key to sign every API request.

  ![Generate signing keys](/img/api-console/api-auth/generate-signing-keys-manually.png)

  1. Generate the key pair:

      Use the option that matches your operating system and preferred tools.

      - ![$OpenSSL]
        :::note[Prerequisites]
        [OpenSSL 3](https://www.openssl.org/source/) or later.

        - **macOS:** You need an OpenSSL version that supports Ed25519. If you don't have it, install OpenSSL 3 using [Homebrew](https://brew.sh). If you encounter errors, see the troubleshooting below.
        - **Linux:** OpenSSL comes pre-installed on most Linux distributions. If it's not available, install it from your package manager (e.g., `sudo apt install openssl` on Debian/Ubuntu).
        - **Windows:** Run the commands in a bash-enabled CLI such as [Git Bash](https://gitforwindows.org/) or [WSL](https://learn.microsoft.com/en-us/windows/wsl/install), with OpenSSL 3 or later available there.
        :::

        Generate the key pair:

        ```shell
        openssl genpkey -algorithm ed25519 -out private.pem && openssl pkey -in private.pem -pubout -out public.pem
        ```

        :::details[Troubleshooting: Algorithm Ed25519 not found]
        **macOS:** If you get an error saying `Algorithm Ed25519 not found`, your macOS may have an older version of OpenSSL that doesn't support Ed25519.
        Install OpenSSL 3 using [Homebrew](https://brew.sh):

        ```shell
        brew install openssl@3
        ```

        Then generate the key pair using the Homebrew installation:

        ```shell
        "$(brew --prefix openssl@3)/bin/openssl" genpkey -algorithm ed25519 -out private.pem && "$(brew --prefix openssl@3)/bin/openssl" pkey -in private.pem -pubout -out public.pem
        ```
        :::

      - ![$Python]
        :::note[Prerequisites]
        [Python 3](https://www.python.org/downloads/) and the [`cryptography`](https://pypi.org/project/cryptography/) library.

        Install the library if you don't have it:

        ```shell
        python3 -m pip install cryptography
        ```
        :::

        Run the following command in your command line:

        ```shell
        python3 -c "from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey; from cryptography.hazmat.primitives import serialization; k=Ed25519PrivateKey.generate(); open('private.pem','wb').write(k.private_bytes(serialization.Encoding.PEM,serialization.PrivateFormat.PKCS8,serialization.NoEncryption())); open('public.pem','wb').write(k.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo))"
        ```

      This command generates two files:
      - `private.pem`: your private key. Keep this secure and never share it.
      - `public.pem`: your public key. You'll upload this to the API Console.

  2. In the API Console, upload your `public.pem` file (or paste its contents).

- ![Generate keys automatically (Sandbox only)]
  **Generate a key pair with a single click** in the API Console.
  The private key is displayed on the final screen together with the API key – click to download it and save it securely.
  You can download the private key again later from the API Console.

  ![Generate signing keys automatically](/img/api-console/api-auth/generate-signing-keys-automatically.png)

### 4. Configure and create the key

The final step is to name your key and configure any optional security settings.

![Configure the key](/img/api-console/api-auth/configure-api-key.png)

1. Give your API key a clear, identifiable name – for example, `Demo key`.
2. If needed, configure the following security settings:

    | Setting | Description |
    |---|---|
    | **Expiry date** | Set a date when the API key expires. The key is valid until 23:59 on that date and stops working the next day. The expiry time uses your device's timezone at key creation. |
    | **IP allowlist** | Restrict API requests to specific IP addresses (e.g., `203.0.113.50`) or CIDR ranges (e.g. `198.51.100.0/24`). Supports both IPv4 and IPv6. Required for certain products that access sensitive information, such as **Card sensitive details**. |

    <!-- -->

    :::warning[Don't use local IP addresses]
    Make sure that the IPs you provide are **not** [local (i.e. private) IP addresses](https://www.okta.com/en-sg/identity-101/understanding-private-ip-ranges/).
    Local addresses (such as `192.168.x.x` or `10.x.x.x`) are not reachable over the internet and will cause your API requests to be rejected.
    :::

    <!-- -->

3. Click **Create API key**.

    :::note[SCA confirmation]
    You may be asked to complete a Strong Customer Authentication (SCA) challenge to confirm key creation.
    This may include a push notification, e-mail confirmation, and/or a selfie.
    :::

4. Copy the generated API key immediately.

:::warning[API key visibility]
Whether you can see the API key again depends on how it was created:
- API keys created without signing keys are shown **only once**, at creation.
  Make sure to copy and store them securely — you won't be able to see them again.
- API keys created with signing keys can be viewed later in the API Console.

Note that API keys that are **initially created without signing keys** but later have a signing key added remain visible only once at creation time — adding a signing key does not retroactively make the API key value viewable again.
:::

Your key is ready. Send a test request now to confirm your authentication and signing setup work — see [Make a request](/docs/guides/api-console/make-a-request).

## Best practices

:::warning[Don't reuse keys between environments]
When you create a Production API key, generate a new Ed25519 key pair — don't reuse the signing keys from your Sandbox account.
A compromised Sandbox key would also give an attacker access to your Production environment if the same key is reused.
Use separate key pairs for Sandbox and Production to keep your environments isolated.
:::

## What's next

- [Manage API key settings](/docs/guides/api-console/manage-key-permissions): Update key permissions, configure IP allowlisting, and manage signing keys.
- [Rotate an API key](/docs/guides/api-console/rotate-api-key): Replace an API key without downtime.
- [Set up Postman](/docs/guides/api-console/set-up-postman): Automate request signing with a pre-request script.
- [Make a request](/docs/guides/api-console/make-a-request)
- See the API reference for:
    - [Merchant endpoints](/docs/api/merchant)
    - [Business endpoints](/docs/api/business)
    <!-- TODO: Re-add Crypto Exchange and Crypto Ramp when Crypto migration is complete
    - [Crypto Exchange endpoints](/docs/api/revolut-x-crypto-exchange)
    - [Crypto Ramp endpoints](/docs/api/crypto-ramp)
    -->
- For step-by-step tutorials on specific features and workflows, browse the guides:
    - [Merchant: Accept payments](/docs/guides/merchant/introduction)
    - [Business: Manage accounts](/docs/guides/manage-accounts/introduction)
    <!-- TODO: Re-add Crypto Ramp guide when Crypto migration is complete
    - [Crypto Ramp: Buy crypto](/docs/guides/crypto-ramp/introduction-to-revolut-ramp/introduction-to-revolut-ramp)
    -->