---
title: "getRepoCommit"
---

> Documentation Index
> Fetch the complete documentation index at: https://buildrforge.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getRepoCommit

Path: Forge API › commits

`GET /repos/{repo_id}/commits/{commit_id}`

Read a commit.

## Path parameters

- `repo_id` (`getRepoCommit.path.repo_id`; string, required)
  - pattern: `^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `commit_id` (`getRepoCommit.path.commit_id`; string, required)
  - pattern: `^commit_[0-7][0-9a-hjkmnp-tv-z]{25}$`

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/repos/<repo_id>/commits/<commit_id>'
```

### TypeScript

```typescript
const url = '<base-url>/repos/<repo_id>/commits/<commit_id>';
const options = {method: 'GET'};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/repos/<repo_id>/commits/<commit_id>"

response = requests.get(url)

print(response.text)
```

## Responses

### 200

Commit

#### Example

```json
{
  "id": "string",
  "parent_id": "string",
  "merge_parent_id": "string",
  "message": "string",
  "created_at": "string",
  "author": {
    "id": "string",
    "display_name": "string"
  },
  "co_authors": [
    {
      "id": "string",
      "display_name": "string"
    }
  ]
}
```

- `id` (`getRepoCommit.response.200.id`; string, required)
  - pattern: `^commit_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `parent_id` (`getRepoCommit.response.200.parent_id`; any of, required)
  - any of the following: `CommitId`, `null`
- `merge_parent_id` (`getRepoCommit.response.200.merge_parent_id`; any of, required)
  - any of the following: `CommitId`, `null`
- `message` (`getRepoCommit.response.200.message`; string, required)
  - minLength: `1`
- `created_at` (`getRepoCommit.response.200.created_at`; string, required)
- `author` (`getRepoCommit.response.200.author`; object, required)
  - `id` (`getRepoCommit.response.200.author.id`; string, required)
    - minLength: `1`
  - `display_name` (`getRepoCommit.response.200.author.display_name`; any of, required)
    - any of the following: `string`, `null`
- `co_authors` (`getRepoCommit.response.200.co_authors`; array of object, required)
  - `id` (`getRepoCommit.response.200.co_authors.id`; string, required)
    - minLength: `1`
  - `display_name` (`getRepoCommit.response.200.co_authors.display_name`; any of, required)
    - any of the following: `string`, `null`

### 400

InvalidRequest

#### Example

```json
{
  "_tag": "InvalidRequest",
  "part": "path",
  "issues": [
    {
      "path": [
        "string"
      ],
      "message": "string"
    }
  ]
}
```

- `_tag` (`getRepoCommit.response.400._tag`; string, required)
  - one of `"InvalidRequest"`
- `part` (`getRepoCommit.response.400.part`; string, required)
  - one of `"path"`, `"query"`, `"headers"`, `"body"`
- `issues` (`getRepoCommit.response.400.issues`; array of object, required)
  - `path` (`getRepoCommit.response.400.issues.path`; array\<any of\>, required)
    - any of the following: `string`, `integer`
  - `message` (`getRepoCommit.response.400.issues.message`; string, required)

### 401

InvalidCredentials

#### Example

```json
{
  "_tag": "InvalidCredentials"
}
```

- `_tag` (`getRepoCommit.response.401._tag`; string, required)
  - one of `"InvalidCredentials"`

### 403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired

#### Example

```json
{
  "_tag": "Forbidden",
  "message": "string"
}
```

Any of the following:

- `ForbiddenEncoded`
  - `_tag` (`ForbiddenEncoded._tag`; string, required)
    - one of `"Forbidden"`
  - `message` (`ForbiddenEncoded.message`; string, required)
- `ForbiddenOriginEncoded`
  - `_tag` (`ForbiddenOriginEncoded._tag`; string, required)
    - one of `"ForbiddenOrigin"`
- `RequiresPersonalSessionEncoded`
  - `_tag` (`RequiresPersonalSessionEncoded._tag`; string, required)
    - one of `"RequiresPersonalSession"`
- `RunBranchRequiredEncoded`
  - `_tag` (`RunBranchRequiredEncoded._tag`; string, required)
    - one of `"RunBranchRequired"`
  - `branch` (`RunBranchRequiredEncoded.branch`; string, required)
    - minLength: `1`
  - `message` (`RunBranchRequiredEncoded.message`; string, required)

### 404

CommitNotFound | RepoNotFound

#### Example

```json
{
  "_tag": "CommitNotFound",
  "commit_id": "string"
}
```

Any of the following:

- `CommitNotFoundEncoded`
  - `_tag` (`CommitNotFoundEncoded._tag`; string, required)
    - one of `"CommitNotFound"`
  - `commit_id` (`CommitNotFoundEncoded.commit_id`; string, required)
    - pattern: `^commit_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `RepoNotFoundEncoded`
  - `_tag` (`RepoNotFoundEncoded._tag`; string, required)
    - one of `"RepoNotFound"`

### 429

RateLimited

#### Example

```json
{
  "_tag": "RateLimited"
}
```

- `_tag` (`getRepoCommit.response.429._tag`; string, required)
  - one of `"RateLimited"`

### 500

RepoFailure

#### Example

```json
{
  "_tag": "RepoFailure",
  "reason": "string"
}
```

- `_tag` (`getRepoCommit.response.500._tag`; string, required)
  - one of `"RepoFailure"`
- `reason` (`getRepoCommit.response.500.reason`; string, required)

### 503

SessionUnavailable | RateLimitUnavailable

#### Example

```json
{
  "_tag": "SessionUnavailable"
}
```

Any of the following:

- `SessionUnavailableEncoded`
  - `_tag` (`SessionUnavailableEncoded._tag`; string, required)
    - one of `"SessionUnavailable"`
- `RateLimitUnavailableEncoded`
  - `_tag` (`RateLimitUnavailableEncoded._tag`; string, required)
    - one of `"RateLimitUnavailable"`


Source: https://buildrforge.com/docs/api/get-repo-commit/index.md
