Create PTY session
Create a pseudo-terminal session for a location.
POST
/api/ptyQuery parameters
locationobject | anyRequest body
requiredapplication/jsoncommandstringargsstring[]cwdstringtitlestringenvobjectResponses
200Success
locationLocation.InforequiredShow propertiesHide properties
directorystringrequiredworkspaceIDobjectShow propertiesHide properties
objectprojectobjectrequiredShow propertiesHide properties
idstringrequireddirectorystringrequireddataPtyrequiredShow propertiesHide properties
idobjectrequiredShow propertiesHide properties
objecttitlestringrequiredcommandstringrequiredargsstring[]requiredcwdstringrequiredstatusstringrequiredAllowed:
runningexitedpidobjectrequiredShow propertiesHide properties
objectexitCodeobjectShow propertiesHide properties
object400InvalidRequestError
_tagstringrequiredAllowed:
InvalidRequestErrormessagestringrequiredkindstring | anyShow propertiesHide properties
Any of:
string
stringany
anyfieldstring | anyShow propertiesHide properties
Any of:
string
stringany
any401UnauthorizedError
_tagstringrequiredAllowed:
UnauthorizedErrormessagestringrequiredRequest
curl -X POST "/api/pty" \
-H "Content-Type: application/json" \
-d '{
"command": "string",
"args": [
"string"
],
"cwd": "string",
"title": "string",
"env": {}
}'const response = await fetch("/api/pty", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"command": "string",
"args": [
"string"
],
"cwd": "string",
"title": "string",
"env": {}
})
});import requests
response = requests.post(
"/api/pty",
headers={
"Content-Type": "application/json"
},
json={
"command": "string",
"args": [
"string"
],
"cwd": "string",
"title": "string",
"env": {}
},
)Response
{
"location": {
"directory": "string",
"workspaceID": {},
"project": {
"id": "string",
"directory": "string"
}
},
"data": {
"id": {},
"title": "string",
"command": "string",
"args": [
"string"
],
"cwd": "string",
"status": "running",
"pid": {},
"exitCode": {}
}
}{
"_tag": "InvalidRequestError",
"message": "string",
"kind": "string",
"field": "string"
}{
"_tag": "UnauthorizedError",
"message": "string"
}