Create a CODEOWNERS Configuration for a Project

POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/codeowners/

Create a CODEOWNERS configuration for a project.

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.

Body Parameters

raw (string)
REQUIRED

The raw contents of the CODEOWNERS file.

codeMappingId (string)
REQUIRED

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/ \
 -H 'Authorization: Bearer <auth_token>' \
 -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?