Mint a single-use ticket (purpose connect)
curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/terminal_sessions/{terminal_session_id}/tickets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"purpose": "connect",
"ttl_seconds": 67
}
'import requests
url = "https://api.staging.bma.beeos.ai/v1/terminal_sessions/{terminal_session_id}/tickets"
payload = {
"purpose": "connect",
"ttl_seconds": 67
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'connect', ttl_seconds: 67})
};
fetch('https://api.staging.bma.beeos.ai/v1/terminal_sessions/{terminal_session_id}/tickets', 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/v1/terminal_sessions/{terminal_session_id}/tickets"
payload := strings.NewReader("{\n \"purpose\": \"connect\",\n \"ttl_seconds\": 67\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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))
}{
"ticket": "<string>",
"ws_url": "<string>",
"type": "ticket",
"purpose": "watch",
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"subprotocol": "<string>",
"permissions": [
"<string>"
],
"machine_id": "<string>",
"desktop_session_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}Terminal sessions
Mint a single-use ticket (purpose connect)
D-7 unified ticket endpoint. purpose defaults to and must be connect; the response is a ticket object. connection_tickets is the deprecated alias that answers terminal_connection_ticket.
POST
/
terminal_sessions
/
{terminal_session_id}
/
tickets
Mint a single-use ticket (purpose connect)
curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/terminal_sessions/{terminal_session_id}/tickets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"purpose": "connect",
"ttl_seconds": 67
}
'import requests
url = "https://api.staging.bma.beeos.ai/v1/terminal_sessions/{terminal_session_id}/tickets"
payload = {
"purpose": "connect",
"ttl_seconds": 67
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'connect', ttl_seconds: 67})
};
fetch('https://api.staging.bma.beeos.ai/v1/terminal_sessions/{terminal_session_id}/tickets', 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/v1/terminal_sessions/{terminal_session_id}/tickets"
payload := strings.NewReader("{\n \"purpose\": \"connect\",\n \"ttl_seconds\": 67\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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))
}{
"ticket": "<string>",
"ws_url": "<string>",
"type": "ticket",
"purpose": "watch",
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"subprotocol": "<string>",
"permissions": [
"<string>"
],
"machine_id": "<string>",
"desktop_session_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}Authorizations
apiKeybearer
Headers
Project scope. Required when the API key can access more than one project (alias: anthropic-workspace-id).
Replays the first result of a create; the same key with another body is 409.
Required string length:
1 - 255Path Parameters
Body
application/json
Response
Success.
A single-use ticket (D-7). purpose names what it opens (watch, connect; control is reserved).
Opaque single-use ticket. Returned once and never logged.
WebSocket URL without the ticket.
Available options:
watch, connect, control