Version: 2.0.22
API
INFORMATION
API access is available only on OpenPanel Enterprise edition
Enable​
To enable OpenAdmin API access:
opencli api on
Example output
# opencli api on
Updated api to on
Disable​
To disable OpenAdmin API access:
opencli api off
Example output
# opencli api off
Updated api to off
Status​
To check current OpenAdmin API status:
opencli api status
Example output
# opencli api status
on
API list​
opencli api list displays all API endpoints of the installed OpenAdmin version, with the access they need and a curl example for each. The list is built into the OpenAdmin binary from the same source as the API docs on OpenAdmin > Settings > API, and the examples use the OpenAdmin URL from opencli admin.
opencli api list
Example output
# opencli api list
# Authentication
Endpoint: GET /api/
Description: Health check - confirms the API is reachable.
Access: No authentication.
Example:
curl -X GET 'https://server.example.com:2087/api/'
--------------------------------------------------------------------------------
Endpoint: POST /api/
Description: Log in with username/password and obtain a JWT Bearer token, valid for 15 minutes.
Access: No authentication.
Example:
curl -X POST 'https://server.example.com:2087/api/' -H "Content-Type: application/json" -d '{"username":"admin","password":"secret"}'
--------------------------------------------------------------------------------
Endpoint: GET /api/whoami
Description: Returns the username embedded in the caller's JWT access token. Reads the identity directly from the token claims rather than the database, so it still answers even if the user row backing the token has since been deleted.
Access: Any authenticated user.
Example:
curl -X GET 'https://server.example.com:2087/api/whoami' -H "Authorization: Bearer TOKEN_HERE"
--------------------------------------------------------------------------------
...
Was this helpful?