{ "swagger": "2.0", "info": { "description": "Our HTTP [REST API](https:\/\/en.wikipedia.org\/wiki\/Representational_state_transfer) allows you to manage vital details of your account and services in client portal. [JSON](http:\/\/www.json.org\/) is used for all API returns.\n\n## Authentication\n\n## JSON Web Token Authentication\n\n```bash\ncurl 'https:\/\/powervps.dk\/api\/login' \\\n -d username=\"username\"\\\n -d password=\"password\"\n\n# grab authentication token from the response and pass it in Authorization header\ncurl 'https:\/\/powervps.dk\/api\/details' \\\n -H \"Authorization: Bearer $token\"\n```\n\n```php\n$resp = $client->post('login', [\n 'form_params' => [\n 'username' => 'username',\n 'password' => 'password'\n ]\n]);\n\n$token = $resp->json()['token'];\n\n$resp = $client->get('details', [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $token\n ]\n]);\n\necho $resp->getBody();\n```\n\n> Make sure to replace `username` and `password` with your client area details.\n\nTo authenticate, you need to send a [JSON Web Token (JWT)](https:\/\/jwt.io\/) in the authorization header of the HTTP request.\n\nTo obtain the authorization `token` you need to submit a request with your username and password to `POST https:\/\/powervps.dk\/api\/login` API method.\n\nAll API calls that require authentication expect HTTP header in the form of `Authorization: Bearer `.\n\nFor example: `Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw...`\n\n", "version": "4.20260401", "title": "PowerVPS User API" }, "host": "powervps.dk", "basePath": "\/api", "tags": [ { "name": "Clientarea" }, { "name": "Billing" }, { "name": "Services" }, { "name": "Cart" }, { "name": "DNS" }, { "name": "Support" } ], "schemes": [ "https" ], "paths": { "\/login": { "post": { "tags": [ "Clientarea" ], "summary": "Login", "description": "Generate new authorization token", "operationId": "getToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "Your acount email address ", "example": "user@example.com" }, "password": { "type": "string", "description": "Account password ", "example": "secret" } }, "example": { "username": "user@example.com", "password": "secret" } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw(...)5lZ9T79ft9uwOkqRRmIBbtR51_w", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzMD(...)ChwIAb3zvxBu6kvULa2AwAt9U-I" } }, "schema": { "type": "object", "example": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw(...)5lZ9T79ft9uwOkqRRmIBbtR51_w", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzMD(...)ChwIAb3zvxBu6kvULa2AwAt9U-I" } } } } } }, "\/logout": { "post": { "tags": [ "Clientarea" ], "summary": "Logout", "description": "Invalidate authorization token", "operationId": "dropToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "status": true } }, "schema": { "type": "object", "example": { "status": true } } } } } }, "\/token": { "post": { "tags": [ "Clientarea" ], "summary": "Refresh Token", "description": "Generate new authorization token using refresh token", "operationId": "refreshToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "refresh_token": { "type": "string", "description": "Refresh token previously obtained from `POST \/login`", "example": "refresh_tokenValue" } }, "example": { "refresh_token": "refresh_tokenValue" } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHR(...)vY2xlYiHGvauCWZD9B0VwXgHEzXDllqY", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJBQ(...)Rmivc_u3YA_kgDqOPtUuGNXOzueXYtZw" } }, "schema": { "type": "object", "example": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHR(...)vY2xlYiHGvauCWZD9B0VwXgHEzXDllqY", "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJBQ(...)Rmivc_u3YA_kgDqOPtUuGNXOzueXYtZw" } } } } } }, "\/revoke": { "post": { "tags": [ "Clientarea" ], "summary": "Revoke Token", "description": "Invalidate authorization and refresh token.\nPass refresh token or call this method with valid access token", "operationId": "revokeToken", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "refresh_token": { "type": "string", "example": "refresh_tokenValue" } }, "example": { "refresh_token": "refresh_tokenValue" } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "status": true } }, "schema": { "type": "object", "example": { "status": true } } } } } }, "\/details": { "get": { "tags": [ "Clientarea" ], "summary": "User Details", "description": "Return registration details for my account", "operationId": "getDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:24:28", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3294", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" } } }, "schema": { "type": "object", "example": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:24:28", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3294", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" } } } } } }, "put": { "tags": [ "Clientarea" ], "summary": "Update User Details", "description": "Update registration details under my account", "operationId": "postDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "type": { "type": "string", "description": "Account Type", "enum": [ "Private", "Company" ] }, "companyname": { "type": "string", "description": "Organization" }, "vateu": { "type": "string", "description": "CVR nr. - If you have valid VAT-EU registered number please provide it here" }, "firstname": { "type": "string", "description": "First Name" }, "lastname": { "type": "string", "description": "Last Name" }, "email": { "type": "string", "description": "Email Address" }, "address1": { "type": "string", "description": "Address 1" }, "address2": { "type": "string", "description": "Address 2" }, "city": { "type": "string", "description": "City" }, "postcode": { "type": "string", "description": "Post code" }, "country": { "type": "string", "description": "Country" }, "phonenumber": { "type": "string", "description": "Phone" } } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:34:20", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "info": [ "client_info_updated" ] } }, "schema": { "type": "object", "example": { "client": { "id": "26", "email": "api@example.com", "lastlogin": "2016-12-30 12:34:20", "ip": "172.100.2.1", "host": "hostname", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "info": [ "client_info_updated" ] } } } } } }, "\/logs": { "get": { "tags": [ "Clientarea" ], "summary": "User Logs", "description": "Returns logs from history", "operationId": "getLogs", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/affiliates\/summary": { "get": { "tags": [ "Clientarea" ], "summary": "Get Affiliate summary", "description": "", "operationId": "affiliates_summary", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/affiliates\/campaigns": { "get": { "tags": [ "Clientarea" ], "summary": "Get Affiliate campaigns", "description": "", "operationId": "affiliates_campaigns", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/affiliates\/commissions": { "get": { "tags": [ "Clientarea" ], "summary": "Get Affiliate commissions", "description": "", "operationId": "affiliates_commissions", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/affiliates\/payouts": { "get": { "tags": [ "Clientarea" ], "summary": "Get Affiliate payouts", "description": "", "operationId": "affiliates_payouts", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/affiliates\/vouchers": { "get": { "tags": [ "Clientarea" ], "summary": "Get Affiliate vouchers", "description": "", "operationId": "affiliates_vouchers", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/affiliates\/commissionplans": { "get": { "tags": [ "Clientarea" ], "summary": "Get Affiliate commission plans", "description": "", "operationId": "affiliates_commission_plans", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/contact": { "get": { "tags": [ "Clientarea" ], "summary": "List contacts", "description": "Return a list of contacts on this account", "operationId": "profiles", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "contacts": [ { "email": "mary@example.com", "id": "49", "firstname": "Mary", "lastname": "Sue", "companyname": "", "company": "0", "lastlogin": "0000-00-00 00:00:00" } ] } }, "schema": { "type": "object", "example": { "contacts": [ { "email": "mary@example.com", "id": "49", "firstname": "Mary", "lastname": "Sue", "companyname": "", "company": "0", "lastlogin": "0000-00-00 00:00:00" } ] } } } } }, "post": { "tags": [ "Clientarea" ], "summary": "Add contact", "description": "Create new contact account, if password is provided you\ncan use provided email addres to login as that contact.", "operationId": "profiles_add", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "password": { "type": "string", "description": "Optional, allows you to login as contact", "example": "passwordValue" }, "privileges": { "type": "array", "description": "Array with privileges that you want to enable. Formatted the same way as output from GET \/contact\/privileges<\/code>", "items": { "type": "string" }, "example": "privilegesValue" }, "type": { "type": "string", "description": "Account Type", "enum": [ "Private", "Company" ] }, "companyname": { "type": "string", "description": "Organization" }, "vateu": { "type": "string", "description": "CVR nr. - If you have valid VAT-EU registered number please provide it here" }, "firstname": { "type": "string", "description": "First Name" }, "lastname": { "type": "string", "description": "Last Name" }, "email": { "type": "string", "description": "Email Address" }, "address1": { "type": "string", "description": "Address 1" }, "address2": { "type": "string", "description": "Address 2" }, "city": { "type": "string", "description": "City" }, "postcode": { "type": "string", "description": "Post code" }, "country": { "type": "string", "description": "Country" }, "phonenumber": { "type": "string", "description": "Phone" } }, "example": { "password": "passwordValue", "privileges": "privilegesValue" } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "contact_id": "1", "info": [ "profile_added" ] } }, "schema": { "type": "object", "example": { "contact_id": "1", "info": [ "profile_added" ] } } } } } }, "\/contact\/privileges": { "get": { "tags": [ "Clientarea" ], "summary": "Contact privileges", "description": "List possible contact privileges.\nEach domain and service may list additional privileges, depending on available features.
", "operationId": "profile_privs", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/contact\/{id}": { "get": { "tags": [ "Clientarea" ], "summary": "Get contacts details", "description": "Return array with contact details", "operationId": "profile_data", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "description": "Contact ID", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "contact": { "id": "49", "email": "mary@example.com", "firstname": "Mary", "lastname": "Sue", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123", "type": "Private", "privileges": { "support": [ "tickets", "newticket" ] } } } }, "schema": { "type": "object", "example": { "contact": { "id": "49", "email": "mary@example.com", "firstname": "Mary", "lastname": "Sue", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123", "type": "Private", "privileges": { "support": [ "tickets", "newticket" ] } } } } } } }, "put": { "tags": [ "Clientarea" ], "summary": "Edit contact", "description": "Change contact details`", "operationId": "profile_edit", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Contact ID", "example": "idValue" }, "privileges": { "type": "array", "description": "Array with privileges that you want to enable. Formatted the same way as output from GET \/contact\/privileges<\/code>", "items": { "type": "string" }, "example": "privilegesValue" }, "type": { "type": "string", "description": "Account Type", "enum": [ "Private", "Company" ] }, "companyname": { "type": "string", "description": "Organization" }, "vateu": { "type": "string", "description": "CVR nr. - If you have valid VAT-EU registered number please provide it here" }, "firstname": { "type": "string", "description": "First Name" }, "lastname": { "type": "string", "description": "Last Name" }, "email": { "type": "string", "description": "Email Address" }, "address1": { "type": "string", "description": "Address 1" }, "address2": { "type": "string", "description": "Address 2" }, "city": { "type": "string", "description": "City" }, "postcode": { "type": "string", "description": "Post code" }, "country": { "type": "string", "description": "Country" }, "phonenumber": { "type": "string", "description": "Phone" } }, "example": { "id": "idValue", "privileges": "privilegesValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "info": [ "profile_updated" ] } }, "schema": { "type": "object", "example": { "info": [ "profile_updated" ] } } } } } }, "\/notifications": { "get": { "tags": [ "Clientarea" ], "summary": "List all portal notifications", "description": "Return a list of all portal notifications.", "operationId": "notifications", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "rel_type", "type": "string", "in": "query", "description": "Optional, return only by relation type" }, { "name": "rel_id", "type": "string", "in": "query", "description": "Optional, return only by relation id" } ], "responses": { "200": { "description": "`Success`" } } } }, "\/notifications\/new": { "get": { "tags": [ "Clientarea" ], "summary": "List new portal notifications", "description": "Return only new portal notifications.", "operationId": "notifications_new", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "rel_type", "type": "string", "in": "query", "description": "Optional, return only by relation type" }, { "name": "rel_id", "type": "string", "in": "query", "description": "Optional, return only by relation id" } ], "responses": { "200": { "description": "`Success`" } } } }, "\/notifications\/{id}\/ack": { "put": { "tags": [ "Clientarea" ], "summary": "Acknowledge notification", "description": "Marks the notification as read", "operationId": "notifications_set_seen", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/balance": { "get": { "tags": [ "Billing" ], "summary": "Account balance", "description": "Get current account balance(unpaid invoices total), account credit", "operationId": "getBalance", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/invoice": { "get": { "tags": [ "Billing" ], "summary": "List Invoices", "description": "List all invoices under my account", "operationId": "getInvoices", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "invoices": [ { "id": "308976", "date": "2016-12-30", "dateorig": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "total": "19.65", "datepaid": "2016-12-30 12:40:47", "status": "Paid", "merge_id": null, "number": "2016\/12\/1", "currency": "USD" } ] } }, "schema": { "type": "object", "example": { "invoices": [ { "id": "308976", "date": "2016-12-30", "dateorig": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "total": "19.65", "datepaid": "2016-12-30 12:40:47", "status": "Paid", "merge_id": null, "number": "2016\/12\/1", "currency": "USD" } ] } } } } } }, "\/invoice\/{id}": { "get": { "tags": [ "Billing" ], "summary": "Invoice Details", "description": "Get invoice details", "operationId": "getInvoiceDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "invoice": { "id": "308976", "status": "Paid", "date": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "datepaid": "2016-12-30 12:40:47", "subtotal": 16.24, "credit": 0, "tax": 3.41, "taxrate": 21, "tax2": 0, "taxrate2": 0, "taxexempt": "0", "total": 19.65, "rate": 1, "rate2": 0, "rate3": 1, "notes": "", "items": [ { "id": "12305", "invoice_id": "308976", "type": "Other", "item_id": "0", "description": "Example Service", "amount": "15.00", "taxed": "1", "qty": "1.00", "linetotal": "15.00" }, { "id": "12309", "invoice_id": "308976", "type": "Other", "item_id": "-2", "description": "PayPal Payment Fee", "amount": "1.24", "taxed": "1", "qty": "1.00", "linetotal": "1.24" } ], "client": { "id": "26", "email": "api@example.com", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "number": "2016\/12\/1", "currency": "USD" } } }, "schema": { "type": "object", "example": { "invoice": { "id": "308976", "status": "Paid", "date": "2016-12-30", "duedate": "2017-01-06", "paybefore": "2017-01-06", "datepaid": "2016-12-30 12:40:47", "subtotal": 16.24, "credit": 0, "tax": 3.41, "taxrate": 21, "tax2": 0, "taxrate2": 0, "taxexempt": "0", "total": 19.65, "rate": 1, "rate2": 0, "rate3": 1, "notes": "", "items": [ { "id": "12305", "invoice_id": "308976", "type": "Other", "item_id": "0", "description": "Example Service", "amount": "15.00", "taxed": "1", "qty": "1.00", "linetotal": "15.00" }, { "id": "12309", "invoice_id": "308976", "type": "Other", "item_id": "-2", "description": "PayPal Payment Fee", "amount": "1.24", "taxed": "1", "qty": "1.00", "linetotal": "1.24" } ], "client": { "id": "26", "email": "api@example.com", "firstname": "Joe", "lastname": "Doe", "companyname": "", "address1": "Pretty View Lane", "address2": "3194", "city": "Santa Rosa", "state": "California", "postcode": "95401", "country": "US", "phonenumber": "+1.24123123" }, "number": "2016\/12\/1", "currency": "USD" } } } } } } }, "\/invoice\/{id}\/credit": { "post": { "tags": [ "Billing" ], "summary": "Apply credit", "description": "Apply account credit to invoice", "operationId": "applyCreditToInvoice", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "amount": { "type": "number", "description": "Optional credit amount, when no value is specified maximum amount to fully pay the invoice will be used", "example": "amountValue" } }, "example": { "amount": "amountValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "success": true, "invoice_status": "Paid", "applied": 2.1 } }, "schema": { "type": "object", "example": { "success": true, "invoice_status": "Paid", "applied": 2.1 } } } } } }, "\/invoice\/{id}\/pdf": { "post": { "tags": [ "Billing" ], "summary": "Invoice PDF", "description": "Get specific invoice PDF", "operationId": "getInvoicePdf", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "success": true, "invoice": "Paid" } }, "schema": { "type": "object", "example": { "success": true, "invoice": "Paid" } } } } } }, "\/payment": { "get": { "tags": [ "Billing" ], "summary": "Payment Methods", "description": "List available payment methods", "operationId": "paymethod", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "payments": { "10": "BankTransfer", "9": "PayPal" } } }, "schema": { "type": "object", "example": { "payments": { "10": "BankTransfer", "9": "PayPal" } } } } } } }, "\/payment\/fees": { "get": { "tags": [ "Billing" ], "summary": "Payment Methods Fees", "description": "List available payment methods with fees", "operationId": "paymethod_fee", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/service": { "get": { "tags": [ "Services" ], "summary": "List services", "description": "List all services under your account", "operationId": "service", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "services": [ { "id": "301", "domain": "examplename.com", "total": "9.99", "status": "Pending", "billingcycle": "Monthly", "next_due": "2017-12-30", "category": "Hosting", "category_url": "hosting", "name": "Starter Hosting" } ] } }, "schema": { "type": "object", "example": { "services": [ { "id": "301", "domain": "examplename.com", "total": "9.99", "status": "Pending", "billingcycle": "Monthly", "next_due": "2017-12-30", "category": "Hosting", "category_url": "hosting", "name": "Starter Hosting" } ] } } } } } }, "\/service\/{id}": { "get": { "tags": [ "Services" ], "summary": "Service details", "description": "Return details for service `@id`", "operationId": "serviceDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "description": "Service id", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "service": { "id": "301", "date_created": "2016-12-30", "domain": "examplename.com", "firstpayment": "9.99", "total": "9.99", "billingcycle": "Monthly", "next_due": "2017-12-30", "next_invoice": "2017-01-27", "status": "Active", "label": "", "username": "examplen", "password": "pdtzc", "name": "Starter Hosting" } } }, "schema": { "type": "object", "example": { "service": { "id": "301", "date_created": "2016-12-30", "domain": "examplename.com", "firstpayment": "9.99", "total": "9.99", "billingcycle": "Monthly", "next_due": "2017-12-30", "next_invoice": "2017-01-27", "status": "Active", "label": "", "username": "examplen", "password": "pdtzc", "name": "Starter Hosting" } } } } } } }, "\/service\/{id}\/methods": { "get": { "tags": [ "Services" ], "summary": "List service methods", "description": "List methods available for service", "operationId": "serviceMethods", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "methods": [ { "name": "Upgrade Request", "method": "POST", "route": "\/service\/@id\/upgrade" }, { "name": "Upgrade Options", "method": "GET", "route": "\/service\/@id\/upgrade" }, { "name": "Change service label", "method": "POST", "route": "\/service\/@id\/label" }, { "name": "Service label", "method": "GET", "route": "\/service\/@id\/label" }, { "name": "Cancel Service", "method": "POST", "route": "\/service\/@id\/cancel" } ] } }, "schema": { "type": "object", "example": { "methods": [ { "name": "Upgrade Request", "method": "POST", "route": "\/service\/@id\/upgrade" }, { "name": "Upgrade Options", "method": "GET", "route": "\/service\/@id\/upgrade" }, { "name": "Change service label", "method": "POST", "route": "\/service\/@id\/label" }, { "name": "Service label", "method": "GET", "route": "\/service\/@id\/label" }, { "name": "Cancel Service", "method": "POST", "route": "\/service\/@id\/cancel" } ] } } } } } }, "\/service\/{id}\/upgrade": { "get": { "tags": [ "Services" ], "summary": "Upgrade Options", "description": "List upgrade options", "operationId": "upgrade", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "resources": [ { "id": 1557, "name": "Bandwidth", "type": "select", "items": [ { "id": "9953", "name": "100 GB", "price": 1, "setup_price": 0, "selected": true }, { "id": "10103", "name": "500 GB", "price": 5, "setup_price": 0, "selected": false }, { "id": "10104", "name": "1 TB", "price": 10, "setup_price": 0, "selected": false } ] } ], "package": [] } }, "schema": { "type": "object", "example": { "resources": [ { "id": 1557, "name": "Bandwidth", "type": "select", "items": [ { "id": "9953", "name": "100 GB", "price": 1, "setup_price": 0, "selected": true }, { "id": "10103", "name": "500 GB", "price": 5, "setup_price": 0, "selected": false }, { "id": "10104", "name": "1 TB", "price": 10, "setup_price": 0, "selected": false } ] } ], "package": [] } } } } }, "post": { "tags": [ "Services" ], "summary": "Upgrade Request", "description": "Estimate or request upgrade\n\n```json\n\/\/ Format of ''resources'' paremeter\n{\n \"resource_id\" : \"qty_value\", \/\/ sliders & qty fields\n \"resource_id\" : \"item_id\", \/\/ dropdown & radio fields\n \"resource_id\" : {\n \"item_id\": \"qty_value\" \/\/ dropdown with qty field\n }\n}\n```", "operationId": "upgrade_test", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id", "example": "idValue" }, "resources": { "type": "array", "description": "array with resource values", "items": { "type": "string" }, "example": "resourcesValue" }, "package": { "type": "integer", "description": "New package id, optonal when upgrading resources", "example": "packageValue" }, "cycle": { "type": "string", "description": "New billing cycle, optonal when upgrading resources", "example": "cycleValue" }, "send": { "type": "boolean", "description": "Set to true when you want to send your upgrade request", "example": "sendValue" } }, "example": { "id": "idValue", "resources": "resourcesValue", "package": "packageValue", "cycle": "cycleValue", "send": "sendValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/cancel": { "post": { "tags": [ "Services" ], "summary": "Cancel Service", "description": "Request service cancellation", "operationId": "service_cancel", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id", "example": "idValue" }, "immediate": { "type": "string", "description": "set to false<\/code> to terminate service at the end of billing date, true<\/code> - terminate immediately", "example": "immediateValue" }, "reason": { "type": "string", "description": "Reason for this request", "example": "reasonValue" } }, "example": { "id": "idValue", "immediate": "immediateValue", "reason": "reasonValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "info": [ "cancell_sent" ] } }, "schema": { "type": "object", "example": { "info": [ "cancell_sent" ] } } } } } }, "\/service\/{id}\/label": { "get": { "tags": [ "Services" ], "summary": "Service label", "description": "Show current service label", "operationId": "service_get_label", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "description": "Service id", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "label": "example" } }, "schema": { "type": "object", "example": { "label": "example" } } } } }, "post": { "tags": [ "Services" ], "summary": "Change service label", "description": "Set new custom label to identify this service", "operationId": "service_set_label", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id", "example": "idValue" }, "label": { "type": "string", "description": "New label", "example": "labelValue" } }, "example": { "id": "idValue", "label": "labelValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "success": true, "info": [ "label_updated" ] } }, "schema": { "type": "object", "example": { "success": true, "info": [ "label_updated" ] } } } } } }, "\/service\/{id}\/renew": { "post": { "tags": [ "Services" ], "summary": "Manual Service Renew", "description": "Generate an invoice to renew the service.", "operationId": "service_renew", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id", "example": "idValue" } }, "example": { "id": "idValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "status": true, "invoice_id": "504426", "info": [ "manualrenew_ok" ] } }, "schema": { "type": "object", "example": { "status": true, "invoice_id": "504426", "info": [ "manualrenew_ok" ] } } } } } }, "\/service\/{id}\/cycle": { "get": { "tags": [ "Services" ], "summary": "List Billing Cycle", "description": "Get recurring billing cycle options", "operationId": "service_cycle", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "description": "Service id", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "current": "m", "cycles": { "m": "14.95", "a": "179.40", "b": "358.80" } } }, "schema": { "type": "object", "example": { "current": "m", "cycles": { "m": "14.95", "a": "179.40", "b": "358.80" } } } } } }, "post": { "tags": [ "Services" ], "summary": "Change Billing Cycle", "description": "Change recurring billing cycle for the service", "operationId": "service_cycle_set", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "Service id", "example": "idValue" }, "cycle": { "type": "string", "description": "New billing cycle", "example": "cycleValue" } }, "example": { "id": "idValue", "cycle": "cycleValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "success": true, "info": [ "changebillingcycle_ok" ] } }, "schema": { "type": "object", "example": { "success": true, "info": [ "changebillingcycle_ok" ] } } } } } }, "\/service\/{id}\/vms": { "get": { "tags": [ "Services" ], "summary": "List VMs", "description": "List virtual servers", "operationId": "vms", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } }, "post": { "tags": [ "Services" ], "summary": "Create VM", "description": "Add new virtual server", "operationId": "vms_create", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "label": { "type": "string", "description": "VM label", "example": "labelValue" }, "template": { "type": "string", "description": "Template ID", "example": "templateValue" }, "memory": { "type": "string", "description": "Amount of RAM memory in MB", "example": "memoryValue" }, "cpu": { "type": "string", "description": "Amount of CPU cores", "example": "cpuValue" }, "disk": { "type": "string", "description": "Disk Space in GB", "example": "diskValue" }, "interface": { "type": "array", "description": "Interface configuration", "items": { "type": "string" }, "example": "interfaceValue" } }, "example": { "label": "labelValue", "template": "templateValue", "memory": "memoryValue", "cpu": "cpuValue", "disk": "diskValue", "interface": "interfaceValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}": { "get": { "tags": [ "Services" ], "summary": "Get VM Details", "description": "Get the details of a particular virtual server", "operationId": "vms_get", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "vmid", "type": "string", "in": "path", "description": "Virtual server id", "required": true }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } }, "delete": { "tags": [ "Services" ], "summary": "Destroy VM", "description": "Remove virtual server", "operationId": "vms_delete", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "vmid", "type": "string", "in": "path", "description": "Virtual server id", "required": true }, { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } }, "put": { "tags": [ "Services" ], "summary": "Resize VM", "description": "Edit a virtual server", "operationId": "vms_edit", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "vmid": { "type": "string", "description": "Virtual server id", "example": "vmidValue" }, "memory": { "type": "string", "description": "Amount of RAM in MB", "example": "memoryValue" }, "cpu": { "type": "string", "description": "Amount of CPU cores", "example": "cpuValue" } }, "example": { "vmid": "vmidValue", "memory": "memoryValue", "cpu": "cpuValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/stop": { "post": { "tags": [ "Services" ], "summary": "Stop VM", "description": "Stop virtual server", "operationId": "vms_stop", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "vmid": { "type": "string", "description": "Virtual server id", "example": "vmidValue" } }, "example": { "vmid": "vmidValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/start": { "post": { "tags": [ "Services" ], "summary": "Start VM", "description": "Start virtual server", "operationId": "vms_start", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "vmid": { "type": "string", "description": "Virtual server id", "example": "vmidValue" } }, "example": { "vmid": "vmidValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/shutdown": { "post": { "tags": [ "Services" ], "summary": "Shutdown VM", "description": "Perform graceful shutdown", "operationId": "vms_shutdown", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "vmid": { "type": "string", "description": "Virtual server id", "example": "vmidValue" } }, "example": { "vmid": "vmidValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/reboot": { "post": { "tags": [ "Services" ], "summary": "Reboot VM", "description": "Reboot virtual server", "operationId": "vms_reboot", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "vmid": { "type": "string", "description": "Virtual server id", "example": "vmidValue" } }, "example": { "vmid": "vmidValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/reset": { "post": { "tags": [ "Services" ], "summary": "Reset VM", "description": "Reset virtual server power", "operationId": "vms_reset", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "vmid": { "type": "string", "description": "Virtual server id", "example": "vmidValue" } }, "example": { "vmid": "vmidValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/hostname": { "post": { "tags": [ "Services" ], "summary": "Change VM Hostname", "description": "Update virtual machine hostname", "operationId": "vms_hostname", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "hostname": { "type": "string", "description": "New hostname for the VM", "example": "hostnameValue" } }, "example": { "hostname": "hostnameValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/rebuild": { "post": { "tags": [ "Services" ], "summary": "Rebuild VM", "description": "Rebuild server, you can get list of templates supported by this server\nusing '''\/service\/$id\/templates'''", "operationId": "vms_rebuild", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "template": { "type": "string", "description": "Template ID", "example": "templateValue" } }, "example": { "template": "templateValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/ips": { "get": { "tags": [ "Services" ], "summary": "List IPs", "description": "List virtual machine IPs", "operationId": "vm_interface_list_ip", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "type", "type": "string", "in": "query", "description": "ipv4 or ipv6" }, { "name": "iface", "type": "integer", "in": "query", "description": "Interface number [optional]" }, { "name": "bridge", "type": "string", "in": "query", "description": "Bridge name [optional, ignored if interface provided]" }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/ippool": { "get": { "tags": [ "Services" ], "summary": "List IP Pools", "description": "List IP pools for a specific interface or network bridge", "operationId": "vm_interface_list_iplist", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "iface", "type": "integer", "in": "query", "description": "Interface number [optional]" }, { "name": "bridge", "type": "string", "in": "query", "description": "Bridge name [optional, ignored if interface provided]" }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/ippool\/{pool}": { "post": { "tags": [ "Services" ], "summary": "Allocate IPs", "description": "Allocate new IP for network interface.", "operationId": "vm_interface_allocate_ip", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "pool": { "type": "string", "description": "List ID to allocate new IP from", "example": "poolValue" }, "type": { "type": "string", "description": "ipv4 or ipv6", "example": "typeValue" }, "iface": { "type": "integer", "description": "Interface number", "example": "ifaceValue" }, "bridge": { "type": "string", "description": "Bridge name [optional, ignored if interface provided]", "example": "bridgeValue" }, "number": { "type": "integer", "description": "Number of IPs to allocate", "example": "numberValue" } }, "example": { "pool": "poolValue", "type": "typeValue", "iface": "ifaceValue", "bridge": "bridgeValue", "number": "numberValue" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true }, { "name": "pool", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/networks": { "get": { "tags": [ "Services" ], "summary": "List available networks", "description": "List of networks and IP pools that can be used for VM creation", "operationId": "networks", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/interfaces": { "get": { "tags": [ "Services" ], "summary": "List VM Network Interfaces", "description": "Get network interfaces assigned to virtual server", "operationId": "vm_interface_list", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } }, "post": { "tags": [ "Services" ], "summary": "Add Network Interface", "description": "Add new network interface to VM", "operationId": "vm_interface_create", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "bridge": { "type": "string", "description": "Network bridge", "example": "bridgeValue" }, "firewall": { "type": "integer", "description": "Enable or disable firewall (may require specific permissions)", "example": "firewallValue" }, "ipv4": { "type": "array", "description": "List of IP v4 IDs", "items": { "type": "string" }, "example": "ipv4Value" }, "ipv6": { "type": "array", "description": "List of IP v6 IDs", "items": { "type": "string" }, "example": "ipv6Value" } }, "example": { "bridge": "bridgeValue", "firewall": "firewallValue", "ipv4": "ipv4Value", "ipv6": "ipv6Value" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/vms\/{vmid}\/interfaces\/{iface}": { "get": { "tags": [ "Services" ], "summary": "Get Network Interfaces", "description": "Get network Interface details", "operationId": "vm_interface_details", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "iface", "type": "string", "in": "path", "description": "Interface name or id, ie '0' or 'net0'", "required": true }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } }, "put": { "tags": [ "Services" ], "summary": "Update Network Interface", "description": "Update network interface details", "operationId": "vm_interface_update", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "iface": { "type": "integer", "description": "Interface number", "example": "ifaceValue" }, "firewall": { "type": "integer", "description": "Enable or disable firewall (may require specific permissions)", "example": "firewallValue" }, "ipv4": { "type": "array", "description": "List of IP v4 IDs", "items": { "type": "string" }, "example": "ipv4Value" }, "ipv6": { "type": "array", "description": "List of IP v6 IDs", "items": { "type": "string" }, "example": "ipv6Value" } }, "example": { "iface": "ifaceValue", "firewall": "firewallValue", "ipv4": "ipv4Value", "ipv6": "ipv6Value" } } }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true }, { "name": "iface", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } }, "delete": { "tags": [ "Services" ], "summary": "Remove Network Interface", "description": "Remove network interface from VM", "operationId": "vm_interface_remove", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "iface", "type": "string", "in": "path", "description": "Interface name or id to remove", "required": true }, { "name": "id", "type": "string", "in": "path", "required": true }, { "name": "vmid", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/templates": { "get": { "tags": [ "Services" ], "summary": "List OS templates", "description": "List templates that can be used to create virtual server", "operationId": "templates", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/resources": { "get": { "tags": [ "Services" ], "summary": "Resources", "description": "Show available and used resources", "operationId": "resources", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/bandwidth-graphs": { "get": { "tags": [ "Services" ], "summary": "Bandwidth Graph", "description": "Return base64 encoded images representing bandwidth usage for last day, week and month", "operationId": "graph", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/service\/{id}\/bandwidth": { "get": { "tags": [ "Services" ], "summary": "Bandwidth Usage", "description": "Return bandwidth usage and billing details", "operationId": "details", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "id", "type": "integer", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/category": { "get": { "tags": [ "Cart" ], "summary": "List product categories", "description": "Return a list of product categories.", "operationId": "cart_categories", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "categories": [ { "id": "10", "name": "Hosting", "description": "", "slug": "hosting" }, { "id": "6", "name": "Domains", "description": "", "slug": "domains" }, { "id": "16", "name": "Dedicated", "description": "", "slug": "dedicated" } ] } }, "schema": { "type": "object", "example": { "categories": [ { "id": "10", "name": "Hosting", "description": "", "slug": "hosting" }, { "id": "6", "name": "Domains", "description": "", "slug": "domains" }, { "id": "16", "name": "Dedicated", "description": "", "slug": "dedicated" } ] } } } } } }, "\/category\/{category_id}\/product": { "get": { "tags": [ "Cart" ], "summary": "List products in category", "description": "Return a list of product available for purchase under requested category", "operationId": "cart_products", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "category_id", "type": "integer", "in": "path", "description": "Category ID", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/order\/{product_id}": { "get": { "tags": [ "Cart" ], "summary": "Get product configuration details", "description": "Return product details with form configuration, addons and subproducts if available.", "operationId": "cart_product", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "product_id", "type": "integer", "in": "path", "description": "Product ID", "required": true } ], "responses": { "200": { "description": "`Success`" } } }, "post": { "tags": [ "Cart" ], "summary": "Order new service", "description": "Create and submit new order for selected product.\n\nTo get available cycle and configuration options lookup product details\nusing `GET \/order\/@product_id`", "operationId": "cart_order", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "product_id": { "type": "integer", "description": "Product ID ", "example": 12 }, "domain": { "type": "string", "description": "Domain name, ie. example.com, may be optional", "example": "domainValue" }, "cycle": { "type": "string", "description": "Billing period symbol", "example": "cycleValue" }, "pay_method": { "type": "integer", "description": "Payment method ID", "example": "pay_methodValue" }, "custom": { "type": "array", "description": "Additional options data available for sop products", "items": { "type": "string" }, "example": "customValue" }, "promocode": { "type": "string", "description": "Promotion code", "example": "promocodeValue" }, "aff_id": { "type": "integer", "description": "Affiliate ID", "example": 55 } }, "example": { "product_id": 12, "domain": "domainValue", "cycle": "cycleValue", "pay_method": "pay_methodValue", "custom": "customValue", "promocode": "promocodeValue", "aff_id": 55 } } }, { "name": "product_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "order_num": 873340995, "invoice_id": "308979", "total": "9.99", "items": { "id": "10", "type": "Hosting", "name": "test.com", "product_id": "3" } } }, "schema": { "type": "object", "example": { "order_num": 873340995, "invoice_id": "308979", "total": "9.99", "items": { "id": "10", "type": "Hosting", "name": "test.com", "product_id": "3" } } } } } } }, "\/order": { "post": { "tags": [ "Cart" ], "summary": "Order multiple services", "description": "Create and submit new order for multiple services\n\nEach item in the `items` array needs to include order `type` and parameters used\nby one of the method listed below:\n
• `POST \/order\/$product_id` - use `product` for item type", "operationId": "cart_order_multi", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "pay_method": { "type": "integer", "description": "Payment method ID ", "example": 1 }, "ignore_errors": { "type": "boolean", "description": "Process order even if some of the items were rejected due to errors ", "example": "No error" }, "items": { "type": "array", "description": "list with order items", "items": { "type": "string" } }, "aff_id": { "type": "integer", "description": "Affiliate ID", "example": 55 } }, "example": { "pay_method": 1, "ignore_errors": "No error", "items": [ { "type": "product", "product_id": 1080, "domain": "hosting.com", "cycle": "a" } ], "aff_id": 55 } } } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "order_num_list": [ 179534732, 179534732, 179534732 ], "invoice_id": "503425", "total": "94.40", "items": [ { "type": "Hosting", "id": "1025", "name": "hosting.com", "product_id": "1080" }, { "type": "Hosting", "id": "1026", "name": "hosting.com", "product_id": "840" }, { "type": "Domain Register", "id": "354", "name": "hosting.com", "product_id": "6" } ] } }, "schema": { "type": "object", "example": { "order_num_list": [ 179534732, 179534732, 179534732 ], "invoice_id": "503425", "total": "94.40", "items": [ { "type": "Hosting", "id": "1025", "name": "hosting.com", "product_id": "1080" }, { "type": "Hosting", "id": "1026", "name": "hosting.com", "product_id": "840" }, { "type": "Domain Register", "id": "354", "name": "hosting.com", "product_id": "6" } ] } } } } } }, "\/quote": { "post": { "tags": [ "Cart" ], "summary": "Get order quote", "description": "Calculate order cost and recurring prices for selected items.\nUse the same parameters as for `POST \/order`", "operationId": "cart_order_quote", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "pay_method": { "type": "integer", "description": "Payment method ID", "example": "pay_methodValue" }, "output": { "type": "string", "description": "Type of output, default is short. Possible options\n
    \n
  • short<\/code> - Basic details about the item in cart<\/li>\n
  • config<\/code>- Basic details and form components<\/li>\n
  • full<\/code> - All details available in cart<\/li>\n<\/ul> ", "example": "short" }, "items": { "type": "array", "description": "list with order items", "items": { "type": "string" } } }, "example": { "pay_method": "pay_methodValue", "output": "short", "items": [ { "type": "product", "product_id": 1080, "domain": "hosting.com", "cycle": "a" } ] } } } ], "responses": { "200": { "description": "`Success`" } } } }, "\/dns": { "get": { "tags": [ "DNS" ], "summary": "List DNS", "description": "Returns a list of all DNS", "operationId": "dns_get", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "service_ids": [ "10", "20" ], "zones": [ { "domain_id": "60", "name": "qwerty.com", "service_id": "10" }, { "domain_id": "61", "name": "bgg12ooble.com", "service_id": "20" } ] } }, "schema": { "type": "object", "example": { "service_ids": [ "10", "20" ], "zones": [ { "domain_id": "60", "name": "qwerty.com", "service_id": "10" }, { "domain_id": "61", "name": "bgg12ooble.com", "service_id": "20" } ] } } } } } }, "\/service\/{service_id}\/dns": { "post": { "tags": [ "DNS" ], "summary": "Add DNS Zone", "description": "Creates a new DNS zone", "operationId": "dns_add_zone", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID", "example": "service_idValue" }, "name": { "type": "string", "description": "Zone name ", "example": "testzone.com" } }, "example": { "service_id": "service_idValue", "name": "testzone.com" } } }, { "name": "service_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "info": [ "Domain zone testzone.com was created successfully." ] } }, "schema": { "type": "object", "example": { "info": [ "Domain zone testzone.com was created successfully." ] } } } } }, "get": { "tags": [ "DNS" ], "summary": "List DNS for service", "description": "Returns a list of DNS zones under the service", "operationId": "dns_list_zones", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "service_id", "type": "integer", "in": "path", "description": "Service ID", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "error": [ "invalid method" ] } }, "schema": { "type": "object", "example": { "error": [ "invalid method" ] } } } } } }, "\/service\/{service_id}\/dns\/{zone_id}": { "get": { "tags": [ "DNS" ], "summary": "Get DNS details", "description": "Returns details of the DNS zone", "operationId": "dns_get_zone", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "service_id", "type": "integer", "in": "path", "description": "Service ID", "required": true }, { "name": "zone_id", "type": "integer", "in": "path", "description": "Zone ID", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "service_id": 10, "name": "qwerty.com", "records": [ { "id": "10", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "127.0.0.1", "type": "A" }, { "id": "11", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "ns1.qwerty.com", "type": "NS" } ] } }, "schema": { "type": "object", "example": { "service_id": 10, "name": "qwerty.com", "records": [ { "id": "10", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "127.0.0.1", "type": "A" }, { "id": "11", "name": "qwerty", "ttl": 1800, "priority": 0, "content": "ns1.qwerty.com", "type": "NS" } ] } } } } } }, "\/service\/{service_id}\/dns\/{zone_id}\/records": { "post": { "tags": [ "DNS" ], "summary": "Add DNS Record", "description": "Creates a new record in the DNS zone", "operationId": "dns_add_record", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID", "example": "service_idValue" }, "zone_id": { "type": "integer", "description": "Zone ID", "example": "zone_idValue" }, "name": { "type": "string", "description": "Record name ", "example": "example.com" }, "ttl": { "type": "integer", "description": "Record ttl ", "example": 3600 }, "priority": { "type": "integer", "description": "Priority of the record ", "example": 10 }, "type": { "type": "string", "description": "Record type ", "example": "A" }, "content": { "type": "string", "description": "Contents of the record ", "example": "192.168.1.2" } }, "example": { "service_id": "service_idValue", "zone_id": "zone_idValue", "name": "example.com", "ttl": 3600, "priority": 10, "type": "A", "content": "192.168.1.2" } } }, { "name": "service_id", "type": "string", "in": "path", "required": true }, { "name": "zone_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "record": { "name": "_sip._tcp.example.com", "type": "SRV", "ttl": "3600", "priority": "10", "content": [ 10, 5060, "vc01.example.com" ] }, "info": [ "dnsnewrecordadded", "SRV" ] } }, "schema": { "type": "object", "example": { "record": { "name": "_sip._tcp.example.com", "type": "SRV", "ttl": "3600", "priority": "10", "content": [ 10, 5060, "vc01.example.com" ] }, "info": [ "dnsnewrecordadded", "SRV" ] } } } } } }, "\/service\/{service_id}\/dns\/{zone_id}\/records\/{record_id}": { "put": { "tags": [ "DNS" ], "summary": "Edit DNS Record", "description": "Edits the selected DNS zone record", "operationId": "dns_edit_record", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID", "example": "service_idValue" }, "zone_id": { "type": "integer", "description": "Zone ID", "example": "zone_idValue" }, "record_id": { "type": "integer", "description": "Record ID", "example": "record_idValue" }, "name": { "type": "string", "description": "Record name ", "example": "example.com" }, "ttl": { "type": "integer", "description": "Record ttl ", "example": 3600 }, "priority": { "type": "integer", "description": "Priority of the record ", "example": 10 }, "type": { "type": "string", "description": "Record type ", "example": "A" }, "content": { "type": "string", "description": "Contents of the record ", "example": "192.168.1.2" } }, "example": { "service_id": "service_idValue", "zone_id": "zone_idValue", "record_id": "record_idValue", "name": "example.com", "ttl": 3600, "priority": 10, "type": "A", "content": "192.168.1.2" } } }, { "name": "service_id", "type": "string", "in": "path", "required": true }, { "name": "zone_id", "type": "string", "in": "path", "required": true }, { "name": "record_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`", "examples": { "application\/json": { "record": { "id": "55", "type": "A", "ttl": "3600", "name": "test", "priority": 0, "content": "192.168.1.2" }, "info": [ "The record was updated successfully." ] } }, "schema": { "type": "object", "example": { "record": { "id": "55", "type": "A", "ttl": "3600", "name": "test", "priority": 0, "content": "192.168.1.2" }, "info": [ "The record was updated successfully." ] } } } } }, "delete": { "tags": [ "DNS" ], "summary": "Remove DNS Record", "description": "Removes the selected DNS zone record", "operationId": "dns_delete_record", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "service_id", "type": "integer", "in": "path", "description": "Service ID", "required": true }, { "name": "zone_id", "type": "integer", "in": "path", "description": "Zone ID", "required": true }, { "name": "record_id", "type": "integer", "in": "path", "description": "Record ID", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/news": { "get": { "tags": [ "Support" ], "summary": "List News", "description": "List News", "operationId": "getNews", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/news\/{news_id}": { "get": { "tags": [ "Support" ], "summary": "Get news item", "description": "Returns details of the news item", "operationId": "getNewsItem", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "news_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/knowledgebase": { "get": { "tags": [ "Support" ], "summary": "List all knowledgebase categories", "description": "Returns list all knowledgebase categories", "operationId": "getKnowledgebaseCategories", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [], "responses": { "200": { "description": "`Success`" } } } }, "\/knowledgebase\/{category_id}": { "get": { "tags": [ "Support" ], "summary": "Get knowledgebase category details", "description": "Returns subcategories and articles of the knowledgebase category", "operationId": "getKnowledgebaseCategoryDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "category_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } }, "\/knowledgebase\/article\/{article_id}": { "get": { "tags": [ "Support" ], "summary": "Get knowledgebase article", "description": "Returns an article details", "operationId": "getKnowledgebaseArticleDetails", "consumes": [ "application\/json" ], "produces": [ "application\/json" ], "parameters": [ { "name": "article_id", "type": "string", "in": "path", "required": true } ], "responses": { "200": { "description": "`Success`" } } } } }, "securityDefinitions": { "bearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header", "description": "Enter: Bearer {token}" } }, "security": [ { "bearerAuth": [] } ], "definitions": { "Clientarea": { "type": "object", "properties": { "username": { "type": "string", "description": "Your acount email address " }, "password": { "type": "string", "description": "Optional, allows you to login as contact" }, "refresh_token": { "type": "string" }, "type": { "type": "string", "description": "Account Type" }, "companyname": { "type": "string", "description": "Organization" }, "vateu": { "type": "string", "description": "CVR nr. - If you have valid VAT-EU registered number please provide it here" }, "firstname": { "type": "string", "description": "First Name" }, "lastname": { "type": "string", "description": "Last Name" }, "email": { "type": "string", "description": "Email Address" }, "address1": { "type": "string", "description": "Address 1" }, "address2": { "type": "string", "description": "Address 2" }, "city": { "type": "string", "description": "City" }, "postcode": { "type": "string", "description": "Post code" }, "country": { "type": "string", "description": "Country" }, "phonenumber": { "type": "string", "description": "Phone" }, "privileges": { "type": "array", "items": { "type": "string" }, "description": "Array with privileges that you want to enable. Formatted the same way as output from GET \/contact\/privileges<\/code>" }, "id": { "type": "integer", "description": "Contact ID" }, "rel_type": { "type": "string", "description": "Optional, return only by relation type" }, "rel_id": { "type": "string", "description": "Optional, return only by relation id" } } }, "Billing": { "type": "object", "properties": { "amount": { "type": "number", "description": "Optional credit amount, when no value is specified maximum amount to fully pay the invoice will be used" } } }, "Services": { "type": "object", "properties": { "id": { "type": "integer" }, "resources": { "type": "array", "items": { "type": "string" }, "description": "array with resource values" }, "package": { "type": "integer", "description": "New package id, optonal when upgrading resources" }, "cycle": { "type": "string", "description": "New billing cycle" }, "send": { "type": "boolean", "description": "Set to true when you want to send your upgrade request" }, "immediate": { "type": "string", "description": "set to false<\/code> to terminate service at the end of billing date, true<\/code> - terminate immediately" }, "reason": { "type": "string", "description": "Reason for this request" }, "label": { "type": "string", "description": "VM label" }, "vmid": { "type": "string", "description": "Virtual server id" }, "template": { "type": "string", "description": "Template ID" }, "memory": { "type": "string", "description": "Amount of RAM in MB" }, "cpu": { "type": "string", "description": "Amount of CPU cores" }, "disk": { "type": "string", "description": "Disk Space in GB" }, "interface": { "type": "array", "items": { "type": "string" }, "description": "Interface configuration" }, "hostname": { "type": "string", "description": "New hostname for the VM" }, "type": { "type": "string", "description": "ipv4 or ipv6" }, "iface": { "type": "string", "description": "Interface name or id to remove" }, "bridge": { "type": "string", "description": "Network bridge" }, "pool": { "type": "string", "description": "List ID to allocate new IP from" }, "number": { "type": "integer", "description": "Number of IPs to allocate" }, "firewall": { "type": "integer", "description": "Enable or disable firewall (may require specific permissions)" }, "ipv4": { "type": "array", "items": { "type": "string" }, "description": "List of IP v4 IDs" }, "ipv6": { "type": "array", "items": { "type": "string" }, "description": "List of IP v6 IDs" } } }, "Cart": { "type": "object", "properties": { "category_id": { "type": "integer", "description": "Category ID" }, "product_id": { "type": "integer", "description": "Product ID " }, "domain": { "type": "string", "description": "Domain name, ie. example.com, may be optional" }, "cycle": { "type": "string", "description": "Billing period symbol" }, "pay_method": { "type": "integer", "description": "Payment method ID" }, "custom": { "type": "array", "items": { "type": "string" }, "description": "Additional options data available for sop products" }, "promocode": { "type": "string", "description": "Promotion code" }, "aff_id": { "type": "integer", "description": "Affiliate ID" }, "ignore_errors": { "type": "boolean", "description": "Process order even if some of the items were rejected due to errors " }, "items": { "type": "array", "items": { "type": "string" }, "description": "list with order items" }, "output": { "type": "string", "description": "Type of output, default is short. Possible options\n
      \n
    • short<\/code> - Basic details about the item in cart<\/li>\n
    • config<\/code>- Basic details and form components<\/li>\n
    • full<\/code> - All details available in cart<\/li>\n<\/ul> " } } }, "DNS": { "type": "object", "properties": { "service_id": { "type": "integer", "description": "Service ID" }, "name": { "type": "string", "description": "Record name " }, "zone_id": { "type": "integer", "description": "Zone ID" }, "ttl": { "type": "integer", "description": "Record ttl " }, "priority": { "type": "integer", "description": "Priority of the record " }, "type": { "type": "string", "description": "Record type " }, "content": { "type": "string", "description": "Contents of the record " }, "record_id": { "type": "integer", "description": "Record ID" } } }, "Support": { "type": "object", "properties": [] } }, "externalDocs": { "description": "Find out more about UserAPI", "url": "https:\/\/powervps.dk\/?cmd=userapi" } }