Create a terminal session
curl --request POST \
--url https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
'import requests
url = "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions"
payload = {
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shell: '<string>', cwd: '<string>', cols: 2048, rows: 256})
};
fetch('https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions"
payload := strings.NewReader("{\n \"shell\": \"<string>\",\n \"cwd\": \"<string>\",\n \"cols\": 2048,\n \"rows\": 256\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"machine_id": "<string>",
"state": "starting",
"created_at": "2023-11-07T05:31:56Z",
"shell": "<string>",
"cwd": "<string>",
"cols": 123,
"rows": 123,
"closed_at": "2023-11-07T05:31:56Z",
"exit_code": 123,
"close_reason": "<string>"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Terminals
Create a terminal session
Creates a PTY-backed shell session. The PTY data plane is being wired to the machine daemon; until then this endpoint reports that terminal sessions are unavailable.
POST
/
orgs
/
{orgID}
/
projects
/
{projectID}
/
machines
/
{machineID}
/
terminal-sessions
Create a terminal session
curl --request POST \
--url https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
'import requests
url = "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions"
payload = {
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shell: '<string>', cwd: '<string>', cols: 2048, rows: 256})
};
fetch('https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/machines/{machineID}/terminal-sessions"
payload := strings.NewReader("{\n \"shell\": \"<string>\",\n \"cwd\": \"<string>\",\n \"cols\": 2048,\n \"rows\": 256\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"machine_id": "<string>",
"state": "starting",
"created_at": "2023-11-07T05:31:56Z",
"shell": "<string>",
"cwd": "<string>",
"cols": 123,
"rows": 123,
"closed_at": "2023-11-07T05:31:56Z",
"exit_code": 123,
"close_reason": "<string>"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
bearerAuthbrowserSessionCookie & csrfHeader
An opaque BMA personal or organization bearer token.
Path Parameters
Organization ID (org_...).
Pattern:
^org_[a-z2-7]{26}$Project ID (proj_...).
Pattern:
^proj_[a-z2-7]{26}$Machine ID (mch_...).
Pattern:
^mch_[a-z2-7]{26}$Body
application/json
Response
Terminal session created.
Terminal session ID (tsn_...).
Pattern:
^tsn_[a-z2-7]{26}$Pattern:
^org_[a-z2-7]{26}$Project ID (proj_...).
Pattern:
^proj_[a-z2-7]{26}$Machine ID (mch_...).
Pattern:
^mch_[a-z2-7]{26}$Available options:
starting, running, closing, closed, failed