---
title: "updateRepo"
---

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

# updateRepo

Path: Forge API › repos

`PATCH /repos/{repo_id}`

Change the repo's description with {"description": text}, at most 280 characters, or null to clear it, or archive it with {"archived":true}: an archived repo keeps its data for reading but takes no writes and runs no tools, and {"archived":false} unarchives it. A key left out leaves that setting alone. Takes update on the repo; archiving is refused with RepoWorkflowRunsActive while any workflow run hasn't finished.

## Path parameters

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

## Request body

_Required._

- `archived` (`updateRepo.archived`; boolean, optional)
- `description` (`updateRepo.description`; any of, optional)
  - any of the following: `RepoDescription`, `null`

## Example request

```json
{
  "archived": true,
  "description": "string"
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url '<base-url>/repos/<repo_id>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "archived": true,
  "description": "string"
}
'
```

### TypeScript

```typescript
const url = '<base-url>/repos/<repo_id>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({archived: true, description: 'string'})
};

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

payload = {
    "archived": True,
    "description": "string"
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 200

Repo

#### Example

```json
{
  "id": "string",
  "org_id": "string",
  "name": "string",
  "description": "string",
  "slug": "string",
  "creator_id": "string",
  "archived_at": "string",
  "archived_by_id": "string"
}
```

- `id` (`updateRepo.response.200.id`; string, required)
  - pattern: `^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `org_id` (`updateRepo.response.200.org_id`; string, required)
  - pattern: `^org_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `name` (`updateRepo.response.200.name`; string, required)
  - minLength: `1`
- `description` (`updateRepo.response.200.description`; any of, required)
  - any of the following: `string`, `null`
- `slug` (`updateRepo.response.200.slug`; string, required)
  - maxLength: `64` · pattern: `^[a-z0-9]+(?:-[a-z0-9]+)*$`
- `creator_id` (`updateRepo.response.200.creator_id`; string, required)
  - pattern: `^(?:user|extension)_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `archived_at` (`updateRepo.response.200.archived_at`; any of, required)
  - any of the following: `string`, `null`
- `archived_by_id` (`updateRepo.response.200.archived_by_id`; any of, required)
  - any of the following: `ActorId`, `null`

### 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` (`updateRepo.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

RepoNotFound

#### Example

```json
{
  "_tag": "RepoNotFound"
}
```

- `_tag` (`updateRepo.response.404._tag`; string, required)
  - one of `"RepoNotFound"`

### 409

RepoWorkflowRunsActive

#### Example

```json
{
  "_tag": "RepoWorkflowRunsActive",
  "workflow_run_count": -9007199254740991
}
```

- `_tag` (`updateRepo.response.409._tag`; string, required)
  - one of `"RepoWorkflowRunsActive"`
- `workflow_run_count` (`updateRepo.response.409.workflow_run_count`; integer, required)
  - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 413

RequestBodyTooLarge

#### Example

```json
{
  "_tag": "RequestBodyTooLarge",
  "max_bytes": -9007199254740991
}
```

- `_tag` (`updateRepo.response.413._tag`; string, required)
  - one of `"RequestBodyTooLarge"`
- `max_bytes` (`updateRepo.response.413.max_bytes`; integer, required)
  - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 429

RateLimited

#### Example

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

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

### 500

OrgFailure | RepoFailure

#### Example

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

Every option has:

- `reason` (`<option>.reason`; string, required)

Any of the following, each adding:

- `OrgFailureEncoded`
  - `_tag` (`OrgFailureEncoded._tag`; string, required)
    - one of `"OrgFailure"`
- `RepoFailureEncoded`
  - `_tag` (`RepoFailureEncoded._tag`; string, required)
    - one of `"RepoFailure"`

### 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/repos/update/index.md
