Get a token for an account
Overview
Issue a token that acts as the account's owner.
Use this before calling account-scoped endpoints on a customer's behalf. A token lasts 7 days. Repeat calls return the same token while it's still valid, for up to 6 days after it was issued; after that a new token is issued and the previous one is revoked (prior_tokens_revoked counts them).
You'll need the account's id.
Returns a token. Use it as the Authorization header for the account-scoped calls.
Prerequisites
- A Partner token. See Authentication.
- The account's id (
account_id), from List accounts. The account must have an owner.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/partner/account-owner/token
Authentication
Partner token
- Any other token gets
403 Only partner users can mint brand-owner tokens. account_idmust be an account inside your partner's tree; otherwise403 Brand is not under your partner tree.- The token acts as the account's owner: it can do anything the owner can, on that account only.
Rate limit
120 requests per minute, counted per user (the token’s user). See Rate limits.
Request parameters
None.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
account_id | integer | Yes | The account to get a token for. Must exist, be an account (not a partner or location), and be inside your partner's tree. |
Request payload
{
"account_id": 5994
}Response body
The payload is inside data.
| Field | Type | Description |
|---|---|---|
status | string | success. |
token | string | The bearer token for the account's owner. Send it as Authorization: Bearer <token>. |
account_owner | object | Who the token acts as. |
account_owner.user_id | integer | The account owner's user id. |
account_owner.account_id | integer | The account's id. |
account_owner.expires_at | string or null | When the token expires (ISO 8601). |
account_owner.prior_tokens_revoked | integer | How many earlier tokens were revoked by this call. 0 when the same token was returned again. |
Response payload
{
"data": {
"status": "success",
"token": "<access-token>",
"account_owner": {
"user_id": 3011,
"account_id": 5994,
"expires_at": "2026-10-08T00:00:00+10:00",
"prior_tokens_revoked": 0
}
}
}Examples
Success payload
The first token for this owner, or the same token again: see Response payload.
A new token, with the previous one revoked:
{
"data": {
"status": "success",
"token": "<access-token>",
"account_owner": {
"user_id": 3011,
"account_id": 5994,
"expires_at": "2026-10-08T00:00:00+10:00",
"prior_tokens_revoked": 1
}
}
}Error payload
403 Not a Partner token
{
"message": "Forbidden",
"status": "error",
"errors": "Only partner users can mint brand-owner tokens."
}403 Account outside your tree
{
"message": "Forbidden",
"status": "error",
"errors": "Brand is not under your partner tree."
}404 Not an account
account_id is a partner or a location, not an account.
{
"message": "Not Found",
"status": "error",
"errors": "Company is not a brand."
}404 Account has no owner
{
"message": "Not Found",
"status": "error",
"errors": "Brand has no owner user."
}422 account_id missing
{
"message": "The account id field is required.",
"errors": {
"account_id": [
"The account id field is required."
]
}
}422 Account doesn't exist
{
"message": "The selected account id is invalid.",
"errors": {
"account_id": [
"The selected account id is invalid."
]
}
}| Status | Meaning |
|---|---|
200 | The token. |
401 | The token is missing, expired or invalid. |
403 | The token isn't a Partner token, or the account is outside your tree. |
404 | account_id isn't an account, or the account has no owner. |
422 | account_id is missing, isn't an integer, or doesn't exist. |
429 | More than 120 requests in a minute from this user. |
500 | Unexpected server error. |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/partner/account-owner/token" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"account_id": 5994}'Updated 17 days ago
