Skip to main content

OakHost Customer API

OakHost offers an API to access and manipulate your resources, such as server information, firewall and more. This allows you to integrate OakHost into your own applications or scripts. The automated creation of servers is currently not supported.

You can access the Swagger endpoint documentation at:

https://www.oakhost.net/api/documentation

info

This API is currently in beta. We do not intend to adjust existing endpoints, but functionality may be slightly adjusted in the future. Please report any issues or suggestions to our support team. We appreciate your feedback!

API Overview

Base URL

The base URL for the API is:

https://www.oakhost.net/api/cws/v1

Authentication

All requests require Bearer token authentication using the Authorization header. Replace [token] with your actual token. The token can be obtained from the OakHost Customer Panel.

Authorization: Bearer [token]

Content Type

All requests must use JSON content type. Set the following headers in your requests:

Content-Type: application/json
Accept: application/json

Response Codes

  • 200 OK - Success
  • 400 Bad Request - Invalid request (e.g., malformed JSON, invalid action)
  • 422 Unprocessable Entity - Validation error (e.g., missing required fields)
  • 401 Unauthorized - Invalid or missing token
  • 403 Forbidden - Access denied (e.g., insufficient permissions)
  • 404 Not Found - Resource not found / Access denied
  • 500 Internal Server Error - Server error

Endpoints

For a complete list of endpoints, please refer to the Swagger documentation.

Firewall

The API allows for managing the external Firewall. This includes creating, updating, deleting and assigning firewalls.

Detailed endpoint documentation can be found here.

Servers

Your OakHost servers can be managed using the API. This always includes listing available servers and details, as well as performing certain actions.

info

Performing power actions via the API depends on various factors due to hardware and software restrictions. Refer to the following table to see which actions are available to you. Note that all hardware options are always available for manual control via the Customer Panel.

ActionDescriptionTypeCondition
rebootInitiate a reboot commandSoftware (Agent)Available for all Macs with the OakHost Agent installed.
powerShort press of power buttonHardwareAvailable for M4 Mac minis and up via API.
force_offLong press of power buttonHardwareAvailable for M4 Mac minis and up via API.
force_rebootforce_off followed by powerHardwareAvailable for M4 Mac minis and up via API.
shutdownInitiate a shutdown commandSoftware (Agent)Available for M4 Mac minis and up with the OakHost Agent installed.

Detailed endpoint documentation can be found here.