List active sessions
Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.
GET
/api/session/activeResponses
200Success
dataobjectrequired400InvalidRequestError
_tagstringrequiredAllowed:
InvalidRequestErrormessagestringrequiredkindstring | anyShow propertiesHide properties
Any of:
string
stringany
anyfieldstring | anyShow propertiesHide properties
Any of:
string
stringany
any401UnauthorizedError
_tagstringrequiredAllowed:
UnauthorizedErrormessagestringrequiredRequest
curl -X GET "/api/session/active"const response = await fetch("/api/session/active", {
method: "GET"
});import requests
response = requests.get(
"/api/session/active",
)Response
{
"data": {}
}{
"_tag": "InvalidRequestError",
"message": "string",
"kind": "string",
"field": "string"
}{
"_tag": "UnauthorizedError",
"message": "string"
}