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.
Authentication
5 endpointsLogin
Login to account.
Request Parameters
| Field | Type | Description |
|---|---|---|
| usernameReq | string | The e-mail of the user. |
| passwordReq | string | The password of the user. |
| secondfactor | string | Two factor code for two factor authentication. |
{
"command": "Login",
"username": "username",
"password": "password",
"secondfactor": "413903"
}{
"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
| Field | Type | Description |
|---|---|---|
| tokenReq | string | Must be a valid authentication token |
{
"command": "Logout",
"token": "cebxfljqkzjyirqxvyxsbaxdq"
}{
"success": true,
"message": "Logout successful."
}Register
Register a new account.
Request Parameters
| Field | Type | Description |
|---|---|---|
| firstnameReq | string | The first name of the contact person |
| lastnameReq | string | The last name of the contact person |
| emailReq | string | The email of the contact person |
| typeReq | string | Must either 'company' or 'person' |
{
"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
}{
"success": true,
"message": "Registration successful.",
"messageId": 1
}GetUserInfo
Get user information.
Request Parameters
| Field | Type | Description |
|---|---|---|
| tokenReq | string | Must be a valid authentication token |
{
"command": "GetUserInfo",
"token": "cebxfljqkzjyirqxvyxsbaxdq"
}{
"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.
{
"command": "Ping"
}{
"success": true,
"data": "pong"
}Domains
7 endpointsGetDomains
Get domain list for account.
Request Parameters
| Field | Type | Description |
|---|---|---|
| tokenReq | string | Must be a valid authentication token |
| clientidReq | number | The ID of the client |
{
"command": "GetDomains",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123
}{
"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
| Field | Type | Description |
|---|---|---|
| domainReq | string | The domain name |
{
"command": "DomainAvailable",
"domain": "example.com"
}{
"success": true,
"message": "success",
"messageId": 10,
"available": false
}GetDomainPrice
Get the price of a domain. Includes prices for registration, transfer and renewal.
Request Parameters
| Field | Type | Description |
|---|---|---|
| domainReq | string | Domain name |
{
"command": "GetDomainPrice",
"domain": "example.com"
}{
"success": true,
"message": "Price found.",
"messageId": 10,
"priceRegistration": "95",
"priceTransfer": "95",
"priceRenewal": "95"
}OrderDomain
Order a new domain.
Request Parameters
| Field | Type | Description |
|---|---|---|
| domainReq | string | The domain name |
| operationReq | string | Can be 'register' or 'transfer' |
| ownerReq | object | The legal owner of the domain |
{
"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"
}
}{
"success": true,
"message": "Domain order processing.",
"messageId": 35
}GetDomainRecords
Get the records of a domain.
Request Parameters
| Field | Type | Description |
|---|---|---|
| domainReq | string | The domain name |
{
"command": "GetDomainRecords",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"domain": "example.com"
}{
"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
| Field | Type | Description |
|---|---|---|
| typeReq | string | Can be A, AAAA, TXT, MX, CNAME, SOA, SRV |
| hostReq | string | The subdomain |
| valueReq | string | The value of the record |
{
"command": "AddDomainRecord",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"domain": "example.com",
"type": "A",
"host": "www",
"value": "192.0.2.146",
"options": {
"ttl": 86400
}
}{
"success": true,
"message": "Record added.",
"messageId": 57
}DeleteDomainRecord
Delete a domain record.
Request Parameters
| Field | Type | Description |
|---|---|---|
| domainReq | string | The domain name |
| typeReq | string | Record type |
| hostReq | string | The subdomain |
{
"command": "DeleteDomainRecord",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"domain": "example.com",
"type": "A",
"host": "www",
"value": "192.0.2.146"
}{
"success": true,
"message": "",
"messageId": 0
}Servers
5 endpointsGetServers
List servers.
Request Parameters
| Field | Type | Description |
|---|---|---|
| clientidReq | number | The ID of the client |
{
"command": "GetServers",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123
}{
"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
| Field | Type | Description |
|---|---|---|
| nameReq | string | Name of server |
| ramReq | number | GB of RAM |
| cpuReq | number | CPU cores |
| OSReq | string | OS to install |
{
"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
}{
"success": true,
"message": "Server ordered.",
"messageId": 10
}GetServerInfo
List server information.
Request Parameters
| Field | Type | Description |
|---|---|---|
| idReq | number | ID of the server |
{
"command": "GetServerInfo",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"id": 123
}{
"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
| Field | Type | Description |
|---|---|---|
| idReq | number | ID of the server service |
{
"command": "RestartVirtualServer",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"id": 123
}{
"success": true,
"message": "",
"messageId": 0
}MonitorCPU
Gets CPU usage information
Request Parameters
| Field | Type | Description |
|---|---|---|
| idReq | number | ID of the server |
{
"command": "MonitorCPU",
"token": "abc123",
"id": 748
}{
"success": true,
"data": {
"average": "1.00",
"total": "4",
"used": 25
}
}Firewall & Security
3 endpointsGetFirewalls
Get the list of firewall services.
Request Parameters
| Field | Type | Description |
|---|---|---|
| clientidReq | number | The ID of the client |
{
"command": "GetFirewalls",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123
}{
"success": true,
"firewalls": [
{
"id": 675,
"name": "Inductive Firewall",
"tb": 1,
"ipv4s": 1,
"status": "active",
"type": "ip"
}
]
}CreateFirewall
Create firewall.
Request Parameters
| Field | Type | Description |
|---|---|---|
| nameReq | string | Name of firewall |
| tbReq | number | Terabytes of data processing per month |
| ipv4sReq | number | Number of public IPv4 addresses |
{
"command": "CreateFirewall",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123,
"name": "My Firewall",
"tb": 1,
"ipv4s": 2,
"type": "ip"
}{
"success": true,
"message": "",
"messageId": 0
}AddFirewallRule
Add firewall rule.
Request Parameters
| Field | Type | Description |
|---|---|---|
| idReq | number | The ID of the firewall |
| src-cidrReq | string | CIDR of allowed addresses |
| dst-portReq | number | Port to expose |
{
"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
}{
"success": true,
"message": "",
"messageId": 0
}Databases
1 endpointsGetDatabases
Get managed databases
Request Parameters
| Field | Type | Description |
|---|---|---|
| clientidReq | number | The ID of the client |
{
"command": "GetDatabases",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123
}{
"success": true,
"databases": [
{
"id": 106,
"type": "MySQL",
"ram": 1,
"cpu": 0.25,
"disk": 10,
"status": {
"status": "active",
"diskUsed": 0.3
}
}
]
}OrderEmailService
Order an email service.
Request Parameters
| Field | Type | Description |
|---|---|---|
| emailtypeReq | string | Type of email service (account, transactional, m365) |
| addressesReq | array | List of email addresses |
{
"command": "OrderEmailService",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 17,
"emailtype": "account",
"addresses": [
"[email protected]"
],
"invoiceterm": "yearly"
}{
"success": true,
"message": "Email order processing.",
"messageId": 71
}Sites & WordPress
1 endpointsGetWordpress
Get managed WordPress websites.
Request Parameters
| Field | Type | Description |
|---|---|---|
| clientidReq | number | ID of the client |
{
"command": "GetWordpress",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123
}{
"success": true,
"wordpresses": [
{
"type": "deploihosted",
"id": 569,
"domain": "example.cloud"
}
]
}Billing
1 endpointsGetInvoices
Get invoices.
Request Parameters
| Field | Type | Description |
|---|---|---|
| clientidReq | number | The ID of the client |
{
"command": "GetInvoices",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 15
}{
"success": true,
"invoices": [
{
"id": 4714,
"date": "2022-12-18",
"due": "2023-01-01",
"amount": "960",
"paid": true
}
]
}Kubernetes
1 endpointsGetKubernetes
Get managed Kubernetes services.
Request Parameters
| Field | Type | Description |
|---|---|---|
| clientidReq | number | The ID of the client |
{
"command": "GetKubernetes",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123
}{
"success": true,
"kubernetes": [
{
"id": 565,
"ram": 8,
"cpu": 4,
"disk": 20
}
]
}VPN
1 endpointsGetVPNs
Get VPN services.
Request Parameters
| Field | Type | Description |
|---|---|---|
| clientidReq | number | ID of the client |
{
"command": "GetVPNs",
"token": "cebxfljqkzjyirqxvyxsbaxdq",
"clientid": 123
}{
"success": true,
"vpns": [
{
"id": 565,
"username": "username1",
"ip": "192.0.2.14"
}
]
}