Revoke service account token
Create, rotate, revoke, and disable organization-scoped service accounts and hashed tokens.
POST
/
api
/
headless
/
v1
/
organizations
/
{organizationId}
/
service-accounts
/
{serviceAccountId}
/
tokens
/
{tokenId}
/
revoke
Revoke service account token
curl --request POST \
--url https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>",
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke"
payload = {
"reason": "<string>",
"idempotencyKey": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>', idempotencyKey: '<string>'})
};
fetch('https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke"
payload := strings.NewReader("{\n \"reason\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Enter a Forge service-account token or delegated OAuth access token. Mintlify adds the Bearer prefix.
Response
Token revoked.
⌘I
Revoke service account token
curl --request POST \
--url https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>",
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke"
payload = {
"reason": "<string>",
"idempotencyKey": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>', idempotencyKey: '<string>'})
};
fetch('https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke"
payload := strings.NewReader("{\n \"reason\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}