api_key field. Store it securely — this is the only time the full key will be shown. The previous key is invalidated immediately upon rotation.curl -X POST "https://api.adrelay.dev/v1/api-keys/rotate" \
-H "X-API-Key: $ADRELAY_API_KEY"
const response = await fetch("https://api.adrelay.dev/v1/api-keys/rotate", {
method: "POST",
headers: { "X-API-Key": process.env.ADRELAY_API_KEY },
});
const data = await response.json();
// Store data.api_key securely -- it won't be shown again
import requests
response = requests.post(
"https://api.adrelay.dev/v1/api-keys/rotate",
headers={"X-API-Key": "your-api-key-here"},
)
data = response.json()
# Store data["api_key"] securely -- it won't be shown again
{
"id": "key_new456",
"api_key": "ar_live_newkey1234567890abcdef",
"created_at": "2026-03-21T10:00:00Z"
}
{
"error": "Invalid or missing API key.",
"code": "UNAUTHORIZED",
"timestamp": 1711036800,
"request_id": "req_abc123"
}
API Keys
Rotate API Key
Rotate your API key. The previous key is immediately invalidated.
curl -X POST "https://api.adrelay.dev/v1/api-keys/rotate" \
-H "X-API-Key: $ADRELAY_API_KEY"
const response = await fetch("https://api.adrelay.dev/v1/api-keys/rotate", {
method: "POST",
headers: { "X-API-Key": process.env.ADRELAY_API_KEY },
});
const data = await response.json();
// Store data.api_key securely -- it won't be shown again
import requests
response = requests.post(
"https://api.adrelay.dev/v1/api-keys/rotate",
headers={"X-API-Key": "your-api-key-here"},
)
data = response.json()
# Store data["api_key"] securely -- it won't be shown again
{
"id": "key_new456",
"api_key": "ar_live_newkey1234567890abcdef",
"created_at": "2026-03-21T10:00:00Z"
}
{
"error": "Invalid or missing API key.",
"code": "UNAUTHORIZED",
"timestamp": 1711036800,
"request_id": "req_abc123"
}