---
title: "🛡️👤 Insert or update a logical repository - a named set of rules to match PRs, releases, and deployments that pretends to be a regular GitHub repository everywhere in UI and API requests."
method: PUT
path: "/settings/logical_repository"
tags: ["settings", "default"]
---

# 🛡️👤 Insert or update a logical repository - a named set of rules to match PRs, releases, and deployments that pretends to be a regular GitHub repository everywhere in UI and API requests.

`PUT /settings/logical_repository`

## Request

- Base URL: `{{ server_url }}/v1`
- URL: `{{ server_url }}/v1/settings/logical_repository`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/athenian/apis/title/docs/settings/logical_repository/put.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- LogicalRepositoryRequest: Set of rules to match PRs, releases, and deployments that has a name and pretends to be a regular GitHub repository everywhere in UI and API requests. Release settings become visible in `/settings/release_match`.
  - `account` integer, required: Account ID.
  - `name` string, required: The logical part of the repository name. Compared to GitHub repository name requirements, we additionally allow / to express the hierarchy further.
  - `parent` string, required: Repository name which uniquely identifies any repository in any service provider. The format matches the repository URL without the protocol part. No ".git" should be appended. We support a special syntax for repository sets: "{reposet id}" adds all the repositories from the given set.
  - `prs` LogicalPRRules, required: Rules to match PRs to logical repository.
    - `title` string: Regular expression to match the PR title. It must be a match starting from the start of the string.
    - `labels_include` string[]: Any matching label puts the PR into the logical repository.
  - `releases` ReleaseMatchSetting, required: Release matching setting for a specific repository.
    - `branches` string, required: Regular expression to match branch names. The match starts from the beginning of the string. Special value `{{ "{{default}}" }}` matches to the default branch name - usually, `main` or `master`. Reference: https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP
    - `tags` string, required: Regular expression to match tag names. The match starts from the beginning of the string. Reference: https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP
    - `events` string: Regular expression to match event releases (submitted by the user via `/events/releases`). The match starts from the beginning of the string. Reference: https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP
    - `match` 'branch' | 'event' | 'tag' | 'tag_or_branch', required: Release workflow choice: how we should detect releases. * `branch`: merges to certain branches are considered releases and nothing else. * `event`: releases are manually registered with `POST /events/releases`. * `tag`: tags with certain name patterns are considered releases and nothing else. * `tag_or_branch`: follow "tag"; if the repository does not have tags, fallback to "branch".
    - `default_branch` string: Name of the default branch of this repository. Returned in responses and ignored in requests.
  - `deployments` LogicalDeploymentRules: Rules to match deployments to logical repository.
    - `title` string: Regular expression to match the deployment name. It must be a match starting from the start of the string.
    - `labels_include` object: Match deployments labeled by any key and having at least one value in the list.

## Response `200`

Created or updated logical repository.

- LogicalRepository: Set of rules to match PRs, releases, and deployments that has a name and pretends to be a regular GitHub repository everywhere in UI and API requests. Release settings are also visible in `/settings/release_match`.
  - `name` string, required: The logical part of the repository name. Compared to GitHub repository name requirements, we additionally allow / to express the hierarchy further.
  - `parent` string, required: Repository name which uniquely identifies any repository in any service provider. The format matches the repository URL without the protocol part. No ".git" should be appended. We support a special syntax for repository sets: "{reposet id}" adds all the repositories from the given set.
  - `prs` LogicalPRRules, required: Rules to match PRs to logical repository.
    - `title` string: Regular expression to match the PR title. It must be a match starting from the start of the string.
    - `labels_include` string[]: Any matching label puts the PR into the logical repository.
  - `releases` ReleaseMatchSetting, required: Release matching setting for a specific repository.
    - `branches` string, required: Regular expression to match branch names. The match starts from the beginning of the string. Special value `{{ "{{default}}" }}` matches to the default branch name - usually, `main` or `master`. Reference: https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP
    - `tags` string, required: Regular expression to match tag names. The match starts from the beginning of the string. Reference: https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP
    - `events` string: Regular expression to match event releases (submitted by the user via `/events/releases`). The match starts from the beginning of the string. Reference: https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP
    - `match` 'branch' | 'event' | 'tag' | 'tag_or_branch', required: Release workflow choice: how we should detect releases. * `branch`: merges to certain branches are considered releases and nothing else. * `event`: releases are manually registered with `POST /events/releases`. * `tag`: tags with certain name patterns are considered releases and nothing else. * `tag_or_branch`: follow "tag"; if the repository does not have tags, fallback to "branch".
    - `default_branch` string: Name of the default branch of this repository. Returned in responses and ignored in requests.
  - `deployments` LogicalDeploymentRules: Rules to match deployments to logical repository.
    - `title` string: Regular expression to match the deployment name. It must be a match starting from the start of the string.
    - `labels_include` object: Match deployments labeled by any key and having at least one value in the list.

## Other responses

- `400`: Request is invalid.
- `403`: The user is not an admin of this account.
- `404`: The user or the account was not found.
- `422`: The installation has not finished yet.

---

[API](https://skmtc.dev/athenian/apis/title.md) - [All operations](https://skmtc.dev/athenian/apis/title/llms.txt) - [OpenAPI document](https://skmtc.dev/athenian/apis/title/revisions/110c9f7cffdd?raw)
