api/docs/account/tokens.md

62 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

# `/account/tokens` - GET
2023-10-08 11:31:23 +00:00
Lists all active auth tokens for the account.
## HTTP Headers
2023-10-08 11:31:23 +00:00
| Header | Content |
|---------------|------------------|
| Authorization | `Bearer {token}` |
## Responses
2023-10-08 11:31:23 +00:00
### 200 - Success
2023-10-08 11:31:23 +00:00
__Content - JSON:__
2023-10-08 11:31:23 +00:00
| Field | Description |
|--------|-------------------------------------------------------------------------------------------------|
| tokens | A list of (token, expiration date) pairs. The expiration date is given as a UTC UNIX timestamp. |
2023-10-08 11:31:23 +00:00
### 401 - Error: Unauthorized
2023-10-08 11:31:23 +00:00
The provided auth token doesn't allow you to perform this operation.
2023-10-08 11:31:23 +00:00
### 403 - Error: Forbidden
2023-10-08 11:31:23 +00:00
Blocked for security reasons.
# `/account/tokens` - DELETE
2023-10-08 11:31:23 +00:00
Deletes a token of the authenticated account.
## HTTP Headers
2023-10-08 11:31:23 +00:00
| Header | Content |
|---------------|--------------------|
| Authorization | `Bearer {token}` |
| Content-Type | `application/json` |
## Content - JSON
2023-10-08 11:31:23 +00:00
| Field | Description |
|-------|-----------------------------------|
| token | The token that should be deleted. |
## Responses
2023-10-08 11:31:23 +00:00
### 200 - Success
2023-10-08 11:31:23 +00:00
The token was deleted.
2023-10-08 11:31:23 +00:00
### 401 - Error: Unauthorized
2023-10-08 11:31:23 +00:00
The provided auth token doesn't allow you to perform this operation.
2023-10-08 11:31:23 +00:00
### 403 - Error: Forbidden
2023-10-08 11:31:23 +00:00
Blocked for security reasons.
2023-10-08 11:31:23 +00:00
### 404 - Error: Not Found
2023-10-08 11:31:23 +00:00
The token that should be deleted wasn't found.