---
search:
  tags:
    - Activity
    - GET
seo:
  description: >-
    Return the most recently committed matching public default-branch commit.
    Reference for the GET /v1/users/{username}/commits/latest endpoint in the
    Kronik API.
sidebar:
  label: Get the latest public commit
  badge: GET
title: Get the latest public commit
type: openapi-operation
---
Return the most recently committed matching public default-branch commit.

`GET /v1/users/{username}/commits/latest`

**Responses**

- `200` — LatestCommit
- `400` — InvalidRequestProblem | InvalidCursorProblem
- `404` — UserNotFoundProblem | LatestCommitNotFoundProblem
- `429` — RateLimitedProblem
- `502` — UpstreamFailureProblem
- `503` — ServiceUnavailableProblem

Response example, 200:

```json
{
  "user": {
    "login": "string",
    "url": "http://example.com",
    "avatarUrl": "http://example.com"
  },
  "commit": {
    "sha": "string",
    "url": "http://example.com",
    "repository": {
      "nameWithOwner": "string",
      "url": "http://example.com"
    },
    "headline": "string",
    "body": "string",
    "bodyTruncated": true,
    "authoredAt": "string",
    "committedAt": "string",
    "additions": 0,
    "deletions": 0,
    "changedLines": 0,
    "parents": [
      {
        "sha": "string",
        "url": "http://example.com"
      }
    ]
  }
}
```
