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

One session: its summary, outcome, cost and branch.

get_ai_session

A session quotes what it read, so it is shown only to someone who can read every group and repository it read from; to anyone else it is not found. The caller also needs to be a Reporter or above of the organization's top-level group.

Parameters

Path
  • session_idAiSessionId (string · uuid)The session

Responses

200The sessionapplication/json
  • 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.
200 exampleSynthesized example
{
"cost_micros": 29,
"created_at": "2026-10-15T21:09:42Z",
"org_id": "2811abe1-0f13-4efb-ada6-9c470a6ea0d7",
"root_group_id": "4c1d8e2f-6a3b-4f90-b7c5-1e2d3c4b5a69",
"session_id": "b2f39836-b3d0-4d4a-aef8-eca71a611823",
"state": "queued",
"subject": {
"address": "address-601a",
"started_by": "c9d8e7f6-a5b4-4c3d-9e2f-1a0b9c8d7e6f"
},
"trigger_kind": "assignment",
"turns": 67,
"agent_id": "1a9ef714-5593-47ac-bb0d-740349fdeea4",
"branch": "feature/region-legend",
"ended_at": "2026-10-12T04:59:02Z",
"instruction": "instruction-44c2",
"model_id": "d7ffed33-5605-4071-8ed6-b15a056696b9",
"outcome": "merge_request_opened",
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70",
"revision_number": 70,
"started_at": "2026-10-11T10:11:09Z",
"summary": "summary-7ab6"
}
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-f3e8",
"message": "Draw the region map from operation density"
}
}
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-6857",
"message": "Stream pipeline status into the run header"
}
}
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-7f89",
"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-10a0",
"message": "Label every synthesized example"
}
}

CLI

gitmoap ai-org get-ai-session

  • --session-ididThe session