The Bonsai API is currently in its Alpha release phase. It may not be feature-complete, and is subject to change without notice. If you have any questions about the roadmap of the API, please reach out to support.
The Spaces API provides users a method to explore the server groups and geographic regions available to their account, where clusters may be provisioned. This API supports the following actions:
All calls to the Spaces API must be authenticated with an active API token.
The Bonsai API provides a standard format for Space objects. A Space object includes:
<table>
<thead>
<tr>
<th>Attribute</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>path</td><td>A String representing a machine-readable name for the server group.</td>
</tr>
<tr>
<td>private_network</td><td>A Boolean indicating whether the space is isolated and inaccessible from the public Internet. A VPC connection will be needed to communicate with a private cluster.</td>
</tr>
<tr>
<td>cloud</td><td>An Object containing details about the cloud provider and region attributes:
</td>
</tr>
</tbody>
</table>
The Bonsai API provides a method to get a list of all available spaces on your account. An HTTP GET call is made to the <span class="inline-code"><pre><code>/spaces</code></pre></span> endpoint, and Bonsai will return a JSON list of Space objects.
No parameters are supported for this action.
An HTTP GET call is made to <span class="inline-code"><pre><code>/spaces</code></pre></span>.
Upon success, Bonsai responds with an <span class="inline-code"><pre><code>HTTP 200: OK</code></pre></span> code, along with a JSON list representing the spaces available to your account:
<div class="code-snippet-container">
<a fs-copyclip-element="click-2" href="#" class="btn w-button code-copy-button" title="Copy">
<img class="copy-image" src="https://global-uploads.webflow.com/63c81e4decde60c281417feb/6483934eeefb356710a1d2e9_icon-copy.svg" loading="lazy" alt="">
<img class="copied-image" src="https://global-uploads.webflow.com/63c81e4decde60c281417feb/64839e207c2860eb9e6aa572_icon-copied.svg" loading="lazy" alt="">
</a>
<div class="code-snippet">
<pre><code fs-codehighlight-element="code" fs-copyclip-element="copy-this-2" class="hljs language-javascript">{
"spaces": [
{
"path": "omc/bonsai/us-east-1/common",
"private_network": false,
"cloud": {
"provider": "aws",
"region": "aws-us-east-1"
}
},
{
"path": "omc/bonsai/eu-west-1/common",
"private_network": false,
"cloud": {
"provider": "aws",
"region": "aws-eu-west-1"
}
},
{
"path": "omc/bonsai/ap-southeast-2/common",
"private_network": false,
"cloud": {
"provider": "aws",
"region": "aws-ap-southeast-2"
}
}
]
}</code></pre>
</div>
</div>
The Bonsai API provides a method to get information about a single space available to your account.
No parameters are supported for this action.
An HTTP GET call is made to <span class="inline-code"><pre><code>/spaces/[:path]</code></pre></span>.
Upon success, Bonsai responds with an <span class="inline-code"><pre><code>HTTP 200: OK</code></pre></span> code, along with a JSON body representing the Space object:
<div class="code-snippet-container">
<a fs-copyclip-element="click-3" href="#" class="btn w-button code-copy-button" title="Copy">
<img class="copy-image" src="https://global-uploads.webflow.com/63c81e4decde60c281417feb/6483934eeefb356710a1d2e9_icon-copy.svg" loading="lazy" alt="">
<img class="copied-image" src="https://global-uploads.webflow.com/63c81e4decde60c281417feb/64839e207c2860eb9e6aa572_icon-copied.svg" loading="lazy" alt="">
</a>
<div class="code-snippet">
<pre><code fs-codehighlight-element="code" fs-copyclip-element="copy-this-3" class="hljs language-javascript">{
"path": "omc/bonsai/us-east-1/common",
"private_network": false,
"cloud": {
"provider": "aws",
"region": "aws-us-east-1"
}
}</code></pre>
</div>
</div>