Skip to content
Median
Esc
↑↓navigate↵open⌘Jpreview

List coding sessions

The newest 100 sessions, most recently moved first. hasAccess is false when the plan does not include Mode.

GET/mode/sessions
Authorization
AuthorizationBearer token · headerrequired
`MEDIAN_KEY` from Settings under API, or an MCP OAuth access token. A key acts as the organization; a token acts as the person who approved it.
Responses
200The sessions.
hasAccessboolean
sessionsModeSession[]
Show properties
Array of ModeSession
idstring
titlestring
statusstring
waiting is ready for a message. paused is asleep and wakes on the next one. ended and failed are over.
Allowed:startingworkingwaitingpausedendedfailed
pausedForstring | null
Allowed:idlecreditsnull
repostring | null
owner/repo. Null once its codebase was disconnected.
signalIdstring | null
The signal it was started to fix.
toolSuggestionIdstring | null
The tool suggestion it was started to build.
pullRequestobject | null
The pull request, once somebody asked for one.
Show properties
statestring
Allowed:openingopenfailed
numberinteger | null
urlstring | null
errorstring | null
Why opening or updating it failed.
updatedAtinteger
startedByNamestring | null
updatedAtinteger
urlstring
The session's page in Median.
401The bearer token is missing, revoked, or expired.
errorobject
Show properties
codestring
messagestring
429Too many requests. Wait the seconds in `Retry-After`. Limits depend on the plan. See [rate limits](/api/errors-and-limits#rate-limits).
errorobject
Show properties
codestring
messagestring
Request
curl -X GET "https://api.median.sh/v1/mode/sessions" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "hasAccess": true,
  "sessions": [
    {
      "id": "string",
      "title": "string",
      "status": "starting",
      "pausedFor": "idle",
      "repo": "string",
      "signalId": "string",
      "toolSuggestionId": "string",
      "pullRequest": {
        "state": "opening",
        "number": 0,
        "url": "string",
        "error": "string",
        "updatedAt": 0
      },
      "startedByName": "string",
      "updatedAt": 0,
      "url": "string"
    }
  ]
}