---
title: "listRepoCustomModelsAtBranch"
---

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

# listRepoCustomModelsAtBranch

Path: Forge API › customModels

`GET /repos/{repo_id}/branches/{branch}/custom-models`

List the custom models with their custom fields at the branch's working state.

## Path parameters

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

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/repos/<repo_id>/branches/<branch>/custom-models'
```

### TypeScript

```typescript
const url = '<base-url>/repos/<repo_id>/branches/<branch>/custom-models';
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>/branches/<branch>/custom-models"

response = requests.get(url)

print(response.text)
```

## Responses

### 200

Success

#### Example

```json
[
  {
    "name": "string",
    "api_name": "string",
    "extension_id": "string",
    "extension_installation_id": "string",
    "fields": [
      {
        "id": "string",
        "name": "string",
        "api_name": "string",
        "type": "text",
        "options": [
          "string"
        ],
        "required": true,
        "unique": true,
        "target_repo_id": "string",
        "target_model_id": "string",
        "on_delete": "cascade",
        "default_value": {},
        "formula": "string",
        "target_model": "string",
        "filter": {
          "operators": [
            "eq"
          ],
          "sortable": true,
          "value_format": "string"
        }
      }
    ],
    "primary_field": "string",
    "id": "string",
    "id_prefix": "string"
  }
]
```

- `name` (`listRepoCustomModelsAtBranch.response.200.name`; string, required)
  - minLength: `1`
- `api_name` (`listRepoCustomModelsAtBranch.response.200.api_name`; string, required)
  - minLength: `1`
- `extension_id` (`listRepoCustomModelsAtBranch.response.200.extension_id`; any of, required)
  - any of the following: `ExtensionId`, `null`
- `extension_installation_id` (`listRepoCustomModelsAtBranch.response.200.extension_installation_id`; any of, required)
  - any of the following: `ExtensionInstallationId`, `null`
- `fields` (`listRepoCustomModelsAtBranch.response.200.fields`; array of object, required)
  - `id` (`listRepoCustomModelsAtBranch.response.200.fields.id`; string, required)
    - pattern: `^field_[0-7][0-9a-hjkmnp-tv-z]{25}$`
  - `name` (`listRepoCustomModelsAtBranch.response.200.fields.name`; string, required)
    - minLength: `1`
  - `api_name` (`listRepoCustomModelsAtBranch.response.200.fields.api_name`; string, required)
    - minLength: `1`
  - `type` (`listRepoCustomModelsAtBranch.response.200.fields.type`; string, required)
    - one of `"text"`, `"rich_text"`, `"integer"`, `"decimal"`, `"currency"`, `"percent"`, `"boolean"`, `"date"`, `"datetime"`, `"duration"`, `"picklist"`, `"multi_picklist"`, `"geo"`, `"reference"`, `"user"`, `"attachment"`, `"multi_attachment"`
  - `options` (`listRepoCustomModelsAtBranch.response.200.fields.options`; any of, required)
    - any of the following: `array<string>`, `null`
  - `required` (`listRepoCustomModelsAtBranch.response.200.fields.required`; boolean, required)
  - `unique` (`listRepoCustomModelsAtBranch.response.200.fields.unique`; boolean, required)
  - `target_repo_id` (`listRepoCustomModelsAtBranch.response.200.fields.target_repo_id`; any of, required)
    - any of the following: `RepoId`, `null`
  - `target_model_id` (`listRepoCustomModelsAtBranch.response.200.fields.target_model_id`; any of, required)
    - any of the following: `TypeId`, `null`
  - `on_delete` (`listRepoCustomModelsAtBranch.response.200.fields.on_delete`; any of, required)
    - any of the following:
      - `string`: one of `"cascade"`
      - `null`
  - `default_value` (`listRepoCustomModelsAtBranch.response.200.fields.default_value`; any of, required)
    - any of the following: `Option 1`, `null`
  - `formula` (`listRepoCustomModelsAtBranch.response.200.fields.formula`; any of, required)
    - any of the following: `string`, `null`
  - `target_model` (`listRepoCustomModelsAtBranch.response.200.fields.target_model`; any of, required)
    - any of the following: `string`, `null`
  - `filter` (`listRepoCustomModelsAtBranch.response.200.fields.filter`; object, required) — How a search takes this field: the operators its type takes, whether sort takes it, and the form its values are written in.
    - `operators` (`listRepoCustomModelsAtBranch.response.200.fields.filter.operators`; array of string, required)
      - one of `"eq"`, `"ne"`, `"gt"`, `"gte"`, `"lt"`, `"lte"`, `"between"`, `"in"`, `"not_in"`, `"contains"`, `"not_contains"`, `"starts_with"`, `"ends_with"`, `"has_any"`, `"has_all"`, `"has_none"`, `"is_empty"`, `"is_not_empty"`, `"matches"`
    - `sortable` (`listRepoCustomModelsAtBranch.response.200.fields.filter.sortable`; boolean, required)
    - `value_format` (`listRepoCustomModelsAtBranch.response.200.fields.filter.value_format`; string, required)
- `primary_field` (`listRepoCustomModelsAtBranch.response.200.primary_field`; any of, required)
  - any of the following: `string`, `null`
- `id` (`listRepoCustomModelsAtBranch.response.200.id`; string, required)
  - pattern: `^custom_model_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `id_prefix` (`listRepoCustomModelsAtBranch.response.200.id_prefix`; string, required)
  - minLength: `1`

### 400

InvalidRequest

#### Example

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

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

### 401

InvalidCredentials

#### Example

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

- `_tag` (`listRepoCustomModelsAtBranch.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 | 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`
- `RepoNotFoundEncoded`
  - `_tag` (`RepoNotFoundEncoded._tag`; string, required)
    - one of `"RepoNotFound"`

### 429

RateLimited

#### Example

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

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

### 500

RepoFailure

#### Example

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

- `_tag` (`listRepoCustomModelsAtBranch.response.500._tag`; string, required)
  - one of `"RepoFailure"`
- `reason` (`listRepoCustomModelsAtBranch.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/list-repo-custom-models-at-branch/index.md
