Skip to content
GitmoapAPIBeta
Codecommits
GET/repositories/{repo_id}/commits

List commits in a repository

list_commits
  • commit:read
    A token needs the commit:read scope: View commitsGranted by mcp_agent, mcp_agent_write, read_api, read_repository, write_api, write_repository.Every operation this scope unlocks
  • Cacheable · ref addressed

    x-gitmoap-cache: {"kind":"ref_addressed"}

  • Single-resource

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

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

The history reachable from a branch, tag or commit — HEAD by default — newest first, including every commit a merge brought in, optionally narrowed to the commits that changed one file or directory. Ask for first_parent=true to see each merge as a single entry instead. Pages hold up to 100 commits, 20 by default; pass next_token back unchanged.

Parameters

Path
  • repo_idRepositoryId (string · uuid)Repository ID
Query
  • refstringoptionalBranch name, tag, or commit SHA (defaults to HEAD)
  • pathstringoptionalShow only commits that changed this file, or anything inside this directory. Follows the change through merges, so you see who made it rather than who merged it.
  • first_parentbooleanoptionalFollow only the first parent of each commit, so a merge appears once and the commits it brought in do not. Defaults to false: every commit reachable from the ref.
  • limitinteger · int32optionalMaximum number of items to return (1-100)
  • next_tokenstringoptionalPagination token from the previous page

Responses

200Commits listedapplication/json
  • itemsarray of Commit
    • The Commit schema
    • author_emailEmail (string)
    • author_namestring
    • authored_atstring
    • commit_shaCommitHash (string)
    • committed_atstring
    • committer_emailEmail (string)
    • committer_namestring
    • repository_idRepositoryId (string · uuid)
    • short_shaShortCommitHash (string)
    • titlestring
    • author_avatar_urlstring or nulloptional
    • committer_avatar_urlstring or nulloptional
    • messagestring or nulloptional
    • parent_shasarray of CommitHash (string)optional
    • tagsarray of TagName (string)optional
  • next_tokenstring or nulloptional
200 exampleSynthesized example
{
"items": [
{
"author_email": "mara@acme.example",
"author_name": "Tomás Reyes",
"authored_at": "2026-10-15T17:49:42Z",
"commit_sha": "72d9953b7e3c8bd28c4f6a5102cbc8469b2a16a4",
"committed_at": "2026-10-15T11:37:35Z",
"committer_email": "lin@acme.example",
"committer_name": "payments-api",
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70",
"short_sha": "f9e645761ef3b1a6ad4ec77f47d7d9e4c316f0de",
"title": "Pin a page's payload to the build that rendered it"
}
],
"next_token": "next-token-0c2f"
}
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-865a",
"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-8d0e",
"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-f434",
"message": "Pin a page's payload to the build that rendered it"
}
}
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-91f0",
"message": "Pin a page's payload to the build that rendered it"
}
}

CLI

gitmoap commits list

  • --repo-ididRepository ID (id or owner/repo path)
  • --first-parentflagoptionalFollow only the first parent of each commit, so a merge appears once and the commits it brought in do not. Defaults to false: every commit reachable from the ref.
  • --limitnumberoptionalMaximum number of items to return (1-100)
  • --next-tokenstringoptionalPagination token from the previous page
  • --pathstringoptionalShow only commits that changed this file, or anything inside this directory. Follows the change through merges, so you see who made it rather than who merged it.
  • --refstringoptionalBranch name, tag, or commit SHA (defaults to HEAD)

Used in these guides