Websites

Websites, with their databases, FTP accounts and shell users.

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_idrequiredstring (uuid)

Response 200

idrequiredstring
domainrequiredstring
statusrequiredstring
php_versionrequiredstring | null
php_handlerstring | null
php_version_idstring | null
php_versionsobject[]default []
idrequiredstring
namerequiredstring
defaultbooleandefault false
web_serverstring | null
snippet_idstring | null
snippetsobject[]default []
idrequiredstring
namerequiredstring
sslrequiredboolean
ssl_letsencryptrequiredboolean
force_httpsrequiredboolean
document_rootrequiredstring | null
hd_quota_mbrequiredinteger | null
serverstring | null
aliasesstring[]default []
subdomainsstring[]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_idrequiredstring (uuid)

Body (JSON)

sslboolean | null
ssl_letsencryptboolean | null
force_httpsboolean | null
activeboolean | null
php_version_idstring | null
snippet_idstring | null

Response 200

idrequiredstring
domainrequiredstring
statusrequiredstring
php_versionrequiredstring | null
php_handlerstring | null
php_version_idstring | null
php_versionsobject[]default []
idrequiredstring
namerequiredstring
defaultbooleandefault false
web_serverstring | null
snippet_idstring | null
snippetsobject[]default []
idrequiredstring
namerequiredstring
sslrequiredboolean
ssl_letsencryptrequiredboolean
force_httpsrequiredboolean
document_rootrequiredstring | null
hd_quota_mbrequiredinteger | null
serverstring | null
aliasesstring[]default []
subdomainsstring[]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_idrequiredstring (uuid)

Response 200

idrequiredstring
namerequiredstring
usernamerequiredstring
activerequiredboolean
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_idrequiredstring (uuid)

Body (JSON)

namerequiredstring
usernamerequiredstring
passwordrequiredstring

Response 201

idrequiredstring
namerequiredstring
usernamerequiredstring
activerequiredboolean
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_idrequiredstring (uuid)
database_idrequiredstring

Body (JSON)

passwordstring | null
activeboolean | null

Response 200

idrequiredstring
namerequiredstring
usernamerequiredstring
activerequiredboolean
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_idrequiredstring (uuid)
database_idrequiredstring

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_idrequiredstring (uuid)

Response 200

idrequiredstring
usernamerequiredstring
quota_mbrequiredinteger | null
activerequiredboolean
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_idrequiredstring (uuid)

Body (JSON)

usernamerequiredstring
passwordrequiredstring
quota_mbintegerfrom 1, up to 10000000, default 1000

Response 201

idrequiredstring
usernamerequiredstring
quota_mbrequiredinteger | null
activerequiredboolean
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_idrequiredstring (uuid)
ftp_account_idrequiredstring

Body (JSON)

passwordstring | null
quota_mbinteger | nullfrom 1, up to 10000000
activeboolean | null

Response 200

idrequiredstring
usernamerequiredstring
quota_mbrequiredinteger | null
activerequiredboolean
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_idrequiredstring (uuid)
ftp_account_idrequiredstring

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_idrequiredstring (uuid)

Response 200

includedrequiredboolean
hoststring | null
prefixrequiredstring
itemsrequiredobject[]
idrequiredstring
usernamerequiredstring
activerequiredboolean
jailedrequiredboolean
ssh_keysrequiredobject[]
typerequiredstring
commentrequiredstring
fingerprintrequiredstring
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_idrequiredstring (uuid)

Body (JSON)

usernamerequiredstring
ssh_keysrequiredstringup to 20000 characters
passwordstring | null

Response 201

idrequiredstring
usernamerequiredstring
activerequiredboolean
jailedrequiredboolean
ssh_keysrequiredobject[]
typerequiredstring
commentrequiredstring
fingerprintrequiredstring
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_idrequiredstring (uuid)
shell_user_idrequiredstring

Body (JSON)

ssh_keysstring | nullup to 20000 characters
passwordstring | null
activeboolean | null

Response 200

idrequiredstring
usernamerequiredstring
activerequiredboolean
jailedrequiredboolean
ssh_keysrequiredobject[]
typerequiredstring
commentrequiredstring
fingerprintrequiredstring
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_idrequiredstring (uuid)
shell_user_idrequiredstring

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_…"