Account API
Account profile, dashboard figures, invoices, SSH keys and billing terms. All endpoints require Bearer-token authentication.
GET /account
Returns the customer profile, notification settings, SSH keys and passkeys. Admin contacts also get the contact list and order history.
curl https://api.gigahost.no/api/v0/account \
-H "Authorization: Bearer $TOKEN"Response (excerpt):
{
"data": {
"cust_id": 12345,
"cust_name": "Acme AS",
"cust_company_no": "999999999",
"cust_address": "1 Example Street",
"cust_address2": "",
"cust_zipcode": "0000",
"cust_city": "Oslo",
"cust_province": "",
"cust_country": "Norway",
"cust_phone": "+4712345678",
"cust_phone2": "",
"cust_email": "[email protected]",
"cust_billing_email": "[email protected]",
"cust_billing_email2": "",
"cust_newsletter": false,
"cust_incident": true,
"cust_bandwidth_notification": true,
"cust_email_on_login": false,
"cust_notify_service_renewal": true,
"cust_last_login": 1779843600,
"contact_2fa": 1,
"contact_password_login_enabled": true,
"sshkeys": [],
"passkeys": [],
"contacts": [],
"orders": []
}
}sshkeys holds the account's SSH keys; use their key_id in POST /servers/{id}/reinstall. contacts and orders are only present for admin contacts. Each order carries billing_changeable (whether its billing term can be changed) and a products array with op_id, srv_id, product_id, op_type, product_name, product_alt_name and op_sum, plus srv_name on active orders.
GET /billing
Returns invoices, orders, the payment method, cards on file and account credit.
curl https://api.gigahost.no/api/v0/billing \
-H "Authorization: Bearer $TOKEN"Response (excerpt):
{
"data": {
"invoices": [
{
"inv_id": 42160,
"inv_md5": "0123456789abcdef0123456789abcdef",
"order_id": 9876,
"inv_number": "42160",
"inv_kid": "",
"inv_date": 1746998400,
"inv_duedate": 1747862400,
"inv_total": 100.00,
"inv_vat": 25,
"inv_paid": 0,
"inv_currency": "NOK",
"inv_topup": 0,
"inv_credited": 0
}
],
"orders": [],
"billing": {},
"card_details": [],
"credit": []
}
}inv_date is a Unix timestamp. inv_total is the amount before VAT and inv_vat the VAT rate in percent. inv_md5 is the key for downloading the PDF and inv_id for paying the invoice.
GET /dashboard
Returns the figures behind the Flux dashboard: service counts, unpaid invoices and the support PIN.
curl https://api.gigahost.no/api/v0/dashboard \
-H "Authorization: Bearer $TOKEN"Response (excerpt):
{
"data": {
"billing": {
"outstanding_amount": { "NOK": 1250.00 },
"overdue_amount": { "NOK": 625.00 },
"unpaid": 2,
"overdue": 1
},
"support_pin": "123456"
}
}outstanding_amount and overdue_amount are keyed by currency and include VAT. overdue_amount counts an invoice once its due date, plus any extension support has granted, has passed. The overdue count does not include extensions. Both amounts are empty for API keys and users without billing access.
support_pin is the 6-digit PIN you give when calling phone support. It belongs to the logged-in user and changes every day. It is null for API keys.
SSH keys
Key names are 1 to 64 characters: letters (including æ, ø and å), digits, spaces and - _ . @. Other names fail with 400 Invalid name. Use 1-64 letters, digits, spaces or - _ . @.
POST /account/sshkey
Add a key.
| Field | Type | Description |
|---|---|---|
name | string | Key name. |
data | string | The public key, one line (ssh-ed25519 AAAA... comment). |
curl -X POST https://api.gigahost.no/api/v0/account/sshkey \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "laptop", "data": "ssh-ed25519 AAAA... you@laptop"}'A key that is not a valid public key fails with 400 SSH-key invalid.
PUT /account/sshkey/{key_id}
Rename a key. Only the name changes; servers that already have the key are not touched.
| Field | Type | Description |
|---|---|---|
name | string | New name. |
curl -X PUT https://api.gigahost.no/api/v0/account/sshkey/42 \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "laptop 2026"}'Returns 200 with meta.message SSH key renamed., or 404 Key not found.
DELETE /account/sshkey/{key_id}
Delete a key. Returns 404 Key not found. if the key is not on the account.
Billing term of an order
Admin logins only; API keys and other users cannot use these endpoints. The order is addressed by its order_number, not order_id. Only orders with billing_changeable: true in GET /account qualify: active hourly orders, and active term orders that contain only servers, volumes and IPv4 addresses. Other orders return 404 Order was not found or its billing term cannot be changed.
GET /account/order/{order_number}/billing?cycle={months}
Preview the change. cycle is 1, 3, 6 or 12 months.
curl "https://api.gigahost.no/api/v0/account/order/100234/billing?cycle=12" \
-H "Authorization: Bearer $TOKEN"data holds from ("hourly" or the current term in months), cycle, currency, lines, monthly_total and term_total (excluding VAT). For an hourly order it adds starts (first day of the new term) and accrued (from, hours and amount of the hourly usage that will be invoiced). For a term order it adds direction (upgrade for a longer term, downgrade for a shorter one), starts and reissue_invoice (the invoice number that will be credited and reissued, or false).
PUT /account/order/{order_number}/billing
| Field | Type | Description |
|---|---|---|
billing_cycle | number | New term in months: 1, 3, 6 or 12. |
curl -X PUT https://api.gigahost.no/api/v0/account/order/100234/billing \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"billing_cycle": 12}'Nothing can be moved to hourly billing. What happens:
- Hourly to a term: the hours used so far and the first term, starting today, are invoiced at once.
datareturnshourly_invoiceandfirst_invoice(invoice numbers, orfalse). - Longer term: the new term applies from the next billing date.
- Shorter term: if the order has one unpaid invoice that is not yet due, it is credited and reissued for the new term, without the discount of the longer term.
data.reissuedis the new invoice number, orfalse.
Returns 200 with meta.message Billing term changed. Errors (400):
New billing term not valid.Pay your overdue invoices before changing the billing term.(hourly orders)Your hourly usage this month has used all the credit on your account. Top up your account before changing the billing term.The order is already on this billing term.Pay the open invoice on this order first.The billing term of this order cannot be changed. Contact support.
Users
Users are added with POST /account and edited with PUT /account/user/{contact_id}, by admin logins only. The access level is admin or user. Single server access (server) is no longer given to new users: adding one fails with 400 Access level is not valid., and moving an existing user to it fails with 403 Access level not valid. Users who already have single server access keep it.

