Texel API documentation

Within the restrictions set out by our License & Terms of service, you may automate certain actions within our service. Where not explicitly clarified elsewhere, the presence of documentation for a specific feature or endpoint on this page implies permission to operate said feature in an automated manner, (such as via a custom program, periodically, or through a third party), anywhere in the world where it is permitted by law.

No guarantee is made on our part about the availability, uptime, or stability of any particular endpoint. The service as described herein is provided on a "best effort" basis. We are not responsible for any losses incurred by network issues, downtime, user error, protocol misuse, or otherwise.


Gateway & Authentication

Obtaining an API token

You can obtain an API token in the  "Devices & API Tokens"  section of the account panel. The current limit is 8 API tokens. If you create a new one, the oldest one will be automatically deleted. Note that when a token is removed, all currently connected clients are instantly disconnected with error code 3003

While most APIs behave identically for API tokens and user tokens (ones obtained from localStorage.texel_token), it is strictly forbidden to use a user token in an automated manner for any endpoints that do not explicitly permit it. If we detect that you may be using a token type incorrectly, we will likely revoke the token immediately before issuing you a formal warning, or, in repeated cases, closing your account.

API Prefix

The default prefix for all API endpoints is

https://api.texel.gg/

This means websocket connections are made to wss://api.texel.gg/...

For 3rd-party servers, the API endpoint prefix within the official client can be changed via localStorage.api_endpoint

WebSocket Gateway

WEBSOCKET /<token>

Connects to the WebSocket gateway for all in-game actions, such as subscribing to areas or placing pixels

All WebSocket endpoints are performed in binary. It is recommended that you use the nanobuf library as that is how the server serializes and parses messages. If you wish to implement serialization from scratch, you can find more details, as well as reference implementations, from one of the github links listed below UTF-8 messages from either the client or the server are non-normative (e.g debug or logging) and should generally be ignored (and not sent) in production.

Account management

GET /revoke/<token>

Revokes token, which is also used for authenticating the request. This endpoint may be used on user tokens as well as API tokens.


Subscribing to updates

Todo

Placing pixels

Todo