Issue or revoke a portal access token
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/portals/{portal_id}/tokens \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"customer_id": "<string>",
"scopes": [],
"expires_in_days": 123
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '<string>', scopes: [], expires_in_days: 123})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/portals/{portal_id}/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/portals/{portal_id}/tokens"
payload = {
"customer_id": "<string>",
"scopes": [],
"expires_in_days": 123
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true
}{
"id": "<string>",
"token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}Portals
Issue or revoke a portal access token
POST
/
admin
/
api
/
projects
/
{project_id}
/
portals
/
{portal_id}
/
tokens
Issue or revoke a portal access token
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/portals/{portal_id}/tokens \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"customer_id": "<string>",
"scopes": [],
"expires_in_days": 123
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '<string>', scopes: [], expires_in_days: 123})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/portals/{portal_id}/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/portals/{portal_id}/tokens"
payload = {
"customer_id": "<string>",
"scopes": [],
"expires_in_days": 123
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true
}{
"id": "<string>",
"token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}Authorizations
sessionbearerAuth
The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.
Body
application/json
- Issue
- Revoke
One endpoint, two modes, discriminated by the presence of a string revoke.
The tenant's own identifier for their end customer. Trimmed; must be non-empty.
Minimum string length:
1Stored on the token but not enforced by the portal API today.
Must be finite and > 0 to take effect; anything else means the token never expires.
Response
Revoke mode only — the token was revoked.
Available options:
true