---
title: "createRepoCheckpoint"
---

> 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.

# createRepoCheckpoint

Path: Forge API › checkpoints

`POST /repos/{repo_id}/checkpoints`

Name a commit, or a branch's head commit without its uncommitted changes. A checkpoint never moves, and a name a live checkpoint holds is refused.

## Path parameters

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

## Request body

_Required._

Every option has:

- `name` (`<option>.name`; string, required)
  - minLength: `1` · pattern: `^(?!\.\.?$)`
- `description` (`<option>.description`; any of, optional)
  - any of the following: `string`, `null`

Any of the following, each adding:

- `CreateCheckpointAtBranchHead`
  - `branch` (`CreateCheckpointAtBranchHead.branch`; string, required)
    - minLength: `1`
  - `commit_id` (`CreateCheckpointAtBranchHead.commit_id`; unknown, optional)
- `CreateCheckpointAtCommit`
  - `commit_id` (`CreateCheckpointAtCommit.commit_id`; string, required)
    - pattern: `^commit_[0-7][0-9a-hjkmnp-tv-z]{25}$`
  - `branch` (`CreateCheckpointAtCommit.branch`; unknown, optional)

## Example request

```json
{
  "name": "string",
  "description": "string",
  "branch": "string",
  "commit_id": null
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/repos/<repo_id>/checkpoints' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "description": "string",
  "branch": "string",
  "commit_id": null
}
'
```

### TypeScript

```typescript
const url = '<base-url>/repos/<repo_id>/checkpoints';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({name: 'string', description: 'string', branch: 'string', commit_id: null})
};

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>/checkpoints"

payload = {
    "name": "string",
    "description": "string",
    "branch": "string",
    "commit_id": None
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Checkpoint

#### Example

```json
{
  "id": "string",
  "name": "string",
  "commit_id": "string",
  "description": "string",
  "created_by_id": "string",
  "created_at": "string"
}
```

- `id` (`createRepoCheckpoint.response.201.id`; string, required)
  - pattern: `^checkpoint_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `name` (`createRepoCheckpoint.response.201.name`; string, required)
  - minLength: `1`
- `commit_id` (`createRepoCheckpoint.response.201.commit_id`; string, required)
  - pattern: `^commit_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `description` (`createRepoCheckpoint.response.201.description`; any of, required)
  - any of the following: `string`, `null`
- `created_by_id` (`createRepoCheckpoint.response.201.created_by_id`; string, required)
  - minLength: `1`
- `created_at` (`createRepoCheckpoint.response.201.created_at`; string, required)

### 400

InvalidRequest | RequestBodyTooDeep

#### Example

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

Any of the following:

- `InvalidRequestEncoded`
  - `_tag` (`InvalidRequestEncoded._tag`; string, required)
    - one of `"InvalidRequest"`
  - `part` (`InvalidRequestEncoded.part`; string, required)
    - one of `"path"`, `"query"`, `"headers"`, `"body"`
  - `issues` (`InvalidRequestEncoded.issues`; array of object, required)
    - `path` (`InvalidRequestEncoded.issues.path`; array\<any of\>, required)
      - any of the following: `string`, `integer`
    - `message` (`InvalidRequestEncoded.issues.message`; string, required)
- `RequestBodyTooDeepEncoded`
  - `_tag` (`RequestBodyTooDeepEncoded._tag`; string, required)
    - one of `"RequestBodyTooDeep"`
  - `max_depth` (`RequestBodyTooDeepEncoded.max_depth`; integer, required)
    - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 401

InvalidCredentials

#### Example

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

- `_tag` (`createRepoCheckpoint.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

BranchNotFound | CommitNotFound | RepoNotFound

#### Example

```json
{
  "_tag": "BranchNotFound",
  "branch": "string"
}
```

Any of the following:

- `BranchNotFoundEncoded`
  - `_tag` (`BranchNotFoundEncoded._tag`; string, required)
    - one of `"BranchNotFound"`
  - `branch` (`BranchNotFoundEncoded.branch`; string, required)
    - minLength: `1`
- `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"`

### 409

CheckpointExists | RepoArchived

#### Example

```json
{
  "_tag": "CheckpointExists",
  "checkpoint": "string"
}
```

Any of the following:

- `CheckpointExistsEncoded`
  - `_tag` (`CheckpointExistsEncoded._tag`; string, required)
    - one of `"CheckpointExists"`
  - `checkpoint` (`CheckpointExistsEncoded.checkpoint`; string, required)
    - minLength: `1`
- `RepoArchivedEncoded`
  - `_tag` (`RepoArchivedEncoded._tag`; string, required)
    - one of `"RepoArchived"`

### 413

WriteTooLarge | RequestBodyTooLarge

#### Example

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

Any of the following:

- `WriteTooLargeEncoded`
  - `_tag` (`WriteTooLargeEncoded._tag`; string, required)
    - one of `"WriteTooLarge"`
  - `message` (`WriteTooLargeEncoded.message`; string, required)
- `RequestBodyTooLargeEncoded`
  - `_tag` (`RequestBodyTooLargeEncoded._tag`; string, required)
    - one of `"RequestBodyTooLarge"`
  - `max_bytes` (`RequestBodyTooLargeEncoded.max_bytes`; integer, required)
    - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 429

RateLimited

#### Example

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

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

### 500

RepoFailure

#### Example

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

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

### 503

RepoBusy | SessionUnavailable | RateLimitUnavailable

#### Example

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

Any of the following:

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


Source: https://buildrforge.com/docs/api/create-repo-checkpoint/index.md
