Rotate your key
curl --request POST \
--url https://catchbackcards.com/api/partner/v2/keys/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://catchbackcards.com/api/partner/v2/keys/rotate"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://catchbackcards.com/api/partner/v2/keys/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://catchbackcards.com/api/partner/v2/keys/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://catchbackcards.com/api/partner/v2/keys/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://catchbackcards.com/api/partner/v2/keys/rotate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://catchbackcards.com/api/partner/v2/keys/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"secret": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"previous_key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z"
},
"idempotent_replay": true
}{
"key": {
"id": "9a41d7e2-3b5c-4d6e-8f0a-1b2c3d4e5f60",
"name": "okx-prod-r2",
"secret": "cb_live_7c1e...",
"created_at": "2026-11-17T10:00:00.000Z"
},
"previous_key": {
"id": "c2f0e8b4-1a7d-4c39-9e55-0b6d3a8f2e17",
"expires_at": "2026-11-18T10:00:00.000Z"
}
}{
"error": "Idempotency-Key must be 8-128 characters of A-Z, a-z, 0-9, _ or -.",
"code": "BAD_IDEMPOTENCY_KEY"
}{
"error": "Invalid API key",
"code": "INVALID_KEY"
}{
"error": "This partner program is not live",
"code": "PROGRAM_INACTIVE"
}{
"error": "This key was already rotated. Use its successor, or retry with the original Idempotency-Key.",
"code": "ALREADY_ROTATED",
"successor": {
"id": "9a41d7e2-3b5c-4d6e-8f0a-1b2c3d4e5f60",
"name": "okx-prod-r2"
},
"expires_at": "2026-11-18T10:00:00.000Z"
}{
"error": "Too many requests. Slow down.",
"code": "RATE_LIMITED",
"retry_after_seconds": 23
}{
"error": "Something went wrong; retry with the same Idempotency-Key."
}{
"error": "Could not load the partner program; try again."
}Keys & revenue
Rotate your key
Issues a new key for the same program, with the same scopes. No body. Store key.secret straight away.
- The old key keeps working for 24 hours (
previous_key.expires_at), then answers401. - If the response is lost, call again with the same old key and the same
Idempotency-Keywithin 10 minutes, before you use the new key: you get the same new key and secret back (200,idempotent_replay: true). After that the replay is409ALREADY_ROTATED. - A key is rotated once; rotate the new key next time.
- Your webhook moves to the new key (same URL, same secret), and the old key’s stops.
POST
/
api
/
partner
/
v2
/
keys
/
rotate
Rotate your key
curl --request POST \
--url https://catchbackcards.com/api/partner/v2/keys/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://catchbackcards.com/api/partner/v2/keys/rotate"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://catchbackcards.com/api/partner/v2/keys/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://catchbackcards.com/api/partner/v2/keys/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://catchbackcards.com/api/partner/v2/keys/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://catchbackcards.com/api/partner/v2/keys/rotate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://catchbackcards.com/api/partner/v2/keys/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"secret": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"previous_key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z"
},
"idempotent_replay": true
}{
"key": {
"id": "9a41d7e2-3b5c-4d6e-8f0a-1b2c3d4e5f60",
"name": "okx-prod-r2",
"secret": "cb_live_7c1e...",
"created_at": "2026-11-17T10:00:00.000Z"
},
"previous_key": {
"id": "c2f0e8b4-1a7d-4c39-9e55-0b6d3a8f2e17",
"expires_at": "2026-11-18T10:00:00.000Z"
}
}{
"error": "Idempotency-Key must be 8-128 characters of A-Z, a-z, 0-9, _ or -.",
"code": "BAD_IDEMPOTENCY_KEY"
}{
"error": "Invalid API key",
"code": "INVALID_KEY"
}{
"error": "This partner program is not live",
"code": "PROGRAM_INACTIVE"
}{
"error": "This key was already rotated. Use its successor, or retry with the original Idempotency-Key.",
"code": "ALREADY_ROTATED",
"successor": {
"id": "9a41d7e2-3b5c-4d6e-8f0a-1b2c3d4e5f60",
"name": "okx-prod-r2"
},
"expires_at": "2026-11-18T10:00:00.000Z"
}{
"error": "Too many requests. Slow down.",
"code": "RATE_LIMITED",
"retry_after_seconds": 23
}{
"error": "Something went wrong; retry with the same Idempotency-Key."
}{
"error": "Could not load the partner program; try again."
}Authorizations
Your API key (cb_live_…), sent as a bearer token, with the scope nft:orders. Keep it on your servers: never in a browser, app or wallet. Use a separate key per environment. A request from a country on our sanctions list gets a 403 with Access denied, whether or not it has a valid key. See Authentication and keys.

