curl --request POST 'https://api.voicecheap.ai/oauth/revoke' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE' \
--data-urlencode 'client_id=mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' \
--data-urlencode 'token_type_hint=refresh_token'
const input = {
token: 'mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
client_id: 'mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
token_type_hint: 'refresh_token',
};
const response = await fetch('https://api.voicecheap.ai/oauth/revoke', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams(input),
redirect: 'manual',
});
console.log(response.status, await response.text());
import os
import requests
response = requests.request(
"POST",
"https://api.voicecheap.ai/oauth/revoke",
headers={"Content-Type":"application/x-www-form-urlencoded"},
data={"token": "mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", "client_id": "mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "token_type_hint": "refresh_token"},
timeout=120,
allow_redirects=False,
)
print(response.status_code, response.text)
OAuth 和 MCP 协议
撤销 MCP OAuth 连接
使用连接的某个访问令牌或刷新令牌,以及已注册的 client_id 撤销该连接。
POST
/
oauth
/
revoke
curl --request POST 'https://api.voicecheap.ai/oauth/revoke' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE' \
--data-urlencode 'client_id=mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' \
--data-urlencode 'token_type_hint=refresh_token'
const input = {
token: 'mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
client_id: 'mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
token_type_hint: 'refresh_token',
};
const response = await fetch('https://api.voicecheap.ai/oauth/revoke', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams(input),
redirect: 'manual',
});
console.log(response.status, await response.text());
import os
import requests
response = requests.request(
"POST",
"https://api.voicecheap.ai/oauth/revoke",
headers={"Content-Type":"application/x-www-form-urlencoded"},
data={"token": "mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", "client_id": "mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "token_type_hint": "refresh_token"},
timeout=120,
allow_redirects=False,
)
print(response.status_code, response.text)
使用连接的某个访问令牌或刷新令牌,以及已注册的 client_id 撤销该连接。
POST https://api.voicecheap.ai/oauth/revoke
身份验证
无客户端密钥。在 URL 编码的表单请求体中发送 token 和 client_id。请求体
string
必填
已签发的 MCP 访问令牌或刷新令牌。未知的令牌字符串也会被接受,不会透露令牌是否存在。最小长度: 1. 最大长度: 256. 匹配模式:
^[^\u0000-\u001F\u007F]+$.string
必填
与令牌关联的 client_id。缺失或格式错误的标量会被拒绝;未知或不匹配的客户端会返回成功。最小长度: 1. 最大长度: 2048. 匹配模式:
^[^\u0000-\u001F\u007F]+$.field
可选的标准提示。此实现忽略该字段,不验证其值;令牌前缀决定令牌类别。
技术架构
技术架构
{
"type": "object",
"properties": {
"token": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[^\\u0000-\\u001F\\u007F]+$",
"description": "An issued MCP access or refresh token. Unknown token strings are accepted without revealing whether a token exists."
},
"client_id": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"pattern": "^[^\\u0000-\\u001F\\u007F]+$",
"description": "The client_id associated with the token. A missing or malformed scalar is rejected; an unknown or mismatched client returns success."
},
"token_type_hint": {
"description": "Optional standard hint. This implementation ignores this field and does not validate its value; token prefixes determine the token family."
}
},
"required": [
"token",
"client_id"
],
"additionalProperties": true
}
请求示例
请遵循此路由文档规定的编码和身份验证方式。操作 API 的封装格式和幂等性规则仅适用于操作调用。curl --request POST 'https://api.voicecheap.ai/oauth/revoke' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE' \
--data-urlencode 'client_id=mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' \
--data-urlencode 'token_type_hint=refresh_token'
const input = {
token: 'mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
client_id: 'mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
token_type_hint: 'refresh_token',
};
const response = await fetch('https://api.voicecheap.ai/oauth/revoke', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams(input),
redirect: 'manual',
});
console.log(response.status, await response.text());
import os
import requests
response = requests.request(
"POST",
"https://api.voicecheap.ai/oauth/revoke",
headers={"Content-Type":"application/x-www-form-urlencoded"},
data={"token": "mcp_refresh_EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", "client_id": "mcp_client_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "token_type_hint": "refresh_token"},
timeout=120,
allow_redirects=False,
)
print(response.status_code, response.text)
响应
一个空 JSON 对象。未知令牌、错误的客户端关联和已撤销的连接也会返回 HTTP 200。HTTP 200
{}
响应头
{
"Cache-Control": "no-store",
"Pragma": "no-cache"
}
操作说明
- 受支持的标量参数必须仅提供一次,值须为不含 ASCII 控制字符或 DEL 的非空字符串。重复的查询或表单字段会解码为数组,在按标量读取时会被拒绝。
- 请使用 application/x-www-form-urlencoded。JSON 请求会被拒绝,并返回 invalid_request。
- 撤销已识别的访问令牌或刷新令牌都会撤销整个连接,并清除其活动刷新令牌;撤销范围不限于所提供的单个令牌。
- 此路由不要求也不检查 resource 参数。token_type_hint 和其他无法识别的字段会被忽略。
- 此端点不会先获取客户端注册信息。格式正确但未知的 client_id、与令牌不匹配的 client_id 或未知令牌都会返回 {},不会泄露令牌是否有效。
- 公共撤销接口的限流为每个客户端 IP 每分钟 60 次请求,由所有工作进程共享。URL 编码请求体的上限为 32 KiB。
- 动态注册返回的 client_id,或客户端元数据文档的精确公开 HTTPS URL。
错误
| HTTP 状态 | 代码 | 含义或恢复方式 |
|---|---|---|
| 400 | invalid_request | 请求体或已识别的参数无效、缺失、重复或编码错误。 |
| 413 | REQUEST_TOO_LARGE | 请求超出允许的请求体大小。JSON 上限为 1 MiB,URL 编码表单上限为 32 KiB。 |
| 415 | UNSUPPORTED_CONTENT_TYPE | 集成请求体解析器仅接受 JSON 或 URL 编码表单。具体路由可能要求使用其中一种编码。 |
| 429 | temporarily_unavailable | 已达到公开 OAuth 请求速率上限。请等待当前时间窗口结束后重试。 |
| 500 | server_error | 授权暂时不可用。请稍后重试。 |
此页面对您有帮助吗?

