TurnOffTheTV's Website

Sign in

If you don't have an account, you can create one.

About the turnoffthetv.xyz API

This API can be used for account management. All data (request/response bodies) is stored with JSON.

/api

GET - Response contains the API version as well as some useless information.
A good use of this endpoint is to check if the API is responsive.

/auth

POST - Request body must contain an object with "username" and "password" or "id" and "password" properties, with the username, user id, and user password.
Response contains a token that can be used to authorize other endpoints.
Alternatively, if the request body contains an object with the "token" property specified, the specified token will be unauthorized, if it exists.
Don't try to be funny and include "username", "password", and "token" in one request body.

/api/users

GET - Response contains a list of every user.
By default, this list contains user ids. By adding a name parameter (e.g. /api/users?name), the list will contain usernames.

/api/users/[user id]

GET - Response contains information about the specified user. When unauthenticated, this will be only their username and user id.
Supplying a bearer token (created by /auth endpoint) in the "Authorization" header will allow you to see more information.
By adding a name parameter (e.g. /api/users/[username]?name), you can specify the user by username.
PATCH - Update your user settings. A bearer token is required for this method.
Request body must contain an object that is supplied with the settings to update as properties with the same keys and types of the properties in the user data.
Properties that cannot be modified this way are: id, permissions, and gamepadConfigs. Properties that do not exist are also not valid.
If any of these are included in the request, they will be ignored. If any valid properties contain invalid values, the response will describe the error and nothing will be updated.

Back