Skip to content
GitmoapAPIBeta
Agentsai-org
GET/groups/{group_id}/ai-org/sessions

The organization's sessions, newest first.

list_ai_sessions
  • ai_org:read
    A token needs the ai_org:read scope: Read an AI organization, its agents, sessions and usageGranted by read_api, write_api.Every operation this scope unlocks
  • Filtered across resources

    x-gitmoap-isolation: {"kind":"cross_resource_filtered"}

  • Paginated
    Pass the next_token a page returns to get the next one.

A session that read from a group or repository you cannot read is left out.

Parameters

Path
  • group_idGroupId (string · uuid)The organization's top-level group
Query
  • agent_idAgentId (string · uuid)optionalOnly this agent's sessions
  • stateAiSessionStatequeuedrunningwaiting_gatewaiting_personcompletedfailedcancelledhaltedoptionalOnly sessions in this state
  • limitinteger · int64optionalMaximum number of sessions, 1-100 (default 50)
  • next_tokenstringoptionalPagination token

Responses

200Sessions, newest firstapplication/json
  • itemsarray of AiSession
    • The AiSession schema
    • cost_microsinteger · int64Settled spend, fee included, in micro-dollars.
    • created_atstring · date-time
    • org_idAiOrgId (string · uuid)
    • root_group_idGroupId (string · uuid)The top-level group whose organization it ran in.
    • session_idAiSessionId (string · uuid)
    • stateAiSessionStatequeuedrunningwaiting_gatewaiting_personcompletedfailedcancelledhalted
    • subjectSessionSubject
      • The SessionSubject schema
      • addressstring or nulloptionalThe address acted on — acme/api#412, acme/api!87 — when the session has one.
      • started_bystring or nulloptionalThe person or account whose action started the session, when one did.
    • trigger_kindAiTriggerKindassignmentreview_requestreview_feedbackmentionchannel_messageritualpipeline_failuretracker_eventgate_decisionhandoffcontinuationproposalmanualprofile_draftWhat started a session.
    • turnsinteger · int32
    • agent_idAgentId (string · uuid) or nulloptional
    • branchstring or nulloptional
    • ended_atstring · date-time or nulloptional
    • instructionSessionInstruction (string) or nulloptional
    • model_idAiModelKey (string) or nulloptional
    • outcomeAiSessionOutcomemerge_request_openedreview_submittedwork_item_updatedmessage_postedproposal_writtenescalatedno_actionbudget_exhaustedrefusederrortaken_overor nulloptional
    • repository_idRepositoryId (string · uuid) or nulloptionalThe repository the session works on, when it works on one.
    • revision_numberinteger · int64 or nulloptionalThe revision it pinned at start; absent only for a platform session started before any revision was published.
    • started_atstring · date-time or nulloptional
    • summarystring or nulloptionalThe agent's own account of the session.
  • next_tokenstring or nulloptional
200 exampleSynthesized example
{
"items": [
{
"cost_micros": 88,
"created_at": "2026-10-13T05:59:47Z",
"org_id": "45b39acf-1cb6-4706-a3a5-c95258e57544",
"root_group_id": "4c1d8e2f-6a3b-4f90-b7c5-1e2d3c4b5a69",
"session_id": "88969887-c1ae-43ca-b6ae-51d9241090b2",
"state": "queued",
"subject": {},
"trigger_kind": "assignment",
"turns": 14
}
],
"next_token": "next-token-6257"
}
400Bad request — a path parameter is not a well-formed value of its typeapplication/json
Error codes
  • BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-c09e",
"message": "Stream pipeline status into the run header"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
  • UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-dfc8",
"message": "Pin a page's payload to the build that rendered it"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names it
  • PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-ac51",
"message": "Stream pipeline status into the run header"
}
}
404Not found — or found and private, which is masked as absentapplication/json
Error codes
  • NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-34bd",
"message": "Stream pipeline status into the run header"
}
}

CLI

gitmoap ai-org list-ai-sessions

  • --group-ididThe organization's top-level group (id or group path)
  • --agent-ididoptionalOnly this agent's sessions
  • --limitnumberoptionalMaximum number of sessions, 1-100 (default 50)
  • --next-tokenstringoptionalPagination token
  • --statequeued | running | waiting_gate | waiting_person | completed | failed | cancelled | haltedoptionalOnly sessions in this state