Skip to main content

Auth

These are the docs for various authentication endpoints. Used for getting the currently logged in user, as well as fetching and creating access tokens.

Get self

Returns the currently logged in user.

GET /api/v3/auth/self
Required scope

user:read

Response
{
"avatarId": "67c4ac35f751623ec8fd366e",
"createdAt": "2025-03-02T19:06:29.538Z",
"id": "0vzj9trh",
"isAdmin": true,
"isContributor": true,
"isSupporter": true,
"username": "CodeMyst"
}

Generate a new access token

Generates a new access token with the specified scopes. The access tokens will get created for the user you're logged in as.

POST /api/v3/auth/self/access_tokens

The list of available scopes: paste, paste:read, user, user:read, user:access_tokens

Once you get the access token, you will never be able to see the actual secret token again.

Required scope

user:access_tokens

Request
{
"scopes": ["paste:read", "user:read"],
"description": "text to remind you what the access token is for",
"expiresIn": "never"
}
Response
{
"accessToken": "...",
"expiresAt": null
}

Get all access tokens

Returns the list of all of your access tokens. This response doesn't actually return the access token strings, since they're encrypted.

GET /api/v3/auth/self/access_tokens
Required scope

user:access_tokens

Response
[
{
"id": "juhbgytr",
"description": "my access token",
"createdAt": "2025-03-02T19:06:29.538Z",
"expiresAt": "never",
"scopes": ["paste:read", "user:read"]
}
]

Delete an access token

Deletes a single access token by its ID.

DELETE /api/v3/auth/self/access_tokens/:id
Required scope

user:access_tokens