getsentry / getsentry/sentry

Add org-scoped equivalents for project-scoped API endpoints (region routing / DE latency)

Open
#118,963 2 comments 0 reactions 0 assignees View on GitHub
api
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 10m
Merged PRs (30d)
635

Description

## Context

Sentry has a `@deprecated` decorator (in `src/sentry/api/helpers/deprecation.py`) that emits `X-Sentry-Deprecation-Date` / `X-Sentry-Replacement-Endpoint` headers and runs brownouts (HTTP 410 on a cron schedule) after the deprecation date.

**Currently deprecated with active brownouts:**

* `ALERTS_API_DEPRECATION_DATE = 2026-05-14` — cron `0 */2 * * *`, duration 120s → 2 min every 2 hours returning 410
* `/projects/{org}/{project}/rules/` → `/organizations/{org}/workflows/`
* `/projects/{org}/{project}/alert-rules/` → `/organizations/{org}/alert-rules/`
* `CELL_API_DEPRECATION_DATE = 2026-05-15` — default cron `0 12 * * *`, duration 60s
* `GET /projects/` (project index) → `/organizations/{org}/projects/`
* Several group/issue endpoints

All other `/projects/{org}/{project}/...` endpoints have no `@deprecated` marker.

## Missing org-scoped endpoints blocking client migration

The following project-scoped endpoints have no org-scoped equivalent, meaning clients cannot migrate off them even if desired. This tracks adding those equivalents.

### Client keys

`/projects/{org}/{project}/keys/` and `/projects/{org}/{project}/keys/{id}/` (`PUBLIC`). `/organizations/{org}/project-keys/` is GET-only list-all — not a CRUD replacement.

### Event attachments

`/projects/{org}/{project}/events/{event_id}/attachments/` (`PUBLIC`).

### Replay recording segments

`/projects/{org}/{project}/replays/{replay_id}/recording-segments/` (`PUBLIC`).

### Transaction profiles

`/projects/{org}/{project}/profiling/profiles/{profile_id}/` (`PUBLIC`). Org-scoped profiling explore endpoints already exist.

### Project repo link

`/projects/{org}/{project}/repo/` (`PUBLIC`).

### Add/remove team from project

`/projects/{org}/{project}/teams/{team}/` (`PUBLIC`).

### Single project GET/PUT

`/projects/{org}/{project}/` (`PUBLIC`). `/organizations/{org}/projects/` list exists; no single-project GET/PUT.

### DIF / build assembly

`/projects/{org}/{project}/files/difs/assemble/` and `/projects/{org}/{project}/files/preprodartifacts/assemble/` — used by `sentry-cli`.

### Preprod artifact snapshots

`/projects/{org}/{project}/preprodartifacts/snapshots/` and `.../upload-options/` — used by `sentry-cli`.

### Trace item details

`/projects/{org}/{project}/trace-items/{item_id}/` (`EXPERIMENTAL`).

## Related

* getsentry/sentry-mcp#1145 — metric alert rules (urgent, brownout active)
* [getsentry/cli#1182]() — issue alert rules (urgent, brownout active)
* getsentry/sentry-cli#3351 — releases, events, issues (not formally deprecated)

Contributor guide

Open the contributing guide

Research direction

Start by reading src/sentry/api/helpers/deprecation.py and comparing the existing project-scoped endpoints with their available organization-scoped counterparts. Work through the listed endpoint groups, including the client keys, attachments, replays, profiling, repository, team, project, artifact, and trace-item routes; done means each required migration path has an org-scoped equivalent suitable for its stated client.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.