Create PTY WebSocket token
Create a short-lived single-use ticket for opening a PTY WebSocket connection.
POST
/api/pty/{ptyID}/connect-tokenPath parameters
ptyIDobjectrequiredQuery parameters
locationobject | anyResponses
200Success
locationLocation.InforequiredShow propertiesHide properties
directorystringrequiredworkspaceIDobjectShow propertiesHide properties
objectprojectobjectrequiredShow propertiesHide properties
idstringrequireddirectorystringrequireddataPtyTicket.ConnectTokenrequiredShow propertiesHide properties
ticketstringrequiredexpires_inobjectrequiredShow propertiesHide properties
object400InvalidRequestError
_tagstringrequiredAllowed:
InvalidRequestErrormessagestringrequiredkindstring | anyShow propertiesHide properties
Any of:
string
stringany
anyfieldstring | anyShow propertiesHide properties
Any of:
string
stringany
any401UnauthorizedError
_tagstringrequiredAllowed:
UnauthorizedErrormessagestringrequired403ForbiddenError
_tagstringrequiredAllowed:
ForbiddenErrormessagestringrequired404PtyNotFoundError
_tagstringrequiredAllowed:
PtyNotFoundErrorptyIDstringrequiredmessagestringrequiredRequest
curl -X POST "/api/pty/%5Bobject%20Object%5D/connect-token"const response = await fetch("/api/pty/%5Bobject%20Object%5D/connect-token", {
method: "POST"
});import requests
response = requests.post(
"/api/pty/%5Bobject%20Object%5D/connect-token",
)Response
{
"location": {
"directory": "string",
"workspaceID": {},
"project": {
"id": "string",
"directory": "string"
}
},
"data": {
"ticket": "string",
"expires_in": {}
}
}{
"_tag": "InvalidRequestError",
"message": "string",
"kind": "string",
"field": "string"
}{
"_tag": "UnauthorizedError",
"message": "string"
}{
"_tag": "ForbiddenError",
"message": "string"
}{
"_tag": "PtyNotFoundError",
"ptyID": "string",
"message": "string"
}