Skip to content

Mint a personal API token.

POST
/v1/account/api-tokens
curl --request POST \
--url https://api.share2.us/v1/account/api-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "label": "example", "scopes": [ "shares:read" ], "expires_in_days": 1 }'

Creates a scoped, revocable personal access token. The raw token (s2u_pat_…) is returned exactly once in this response and never again. Enforces the plan’s api_token_limit. Requires an interactive login.

Media typeapplication/json
object
label
required
string
<= 120 characters
scopes
required
Array<string>
>= 1 items
Allowed values: shares:read shares:write account:read
expires_in_days

Days until expiry. 0 or omitted means no expiry.

integer
<= 3650

Token created. token is shown only here.

Media typeapplication/json
object
token
required

The raw token (s2u_pat_…). Shown only in this response — store it securely.

string
api_token
required

A personal access token as shown to its owner (never the secret).

object
id
required
string format: uuid
label
required
string
scopes
required
Array<string>
Allowed values: shares:read shares:write account:read
token_hint

Masked display form, e.g. “s2u_pat_…9f3a”. Never the full secret.

string
last_used_at
string format: date-time
nullable
expires_at
string format: date-time
nullable
revoked_at
string format: date-time
nullable
created_at
required
string format: date-time
Example
{
"api_token": {
"scopes": [
"shares:read"
]
}
}

Plan limit reached (api_token_limit_reached) or session required.

Standard error envelope.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{
"error": {
"code": "quota_exceeded"
}
}