Regenerar la clave de API de un número
REGENERA la API key predeterminada de un solo número (el producto mantiene exactamente una clave predeterminada por número; no existe “crear otra clave”). Solo con alcance de tenant (403 NUMBER_SCOPE_NOT_ALLOWED para una clave de número). Pasa el número en whatsappNumberId: su clave anterior se rota/invalida y el nuevo valor crudo (campo key) se devuelve SOLO UNA VEZ; guárdalo. Número desconocido → 404 NUMBER_NOT_FOUND.
whatsappNumberId acepta el id del número o su id de instancia (ambos vienen de GET /v1/numbers). La nueva clave tiene el prefijo ps_number_.
Requiere una credencial con alcance de tenant. Con una clave de cuenta (x-workspace-id) el usuario debe ser ADMIN u OWNER (apikeys:rotate). Por OAuth/MCP el usuario debe ser el OWNER del workspace, verificado en vivo en cada llamada (403 OAUTH_SECRET_REQUIRES_OWNER en caso contrario), y el acto se registra primero en un log de auditoría; si ese registro no se puede escribir, no ocurre nada y la respuesta es 500 OAUTH_SECRET_AUDIT_UNAVAILABLE.
curl --request POST \
--url https://pilotstatus.com.br/v1/api-keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"whatsappNumberId": "wn_1"
}
'import requests
url = "https://pilotstatus.com.br/v1/api-keys"
payload = { "whatsappNumberId": "wn_1" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({whatsappNumberId: 'wn_1'})
};
fetch('https://pilotstatus.com.br/v1/api-keys', 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://pilotstatus.com.br/v1/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'whatsappNumberId' => 'wn_1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/api-keys"
payload := strings.NewReader("{\n \"whatsappNumberId\": \"wn_1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/api-keys")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"whatsappNumberId\": \"wn_1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"whatsappNumberId\": \"wn_1\"\n}"
response = http.request(request)
puts response.read_body{
"numberId": "wn_1",
"keyId": "k_new",
"keyPrefix": "ps_",
"keyLast4": "wxyz",
"key": "ps_...newreal...",
"createdAt": "2026-06-28T10:00:00.000Z"
}¿Esta página le ayudó?
curl --request POST \
--url https://pilotstatus.com.br/v1/api-keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"whatsappNumberId": "wn_1"
}
'import requests
url = "https://pilotstatus.com.br/v1/api-keys"
payload = { "whatsappNumberId": "wn_1" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({whatsappNumberId: 'wn_1'})
};
fetch('https://pilotstatus.com.br/v1/api-keys', 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://pilotstatus.com.br/v1/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'whatsappNumberId' => 'wn_1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/api-keys"
payload := strings.NewReader("{\n \"whatsappNumberId\": \"wn_1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/api-keys")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"whatsappNumberId\": \"wn_1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"whatsappNumberId\": \"wn_1\"\n}"
response = http.request(request)
puts response.read_body{
"numberId": "wn_1",
"keyId": "k_new",
"keyPrefix": "ps_",
"keyLast4": "wxyz",
"key": "ps_...newreal...",
"createdAt": "2026-06-28T10:00:00.000Z"
}