Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Create PTY WebSocket token

Create a short-lived single-use ticket for opening a PTY WebSocket connection.

POST/api/pty/{ptyID}/connect-token
Path parameters
ptyIDobjectrequired
Query parameters
locationobject | any
Responses
200Success
locationLocation.Inforequired
Show properties
directorystringrequired
workspaceIDobject
Show properties
object
projectobjectrequired
Show properties
idstringrequired
directorystringrequired
dataPtyTicket.ConnectTokenrequired
Show properties
ticketstringrequired
expires_inobjectrequired
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
403ForbiddenError
_tagstringrequired
Allowed:ForbiddenError
messagestringrequired
404PtyNotFoundError
_tagstringrequired
Allowed:PtyNotFoundError
ptyIDstringrequired
messagestringrequired
Request
curl -X POST "/api/pty/%5Bobject%20Object%5D/connect-token"
Response
{
  "location": {
    "directory": "string",
    "workspaceID": {},
    "project": {
      "id": "string",
      "directory": "string"
    }
  },
  "data": {
    "ticket": "string",
    "expires_in": {}
  }
}