Rotate API Key
curl --request POST \
--url https://b2b.usetapp.xyz/v1/sender/api-key/rotate \
--header 'API-Key: <api-key>'import requests
url = "https://b2b.usetapp.xyz/v1/sender/api-key/rotate"
headers = {"API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'API-Key': '<api-key>'}};
fetch('https://b2b.usetapp.xyz/v1/sender/api-key/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://b2b.usetapp.xyz/v1/sender/api-key/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 => [
"API-Key: <api-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://b2b.usetapp.xyz/v1/sender/api-key/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://b2b.usetapp.xyz/v1/sender/api-key/rotate")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://b2b.usetapp.xyz/v1/sender/api-key/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "API key rotated",
"data": {
"api_key_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"secret": "sk_live_…"
}
}
API Reference
Rotate API Key
Issue a fresh API key and invalidate the old one.
POST
/
v1
/
sender
/
api-key
/
rotate
Rotate API Key
curl --request POST \
--url https://b2b.usetapp.xyz/v1/sender/api-key/rotate \
--header 'API-Key: <api-key>'import requests
url = "https://b2b.usetapp.xyz/v1/sender/api-key/rotate"
headers = {"API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'API-Key': '<api-key>'}};
fetch('https://b2b.usetapp.xyz/v1/sender/api-key/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://b2b.usetapp.xyz/v1/sender/api-key/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 => [
"API-Key: <api-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://b2b.usetapp.xyz/v1/sender/api-key/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://b2b.usetapp.xyz/v1/sender/api-key/rotate")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://b2b.usetapp.xyz/v1/sender/api-key/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "API key rotated",
"data": {
"api_key_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"secret": "sk_live_…"
}
}
Rotates your API key. Authenticate this request with your current key; the
old key is invalidated immediately and the response returns the new one.
After rotating, use the returned
api_key_id as your API-Key header. The
previous key stops working right away — update your integration before the next
request. Store the secret securely; it’s used to verify webhook signatures.Header Parameters
string
required
Your current API key.
Response
string
Response state (
success).object
{
"status": "success",
"message": "API key rotated",
"data": {
"api_key_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"secret": "sk_live_…"
}
}