curl --request POST \
--url https://{host}/v1/keys/revoke \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/keys/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v1/keys/revoke"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/v1/keys/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))
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "Invalid credentials.",
"doc_url": "https://docs.matambaintelligence.com/errors#unauthorized"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Nothing was done. Send the same request again after the Retry-After interval.",
"doc_url": "https://docs.matambaintelligence.com/errors#rate_limited"
}
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "The gateway encountered an internal error. Send the same request again, exactly as you sent it.",
"doc_url": "https://docs.matambaintelligence.com/errors#internal_error"
}
}{
"error": {
"type": "api_error",
"code": "service_unavailable",
"message": "The gateway is temporarily unable to process this request. Send the same request again, with the same Idempotency-Key if it has one.",
"doc_url": "https://docs.matambaintelligence.com/errors#service_unavailable"
}
}Revoke this key
Ends the key you send in the Authorization header, at once. Use it the moment a key leaks, at any hour. Any key can revoke itself, whatever its scopes, and from any address, including one a live key isn’t registered for. The answer is 204 whether the key worked, was already revoked or was never issued, so it never confirms that a key is real. To check, send any request with the key from one of your servers: 401 means it no longer works. Your other keys keep working, and a request the key started before you revoked it still finishes. Takes no body.
curl --request POST \
--url https://{host}/v1/keys/revoke \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/keys/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v1/keys/revoke"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/v1/keys/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))
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "Invalid credentials.",
"doc_url": "https://docs.matambaintelligence.com/errors#unauthorized"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Nothing was done. Send the same request again after the Retry-After interval.",
"doc_url": "https://docs.matambaintelligence.com/errors#rate_limited"
}
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "The gateway encountered an internal error. Send the same request again, exactly as you sent it.",
"doc_url": "https://docs.matambaintelligence.com/errors#internal_error"
}
}{
"error": {
"type": "api_error",
"code": "service_unavailable",
"message": "The gateway is temporarily unable to process this request. Send the same request again, with the same Idempotency-Key if it has one.",
"doc_url": "https://docs.matambaintelligence.com/errors#service_unavailable"
}
}Authorizations
Authorization: Bearer <key>. Sandbox keys start with mgw_test_ and live keys start with mgw_live_. Each key works only in its own environment, and a live key works only from the IP addresses or ranges registered for it.
Response
The key no longer works on this host, if it ever did. No body.