Revogar chave de API do projeto
curl --request POST \
--url https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke",
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>"
],
]);
$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://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "key_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"project_id": "proj_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "Loja do Zé",
"key_prefix": "rt_live_abc",
"last_four": "k3xQ",
"scopes": [
"messages:read"
],
"expires_at": "2023-11-07T05:31:56Z",
"ip_allowlist": [
"<string>"
],
"created_at": "2026-09-04T13:22:41.031Z",
"revoked_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}Projetos
Revogar chave de API do projeto
Revoga a chave. Ela deixa de funcionar na hora. Use depois de rotacionar uma chave, ou quando um cliente sair.
POST
/
v1
/
partner
/
projects
/
{projectId}
/
api_keys
/
{id}
/
revoke
Revogar chave de API do projeto
curl --request POST \
--url https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke",
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>"
],
]);
$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://api.routa.chat/v1/partner/projects/{projectId}/api_keys/{id}/revoke"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "key_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"project_id": "proj_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "Loja do Zé",
"key_prefix": "rt_live_abc",
"last_four": "k3xQ",
"scopes": [
"messages:read"
],
"expires_at": "2023-11-07T05:31:56Z",
"ip_allowlist": [
"<string>"
],
"created_at": "2026-09-04T13:22:41.031Z",
"revoked_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}Autorizações
Parâmetros de caminho
Resposta
Chave revogada. O revoked_at indica quando