Websites
Websites, with their databases, FTP accounts and shell users.
- GET
/services/{service_id}/websiteA website - PATCH
/services/{service_id}/websiteChange a website - GET
/services/{service_id}/databasesList databases - POST
/services/{service_id}/databasesCreate a database - PATCH
/services/{service_id}/databases/{database_id}Change a database - DELETE
/services/{service_id}/databases/{database_id}Delete a database - GET
/services/{service_id}/ftp-accountsList FTP accounts - POST
/services/{service_id}/ftp-accountsCreate an FTP account - PATCH
/services/{service_id}/ftp-accounts/{ftp_account_id}Change an FTP account - DELETE
/services/{service_id}/ftp-accounts/{ftp_account_id}Delete an FTP account - GET
/services/{service_id}/shell-usersList shell users - POST
/services/{service_id}/shell-usersCreate a shell user - PATCH
/services/{service_id}/shell-users/{shell_user_id}Change a shell user - DELETE
/services/{service_id}/shell-users/{shell_user_id}Delete a shell user
A website
GET/services/{service_id}/website
Needs the permission website:read
Its folder, PHP version, quota, web server, alias domains, and what can be changed.
Path
service_idrequired | string (uuid) |
Response 200
idrequired | string | |
domainrequired | string | |
statusrequired | string | |
php_versionrequired | string | null | |
php_handler | string | null | |
php_version_id | string | null | |
php_versions | object[] | default [] |
idrequired | string | |
namerequired | string | |
default | boolean | default false |
web_server | string | null | |
snippet_id | string | null | |
snippets | object[] | default [] |
idrequired | string | |
namerequired | string | |
sslrequired | boolean | |
ssl_letsencryptrequired | boolean | |
force_httpsrequired | boolean | |
document_rootrequired | string | null | |
hd_quota_mbrequired | integer | null | |
server | string | null | |
aliases | string[] | default [] |
subdomains | string[] | default [] |
curl "https://portal.nimag.net/api/v1/services/{service_id}/website" \
-H "Authorization: Bearer nck_…"{
"id": "string",
"domain": "string",
"status": "string",
"php_version": "string",
"php_handler": "string",
"php_version_id": "string",
"php_versions": [],
"web_server": "string",
"snippet_id": "string",
"snippets": [],
"ssl": true,
"ssl_letsencrypt": true,
"force_https": true,
"document_root": "string",
"hd_quota_mb": 0,
"server": "string",
"aliases": [],
"subdomains": []
}Change a website
PATCH/services/{service_id}/website
Needs the permission website:manage
SSL, HTTPS redirect, the PHP version (one of php_versions) and the web server configuration (one of snippets). The web server applies a change within a minute or two.
Path
service_idrequired | string (uuid) |
Body (JSON)
ssl | boolean | null | |
ssl_letsencrypt | boolean | null | |
force_https | boolean | null | |
active | boolean | null | |
php_version_id | string | null | |
snippet_id | string | null |
Response 200
idrequired | string | |
domainrequired | string | |
statusrequired | string | |
php_versionrequired | string | null | |
php_handler | string | null | |
php_version_id | string | null | |
php_versions | object[] | default [] |
idrequired | string | |
namerequired | string | |
default | boolean | default false |
web_server | string | null | |
snippet_id | string | null | |
snippets | object[] | default [] |
idrequired | string | |
namerequired | string | |
sslrequired | boolean | |
ssl_letsencryptrequired | boolean | |
force_httpsrequired | boolean | |
document_rootrequired | string | null | |
hd_quota_mbrequired | integer | null | |
server | string | null | |
aliases | string[] | default [] |
subdomains | string[] | default [] |
curl -X PATCH "https://portal.nimag.net/api/v1/services/{service_id}/website" \
-H "Authorization: Bearer nck_…" \
-H "Content-Type: application/json" \
-d '{
"ssl": true,
"ssl_letsencrypt": true,
"force_https": true,
"active": true,
"php_version_id": "string",
"snippet_id": "string"
}'{
"id": "string",
"domain": "string",
"status": "string",
"php_version": "string",
"php_handler": "string",
"php_version_id": "string",
"php_versions": [],
"web_server": "string",
"snippet_id": "string",
"snippets": [],
"ssl": true,
"ssl_letsencrypt": true,
"force_https": true,
"document_root": "string",
"hd_quota_mb": 0,
"server": "string",
"aliases": [],
"subdomains": []
}List databases
GET/services/{service_id}/databases
Needs the permission website:read
Path
service_idrequired | string (uuid) |
Response 200
idrequired | string | |
namerequired | string | |
usernamerequired | string | |
activerequired | boolean |
curl "https://portal.nimag.net/api/v1/services/{service_id}/databases" \
-H "Authorization: Bearer nck_…"[
{
"id": "string",
"name": "string",
"username": "string",
"active": true
}
]Create a database
POST/services/{service_id}/databases
Needs the permission website:manage
With its user. The account's prefix is added in front of both names.
Path
service_idrequired | string (uuid) |
Body (JSON)
namerequired | string | |
usernamerequired | string | |
passwordrequired | string |
Response 201
idrequired | string | |
namerequired | string | |
usernamerequired | string | |
activerequired | boolean |
curl -X POST "https://portal.nimag.net/api/v1/services/{service_id}/databases" \
-H "Authorization: Bearer nck_…" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"username": "string",
"password": "string"
}'{
"id": "string",
"name": "string",
"username": "string",
"active": true
}Change a database
PATCH/services/{service_id}/databases/{database_id}
Needs the permission website:manage
Its user's password, or whether it is active.
Path
service_idrequired | string (uuid) | |
database_idrequired | string |
Body (JSON)
password | string | null | |
active | boolean | null |
Response 200
idrequired | string | |
namerequired | string | |
usernamerequired | string | |
activerequired | boolean |
curl -X PATCH "https://portal.nimag.net/api/v1/services/{service_id}/databases/{database_id}" \
-H "Authorization: Bearer nck_…" \
-H "Content-Type: application/json" \
-d '{
"password": "string",
"active": true
}'{
"id": "string",
"name": "string",
"username": "string",
"active": true
}Delete a database
DELETE/services/{service_id}/databases/{database_id}
Needs the permission website:manage
Its data is deleted with it.
Path
service_idrequired | string (uuid) | |
database_idrequired | string |
Response 204: no content.
curl -X DELETE "https://portal.nimag.net/api/v1/services/{service_id}/databases/{database_id}" \
-H "Authorization: Bearer nck_…"List FTP accounts
GET/services/{service_id}/ftp-accounts
Needs the permission website:read
Path
service_idrequired | string (uuid) |
Response 200
idrequired | string | |
usernamerequired | string | |
quota_mbrequired | integer | null | |
activerequired | boolean |
curl "https://portal.nimag.net/api/v1/services/{service_id}/ftp-accounts" \
-H "Authorization: Bearer nck_…"[
{
"id": "string",
"username": "string",
"quota_mb": 0,
"active": true
}
]Create an FTP account
POST/services/{service_id}/ftp-accounts
Needs the permission website:manage
Path
service_idrequired | string (uuid) |
Body (JSON)
usernamerequired | string | |
passwordrequired | string | |
quota_mb | integer | from 1, up to 10000000, default 1000 |
Response 201
idrequired | string | |
usernamerequired | string | |
quota_mbrequired | integer | null | |
activerequired | boolean |
curl -X POST "https://portal.nimag.net/api/v1/services/{service_id}/ftp-accounts" \
-H "Authorization: Bearer nck_…" \
-H "Content-Type: application/json" \
-d '{
"username": "string",
"password": "string",
"quota_mb": 1000
}'{
"id": "string",
"username": "string",
"quota_mb": 0,
"active": true
}Change an FTP account
PATCH/services/{service_id}/ftp-accounts/{ftp_account_id}
Needs the permission website:manage
Path
service_idrequired | string (uuid) | |
ftp_account_idrequired | string |
Body (JSON)
password | string | null | |
quota_mb | integer | null | from 1, up to 10000000 |
active | boolean | null |
Response 200
idrequired | string | |
usernamerequired | string | |
quota_mbrequired | integer | null | |
activerequired | boolean |
curl -X PATCH "https://portal.nimag.net/api/v1/services/{service_id}/ftp-accounts/{ftp_account_id}" \
-H "Authorization: Bearer nck_…" \
-H "Content-Type: application/json" \
-d '{
"password": "string",
"quota_mb": 0,
"active": true
}'{
"id": "string",
"username": "string",
"quota_mb": 0,
"active": true
}Delete an FTP account
DELETE/services/{service_id}/ftp-accounts/{ftp_account_id}
Needs the permission website:manage
Path
service_idrequired | string (uuid) | |
ftp_account_idrequired | string |
Response 204: no content.
curl -X DELETE "https://portal.nimag.net/api/v1/services/{service_id}/ftp-accounts/{ftp_account_id}" \
-H "Authorization: Bearer nck_…"List shell users
GET/services/{service_id}/shell-users
Needs the permission website:read
Whether the package includes them, the host to log in to and the name prefix.
Path
service_idrequired | string (uuid) |
Response 200
includedrequired | boolean | |
host | string | null | |
prefixrequired | string | |
itemsrequired | object[] | |
idrequired | string | |
usernamerequired | string | |
activerequired | boolean | |
jailedrequired | boolean | |
ssh_keysrequired | object[] | |
typerequired | string | |
commentrequired | string | |
fingerprintrequired | string |
curl "https://portal.nimag.net/api/v1/services/{service_id}/shell-users" \
-H "Authorization: Bearer nck_…"{
"included": true,
"host": "string",
"prefix": "string",
"items": [
{
"id": "string",
"username": "string",
"active": true,
"jailed": true,
"ssh_keys": [
{
"type": "string",
"comment": "string",
"fingerprint": "string"
}
]
}
]
}Create a shell user
POST/services/{service_id}/shell-users
Needs the permission website:manage
SSH access to the website's folder, in a chroot, with SSH public keys.
Path
service_idrequired | string (uuid) |
Body (JSON)
usernamerequired | string | |
ssh_keysrequired | string | up to 20000 characters |
password | string | null |
Response 201
idrequired | string | |
usernamerequired | string | |
activerequired | boolean | |
jailedrequired | boolean | |
ssh_keysrequired | object[] | |
typerequired | string | |
commentrequired | string | |
fingerprintrequired | string |
curl -X POST "https://portal.nimag.net/api/v1/services/{service_id}/shell-users" \
-H "Authorization: Bearer nck_…" \
-H "Content-Type: application/json" \
-d '{
"username": "string",
"ssh_keys": "string",
"password": "string"
}'{
"id": "string",
"username": "string",
"active": true,
"jailed": true,
"ssh_keys": [
{
"type": "string",
"comment": "string",
"fingerprint": "string"
}
]
}Change a shell user
PATCH/services/{service_id}/shell-users/{shell_user_id}
Needs the permission website:manage
Its SSH keys (the whole list), password, or whether it is active.
Path
service_idrequired | string (uuid) | |
shell_user_idrequired | string |
Body (JSON)
ssh_keys | string | null | up to 20000 characters |
password | string | null | |
active | boolean | null |
Response 200
idrequired | string | |
usernamerequired | string | |
activerequired | boolean | |
jailedrequired | boolean | |
ssh_keysrequired | object[] | |
typerequired | string | |
commentrequired | string | |
fingerprintrequired | string |
curl -X PATCH "https://portal.nimag.net/api/v1/services/{service_id}/shell-users/{shell_user_id}" \
-H "Authorization: Bearer nck_…" \
-H "Content-Type: application/json" \
-d '{
"ssh_keys": "string",
"password": "string",
"active": true
}'{
"id": "string",
"username": "string",
"active": true,
"jailed": true,
"ssh_keys": [
{
"type": "string",
"comment": "string",
"fingerprint": "string"
}
]
}Delete a shell user
DELETE/services/{service_id}/shell-users/{shell_user_id}
Needs the permission website:manage
Path
service_idrequired | string (uuid) | |
shell_user_idrequired | string |
Response 204: no content.
curl -X DELETE "https://portal.nimag.net/api/v1/services/{service_id}/shell-users/{shell_user_id}" \
-H "Authorization: Bearer nck_…"