Skip to main content

Settings

These are the docs for the settings endpoints. Used for getting and changing the settings of your user, as well as local browser (cookie-based) settings.

Get the settings

Returns the settings. If requesting as the logged in user, it will return settings saved on the user. If not logged in it will return the settings saved in the browser as a cookie (or default settings if the cookie isn't set, and sets one).

GET /api/v3/settings
Required scope

user:read (if logged in)

Response

It will also set a new session cookie with settings if one didn't exist on the request.

{
"copyLinkOnCreate": false,
"defaultIndentationUnit": "spaces",
"defaultIndentationWidth": 4,
"defaultLanguage": "Autodetect",
"pasteView": "tabbed",
"textWrap": true,
"theme": "myst"
}

Update the settings

Updates the settings. If requesting as the logged in user, it will update the settings saved on the user. If not logged in it will update the settings saved in the browser as a cookie.

PATCH /api/v3/settings
Required scope

user (if logged in)

Request

It will also set a new session cookie with settings if one didn't exist on the request.

{
"copyLinkOnCreate": false,
"defaultIndentationUnit": "spaces",
"defaultIndentationWidth": 4,
"defaultLanguage": "Autodetect",
"pasteView": "tabbed",
"textWrap": true,
"theme": "myst"
}

Get the user settings

Returns the user settings of the currently logged in user.

GET /api/v3/settings/user
Required scope

user:read

Response
{
"showAllPastesOnProfile": true
}

Update the user settings

Updates the user settings of the currently logged in user.

PATCH /api/v3/settings/user
Required scope

user

Request
{
"showAllPastesOnProfile": true
}

Update the username

Updates the currently logged in user's username (if available).

PATCH /api/v3/settings/username

The new username must contain only alphanumeric characters and the ., -, _ symbols.

The maximum length is 20 characters.

Required scope

user

Request
{
"username": "NewUsername"
}
Request

You will get the status 400 Bad Request if the username is already taken (or trying to set the same username).

Update the avatar

Updates the currently logged in user's avatar.

PATCH /api/v3/settings/avatar

You should make the request as a multipart/form-data request with the file attached.

Required scope

user