After you've created your API key, make a test request to verify that your authentication and signing setup works correctly.
Before you begin
Before you start, make sure you have:
- An API key with the products and permissions your integration needs — see Create an API key.
- If your key has signing enabled: the private key (
private.pem) you saved when generating signing keys.
How it works
To make an authenticated request to the Revolut API, you need:
- The base URL for the endpoints you're calling
- Your API key
- If signing is enabled on your key, the current Unix timestamp and a signature generated from the request
The sections below explain each part, and Make the request puts it all together into ready-to-run examples.
Base URLs
Use the correct base URL for the endpoints you're calling and the environment you're in:
| Endpoints | Sandbox | Production |
|---|---|---|
| Business | https://sandbox-b2b.revolut.com | https://b2b.revolut.com |
| Merchant | https://sandbox-merchant.revolut.com | https://merchant.revolut.com |
Make sure that you test your integration in Sandbox before going live, and that you use the correct URL for each environment.
Authentication headers
Every request to the Revolut API must include an Authorization header with your API key.
If your key has signing enabled, each Production request must also include Revolut-Api-Timestamp and Revolut-Api-Signature headers.
Whether a request must be signed depends on the API key you use, not on the endpoint. The products and permissions you select when creating the key determine whether it's created with signing keys — see Signing requirements.
| Header | Required | Description |
|---|---|---|
Authorization | Always | Your API key, in the format Bearer {API_KEY}. |
Revolut-Api-Timestamp | If signing is enabled* | The current Unix timestamp in milliseconds (e.g., 1783616701644). Used to prevent replay attacks. |
Revolut-Api-Signature | If signing is enabled* | A Base64-encoded Ed25519 signature of the request data. |
To facilitate testing, in Sandbox, requests made with a key that has signing enabled are also accepted without the Revolut-Api-Timestamp and Revolut-Api-Signature headers.
However, we strongly recommend that you test a production-like setup by including the headers.
If you include them, they must be valid.
Message construction
To generate the Revolut-Api-Signature header, you sign a message string constructed from your request data.
The string is a concatenation of the following values, in this specific order:
| # | Component | Notes | Example |
|---|---|---|---|
| 1 | Timestamp | Same value as the Revolut-Api-Timestamp header | 1783616701644 |
| 2 | HTTP method | Uppercase | GET |
| 3 | Request path | Starting from /api, including any path parameters | /api/1.0/team-members |
| 4 | Query string (if present) | Without the ? prefix (empty string if none) | limit=10 |
| 5 | Request body (if present) | Minified JSON (empty string if none) | {"name":"John"} |
Do not add any separators (spaces, newlines, or commas) between the fields. Use an empty string for any component that's not present in your request.
If your request includes URL-encoded query string values (e.g., key=hello%3Aworld), you must use the same URL-encoded value when constructing the signature message.
Signing the raw, unencoded value (e.g., key=hello:world) will cause signature verification to fail.
Keep the space encoding consistent between the request and the signature message.
Some API clients encode spaces as + in query strings (for example, Bruno), others as %20.
Either approach is valid, provided the signature message uses the same encoding as the request.
Signature generation
To generate the Revolut-Api-Signature header:
- Construct the message string by concatenating the present components in order, with no separators.
- Sign the message using your Ed25519 private key. Ed25519 signing produces a 64-byte raw signature that is unique to both the message and the private key.
- Base64-encode the raw signature bytes.
Send the encoded value in the Revolut-Api-Signature header.
Generate the signature programmatically
The following snippets only generate the signature and print it to the console — they don't make an API request.
Use them to verify your signature against the expected values below, or to generate a signature for a request you're building manually.
The scripts assume your private key is saved as private.pem in the same directory.
For sample scripts that generate a signature and make a request, see the Full flow below.
const crypto = require('crypto');
const fs = require('fs');
// Configure your variables
const privateKeyPath = './private.pem';
const timestamp = '1783616701644';
const method = 'GET';
const path = '/api/1.0/team-members';
const query = '';
const body = '';
// Generate the signature
const privateKey = fs.readFileSync(privateKeyPath, 'utf8');
const message = timestamp + method + path + query + body;
const signature = crypto.sign(null, Buffer.from(message), privateKey).toString('base64');
console.log('Message:', message);
console.log('Revolut-Api-Timestamp:', timestamp);
console.log('Revolut-Api-Signature:', signature);Verify your signature
You can check that your signature generation is correct by comparing your output with the expected signatures for the demo keys in this section.
Demo keys and expected signatures
The following private and public keys are provided for verification purposes only. They are not associated with any Revolut account and must not be used to authenticate real API requests.
Use it to generate test signatures.
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIJlVQCVDhqI3k4Z4DXDydAu7Mtzgu+EWRClctYhXn/MK
-----END PRIVATE KEY-----Using timestamp 1783616701644, the expected signatures are:
| Request | Message | Expected signature |
|---|---|---|
GET /api/1.0/team-members | 1783616701644GET/api/1.0/team-members | XVZerlAdz6IyfC5jidsDqJf4AO8g1dx5BwFMUwO4DmoJqXrj/Q5VPOk3pf4cJl9B9cGgBNAzao9bsv/O2ADuDg== |
GET /api/1.0/team-members?limit=10 | 1783616701644GET/api/1.0/team-memberslimit=10 | kj57qIVzIH12gfaxkxUzFOMbD/KnASmPpRx49AJdUcS+Uhpp9Iowd1fGd3kJ/iFTgADiITLUnZ1udtf7Z0LFAw== |
GET /api/1.0/team-members/76969b71-a123-42dc-b874-a34688d7bba4 | 1783616701644GET/api/1.0/team-members/76969b71-a123-42dc-b874-a34688d7bba4 | 5pGo0qVGzDMXBuhf80RZs4Q04h96pxqyP5OgvUgFLO0DbLkBQrUP/M8pb1j1PNZzP7Ruj+R2iZvGBJcI5qBNAQ== |
POST /api/1.0/accounting-categories + body: {"code":"123","name":"Office supplies"} | 1783616701644POST/api/1.0/accounting-categories{"code":"123","name":"Office supplies"} | WVTwvOLip4oPPCPwyzJb/bIxAkTQoIGcPfEyDSiIj4qLYzS30kKC9du6vdV6KemGQJJ/IKFt9c/q1S1stvWvAg== |
POST /api/1.0/label-groups/8b8e3a86-21c4-4b5a-9e6f-0e8f7d6c5b4a/labels + body: {"name":"Communications"} | 1783616701644POST/api/1.0/label-groups/8b8e3a86-21c4-4b5a-9e6f-0e8f7d6c5b4a/labels{"name":"Communications"} | +EZA2SyGtIFRqm59J8qrDba1XIN4oODE5hYHNRMRQbRISNcTwCdupRLsmC13LUH/gijrDyeSNvR090HmxeZNAA== |
If your signature matches, your implementation is correct. If it doesn't, check that you're concatenating the components in the right order with no separators, and that your private key is in the correct format.
For complete scripts that generate the signature and make the request, see the Full flow below.
You can also verify a signature using the demo public key provided above and OpenSSL.
This requires OpenSSL 3 or later and a bash-enabled CLI. See Create an API key -> 3. Generate signing keys (if required) -> Generate keys manually for details and troubleshooting.
-
Save the demo public key to a file named
public.pemin your working directory. -
Save the message string to a text file (e.g.
message.txt) and the Base64-decoded signature to a binary file (e.g.signature.sig) in the same directory:echo -n "1783616701644GET/api/1.0/team-members" > message.txt echo -n "XVZerlAdz6IyfC5jidsDqJf4AO8g1dx5BwFMUwO4DmoJqXrj/Q5VPOk3pf4cJl9B9cGgBNAzao9bsv/O2ADuDg==" | base64 -d > signature.sig -
Then verify the signature with OpenSSL:
openssl pkeyutl -verify -pubin -inkey public.pem -rawin -in message.txt -sigfile signature.sig
Expected output: Signature Verified Successfully.
Make the request
Quickly verify your API key works by making a simple request from your terminal.
Postman can automate request signing for you with a pre-request script, so you don't need to manually generate signatures for each request. See Set up Postman to configure your environment.
If your key doesn't have signing enabled, you can skip the signature and make a simple request.
Set your environment variables:
export API_KEY=YOUR_API_KEY
export BASE_URL=https://sandbox-b2b.revolut.comThen make the request:
curl -X GET "${BASE_URL}/api/1.0/expenses" \
-H "Authorization: Bearer ${API_KEY}"Full flow
Below are example scripts you can adapt for your integration — save, configure, and run in your preferred language.
The scripts read your API key from an environment variable. Other request parameters are set as variables at the beginning of the script. The scripts then construct the message, generate the signature, make the request using each language's standard HTTP client, and print the response.
Each script prints a summary of the request it makes — the method and URL, the body if present, and the timestamp and signature used for signing. The cURL equivalent of the request is printed only if you uncomment the corresponding lines — useful when you want to see the exact request shape or reproduce it outside the script.
Example scripts
First, export your API key as an environment variable:
export API_KEY=YOUR_API_KEYThen, save the script.
By default, the scripts print a summary of the request.
If you want to print what the request would look like if it were a cURL command, uncomment the corresponding lines.
The masked variant prints API_KEY as a placeholder in the Authorization header, so the output is safe to share and screenshare.
The variant with your real API key prints it in the Authorization header — only uncomment it in an environment where your credentials are safe, and don't share the output.
Save as test-request.js:
const crypto = require('crypto');
const fs = require('fs');
// ── Configure your variables ──────────────────────────────────
const apiKey = process.env.API_KEY;
const privateKeyPath = './private.pem';
const baseUrl = 'https://sandbox-b2b.revolut.com';
const method = 'GET';
const path = '/api/1.0/team-members';
const query = '';
const body = '';
// ──────────────────────────────────────────────────────────────
// Generate the signature
const privateKey = fs.readFileSync(privateKeyPath, 'utf8');
const timestamp = Date.now().toString();
const message = timestamp + method + path + query + body;
const signature = crypto.sign(null, Buffer.from(message), privateKey).toString('base64');
// Build the request
const queryString = query ? `?${query}` : '';
const bodyArg = body ? ` -H "Content-Type: application/json" -d '${body}'` : '';
// Send the request
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Revolut-Api-Timestamp': timestamp,
'Revolut-Api-Signature': signature,
};
const options = { method, headers };
if (body) {
headers['Content-Type'] = 'application/json';
options.body = body;
}
// Build a request sample (for display only)
const requestSample = `curl -X ${method} "${baseUrl}${path}${queryString}"` +
` -H "Authorization: Bearer ${apiKey}"` +
` -H "Revolut-Api-Timestamp: ${timestamp}"` +
` -H "Revolut-Api-Signature: ${signature}"${bodyArg} -s`;
// Print a summary of the request
console.log(`Sending: ${method} ${baseUrl}${path}${queryString}`);
if (body) {
console.log(`Body: ${body}`);
}
console.log(`Signed: timestamp=${timestamp}, signature=${signature}`);
// Uncomment to print the request sample instead:
// console.log(requestSample.replace(apiKey, 'API_KEY')); // API key masked — safe to share
// console.log(requestSample); // With your real API key — run only in a safe environment.
console.log('\n--- Response ---');
fetch(`${baseUrl}${path}${queryString}`, options)
.then(res => res.text())
.then(text => console.log(text));Run the script:
node test-request.jsExample output:
Sending: GET https://sandbox-b2b.revolut.com/api/1.0/team-members
Signed: timestamp=1783616701644, signature=XVZerlAdz6IyfC5jidsDqJf4AO8g1dx5BwFMUwO4DmoJqXrj/Q5VPOk3pf4cJl9B9cGgBNAzao9bsv/O2ADuDg==
--- Response ---
[
{
"id": "76969b71-a123-42dc-b874-a34688d7bba4",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"role_id": "owner",
"state": "active",
"created_at": "2022-09-07T09:19:31.592368Z",
"updated_at": "2022-09-07T09:21:24.346670Z"
}
]Update the method, path, query, and body variables at the top of the script to test different endpoints.
For example, to test a POST request with a body, change:
const method = 'POST';
const path = '/api/1.0/accounting-categories';
const query = '';
const body = '{"code":"123","name":"Office supplies"}';You can also change the baseUrl and privateKeyPath values to test with a different environment, group of endpoints, or a different signing key.
To use a different API key, set the API_KEY environment variable again before you run the script.
Troubleshooting
If a request is rejected, the cause is usually in the authentication or signing setup this guide covers:
| Problem | What to do |
|---|---|
| 401 Unauthorized | The API key is wrong, expired, or revoked. Check the key's status in the API Console. |
| Signature verification failure | The Revolut-Api-Signature doesn't match what the server computes. Construct the message exactly as shown in Message construction and sign it with the private key matching the key's registered public key. |
| Timestamp rejected | Requests are rejected when the Revolut-Api-Timestamp is too far from the current time. Make sure your system clock is accurate and synchronised (e.g., via NTP), and that the timestamp is in milliseconds. |
| IP rejected | The request comes from an IP address that's not on the key's IP allowlist. See Configure an IP allowlist. |
Use the API logs view in the API Console to inspect the requests you sent, their status, and failure reasons. For endpoint-specific errors (invalid parameters, missing permissions, and similar), see the error handling documentation of the respective API reference.
Verify your requests in the Business Sandbox
Go to Test your integration with Revolut Sandbox to check the results of your Business or Merchant requests in the Revolut Business Sandbox app.
What's next
- Manage API key settings: Update key permissions, configure IP allowlisting, and manage signing keys.
- Rotate an API key: Replace an API key without downtime.
- Set up Postman: Automate request signing with a pre-request script.
- See the API reference for:
- For step-by-step tutorials on specific features and workflows, browse the guides: