Update a Project's CODEOWNERS Configuration

PUT /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/codeowners/{codeowners_id}/

Update a CODEOWNERS configuration.

Path Parameters

organization_id_or_slug (string)
REQUIRED

The ID or slug of the organization the resource belongs to.

project_id_or_slug (string)
REQUIRED

The ID or slug of the project the resource belongs to. Project slugs are unique within each organization.

codeowners_id (string)
REQUIRED

The ID of the CODEOWNERS configuration.

Body Parameters

raw (string)

The raw contents of the CODEOWNERS file.

codeMappingId (string)

The ID of the code mapping used to translate repository paths to stack trace paths.

Scopes

<auth_token> requires one of the following scopes:
  • project:admin
  • project:write
Copied
curl https://sentry.io/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/codeowners/{codeowners_id}/ \
 -H 'Authorization: Bearer <auth_token>' \
 -X PUT \
 -H 'Content-Type: application/json' \
 -d '{}'
RESPONSESCHEMA
Copied
{ "id": "42", "raw": "src/* user@example.com", "dateCreated": "2024-01-15T10:30:00Z", "dateUpdated": "2024-01-15T10:30:00Z", "dateSynced": "2024-01-15T10:30:00Z", "codeMappingId": "7", "provider": "github", "errors": { "missing_external_teams": [], "missing_external_users": [], "missing_user_emails": [], "teams_without_access": [], "users_without_access": [] }, "schema": { "$version": 1, "rules": [ { "matcher": { "type": "codeowners", "pattern": "src/*" }, "owners": [ { "type": "user", "id": "1", "name": "user@example.com" } ] } ] }, "codeOwnersUrl": "https://github.com/example/repository/blob/main/CODEOWNERS", "ownershipSyntax": "codeowners:src/* user@example.com\n" }
Was this helpful?