Authentication to the API

Bearer tokens are used for authentication to the API. You can generate it by clicking on your profile and navigating to Security Controls. API token must be included in the headers on every request, and it must be explicitly specified that it’s a bearer token as follows:

Authorization: Bearer APITOKEN

All requests expect JSON, so you must change Content-Type and the Accept header:

Content-Type: application/json Accept: application/vnd.wisp.v1+json

Alternatively, instead of using tokens, you can pass the session cookie wisp_session to authenticate. This can be retrieved by authenticating with your user, or by retrieving it from a response of a successful API request.

A user-agent is required for some API endpoints.

-H 'Cookie: wisp_session=eyJpdiI6IjJ6S1R2c0FGUzJtbUtMZ0ZMWEU2L1E9PSIsInZhbHVlIjoiMGFvVEMrb1VZRVFvL1hDUFErZ2ZFazE1VWQzckVBQjF4UTRHTXpDMUdsSi95WTZ5VFFOMXBNdklrd0o1bFBpcnIyRVYxQjRtdFFOWXNuUHEyS2VIN1vOljVVbGYxS0tDeGZDb3BWV0hlWU9GZis1cnFjNmkyTGlKVDFxa1orWGwiLCJtYWMiOiI1ZGJhYmM4YWM3YWVjYTkxYTY5MTY2ZmI3MDMzMTkwODZjYTQ3NDM2NTdlN2Y1MWQ5MTUyMGIzMGNmODY4OTQyIn0%3D; expires=Wed, 02-Mar-2022 10:53:45 GMT;;

Example

curl "<https://your-panel.com/api/client/ENDPOINT>" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/vnd.wisp.v1+json" \\
  -H "Authorization: Bearer APITOKEN"

<aside> 💡 You must replace APITOKEN with your token and your-panel.com with your panel URL for all requests.

</aside>


Pagination

You can view if there are more servers to display using the meta.pagination data provided in the request.

To check the next page, you can append at end of the URL ?page=NUMBER and replace NUMBER with the desired page to load.

Example

https://your-panel.com/api/client/servers?page=1

?per_page=NUMBER can be passed to retrieve more requests per page. The default value is 10 and the max is 25.


Endpoints