Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Create PTY session

Create a pseudo-terminal session for a location.

POST/api/pty
Query parameters
locationobject | any
Request body
requiredapplication/json
commandstring
argsstring[]
cwdstring
titlestring
envobject
Responses
200Success
locationLocation.Inforequired
Show properties
directorystringrequired
workspaceIDobject
Show properties
object
projectobjectrequired
Show properties
idstringrequired
directorystringrequired
dataPtyrequired
Show properties
idobjectrequired
Show properties
object
titlestringrequired
commandstringrequired
argsstring[]required
cwdstringrequired
statusstringrequired
Allowed:runningexited
pidobjectrequired
Show properties
object
exitCodeobject
Show properties
object
400InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
Request
curl -X POST "/api/pty" \
  -H "Content-Type: application/json" \
  -d '{
  "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": {}
  }
}