Accounts
Access tokens and the scopes an account can grant them. Every command
also takes the common flags — --username/-u, --token/-t,
--profile, --id — described in Shared parameters.
mapbox accounts list-tokens
Lists the access tokens for an account. Requires the tokens:read scope. Secret (sk) entries omit the token string.
Results are paginated. When there are more, the CLI says so on stderr and
names the flags that fetch the next page, such as
--limit 2 --start cmtoken00000000000000002b.
Parameters:
| Parameter | Description |
|---|---|
--default | If true, return only the account's default token. If false, exclude the default token from the results. |
--limit | The maximum number of tokens to return. |
--sortby | Sort the tokens by their creation or last-modified date. Values: created, modified. |
--start | The token ID after which to start the listing, used for pagination. Supply the value from the Link header of the previous response. |
--usage | Filter the returned tokens by token type. Values: pk, sk. |
Examples:
mapbox accounts list-tokens
mapbox accounts list-tokens --limit 2
mapbox accounts list-tokens --usage sk --sortby created
mapbox accounts retrieve-token
Checks whether the token the command authenticates with is valid and reports what it carries. The outcome is in the response's code field: TokenValid, TokenMalformed, TokenInvalid, TokenExpired, or TokenRevoked.
Examples:
mapbox accounts retrieve-token
mapbox accounts retrieve-token --profile work -o json
mapbox accounts list-scopes
Lists the token scopes the account may request. Requires the scopes:list scope. Scopes usable with public (pk) tokens are marked "public": true.
Examples:
mapbox accounts list-scopes