Websites
Endpoints for managing websites.
Admins see every website on the server. Non-admin users see only their own.
List Websites
GET /api/v1/websites
Scope: read:websites
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number. See Pagination |
limit |
integer | Items per page. See Pagination |
Response
{
"data": [
{
"id": 11,
"user_id": 1,
"domain": "wordpress.local",
"system_user": "webuser",
"document_root": "/home/webuser/nexpanel/websites/wordpress.local/public_html",
"website_type": "php",
"php_version": "8.4",
"proxy_port": 0,
"ssl_enabled": false,
"is_active": true,
"created_at": "2026-08-10T05:12:33Z",
"updated_at": "2026-10-17T16:28:31Z"
}
],
"pagination": {
"page": 1,
"limit": 25,
"total": 1,
"total_pages": 1
}
}
| Field | Type | Description |
|---|---|---|
id |
integer | Website ID |
user_id |
integer | ID of the owning panel user |
domain |
string | Primary domain |
system_user |
string | OS user the site runs as |
document_root |
string | Path to the site's files |
website_type |
string | php, static, proxy, etc. |
php_version |
string | PHP version for PHP sites, empty otherwise |
proxy_port |
integer | Upstream port for proxy sites, 0 otherwise |
ssl_enabled |
boolean | true if SSL is active, false otherwise |
is_active |
boolean | true if the site is enabled, false if suspended |
created_at |
string (RFC 3339) | Creation timestamp |
updated_at |
string (RFC 3339) | Last update timestamp |
Example
curl -H "Authorization: Bearer $TOKEN" \
"https://panel.example.com/api/v1/websites?page=1&limit=10"
Get Website
GET /api/v1/websites/{id}
Scope: read:websites
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id |
integer | Website ID |
Response
Same shape as a single item in the list response, wrapped in data:
{
"data": {
"id": 11,
"domain": "wordpress.local",
...
}
}
Errors
| Code | Status | Condition |
|---|---|---|
not_found |
404 | Website does not exist |
forbidden |
403 | Website belongs to another user |
invalid_request |
400 | id is not a valid integer |
Example
curl -H "Authorization: Bearer $TOKEN" \
https://panel.example.com/api/v1/websites/11
Toggle Website Active Status
PATCH /api/v1/websites/{id}
Scope: write:websites
Enable or suspend a website. Regenerates the web server configuration, starts or stops the PHP-FPM pool for PHP sites, and reloads the web server. The change is applied immediately.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id |
integer | Website ID |
Request Body
{
"is_active": true
}
| Field | Type | Required | Description |
|---|---|---|---|
is_active |
boolean | Yes | true to enable, false to suspend |
Response
When the state changed:
{
"data": { ...updated website... },
"changed": true
}
When the website was already in the requested state:
{
"data": { ...website... },
"changed": false,
"message": "Website is already enabled."
}
Errors
| Code | Status | Condition |
|---|---|---|
invalid_request |
400 | Missing or non-boolean is_active, or malformed body |
not_found |
404 | Website does not exist |
forbidden |
403 | Website belongs to another user |
Example
curl -X PATCH \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"is_active": false}' \
https://panel.example.com/api/v1/websites/11
Related
- Authentication - token format and auth failures
- Responses - success response shape, including
changed - Pagination - list parameters and iteration
- Errors - error codes