---
title: "Replace the project's ownership rules"
method: PUT
path: "/projects/{project_id}/error-ownership-rules"
tags: ["error-tracking"]
---

# Replace the project's ownership rules

`PUT /projects/{project_id}/error-ownership-rules`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/error-ownership-rules`
- Auth: HTTP bearer

A new group is assigned to the owner of the first rule matching one of
its frames, innermost first. Existing groups are not reassigned.

## Path parameters

- `project_id` integer, required

## Request body

- ReplaceOwnershipRulesRequest: Replace every ownership rule of the project, in order.
  - `rules` OwnershipRuleRequest[], required: At most 50; the first match wins.
    - `owner_user_id` integer, required: The member a matching new group is assigned to.
    - `pattern` string, required: A repository path: `src/billing/` (everything under it), `*.py` (a file name anywhere), `src/**/cart.ts`.

## Response `200`

The rules now in force

- OwnershipRuleList: The project's ownership rules, in order.
  - `data` OwnershipRuleView[], required
    - `created_at` string, date-time, required
    - `id` integer, required
    - `owner_name` string, nullable
    - `owner_user_id` integer, required
    - `pattern` string, required
    - `position` integer, required: Rules are tried in this order.
    - `updated_at` string, date-time, required

## Other responses

- `400`: A pattern that is not a repository path, more than 50 rules, or an owner who is not a user or cannot open the project
- `401`: Not authenticated
- `403`: Error tracking write permission required
- `500`: Internal server error

## Changes

- **2026-11-21** `451aa64395bb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/error-ownership-rules/put.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
