Revoke a bot token
curl --request POST \
--url https://public-api.workchats.com/oauth/revoke \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"client_id": "<string>",
"client_secret": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({token: '<string>', client_id: '<string>', client_secret: '<string>'})
};
fetch('https://public-api.workchats.com/oauth/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.workchats.com/oauth/revoke"
payload = {
"token": "<string>",
"client_id": "<string>",
"client_secret": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}Reference
Revoke a bot token
Disconnects the App from the company the token belongs to: every token of the installation stops working at once, and the bot stays in its groups for a later reconnect.
Answers 200 {"ok": true} for any token, including an unknown or
already revoked one. Client credentials are optional; when sent, they
must authenticate, and a token issued to another App is left alone.
POST
/
oauth
/
revoke
Revoke a bot token
curl --request POST \
--url https://public-api.workchats.com/oauth/revoke \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"client_id": "<string>",
"client_secret": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({token: '<string>', client_id: '<string>', client_secret: '<string>'})
};
fetch('https://public-api.workchats.com/oauth/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.workchats.com/oauth/revoke"
payload = {
"token": "<string>",
"client_id": "<string>",
"client_secret": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}Authorizations
The App's client_id and client_secret, for the OAuth endpoints
Body
application/jsonapplication/x-www-form-urlencoded
Token to revoke
Response
Revoked, or nothing to revoke
Available options:
true