Deploi API Reference

Welcome to the Deploi API documentation. All requests should be made to https://api.deploi.no. The API accepts JSON bodies and returns JSON responses.

Base URL: https://api.deploi.no

Authentication

5 endpoints

Login

Login to account.

Request Parameters

FieldTypeDescription
usernameReqstringThe e-mail of the user.
passwordReqstringThe password of the user.
secondfactorstringTwo factor code for two factor authentication.
Request Body
{
  "command": "Login",
  "username": "username",
  "password": "password",
  "secondfactor": "413903"
}
Response Body
{
  "success": true,
  "message": "Login successful.",
  "messageId": 0,
  "data": {
    "token": "cebxfljqkzjyirqxvyxsbaxdq",
    "clients": [
      {
        "id": 123,
        "name": "Company A"
      },
      {
        "id": 321,
        "name": "Company B"
      }
    ]
  }
}

Logout

Log out of an account.

Request Parameters

FieldTypeDescription
tokenReqstringMust be a valid authentication token
Request Body
{
  "command": "Logout",
  "token": "cebxfljqkzjyirqxvyxsbaxdq"
}
Response Body
{
  "success": true,
  "message": "Logout successful."
}

Register

Register a new account.

Request Parameters

FieldTypeDescription
firstnameReqstringThe first name of the contact person
lastnameReqstringThe last name of the contact person
emailReqstringThe email of the contact person
typeReqstringMust either 'company' or 'person'
Request Body
{
  "command": "Register",
  "firstname": "John",
  "lastname": "Reugers",
  "email": "[email protected]",
  "phone": "98162249",
  "password": "mcyf3ZA5uQGfm7S",
  "type": "company",
  "companyname": "example company",
  "taxid": "39346459374947",
  "addressline1": "Gardveien 11",
  "addressline2": "",
  "city": "Oslo",
  "state": "",
  "postalcode": "0193",
  "country": "NO",
  "agreedtotac": true,
  "receiveinfo": false,
  "ehfinvoice": false
}
Response Body
{
  "success": true,
  "message": "Registration successful.",
  "messageId": 1
}

GetUserInfo

Get user information.

Request Parameters

FieldTypeDescription
tokenReqstringMust be a valid authentication token
Request Body
{
  "command": "GetUserInfo",
  "token": "cebxfljqkzjyirqxvyxsbaxdq"
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0,
  "userInfo": {
    "id": 432,
    "firstname": "Bob",
    "lastname": "Jensen",
    "email": "[email protected]",
    "twoFactorAuthentication": false,
    "accounts": [
      123,
      321
    ]
  }
}

Ping

Simple operation used to check if the API is up.

Request Body
{
  "command": "Ping"
}
Response Body
{
  "success": true,
  "data": "pong"
}

Domains

7 endpoints

GetDomains

Get domain list for account.

Request Parameters

FieldTypeDescription
tokenReqstringMust be a valid authentication token
clientidReqnumberThe ID of the client
Request Body
{
  "command": "GetDomains",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0,
  "domains": [
    {
      "name": "inductive.no",
      "id": "7",
      "status": "active",
      "registrationDate": "2015-06-01",
      "expiryDate": "2023-06-01",
      "nextDueDate": "2023-05-01"
    }
  ]
}

DomainAvailable

Check if a domain is available.

Request Parameters

FieldTypeDescription
domainReqstringThe domain name
Request Body
{
  "command": "DomainAvailable",
  "domain": "example.com"
}
Response Body
{
  "success": true,
  "message": "success",
  "messageId": 10,
  "available": false
}

GetDomainPrice

Get the price of a domain. Includes prices for registration, transfer and renewal.

Request Parameters

FieldTypeDescription
domainReqstringDomain name
Request Body
{
  "command": "GetDomainPrice",
  "domain": "example.com"
}
Response Body
{
  "success": true,
  "message": "Price found.",
  "messageId": 10,
  "priceRegistration": "95",
  "priceTransfer": "95",
  "priceRenewal": "95"
}

OrderDomain

Order a new domain.

Request Parameters

FieldTypeDescription
domainReqstringThe domain name
operationReqstringCan be 'register' or 'transfer'
ownerReqobjectThe legal owner of the domain
Request Body
{
  "command": "OrderDomain",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 15,
  "domain": "example.com",
  "operation": "register",
  "prepare": false,
  "authcode": "",
  "setOwnerAndContacts": true,
  "setOwner": true,
  "owner": {
    "firstname": "John",
    "lastname": "Eirik",
    "email": "[email protected]",
    "phone": "48165937",
    "companyname": "",
    "taxid": "",
    "type": "person",
    "addressline1": "Kasperudgata 48",
    "country": "NO",
    "state": "Ålesund",
    "postalcode": "4487",
    "city": "Ålesund"
  }
}
Response Body
{
  "success": true,
  "message": "Domain order processing.",
  "messageId": 35
}

GetDomainRecords

Get the records of a domain.

Request Parameters

FieldTypeDescription
domainReqstringThe domain name
Request Body
{
  "command": "GetDomainRecords",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "domain": "example.com"
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0,
  "records": [
    {
      "type": "A",
      "host": "www.progsbase.com",
      "value": "192.0.2.146",
      "options": {
        "ttl": 86400
      }
    }
  ]
}

AddDomainRecord

Add domain record.

Request Parameters

FieldTypeDescription
typeReqstringCan be A, AAAA, TXT, MX, CNAME, SOA, SRV
hostReqstringThe subdomain
valueReqstringThe value of the record
Request Body
{
  "command": "AddDomainRecord",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "domain": "example.com",
  "type": "A",
  "host": "www",
  "value": "192.0.2.146",
  "options": {
    "ttl": 86400
  }
}
Response Body
{
  "success": true,
  "message": "Record added.",
  "messageId": 57
}

DeleteDomainRecord

Delete a domain record.

Request Parameters

FieldTypeDescription
domainReqstringThe domain name
typeReqstringRecord type
hostReqstringThe subdomain
Request Body
{
  "command": "DeleteDomainRecord",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "domain": "example.com",
  "type": "A",
  "host": "www",
  "value": "192.0.2.146"
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0
}

Servers

5 endpoints

GetServers

List servers.

Request Parameters

FieldTypeDescription
clientidReqnumberThe ID of the client
Request Body
{
  "command": "GetServers",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0,
  "servers": [
    {
      "id": 2,
      "name": "testvps",
      "type": "virtual",
      "ram": 2,
      "cpu": 1,
      "disk": 10,
      "status": "active"
    }
  ]
}

CreateVirtualServer

Create virtual server.

Request Parameters

FieldTypeDescription
nameReqstringName of server
ramReqnumberGB of RAM
cpuReqnumberCPU cores
OSReqstringOS to install
Request Body
{
  "command": "CreateVirtualServer",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 10,
  "name": "My server",
  "ram": 16,
  "cpu": 4,
  "disks": [
    {
      "name": "mydisk1",
      "size": 40,
      "type": "ssd"
    }
  ],
  "OS": "Ubuntu 22.04",
  "username": "bob",
  "password": "Pn37NaQbN6bfAg7",
  "publicip": true
}
Response Body
{
  "success": true,
  "message": "Server ordered.",
  "messageId": 10
}

GetServerInfo

List server information.

Request Parameters

FieldTypeDescription
idReqnumberID of the server
Request Body
{
  "command": "GetServerInfo",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "id": 123
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0,
  "serverInfo": {
    "type": "virtual",
    "virtual": {
      "mainip": "192.0.2.55",
      "ram": 2,
      "cpu": 1,
      "disks": [
        {
          "id": "125",
          "type": "ssd",
          "size": 20
        }
      ],
      "running": true
    }
  }
}

RestartVirtualServer

Requests a graceful restart from the server's operating system.

Request Parameters

FieldTypeDescription
idReqnumberID of the server service
Request Body
{
  "command": "RestartVirtualServer",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "id": 123
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0
}

MonitorCPU

Gets CPU usage information

Request Parameters

FieldTypeDescription
idReqnumberID of the server
Request Body
{
  "command": "MonitorCPU",
  "token": "abc123",
  "id": 748
}
Response Body
{
  "success": true,
  "data": {
    "average": "1.00",
    "total": "4",
    "used": 25
  }
}

Firewall & Security

3 endpoints

GetFirewalls

Get the list of firewall services.

Request Parameters

FieldTypeDescription
clientidReqnumberThe ID of the client
Request Body
{
  "command": "GetFirewalls",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123
}
Response Body
{
  "success": true,
  "firewalls": [
    {
      "id": 675,
      "name": "Inductive Firewall",
      "tb": 1,
      "ipv4s": 1,
      "status": "active",
      "type": "ip"
    }
  ]
}

CreateFirewall

Create firewall.

Request Parameters

FieldTypeDescription
nameReqstringName of firewall
tbReqnumberTerabytes of data processing per month
ipv4sReqnumberNumber of public IPv4 addresses
Request Body
{
  "command": "CreateFirewall",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123,
  "name": "My Firewall",
  "tb": 1,
  "ipv4s": 2,
  "type": "ip"
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0
}

AddFirewallRule

Add firewall rule.

Request Parameters

FieldTypeDescription
idReqnumberThe ID of the firewall
src-cidrReqstringCIDR of allowed addresses
dst-portReqnumberPort to expose
Request Body
{
  "command": "AddFirewallRule",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "id": 123,
  "src-cidr": "192.0.2.0/8",
  "src-ip": "192.0.2.2",
  "src-port": 59375,
  "dst-ip": "10.0.1.5",
  "dst-port": 22
}
Response Body
{
  "success": true,
  "message": "",
  "messageId": 0
}

Databases

1 endpoints

GetDatabases

Get managed databases

Request Parameters

FieldTypeDescription
clientidReqnumberThe ID of the client
Request Body
{
  "command": "GetDatabases",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123
}
Response Body
{
  "success": true,
  "databases": [
    {
      "id": 106,
      "type": "MySQL",
      "ram": 1,
      "cpu": 0.25,
      "disk": 10,
      "status": {
        "status": "active",
        "diskUsed": 0.3
      }
    }
  ]
}

Email

1 endpoints

OrderEmailService

Order an email service.

Request Parameters

FieldTypeDescription
emailtypeReqstringType of email service (account, transactional, m365)
addressesReqarrayList of email addresses
Request Body
{
  "command": "OrderEmailService",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 17,
  "emailtype": "account",
  "addresses": [
    "[email protected]"
  ],
  "invoiceterm": "yearly"
}
Response Body
{
  "success": true,
  "message": "Email order processing.",
  "messageId": 71
}

Sites & WordPress

1 endpoints

GetWordpress

Get managed WordPress websites.

Request Parameters

FieldTypeDescription
clientidReqnumberID of the client
Request Body
{
  "command": "GetWordpress",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123
}
Response Body
{
  "success": true,
  "wordpresses": [
    {
      "type": "deploihosted",
      "id": 569,
      "domain": "example.cloud"
    }
  ]
}

Billing

1 endpoints

GetInvoices

Get invoices.

Request Parameters

FieldTypeDescription
clientidReqnumberThe ID of the client
Request Body
{
  "command": "GetInvoices",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 15
}
Response Body
{
  "success": true,
  "invoices": [
    {
      "id": 4714,
      "date": "2022-12-18",
      "due": "2023-01-01",
      "amount": "960",
      "paid": true
    }
  ]
}

Kubernetes

1 endpoints

GetKubernetes

Get managed Kubernetes services.

Request Parameters

FieldTypeDescription
clientidReqnumberThe ID of the client
Request Body
{
  "command": "GetKubernetes",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123
}
Response Body
{
  "success": true,
  "kubernetes": [
    {
      "id": 565,
      "ram": 8,
      "cpu": 4,
      "disk": 20
    }
  ]
}

VPN

1 endpoints

GetVPNs

Get VPN services.

Request Parameters

FieldTypeDescription
clientidReqnumberID of the client
Request Body
{
  "command": "GetVPNs",
  "token": "cebxfljqkzjyirqxvyxsbaxdq",
  "clientid": 123
}
Response Body
{
  "success": true,
  "vpns": [
    {
      "id": 565,
      "username": "username1",
      "ip": "192.0.2.14"
    }
  ]
}