{% extends "baseTemplate/index.html" %} {% load static %} {% comment %} REST API token management. The plaintext token is rendered exactly once, in the response to the issuing call; every page load after that shows only a prefix. {% endcomment %} {% block title %}API access{% endblock %} {% block content %} {% comment %} The stored allowlist is handed to the controller through a data attribute so Django does the escaping; never interpolate server text into a script body. {% endcomment %}

API access

Tokens authenticate automated callers against the CloudPanel REST API at /api/.

Profile

New token for

Copy it now. This is the only time the full value is shown — the panel stores it but never displays it again. If you lose it, issue a new one, which invalidates this one.

Your token

Account
{{ userName }}
Status
{% if apiEnabled %} Enabled {% else %} Disabled {% endif %}
Token
{% if hasToken %} {{ tokenPrefix }}… (prefix only) {% else %} No token issued {% endif %}
Rate limit
{{ rateLimitPerMinute }} requests / minute
Last used
{{ lastUsed }}
Applied when the token is issued. A leaked token is still useless from an address outside this list.
{% if hasToken %} {% endif %}

Using the token

Send it as a bearer token:

curl -H "Authorization: Bearer <token>" \
     https://cp.a1hosting.net:8090/api/
  • Issuing a new token immediately invalidates the old one.
  • Revoking also switches API access off for the account.
  • Issue and revoke are both written to the audit log, with the prefix but never the token itself.
{% if manageableUsers %}

Manage another account's token

Issuing a token for an account is equivalent to holding its credentials, so this is limited to accounts you own.

{% endif %}
{% endblock %} {% block scripts %} {% endblock %}