Skip to main content
Retrieve commit history for a branch with pagination.
GET /api/v1/repos/commits?branch=main&cursor=CURSOR&limit=20
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

ParameterTypeDescription
branchOptionalBranch name (defaults to repository’s default branch)
cursorOptionalPagination cursor from previous response
limitOptionalMaximum number of commits to return (default: 20)

JWT Requirements

  • The JWT must include the repository in the repo claim
  • Requires git:read scope

Response

{
  "commits": [
    {
      "sha": "b003fc78805954584e1ee364a4ad39d7c79e819a",
      "message": "fix: resolve scrolling issue in dashboard",
      "author_name": "Jane Doe",
      "author_email": "[email protected]",
      "committer_name": "Jane Doe",
      "committer_email": "[email protected]",
      "date": "2024-01-15T14:32:18Z"
    },
    {
      "sha": "a4d39d7c79e819ab003fc78805954584e1ee36",
      "message": "feat: add user authentication",
      "author_name": "John Smith",
      "author_email": "[email protected]",
      "committer_name": "John Smith",
      "committer_email": "[email protected]",
      "date": "2024-01-14T10:15:00Z"
    }
  ],
  "next_cursor": "20",
  "has_more": true
}

Notes

  • The cursor represents the number of commits to skip
  • Commits are ordered by commit date (newest first)
  • If branch is not specified, uses the repository’s default branch

Error Responses

StatusDescription
404 Not FoundBranch doesn’t exist (includes branch name in error)
401 UnauthorizedInvalid JWT or missing git:read scope
400 Bad RequestInvalid cursor format