diff --git a/README.md b/README.md
index ef1743d..4b23131 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
[](https://pkg.go.dev/github.com/patch-it-dev/patch-it-plugins)
[](go.mod)
[](LICENSE)
-[](docs/plugins.md)
+[](docs/plugins.md)
[](https://docs.patch-it.dev)
[](https://github.com/patch-it-dev/patch-it-plugins/discussions)
diff --git a/adapter/sentry.go b/adapter/sentry.go
new file mode 100644
index 0000000..5b5fb4f
--- /dev/null
+++ b/adapter/sentry.go
@@ -0,0 +1,292 @@
+package adapter
+
+import (
+ "bytes"
+ "cmp"
+ "context"
+ "encoding/json"
+ "fmt"
+ "regexp"
+ "slices"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/patch-it-dev/patch-it-plugins/fetch"
+)
+
+// sentryAsset is the spec's file name in both places it's published:
+// Sentry's public API spec with every $ref resolved.
+const sentryAsset = "openapi-derefed.json"
+
+var (
+ // sentryRelease is a getsentry/sentry API spec release tag.
+ sentryRelease = regexp.MustCompile(`^api@(\d+)\.(\d+)\.(\d+)$`)
+ // sentrySchemaTag is a getsentry/sentry-api-schema release tag.
+ sentrySchemaTag = regexp.MustCompile(`^\d+\.\d+\.\d+$`)
+ // sentrySchemaCommit is a full getsentry/sentry-api-schema commit SHA.
+ sentrySchemaCommit = regexp.MustCompile(`^[0-9a-f]{40}$`)
+)
+
+// Sentry adapts Sentry's public API spec for the openapi plugin. A tag is a
+// getsentry/sentry release, "api@2.16.0" (where the spec is published now),
+// or, to replay the history, a getsentry/sentry-api-schema release tag,
+// "0.224.0", or commit SHA.
+//
+// - getsentry/sentry publishes the spec as an asset of each api@X.Y.Z
+// release, from api@2.5.0 (2026-11-14) on.
+// - getsentry/sentry-api-schema published it before that, as
+// openapi-derefed.json committed to the repo: commits from 2020-08-25,
+// release tags 0.1.0 to 2.4.0 from 2026-02-10. The repo is archived;
+// its 2.4.0 is byte for byte api@2.5.0.
+//
+// The zero value reads GitHub. The fields point it at another server, for
+// tests.
+type Sentry struct {
+ APIBase string // GitHub's REST API; "" is https://api.github.com
+ DownloadBase string // release downloads; "" is https://github.com
+ RawBase string // files at a tag or commit; "" is https://raw.githubusercontent.com
+}
+
+var _ Adapter = Sentry{}
+
+func (Sentry) API() string { return "sentry" }
+
+func (s Sentry) api(path string) string {
+ return cmp.Or(s.APIBase, "https://api.github.com") + path
+}
+
+// LatestTag is the highest api@X.Y.Z release of getsentry/sentry that has the
+// spec attached, drafts and prereleases left out.
+//
+// The releases listing is newest first by date, and getsentry/sentry
+// releases other things too (the server, "26.11.0"; npm packages,
+// "scraps@0.5.0"). GitHub lists releases in an order that isn't version
+// order, so the newest is computed from the version.
+func (s Sentry) LatestTag(ctx context.Context) (string, error) {
+ body, err := fetch.Get(ctx, s.api("/repos/getsentry/sentry/releases?per_page=100"), githubHeaders())
+ if err != nil {
+ return "", fmt.Errorf("listing sentry releases: %w", err)
+ }
+ var releases []sentryReleaseInfo
+ if err := json.Unmarshal(body, &releases); err != nil {
+ return "", fmt.Errorf("parsing github releases: %w", err)
+ }
+ type release struct {
+ tag string
+ v [3]int
+ }
+ var found []release
+ for _, r := range releases {
+ m := sentryRelease.FindStringSubmatch(r.Tag)
+ if m == nil || r.Draft || r.Prerelease || !r.hasSpec() {
+ continue
+ }
+ rel := release{tag: r.Tag}
+ for i := range rel.v {
+ rel.v[i], _ = strconv.Atoi(m[i+1])
+ }
+ found = append(found, rel)
+ }
+ if len(found) == 0 {
+ return "", fmt.Errorf("github lists no sentry api@ release with %s", sentryAsset)
+ }
+ newest := slices.MaxFunc(found, func(a, b release) int {
+ return cmp.Or(cmp.Compare(a.v[0], b.v[0]), cmp.Compare(a.v[1], b.v[1]), cmp.Compare(a.v[2], b.v[2]))
+ })
+ return newest.tag, nil
+}
+
+type sentryReleaseInfo struct {
+ Tag string `json:"tag_name"`
+ Draft bool `json:"draft"`
+ Prerelease bool `json:"prerelease"`
+ PublishedAt time.Time `json:"published_at"`
+ Assets []struct {
+ Name string `json:"name"`
+ } `json:"assets"`
+}
+
+func (r sentryReleaseInfo) hasSpec() bool {
+ for _, a := range r.Assets {
+ if a.Name == sentryAsset {
+ return true
+ }
+ }
+ return false
+}
+
+// Fetch downloads the spec of an api@X.Y.Z release (the release's asset), or
+// of a sentry-api-schema tag or commit (the file at it), and moves the
+// server URL's path into the paths: see sentryBasePath.
+//
+// Version is the release's publication date, or a commit's date
+// (YYYY-MM-DD): the API has no version of its own (`/api/0`, info.version
+// "v0"), and the spec's own version numbers are a package's (@sentry/api),
+// not the API's.
+func (s Sentry) Fetch(ctx context.Context, tag string) (Spec, error) {
+ raw := cmp.Or(s.RawBase, "https://raw.githubusercontent.com") + "/getsentry/sentry-api-schema/" + tag + "/" + sentryAsset
+ var url string
+ var date time.Time
+ switch {
+ case sentryRelease.MatchString(tag):
+ r, err := sentryReleaseMeta(ctx, s.api("/repos/getsentry/sentry/releases/tags/"+tag), tag)
+ if err != nil {
+ return Spec{}, err
+ }
+ if !r.hasSpec() {
+ return Spec{}, fmt.Errorf("sentry release %s has no %s", tag, sentryAsset)
+ }
+ // Spelled as GitHub's own links spell it: the tag's @ as %40.
+ url = cmp.Or(s.DownloadBase, "https://github.com") + "/getsentry/sentry/releases/download/" +
+ strings.ReplaceAll(tag, "@", "%40") + "/" + sentryAsset
+ date = r.PublishedAt
+ case sentrySchemaTag.MatchString(tag):
+ r, err := sentryReleaseMeta(ctx, s.api("/repos/getsentry/sentry-api-schema/releases/tags/"+tag), tag)
+ if err != nil {
+ return Spec{}, err
+ }
+ url, date = raw, r.PublishedAt
+ case sentrySchemaCommit.MatchString(tag):
+ meta, err := fetch.Get(ctx, s.api("/repos/getsentry/sentry-api-schema/commits/"+tag), githubHeaders())
+ if err != nil {
+ return Spec{}, fmt.Errorf("looking up sentry-api-schema commit %s: %w", tag, err)
+ }
+ var c struct {
+ Commit struct {
+ Committer struct {
+ Date time.Time `json:"date"`
+ } `json:"committer"`
+ } `json:"commit"`
+ }
+ if err := json.Unmarshal(meta, &c); err != nil {
+ return Spec{}, fmt.Errorf("parsing github commit %s: %w", tag, err)
+ }
+ url, date = raw, c.Commit.Committer.Date
+ default:
+ return Spec{}, fmt.Errorf("%q is neither a sentry api@X.Y.Z release, a sentry-api-schema tag nor a full commit sha", tag)
+ }
+ if date.IsZero() {
+ return Spec{}, fmt.Errorf("sentry %s: github gives no date", tag)
+ }
+ body, err := fetch.Get(ctx, url, nil) // public downloads need no auth
+ if err != nil {
+ return Spec{}, fmt.Errorf("fetching the sentry %s spec: %w", tag, err)
+ }
+ content, err := sentryBasePath(body)
+ if err != nil {
+ return Spec{}, fmt.Errorf("sentry %s: %w", tag, err)
+ }
+ return Spec{Content: content, Version: date.UTC().Format("2006-01-02"), SourceURL: url}, nil
+}
+
+func sentryReleaseMeta(ctx context.Context, url, tag string) (sentryReleaseInfo, error) {
+ meta, err := fetch.Get(ctx, url, githubHeaders())
+ if err != nil {
+ return sentryReleaseInfo{}, fmt.Errorf("looking up sentry release %s: %w", tag, err)
+ }
+ var r sentryReleaseInfo
+ if err := json.Unmarshal(meta, &r); err != nil {
+ return sentryReleaseInfo{}, fmt.Errorf("parsing github release %s: %w", tag, err)
+ }
+ if r.Draft || r.Prerelease {
+ return sentryReleaseInfo{}, fmt.Errorf("sentry %s is a draft or a prerelease", tag)
+ }
+ return r, nil
+}
+
+// sentryBasePathKey is the root key Fetch records the server path it moved
+// into the paths under. The differ reads only paths and components, so the
+// key is never diffed.
+const sentryBasePathKey = "x-patch-it-base-path"
+
+// sentryBasePath puts the server URL's path back at the front of every path.
+//
+// Until sentry-api-schema 2.0.1 the server was "https://{region}.sentry.io"
+// and the paths started "/api/0/"; from 2.1.0 (2026-11-13) the server is
+// "https://{region}.sentry.io/api/0" and the paths don't. The URLs a caller
+// sends are the same, but compared as published, every operation (289 of
+// them) reads as removed and added again. With the server's path moved into
+// the paths, every spec names an operation by the path a caller sends,
+// "GET /api/0/organizations/", as Sentry's API reference does.
+//
+// A spec whose server has no path is returned byte for byte. The values are
+// otherwise unchanged (numbers kept as written); the path moved is recorded
+// for SourcePointer.
+func sentryBasePath(body []byte) ([]byte, error) {
+ dec := json.NewDecoder(bytes.NewReader(body))
+ dec.UseNumber()
+ var doc map[string]any
+ if err := dec.Decode(&doc); err != nil {
+ return nil, fmt.Errorf("parsing the spec: %w", err)
+ }
+ base := ""
+ for i, s := range asSlice(doc["servers"]) {
+ u, _ := asMap(s)["url"].(string)
+ p := serverPath(u)
+ if i > 0 && p != base {
+ return nil, fmt.Errorf("servers with different paths (%q, %q)", base, p)
+ }
+ base = p
+ }
+ if base == "" {
+ return body, nil
+ }
+ paths := asMap(doc["paths"])
+ moved := make(map[string]any, len(paths))
+ for p, item := range paths {
+ if !strings.HasPrefix(p, "/") {
+ return nil, fmt.Errorf("path %q doesn't start with /", p)
+ }
+ moved[base+p] = item
+ }
+ doc["paths"] = moved
+ doc[sentryBasePathKey] = base
+ return json.Marshal(doc)
+}
+
+// serverPath is the path of a server URL ("/api/0" for
+// "https://{region}.sentry.io/api/0"), without a trailing slash; "" for
+// none. Read by hand: url.Parse refuses the {region} variable in the host.
+func serverPath(u string) string {
+ _, rest, ok := strings.Cut(u, "://")
+ if !ok {
+ return ""
+ }
+ i := strings.Index(rest, "/")
+ if i < 0 {
+ return ""
+ }
+ return strings.TrimRight(rest[i:], "/")
+}
+
+// SourcePointer turns a pointer into a path Fetch prefixed with the server's
+// path back into one into the path as published. Every other pointer, and
+// every pointer into a spec Fetch didn't change, is already right.
+func (Sentry) SourcePointer(content []byte) func(string) string {
+ var doc struct {
+ Base string `json:"x-patch-it-base-path"`
+ }
+ _ = json.Unmarshal(content, &doc) // unreadable content: pointers stay as they are
+ if doc.Base == "" {
+ return func(ptr string) string { return ptr }
+ }
+ prefix := "/paths/" + pointerToken(doc.Base)
+ return func(ptr string) string {
+ rest, ok := strings.CutPrefix(ptr, prefix)
+ // Every path starts with /, so what follows is "~1..."; anything
+ // else is a pointer into a path that wasn't moved.
+ if !ok || !strings.HasPrefix(rest, "~1") {
+ return ptr
+ }
+ return "/paths/" + rest
+ }
+}
+
+var _ Reshaper = Sentry{}
+
+// asSlice is v as an array, or nil.
+func asSlice(v any) []any {
+ s, _ := v.([]any)
+ return s
+}
diff --git a/adapter/sentry_test.go b/adapter/sentry_test.go
new file mode 100644
index 0000000..eb70ccf
--- /dev/null
+++ b/adapter/sentry_test.go
@@ -0,0 +1,185 @@
+package adapter
+
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "strings"
+ "testing"
+)
+
+// fakeSentryGitHub serves GitHub's API, release downloads and raw files from
+// routes: a request path (decoded) to its body, under /api, /dl and /raw.
+// Anything else is a 404. It returns the adapter pointed at it.
+func fakeSentryGitHub(t *testing.T, routes map[string]string) (Sentry, string) {
+ t.Helper()
+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ body, ok := routes[r.URL.Path]
+ if !ok {
+ http.NotFound(w, r)
+ return
+ }
+ w.Write([]byte(body))
+ }))
+ t.Cleanup(srv.Close)
+ return Sentry{APIBase: srv.URL + "/api", DownloadBase: srv.URL + "/dl", RawBase: srv.URL + "/raw"}, srv.URL
+}
+
+const (
+ sentryReleases = "/api/repos/getsentry/sentry/releases"
+ withSpec = `"assets":[{"name":"sentry-api.tgz"},{"name":"openapi-derefed.json"}]`
+)
+
+// The highest api@ version, not the newest by date (api@2.9.0 was published
+// after api@2.12.0), and never the server's releases, a draft, a prerelease
+// or a release without the spec.
+func TestSentryLatestTagIsTheHighestAPIRelease(t *testing.T) {
+ s, _ := fakeSentryGitHub(t, map[string]string{sentryReleases: `[
+ {"tag_name":"api@3.0.0","prerelease":true,` + withSpec + `},
+ {"tag_name":"api@2.17.0","draft":true,` + withSpec + `},
+ {"tag_name":"api@2.16.1","assets":[{"name":"sentry-api.tgz"}]},
+ {"tag_name":"api@2.9.0",` + withSpec + `},
+ {"tag_name":"26.11.0","assets":[]},
+ {"tag_name":"scraps@9.0.0",` + withSpec + `},
+ {"tag_name":"api@2.12.0",` + withSpec + `},
+ {"tag_name":"api@2.10.1",` + withSpec + `}]`})
+ tag, err := s.LatestTag(context.Background())
+ if err != nil || tag != "api@2.12.0" {
+ t.Errorf("got %q, %v; want api@2.12.0", tag, err)
+ }
+ s, _ = fakeSentryGitHub(t, map[string]string{sentryReleases: `[{"tag_name":"26.11.0","assets":[]}]`})
+ if _, err := s.LatestTag(context.Background()); err == nil {
+ t.Error("no api@ release: want an error")
+ }
+}
+
+// A spec as published from sentry-api-schema 2.1.0 on: the server carries
+// /api/0, the paths don't.
+const sentryNewSpec = `{"openapi":"3.0.3","info":{"version":"v0"},
+ "servers":[{"url":"https://{region}.sentry.io/api/0","variables":{"region":{"default":"us"}}}],
+ "paths":{"/":{"get":{"operationId":"index"}},"/organizations/{organization_id_or_slug}/":{"get":{"x-big":12345678901234567890}}}}`
+
+// A spec as published before 2.1.0: /api/0 in every path.
+const sentryOldSpec = `{"openapi":"3.0.3","info":{"version":"v0"},
+ "servers":[{"url":"https://{region}.sentry.io"}],
+ "paths":{"/api/0/":{"get":{"operationId":"index"}}}}`
+
+// An api@ release: the asset, cited by its download URL (the tag's @ spelled
+// %40, as GitHub's own links do), dated by the release's publication, with
+// /api/0 moved from the server into the paths.
+func TestSentryFetchRelease(t *testing.T) {
+ s, base := fakeSentryGitHub(t, map[string]string{
+ sentryReleases + "/tags/api@2.16.0": `{"tag_name":"api@2.16.0","published_at":"2026-11-18T20:55:52Z",` + withSpec + `}`,
+ "/dl/getsentry/sentry/releases/download/api@2.16.0/" + sentryAsset: sentryNewSpec,
+ })
+ spec, err := s.Fetch(context.Background(), "api@2.16.0")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if spec.Version != "2026-11-18" || spec.SourceURL != base+"/dl/getsentry/sentry/releases/download/api%402.16.0/openapi-derefed.json" {
+ t.Errorf("got %q %s", spec.Version, spec.SourceURL)
+ }
+ var doc struct {
+ Paths map[string]map[string]map[string]json.RawMessage `json:"paths"`
+ Base string `json:"x-patch-it-base-path"`
+ }
+ if err := json.Unmarshal(spec.Content, &doc); err != nil {
+ t.Fatal(err)
+ }
+ if _, ok := doc.Paths["/api/0/organizations/{organization_id_or_slug}/"]; !ok || len(doc.Paths) != 2 || doc.Base != "/api/0" {
+ t.Errorf("paths %v, base %q: want /api/0 moved into every path", doc.Paths, doc.Base)
+ }
+ if _, ok := doc.Paths["/api/0/"]; !ok {
+ t.Error(`"/" should become "/api/0/"`)
+ }
+ // Values are unchanged: a number too big for a float64 keeps its digits.
+ if got := string(doc.Paths["/api/0/organizations/{organization_id_or_slug}/"]["get"]["x-big"]); got != "12345678901234567890" {
+ t.Errorf("x-big is %s", got)
+ }
+
+ ptr := s.SourcePointer(spec.Content)
+ for in, want := range map[string]string{
+ "/paths/~1api~10~1organizations~1{organization_id_or_slug}~1/get": "/paths/~1organizations~1{organization_id_or_slug}~1/get",
+ "/paths/~1api~10~1/get/description": "/paths/~1/get/description",
+ "/components/schemas/X": "/components/schemas/X",
+ "/paths/~1api~10x/get": "/paths/~1api~10x/get",
+ } {
+ if got := ptr(in); got != want {
+ t.Errorf("SourcePointer(%s) = %s, want %s", in, got, want)
+ }
+ }
+
+ s, _ = fakeSentryGitHub(t, map[string]string{sentryReleases + "/tags/api@2.16.0": `{"tag_name":"api@2.16.0","published_at":"2026-11-18T20:55:52Z","assets":[]}`})
+ if _, err := s.Fetch(context.Background(), "api@2.16.0"); err == nil {
+ t.Error("a release without the spec: want an error")
+ }
+}
+
+// A sentry-api-schema tag: the file at the tag, dated by the tag's release.
+// Its server has no path, so the spec is returned byte for byte and every
+// pointer stays as it is. A commit, for the history before the first tag, is
+// dated by the commit.
+func TestSentryFetchSchemaTagOrCommit(t *testing.T) {
+ sha := strings.Repeat("a", 40)
+ const schema = "/api/repos/getsentry/sentry-api-schema"
+ s, base := fakeSentryGitHub(t, map[string]string{
+ schema + "/releases/tags/0.224.0": `{"tag_name":"0.224.0","published_at":"2026-06-16T23:16:45Z"}`,
+ "/raw/getsentry/sentry-api-schema/0.224.0/" + sentryAsset: sentryOldSpec,
+ schema + "/releases/tags/0.225.0": `{"tag_name":"0.225.0","published_at":"2026-06-17T01:00:00Z"}`,
+ "/raw/getsentry/sentry-api-schema/0.225.0/" + sentryAsset: `<<<<<<< HEAD`,
+ schema + "/commits/" + sha: `{"sha":"` + sha + `","commit":{"committer":{"date":"2026-01-22T18:02:11Z"}}}`,
+ "/raw/getsentry/sentry-api-schema/" + sha + "/" + sentryAsset: sentryOldSpec,
+ })
+ spec, err := s.Fetch(context.Background(), "0.224.0")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if spec.Version != "2026-06-16" || spec.SourceURL != base+"/raw/getsentry/sentry-api-schema/0.224.0/openapi-derefed.json" || string(spec.Content) != sentryOldSpec {
+ t.Errorf("got %q %s %.40s", spec.Version, spec.SourceURL, spec.Content)
+ }
+ if got := s.SourcePointer(spec.Content)("/paths/~1api~10~1/get"); got != "/paths/~1api~10~1/get" {
+ t.Errorf("SourcePointer changed a pointer into a spec Fetch didn't change: %s", got)
+ }
+
+ spec, err = s.Fetch(context.Background(), sha)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if spec.Version != "2026-01-22" || spec.SourceURL != base+"/raw/getsentry/sentry-api-schema/"+sha+"/openapi-derefed.json" {
+ t.Errorf("got %q %s", spec.Version, spec.SourceURL)
+ }
+
+ // One commit in the history has merge-conflict markers in the spec.
+ if _, err := s.Fetch(context.Background(), "0.225.0"); err == nil {
+ t.Error("invalid json: want an error")
+ }
+ for _, tag := range []string{"main", "v2.16.0", "api@2.16", "aaaaaaa", "2.16.0-rc1", "0.226.0"} {
+ if _, err := s.Fetch(context.Background(), tag); err == nil {
+ t.Errorf("%s: want an error", tag)
+ }
+ }
+}
+
+func TestSentryBasePathRefusesWhatItCantMove(t *testing.T) {
+ if _, err := sentryBasePath([]byte(`{"servers":[{"url":"https://x/api"}],"paths":{"/a":{},"a":{}}}`)); err == nil {
+ t.Error("a path without a leading /: want an error")
+ }
+ if _, err := sentryBasePath([]byte(`{"servers":[{"url":"https://x/api/0"},{"url":"https://y"}],"paths":{}}`)); err == nil {
+ t.Error("servers with different paths: want an error")
+ }
+}
+
+func TestServerPath(t *testing.T) {
+ for in, want := range map[string]string{
+ "https://{region}.sentry.io/api/0": "/api/0",
+ "https://{region}.sentry.io/api/0/": "/api/0",
+ "https://{region}.sentry.io": "",
+ "https://sentry.io/": "",
+ "/api/0": "",
+ } {
+ if got := serverPath(in); got != want {
+ t.Errorf("serverPath(%q) = %q, want %q", in, got, want)
+ }
+ }
+}
diff --git a/diff/diff.go b/diff/diff.go
index 0e53200..a10bcda 100644
--- a/diff/diff.go
+++ b/diff/diff.go
@@ -106,6 +106,13 @@ type Options struct {
// `deprecated` flag. Nil reads only the flag.
DeprecatedSummary func(summary string) bool
+ // DeprecatedDescription reports whether an operation's description marks
+ // it deprecated, for a spec that says so in the description's words
+ // ("## Deprecated", "This endpoint is DEPRECATED.") and seldom in the
+ // flag. Nil doesn't read the description. A deprecation said only there
+ // cites the description.
+ DeprecatedDescription func(description string) bool
+
// QuoteDeprecatedOperation makes a deprecation by the flag cite the whole
// operation, not the bare `true`: for a spec that says why in the
// operation's description ("This endpoint is deprecated - use the deploy
@@ -116,9 +123,15 @@ type Options struct {
}
// OperationDeprecated reports whether an operation object is marked
-// deprecated, by its flag or, when DeprecatedSummary is set, its summary.
+// deprecated, by its flag or, when DeprecatedSummary or DeprecatedDescription
+// is set, its summary or description.
func (o Options) OperationDeprecated(op map[string]any) bool {
- return truthy(op["deprecated"]) || o.summaryDeprecated(op)
+ return truthy(op["deprecated"]) || o.summaryDeprecated(op) || o.descriptionDeprecated(op)
+}
+
+func (o Options) descriptionDeprecated(op map[string]any) bool {
+ description, _ := op["description"].(string)
+ return o.DeprecatedDescription != nil && description != "" && o.DeprecatedDescription(description)
}
func (o Options) summaryDeprecated(op map[string]any) bool {
@@ -294,9 +307,12 @@ func (d *differ) paths(oldPaths, newPaths map[string]any) {
d.add(w, OperationDeprecated, "", false, newOp)
case truthy(newOp["deprecated"]):
d.add(w.child("deprecated"), OperationDeprecated, "", false, newOp["deprecated"])
- default:
+ case d.opts.summaryDeprecated(newOp):
// Said in words: the summary is the evidence.
d.add(w.child("summary"), OperationDeprecated, "", false, newOp["summary"])
+ default:
+ // Said in the description's words: it is the evidence.
+ d.add(w.child("description"), OperationDeprecated, "", false, newOp["description"])
}
}
d.parameters(w, oldOp, newOp, pathParamRenames(pair.oldPath, pair.newPath))
diff --git a/diff/options_test.go b/diff/options_test.go
index b819ac7..bc73990 100644
--- a/diff/options_test.go
+++ b/diff/options_test.go
@@ -132,3 +132,69 @@ func TestQuoteDeprecatedOperation(t *testing.T) {
t.Errorf("without the option: %+v, want the flag cited", got)
}
}
+
+var saysDeprecated = func(s string) bool { return strings.HasPrefix(s, "## Deprecated") }
+
+// A deprecation said only in the description is one when
+// DeprecatedDescription says so, and cites the description, even with
+// QuoteDeprecatedOperation (which is about the flag); without it, only the
+// flag counts.
+func TestDeprecatedDescription(t *testing.T) {
+ oldSpec := mustParse(t, pathsSpec(`"/rules/":{"get":{"summary":"List rules","description":"Return a list of rules."}}`))
+ newSpec := mustParse(t, pathsSpec(`"/rules/":{"get":{"summary":"List rules","description":"## Deprecated\nUse monitors.\n\nReturn a list of rules."}}`))
+
+ if got := Changes(oldSpec, newSpec); len(got) != 0 {
+ t.Errorf("without DeprecatedDescription: %v, want nothing", kinds(got))
+ }
+ got := ChangesWith(oldSpec, newSpec, Options{DeprecatedDescription: saysDeprecated, QuoteDeprecatedOperation: true})
+ if len(got) != 1 || got[0].Kind != OperationDeprecated || got[0].Pointer != "/paths/~1rules~1/get/description" ||
+ got[0].Node != "## Deprecated\nUse monitors.\n\nReturn a list of rules." {
+ t.Fatalf("got %+v, want one operation_deprecated citing the description", got)
+ }
+}
+
+// Said in the description first, flagged later: deprecated once, when the
+// words came. Flagged and said at once: the flag's evidence wins.
+func TestDeprecatedDescriptionThenFlag(t *testing.T) {
+ plain := mustParse(t, pathsSpec(`"/a":{"get":{"description":"A."}}`))
+ words := mustParse(t, pathsSpec(`"/a":{"get":{"description":"## Deprecated A."}}`))
+ both := mustParse(t, pathsSpec(`"/a":{"get":{"description":"## Deprecated A.","deprecated":true}}`))
+ opts := Options{DeprecatedDescription: saysDeprecated}
+ if got := ChangesWith(words, both, opts); len(got) != 0 {
+ t.Errorf("words then flag: %v, want nothing", kinds(got))
+ }
+ got := ChangesWith(plain, both, opts)
+ if len(got) != 1 || got[0].Pointer != "/paths/~1a/get/deprecated" {
+ t.Errorf("flag and words at once: %+v, want the flag cited", got)
+ }
+}
+
+// Summary and description both said so at once: the summary is cited.
+func TestDeprecatedSummaryBeforeDescription(t *testing.T) {
+ oldSpec := mustParse(t, pathsSpec(`"/a":{"get":{"summary":"A","description":"A."}}`))
+ newSpec := mustParse(t, pathsSpec(`"/a":{"get":{"summary":"A (deprecated)","description":"## Deprecated A."}}`))
+ got := ChangesWith(oldSpec, newSpec, Options{DeprecatedSummary: endsDeprecated, DeprecatedDescription: saysDeprecated})
+ if len(got) != 1 || got[0].Pointer != "/paths/~1a/get/summary" {
+ t.Errorf("got %+v, want the summary cited", got)
+ }
+}
+
+func TestOperationDeprecatedByDescription(t *testing.T) {
+ o := Options{DeprecatedDescription: saysDeprecated}
+ for _, c := range []struct {
+ op map[string]any
+ want bool
+ }{
+ {map[string]any{"description": "## Deprecated\nUse B."}, true},
+ {map[string]any{"description": "Lists deprecation details."}, false},
+ {map[string]any{"summary": "## Deprecated"}, false},
+ {map[string]any{"description": 3}, false},
+ } {
+ if got := o.OperationDeprecated(c.op); got != c.want {
+ t.Errorf("%v: got %v, want %v", c.op, got, c.want)
+ }
+ }
+ if (Options{}).OperationDeprecated(map[string]any{"description": "## Deprecated"}) {
+ t.Error("zero Options reads the description")
+ }
+}
diff --git a/docs/plugins.json b/docs/plugins.json
index 2f2fdf8..b76eb94 100644
--- a/docs/plugins.json
+++ b/docs/plugins.json
@@ -1,7 +1,7 @@
{
"_comment": "Generated from the plugin registry and docs/plugins.md by `make plugins-json` (go run ./cmd/list-plugins). Don't edit by hand.",
"$schema": "./plugins.schema.json",
- "count": 22,
+ "count": 23,
"plugins": [
{
"id": "algolia-ingestion",
@@ -163,6 +163,16 @@
"status": "live",
"provider_page": "providers/redis.md"
},
+ {
+ "id": "sentry",
+ "provider": "Sentry",
+ "layer": "api",
+ "watches": "REST API operations deprecated between releases of the spec, most of them in the operation's description",
+ "format": "openapi",
+ "source_url": "https://github.com/getsentry/sentry/releases",
+ "status": "live",
+ "provider_page": "providers/sentry.md"
+ },
{
"id": "stripe",
"provider": "Stripe",
diff --git a/docs/plugins.md b/docs/plugins.md
index 172cf70..7e479fd 100644
--- a/docs/plugins.md
+++ b/docs/plugins.md
@@ -19,6 +19,7 @@ The table between the `plugins:start` and `plugins:end` markers is also publishe
| [`algolia-ingestion`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/algolia.md) | Algolia | API | Ingestion API operations deprecated, and deprecated operations removed, between releases of the spec | `openapi` | [algolia/api-clients-automation](https://github.com/algolia/api-clients-automation) (`specs/bundled/ingestion.yml`) | live |
| [`algolia-recommend`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/algolia.md) | Algolia | API | Recommend API operations deprecated, and deprecated operations removed, between releases of the spec | `openapi` | [algolia/api-clients-automation](https://github.com/algolia/api-clients-automation) (`specs/bundled/recommend.yml`) | live |
| [`elasticsearch`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/elasticsearch.md) | Elastic | API | Elasticsearch REST API operations deprecated, and deprecated operations removed, between released minor versions of the spec | `openapi` | [elastic/elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) (`output/openapi/elasticsearch-openapi.json`) | live |
+| [`sentry`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/sentry.md) | Sentry | API | REST API operations deprecated between releases of the spec, most of them in the operation's description | `openapi` | [getsentry/sentry releases](https://github.com/getsentry/sentry/releases) (`openapi-derefed.json` on each `api@` release) | live |
| [`mongodb-atlas`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/mongodb-atlas.md) | MongoDB | API | Atlas Administration API versions deprecated and removed at their sunset date, per endpoint, from MongoDB's own API changelog | `apichangelog` | [mongodb/openapi `changelog/changelog.json`](https://github.com/mongodb/openapi/blob/main/changelog/changelog.json) | live |
| [`openai-models`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/openai-models.md) | OpenAI | AI models | Model deprecations and shutdown dates (Chat Completions and Responses text models) | `retirements` | [OpenAI deprecations](https://developers.openai.com/api/docs/deprecations) | live |
| [`anthropic-models`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/anthropic-models.md) | Anthropic | AI models | Model deprecations and retirement dates (Messages API models) | `retirements` | [Anthropic model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations) | live |
diff --git a/plugins/openapi/openapi.go b/plugins/openapi/openapi.go
index ccc310c..2ff5f48 100644
--- a/plugins/openapi/openapi.go
+++ b/plugins/openapi/openapi.go
@@ -1,9 +1,9 @@
// Package openapi is the source plugin for an API that publishes an OpenAPI
// spec per release (Stripe, Datadog, GitLab, GitHub, Vercel, Supabase,
-// Algolia, Elasticsearch): fetch the newest spec, diff it against the last
-// one seen, normalize the changes into events, and attach migration hints
-// from the API's changelog when it has one. It can also replay two given
-// releases.
+// Algolia, Elasticsearch, Sentry): fetch the newest spec, diff it against the
+// last one seen, normalize the changes into events, and attach migration
+// hints from the API's changelog when it has one. It can also replay two
+// given releases.
package openapi
import (
@@ -45,6 +45,10 @@ func init() {
// No Hints: Elastic's breaking-changes page is prose per area, not keyed
// by operation. See elasticsearch.go.
plugin.Register(Plugin{Adapter: adapter.Elasticsearch{}, Diff: elasticsearchDiff, Keep: elasticsearchKeep, RemovalsNeedANewVersion: true})
+ // No Hints: Sentry's changelog is product news, not keyed by operation.
+ // Operation deprecations only, most said in the description: see
+ // sentry.go.
+ plugin.Register(Plugin{Adapter: adapter.Sentry{}, Diff: sentryDiff, Keep: sentryKeep})
}
// requestSide keeps the changes to what callers send. GitLab's response
diff --git a/plugins/openapi/registered_test.go b/plugins/openapi/registered_test.go
index bb2992a..107e8fc 100644
--- a/plugins/openapi/registered_test.go
+++ b/plugins/openapi/registered_test.go
@@ -8,7 +8,7 @@ import (
)
func TestRegistersItself(t *testing.T) {
- for _, a := range []adapter.Adapter{adapter.Stripe{}, adapter.Datadog{}, adapter.GitLab{}, adapter.GitHub{}, adapter.Vercel{}, adapter.Supabase{}, adapter.Algolia{Spec: "search"}, adapter.Algolia{Spec: "ingestion"}, adapter.Algolia{Spec: "recommend"}, adapter.Elasticsearch{}} {
+ for _, a := range []adapter.Adapter{adapter.Stripe{}, adapter.Datadog{}, adapter.GitLab{}, adapter.GitHub{}, adapter.Vercel{}, adapter.Supabase{}, adapter.Algolia{Spec: "search"}, adapter.Algolia{Spec: "ingestion"}, adapter.Algolia{Spec: "recommend"}, adapter.Elasticsearch{}, adapter.Sentry{}} {
kittest.Registered(t, Plugin{Adapter: a})
}
}
diff --git a/plugins/openapi/sentry.go b/plugins/openapi/sentry.go
new file mode 100644
index 0000000..a702fd5
--- /dev/null
+++ b/plugins/openapi/sentry.go
@@ -0,0 +1,62 @@
+package openapi
+
+import (
+ "regexp"
+
+ "github.com/patch-it-dev/patch-it-plugins/diff"
+)
+
+// sentryDiff is how Sentry's spec says what it says:
+//
+// - Deprecations are mostly in the operation's description, not the flag.
+// Over the spec's history (the 1,130 commits that changed it in
+// getsentry/sentry-api-schema, 2020-08-25 to 2026-11-14, then the 19
+// api@ releases to api@2.16.0) the flag deprecates 3 operations and the
+// description 13, those 3 included, never later than the flag: the 10
+// issue and metric alert-rule operations on 2026-01-22, never flagged;
+// POST .../user-feedback/ on 2024-07-31 and GET .../issues/ on
+// 2025-07-25, both flagged on 2026-06-16; GET .../stats/, words and flag
+// together on 2022-03-01.
+// - The flag, when it's set, comes with the reason in the description, so
+// a flagged operation is quoted whole.
+// - Path parameters get renamed ({organization_slug} became
+// {organization_id_or_slug} on 2024-05-10), and that isn't a change for
+// callers.
+var sentryDiff = diff.Options{PathTemplates: true, QuoteDeprecatedOperation: true, DeprecatedDescription: sentryDeprecatedDescription}
+
+// sentryDeprecatedWords are the three ways the descriptions say it, over the
+// whole history: a "## Deprecated" heading with nothing else on its line, a
+// line starting "**Deprecated**:", and "This endpoint is deprecated" in any
+// case ("*This endpoint is DEPRECATED."). Also "**Deprecated:**", the colon
+// inside the bold: never used for a deprecation yet, but how Sentry writes
+// its other notes ("**Experimental:**", 45 times in api@2.16.0). Not a heading
+// with more words ("## Deprecated fields"), which would be about part of the
+// operation. Not "deprecat" anywhere: that also matches
+// three descriptions that aren't deprecations, GET .../events/'s "**Eventsv2
+// Deprecation Note**" (about another endpoint; 2022-06-16, and again under
+// the 2024-05-10 rename) and GET .../trace-items/attributes/'s "examples, and
+// deprecation details" (2026-10-15).
+var sentryDeprecatedWords = regexp.MustCompile(`(?im)^\s*#+\s*deprecated[^\p{L}\p{N}\n]*$|^\s*\*\*deprecated(\*\*:|:\*\*)|\bthis endpoint is deprecated\b`)
+
+func sentryDeprecatedDescription(description string) bool {
+ return sentryDeprecatedWords.MatchString(description)
+}
+
+// sentryKeep keeps operation deprecations only: not even a deprecated
+// operation's removal. An operation leaving Sentry's spec means Sentry
+// stopped documenting it, and the history doesn't show when, or whether, it
+// stopped working.
+//
+// - 157 operations left the spec (by path template, with /api/0 in every
+// path: see adapter.Sentry). 11 had been deprecated first: GET
+// /api/0/organizations/{organization_slug}/stats/, gone on 2024-01-22
+// and still routed in getsentry/sentry's src/sentry/api/urls.py on
+// 2026-11-19, and the 10 alert-rule operations, gone on 2026-05-08 (the
+// day after Sentry's "Monitors & Alerts — Now Generally Available"),
+// with nothing from Sentry saying they stopped answering then.
+// - Compared as published, 289 more left on 2026-11-13, when /api/0
+// moved into the server URL, GET .../issues/ and POST .../user-feedback/
+// among them, both flagged deprecated.
+//
+// Property changes and new operations are dropped too, as for vercel.
+func sentryKeep(c diff.Change) bool { return c.Kind == diff.OperationDeprecated }
diff --git a/plugins/openapi/sentry_test.go b/plugins/openapi/sentry_test.go
new file mode 100644
index 0000000..03b69c8
--- /dev/null
+++ b/plugins/openapi/sentry_test.go
@@ -0,0 +1,276 @@
+package openapi
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "regexp"
+ "strings"
+ "testing"
+
+ "github.com/patch-it-dev/patch-it-plugins/adapter"
+ "github.com/patch-it-dev/patch-it-plugins/diff"
+ "github.com/patch-it-dev/patch-it-plugins/event"
+ "github.com/patch-it-dev/patch-it-plugins/kit/kittest"
+)
+
+// The getsentry/sentry-api-schema commits and release tags saved under
+// testdata/ (trimmed to the paths involved, every line unchanged; checked
+// 2026-11-19), with the dates GitHub gives them: a commit's committer date,
+// a tag's release publication.
+var (
+ sentryCommits = map[string]string{
+ "ead7f0cf9ccb8ac817105ac11bb94fe316fcb337": "2024-07-31T20:37:27Z",
+ "4650a66a859e015cccef2c171b115633321768e9": "2024-07-31T22:59:10Z",
+ "d64149d65723484ca4d34c956ad017a66e1a4e07": "2025-07-25T16:37:23Z",
+ "c2f638f601baadcb055aec4ca3c2ba9f2654c087": "2025-07-25T19:03:21Z",
+ "47231e6180b34f222ed462b1d0cb3cdb951cc4e7": "2026-01-21T18:50:44Z",
+ "1da1f31fac696201b1a7d20046fc199c8b1324b6": "2026-01-22T21:11:05Z",
+ "94bc6e593eaf8a3800341abd429d2949895926fd": "2022-06-15T23:41:53Z",
+ "d15557ff7472748887043ab8a72687b20214a9bd": "2022-06-16T18:26:31Z",
+ "e8ec23b4c9601dea2d51205983ec1d7b89550b85": "2026-10-14T07:33:16Z",
+ "1ef7f21a0501fae9490d69e3ae29f0d5acbfb61c": "2026-10-15T14:07:38Z",
+ }
+ sentryTags = map[string]string{
+ "0.223.0": "2026-06-16T21:16:09Z",
+ "0.224.0": "2026-06-16T23:16:45Z",
+ "2.0.1": "2026-11-13T14:42:22Z",
+ "2.1.0": "2026-11-13T15:52:17Z",
+ }
+)
+
+// sentryFile is the saved copy of a commit or tag.
+func sentryFile(ref string) string {
+ if _, ok := sentryTags[ref]; ok {
+ return "testdata/sentry-" + ref + ".json"
+ }
+ return "testdata/sentry-" + ref[:8] + ".json"
+}
+
+// sentryPlugin is the plugin as registered for Sentry, its adapter reading
+// GitHub's answers and the saved copies from a local server. It returns the
+// base of the spec URLs: /[/openapi-derefed.json.
+func sentryPlugin(t *testing.T) (Plugin, string) {
+ t.Helper()
+ const schema = "/api/repos/getsentry/sentry-api-schema"
+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ p := r.URL.Path
+ if sha, ok := strings.CutPrefix(p, schema+"/commits/"); ok && sentryCommits[sha] != "" {
+ fmt.Fprintf(w, `{"sha":%q,"commit":{"committer":{"date":%q}}}`, sha, sentryCommits[sha])
+ return
+ }
+ if tag, ok := strings.CutPrefix(p, schema+"/releases/tags/"); ok && sentryTags[tag] != "" {
+ fmt.Fprintf(w, `{"tag_name":%q,"published_at":%q}`, tag, sentryTags[tag])
+ return
+ }
+ if rest, ok := strings.CutPrefix(p, "/raw/getsentry/sentry-api-schema/"); ok {
+ ref, file, _ := strings.Cut(rest, "/")
+ if _, known := sentryCommits[ref]; (known || sentryTags[ref] != "") && file == "openapi-derefed.json" {
+ http.ServeFile(w, r, sentryFile(ref))
+ return
+ }
+ }
+ http.NotFound(w, r)
+ }))
+ t.Cleanup(srv.Close)
+ a := adapter.Sentry{APIBase: srv.URL + "/api", RawBase: srv.URL + "/raw"}
+ return Plugin{Adapter: a, Diff: sentryDiff, Keep: sentryKeep}, srv.URL + "/raw/getsentry/sentry-api-schema"
+}
+
+func replaySentry(t *testing.T, p Plugin, pairs ...[2]string) []event.EventV2 {
+ t.Helper()
+ s := openStore(t)
+ for _, pair := range pairs {
+ if rejected, err := kittest.Replay(context.Background(), vercelEnv(s), s, p, pair[0], pair[1]); err != nil || rejected {
+ t.Fatalf("replay %s -> %s: rejected=%v err=%v", pair[0], pair[1], rejected, err)
+ }
+ }
+ return kittest.Stored(t, s)
+}
+
+// The golden test: the three times Sentry deprecated operations in their
+// descriptions' words, none with the flag at the time.
+//
+// - 2024-07-31: POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/,
+// "*This endpoint is DEPRECATED. We document it here for older SDKs ...".
+// - 2025-07-25: GET .../issues/, "**Deprecated**: This endpoint has been
+// replaced with the [Organization Issues endpoint]".
+// - 2026-01-22: the 10 issue and metric alert-rule operations, "## Deprecated
+// 🚧 Use [Fetch an Organization's Monitors](...)" and the like, never
+// flagged before they left the spec.
+//
+// Each event cites the description, in the commit's file.
+func TestSentryGolden(t *testing.T) {
+ p, base := sentryPlugin(t)
+ events := replaySentry(t, p,
+ [2]string{"ead7f0cf9ccb8ac817105ac11bb94fe316fcb337", "4650a66a859e015cccef2c171b115633321768e9"},
+ [2]string{"d64149d65723484ca4d34c956ad017a66e1a4e07", "c2f638f601baadcb055aec4ca3c2ba9f2654c087"},
+ [2]string{"47231e6180b34f222ed462b1d0cb3cdb951cc4e7", "1da1f31fac696201b1a7d20046fc199c8b1324b6"},
+ )
+ byVersion := map[string]int{}
+ for _, e := range events {
+ byVersion[e.Version]++
+ if e.ChangeType != event.ChangeTypeDeprecation || !strings.HasSuffix(e.SourcePointer, "/description") {
+ t.Errorf("%s: %s citing %s", e.Subject.Operation, e.ChangeType, e.SourcePointer)
+ }
+ if !strings.Contains(e.Subject.Operation, " /api/0/") {
+ t.Errorf("%s: want the path a caller sends, with /api/0", e.Subject.Operation)
+ }
+ ref := strings.TrimSuffix(strings.TrimPrefix(e.SourceURL, base+"/"), "/openapi-derefed.json")
+ if _, ok := sentryCommits[ref]; !ok {
+ t.Fatalf("%s: cited %s", e.Subject.Operation, e.SourceURL)
+ }
+ if node := jsonNode(t, sentryFile(ref), e.SourcePointer); node != e.SourceExcerpt && !truncated(e.SourceExcerpt, node) {
+ t.Errorf("%s: excerpt doesn't match %s#%s", e.Subject.Operation, sentryFile(ref), e.SourcePointer)
+ }
+ // The excerpt is the description, JSON-encoded and maybe cut at 2,000
+ // characters: the words are at its start.
+ var description string
+ if err := json.Unmarshal([]byte(e.SourceExcerpt), &description); err != nil {
+ description = strings.ReplaceAll(strings.TrimPrefix(e.SourceExcerpt, `"`), `\n`, "\n")
+ }
+ if !sentryDeprecatedDescription(description) {
+ t.Errorf("%s: the excerpt doesn't show the words: %.80s", e.Subject.Operation, e.SourceExcerpt)
+ }
+ }
+ if want := map[string]int{"2024-07-31": 1, "2025-07-25": 1, "2026-01-22": 10}; fmt.Sprint(byVersion) != fmt.Sprint(want) {
+ t.Errorf("events by version: %v, want %v", byVersion, want)
+ }
+ // The golden file cites GitHub, where the local server stood in for it.
+ for i := range events {
+ events[i].SourceURL = strings.Replace(events[i].SourceURL, base, "https://raw.githubusercontent.com/getsentry/sentry-api-schema", 1)
+ }
+ kittest.Golden(t, "testdata/golden/sentry.json", events)
+}
+
+// 0.224.0 (2026-06-16) set the `deprecated` flag on user-feedback and issues,
+// almost 23 and 11 months after their descriptions said so: no new event, they
+// were deprecated when the words came. Read by the flag alone, the pair would
+// date both deprecations 2026-06-16.
+func TestSentryFlagAfterWordsIsNotNew(t *testing.T) {
+ p, _ := sentryPlugin(t)
+ if events := replaySentry(t, p, [2]string{"0.223.0", "0.224.0"}); len(events) != 0 {
+ t.Fatalf("%d events, want none", len(events))
+ }
+ p.Diff.DeprecatedDescription = nil
+ events := replaySentry(t, p, [2]string{"0.223.0", "0.224.0"})
+ var ops []string
+ for _, e := range events {
+ if strings.HasSuffix(e.SourcePointer, "/description") || !strings.Contains(e.SourceExcerpt, `"deprecated":true`) {
+ t.Errorf("%s: cited %s", e.Subject.Operation, e.SourcePointer)
+ }
+ ops = append(ops, e.Subject.Operation)
+ }
+ if want := "GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/, POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/"; strings.Join(ops, ", ") != want {
+ t.Errorf("by the flag alone: %v, want %s", ops, want)
+ }
+}
+
+// rawSentry serves the saved copies as published, without the adapter's
+// moving /api/0 into the paths.
+type rawSentry struct{}
+
+func (rawSentry) API() string { return "sentry" }
+func (rawSentry) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("replay only") }
+func (rawSentry) Fetch(_ context.Context, tag string) (adapter.Spec, error) {
+ body, err := os.ReadFile(sentryFile(tag))
+ return adapter.Spec{Content: body, Version: sentryTags[tag][:10], SourceURL: "https://example.invalid/" + tag}, err
+}
+
+// The pinned drop test. sentry-api-schema 2.1.0 (2026-11-13) moved /api/0
+// from every path into the server URL: the same URLs, so no event. Compared
+// as published, every operation (289 in the full files) reads as removed and
+// added again, including GET .../issues/, which 2.0.1 flags deprecated: a
+// rule that kept removals of deprecated operations would report it shut down.
+func TestSentryBasePathMoveIsNoChange(t *testing.T) {
+ p, base := sentryPlugin(t)
+ if events := replaySentry(t, p, [2]string{"2.0.1", "2.1.0"}); len(events) != 0 {
+ t.Fatalf("%d events, want none", len(events))
+ }
+
+ // Unfiltered, what the move leaves is a few property changes, and every
+ // pointer names a node in the file as published, without /api/0.
+ p.Keep = nil
+ for _, e := range replaySentry(t, p, [2]string{"2.0.1", "2.1.0"}) {
+ if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.AffectedKindOperation {
+ t.Errorf("unfiltered: %s %s", e.ChangeType, e.Subject.Operation)
+ }
+ ref := strings.TrimSuffix(strings.TrimPrefix(e.SourceURL, base+"/"), "/openapi-derefed.json")
+ if node := jsonNode(t, sentryFile(ref), e.SourcePointer); node != e.SourceExcerpt && !truncated(e.SourceExcerpt, node) {
+ t.Errorf("%s: %s doesn't name the excerpt in %s", e.Subject.Operation, e.SourcePointer, sentryFile(ref))
+ }
+ }
+
+ // As published: every operation of 2.0.1 removed.
+ raw := Plugin{Adapter: rawSentry{}, Diff: sentryDiff}
+ var removed []string
+ for _, e := range replaySentry(t, raw, [2]string{"2.0.1", "2.1.0"}) {
+ if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.AffectedKindOperation {
+ removed = append(removed, e.Subject.Operation)
+ }
+ }
+ if len(removed) != 5 {
+ t.Errorf("as published: removed %v, want the 5 operations of the saved 2.0.1", removed)
+ }
+ raw.Keep = deprecationsOnly(sentryDiff)
+ events := replaySentry(t, raw, [2]string{"2.0.1", "2.1.0"})
+ if len(events) != 1 || events[0].Subject.Operation != "GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/" || !events[0].Breaking {
+ t.Errorf("as published, removals of deprecated operations: %d events, want GET .../issues/ removed", len(events))
+ }
+}
+
+// Three descriptions say "deprecation" without deprecating their operation:
+// GET /api/0/organizations/{organization_slug}/events/ gained an "Eventsv2
+// Deprecation Note" (about another endpoint) on 2022-06-16, and the same
+// note moved with it to {organization_id_or_slug} on 2024-05-10; GET
+// .../trace-items/attributes/ gained "examples, and deprecation details" on
+// 2026-10-15. No event, where a match on "deprecat" anywhere would make one.
+func TestSentryDeprecationWordsThatArentDeprecations(t *testing.T) {
+ pairs := [][2]string{
+ {"94bc6e593eaf8a3800341abd429d2949895926fd", "d15557ff7472748887043ab8a72687b20214a9bd"},
+ {"e8ec23b4c9601dea2d51205983ec1d7b89550b85", "1ef7f21a0501fae9490d69e3ae29f0d5acbfb61c"},
+ }
+ p, _ := sentryPlugin(t)
+ if events := replaySentry(t, p, pairs...); len(events) != 0 {
+ t.Fatalf("%d events, want none: %v", len(events), events[0].Subject.Operation)
+ }
+ loose := regexp.MustCompile(`(?i)deprecat`)
+ p.Diff.DeprecatedDescription = loose.MatchString
+ if events := replaySentry(t, p, pairs...); len(events) != 2 {
+ t.Errorf("matching %q: %d events, want the 2 wrong ones", loose, len(events))
+ }
+}
+
+// The patterns against each way the history says it, and the three
+// descriptions that only mention deprecation.
+func TestSentryDeprecatedWords(t *testing.T) {
+ for desc, want := range map[string]bool{
+ "## Deprecated\n🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors/) instead.": true,
+ "## Deprecated\n 🚧 Use [Delete a Monitor](/api/monitors/delete-a-monitor/) instead.": true,
+ "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint]": true,
+ "\n*This endpoint is DEPRECATED. We document it here for older SDKs": true,
+ "This endpoint is deprecated in favor of [Organization Stats V2](/api/organizations/retrieve-event-counts-for-an-organization-v2/).": true,
+ "Retrieves discover (also known as events) data for a given organization.\n\n**Eventsv2 Deprecation Note**: Users who may be using the `eventsv2` endpoint should update": false,
+ "Pass `expand=context` (experimental) to include each attribute's metadata:\na brief description, examples, and deprecation details.": false,
+ "Returns deprecated fields too.": false,
+ // Sentry's own style for its notes, the colon inside the bold.
+ "**Deprecated:** Use the monitors endpoints instead.": true,
+ "## Deprecated 🚧\nUse monitors.": true,
+ // A heading about part of the operation, not the operation.
+ "## Deprecated fields\n- `status`": false,
+ "### Deprecated parameters\n`cursor` is ignored.": false,
+ } {
+ if got := sentryDeprecatedDescription(desc); got != want {
+ t.Errorf("%.60q: got %v, want %v", desc, got, want)
+ }
+ }
+ if !sentryDiff.OperationDeprecated(map[string]any{"description": "## Deprecated\nUse monitors."}) {
+ t.Error("sentryDiff doesn't read the description")
+ }
+ if c := (diff.Change{Kind: diff.OperationRemoved, Node: map[string]any{"deprecated": true}}); sentryKeep(c) {
+ t.Error("sentryKeep keeps a removal of a deprecated operation")
+ }
+}
diff --git a/plugins/openapi/testdata/README.md b/plugins/openapi/testdata/README.md
index 43e5c39..64df17c 100644
--- a/plugins/openapi/testdata/README.md
+++ b/plugins/openapi/testdata/README.md
@@ -21,6 +21,13 @@ Each pair is a real breaking change between two releases of a provider's own spe
| `algolia-ingestion-2024-09-18-cc190fae3.yml`, `algolia-ingestion-2024-09-19-a62c27d3b.yml` | https://raw.githubusercontent.com/algolia/api-clients-automation/released-2024-09-18-cc190fae3/specs/bundled/ingestion.yml (and `released-2024-09-19-a62c27d3b`) | 2026-11-19 | MIT (algolia/api-clients-automation) | `/1/transformations/models:` (in `2024-09-18`, never deprecated, gone in `2024-09-19`): the drop test |
| `elasticsearch-8.19-fd5d063c.json`, `elasticsearch-9.0-57ecfe5f.json` | https://raw.githubusercontent.com/elastic/elasticsearch-specification/fd5d063c4824de5d33618b7fca4df0e6c1b8489f/output/openapi/elasticsearch-openapi.json (the head of `8.19`; and `57ecfe5fda6976b94fc8b8830ecb51f4969dccd6`, the head of `9.0`) | 2026-11-19 | Apache-2.0 (elastic/elasticsearch-specification) | `"/{index}/_unfreeze": {` (in 8.19, deprecated; gone in 9.0) |
| `elasticsearch-9.1-12639d0e.json`, `elasticsearch-9.2-87a82640.json` | https://raw.githubusercontent.com/elastic/elasticsearch-specification/12639d0e5ec07f064c909f15160ff68d608dbc2c/output/openapi/elasticsearch-openapi.json (the head of `9.1`; and `87a82640d8aa1139163dc7071bf00f971ce5e453`, the head of `9.2`) | 2026-11-19 | Apache-2.0 (elastic/elasticsearch-specification) | "designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported." (`/_autoscaling/capacity`, in 9.1, gone in 9.2): the drop test |
+| `sentry-ead7f0cf.json`, `sentry-4650a66a.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/ead7f0cf9ccb8ac817105ac11bb94fe316fcb337/openapi-derefed.json (and `4650a66a859e015cccef2c171b115633321768e9`) | 2026-11-19 | Apache 2.0 (the spec's own `info.license`; getsentry/sentry-api-schema had no license file before 2026-02-10) | "*This endpoint is DEPRECATED. We document it here for older SDKs" (`POST .../user-feedback/`, new in `4650a66a`) |
+| `sentry-d64149d6.json`, `sentry-c2f638f6.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/d64149d65723484ca4d34c956ad017a66e1a4e07/openapi-derefed.json (and `c2f638f601baadcb055aec4ca3c2ba9f2654c087`) | 2026-11-19 | Apache 2.0 (the spec's own `info.license`; getsentry/sentry-api-schema had no license file before 2026-02-10) | "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint]" (`GET .../issues/`, new in `c2f638f6`) |
+| `sentry-47231e61.json`, `sentry-1da1f31f.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/47231e6180b34f222ed462b1d0cb3cdb951cc4e7/openapi-derefed.json (and `1da1f31fac696201b1a7d20046fc199c8b1324b6`) | 2026-11-19 | Apache 2.0 (the spec's own `info.license`; getsentry/sentry-api-schema had no license file before 2026-02-10) | "## Deprecated" then "🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors)" (`GET .../alert-rules/` and 9 more alert-rule operations, new in `1da1f31f`) |
+| `sentry-0.223.0.json`, `sentry-0.224.0.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/0.223.0/openapi-derefed.json (and `0.224.0`) | 2026-11-19 | FSL-1.1-Apache-2.0 (getsentry/sentry-api-schema; the spec's own `info.license` says Apache 2.0) | `"deprecated": true` on `POST .../user-feedback/` and `GET .../issues/` (new in `0.224.0`, long after their descriptions said so) |
+| `sentry-2.0.1.json`, `sentry-2.1.0.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/2.0.1/openapi-derefed.json (and `2.1.0`) | 2026-11-19 | FSL-1.1-Apache-2.0 (getsentry/sentry-api-schema; the spec's own `info.license` says Apache 2.0) | `"url": "https://{region}.sentry.io"` and `"/api/0/organizations/": {` (in `2.0.1`), `"url": "https://{region}.sentry.io/api/0"` and `"/organizations/": {` (in `2.1.0`): the drop test |
+| `sentry-94bc6e59.json`, `sentry-d15557ff.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/94bc6e593eaf8a3800341abd429d2949895926fd/openapi-derefed.json (and `d15557ff7472748887043ab8a72687b20214a9bd`) | 2026-11-19 | Apache 2.0 (the spec's own `info.license`; getsentry/sentry-api-schema had no license file before 2026-02-10) | "**Eventsv2 Deprecation Note**: Users who may be using the `eventsv2` endpoint should update their requests to the `events` endpoint" (`GET .../events/`, new in `d15557ff`; not a deprecation of it) |
+| `sentry-e8ec23b4.json`, `sentry-1ef7f21a.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/e8ec23b4c9601dea2d51205983ec1d7b89550b85/openapi-derefed.json (and `1ef7f21a0501fae9490d69e3ae29f0d5acbfb61c`) | 2026-11-19 | FSL-1.1-Apache-2.0 (getsentry/sentry-api-schema; the spec's own `info.license` says Apache 2.0) | "a brief description, examples, and deprecation details." (`GET .../trace-items/attributes/`, new in `1ef7f21a`; not a deprecation) |
The Elasticsearch copies keep `openapi`, `info` and the paths involved, every line unchanged; the 9.2 copy's paths are all gone in 9.2, so its `"paths": {}` is the one line that isn't in the original.
@@ -28,4 +35,6 @@ The Algolia copies are trimmed by lines: `openapi`, `info` and the paths involve
The Supabase copies keep each value unchanged but are re-indented: the source is Prettier-formatted (objects on one line where they fit), and minified on one line before 2025.
+The Sentry copies keep `openapi`, `info`, `servers` and the path items involved, whole, in their original order except that `servers` comes before `paths`, every line copied unchanged (bar the trailing comma after a path item that's now last); `components` and `tags` left out. Each pair gives the same events as the full files, with the filter and with the variants the tests use (flag only, "deprecat" anywhere). The tests serve them as GitHub would, with each commit's date and each tag's release date.
+
Stripe's spec isn't saved here: its tests use small specs written inline.
diff --git a/plugins/openapi/testdata/golden/sentry.json b/plugins/openapi/testdata/golden/sentry.json
new file mode 100644
index 0000000..e9c4f60
--- /dev/null
+++ b/plugins/openapi/testdata/golden/sentry.json
@@ -0,0 +1,254 @@
+[
+ {
+ "id": 1,
+ "fingerprint": "sha256:2efa45f20c4794cb83d70cc75a4a098f03002e8ca698ae69be2f0a032fba4d43",
+ "api": "sentry",
+ "version": "2024-07-31",
+ "previous_version": "2024-07-31",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/"
+ },
+ "description": "Operation POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/4650a66a859e015cccef2c171b115633321768e9/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1projects~1{organization_id_or_slug}~1{project_id_or_slug}~1user-feedback~1/post/description",
+ "source_excerpt": "\"*This endpoint is DEPRECATED. We document it here for older SDKs and users who are still migrating to the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) or [API](https://docs.sentry.io/platforms/javascript/user-feedback/#user-feedback-api)(multi-platform). If you are a new user, do not use this endpoint - unless you don't have a JS frontend, and your platform's SDK does not offer a feedback API.*\\n\\nFeedback must be received by the server no more than 30 minutes after the event was saved.\\n\\nAdditionally, within 5 minutes of submitting feedback it may also be overwritten. This is useful in situations where you may need to retry sending a request due to network failures.\\n\\nIf feedback is rejected due to a mutability threshold, a 409 status code will be returned.\\n\\nNote: Feedback may be submitted with DSN authentication (see auth documentation).\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 2,
+ "fingerprint": "sha256:c9d7575990702109c5fe20bb8a1cf67654789f4e4a0977b4eb4d540093015e15",
+ "api": "sentry",
+ "version": "2025-07-25",
+ "previous_version": "2025-07-25",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/"
+ },
+ "description": "Operation GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/c2f638f601baadcb055aec4ca3c2ba9f2654c087/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1projects~1{organization_id_or_slug}~1{project_id_or_slug}~1issues~1/get/description",
+ "source_excerpt": "\"**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint](/api/events/list-an-organizations-issues/) which\\nsupports filtering on project and additional functionality.\\n\\nReturn a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \\n\\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\\n\\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\\\"\\\"`` (disable),``\\\"24h\\\"`` (default), ``\\\"14d\\\"``\\n\\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 3,
+ "fingerprint": "sha256:6fc16106a310cfe991afc1001b20127813897fb5ae8a495c6b35f3877f844e73",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "GET /api/0/organizations/{organization_id_or_slug}/alert-rules/"
+ },
+ "description": "Operation GET /api/0/organizations/{organization_id_or_slug}/alert-rules/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1organizations~1{organization_id_or_slug}~1alert-rules~1/get/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors) and [Fetch Alerts](/api/monitors/fetch-alerts) instead.\\n\\n\\nReturn a list of active metric alert rules bound to an organization.\\n\\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\\nIt specifies the metric type, function, time interval, and threshold\\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\\npredefined threshold. These rules help you proactively identify and address issues in your\\nproject.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 4,
+ "fingerprint": "sha256:c2eb3298f4f871a01f9b5bf7b99e3731aa0328acc1f654b68308844bc8d9cdc7",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "POST /api/0/organizations/{organization_id_or_slug}/alert-rules/"
+ },
+ "description": "Operation POST /api/0/organizations/{organization_id_or_slug}/alert-rules/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1organizations~1{organization_id_or_slug}~1alert-rules~1/post/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Create a Monitor for a Project](/api/monitors/create-a-monitor-for-a-project) and [Create an Alert for an Organization](/api/monitors/create-an-alert-for-an-organization) instead.\\n\\n\\nCreate a new metric alert rule for the given organization.\\n\\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\\nIt specifies the metric type, function, time interval, and threshold\\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\\npredefined threshold. These rules help you proactively identify and address issues in your\\nproject.\\n\\n## Metric Alert Rule Types\\nBelow are the types of metric alert rules you can create and the parameter values required\\nto set them up. All other parameters can be customized based on how you want the alert\\nrule to work. Scroll down to Body Parameters for more information. Visit the\\n[Alert Types](/product/alerts/alert-types/#metric-alerts) docs for more details on each\\nmetric alert rule type.\\n\\n### [Number of Errors](/product/alerts/alert-types/#number-of-errors)\\n- `eventTypes`: Any of `error` or `default`.\\n```json\\n{\\n \\\"queryType\\\": 0,\\n \\\"dataset\\\": \\\"events\\\",\\n \\\"aggregate\\\": \\\"count()\\\",\\n \\\"eventTypes\\\": [\\\"error\\\", \\\"default\\\"]\\n}\\n```\\n\\n### [Users Experiencing Errors](/product/alerts/alert-types/#users-experiencing-errors)\\n- `eventTypes`: Any of `error` or `default`.\\n```json\\n{\\n \\\"queryType\\\": 0,\\n \\\"dataset\\\": \\\"events\\\",\\n \\\"aggregate\\\": \\\"count_unique(user)\\\"\\n}\\n```\\n\\n### [Crash Free Session Rate](/product/alerts/alert-types/#crash-free-session-rate)\\n```json\\n{\\n \\\"queryType\\\": 2,\\n \\\"dataset\\\": \\\"metrics\\\",\\n \\\"aggregate\\\": \\\"percentage(sessions_crashed, sessions) AS _crash_rate_alert_aggregate\\\"\\n}\\n```\\n\\n### [Crash Free User Rate](/product/alerts/alert-types/#crash-free-user-rate)\\n```json\\n{\\n …",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 5,
+ "fingerprint": "sha256:7c4f21e09fe00c30d1239b95e167e7739e81ad21e7ede0234ae837277f60b590",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "DELETE /api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/"
+ },
+ "description": "Operation DELETE /api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1organizations~1{organization_id_or_slug}~1alert-rules~1{alert_rule_id}~1/delete/description",
+ "source_excerpt": "\"## Deprecated\\n 🚧 Use [Delete a Monitor](/api/monitors/delete-a-monitor) and [Delete an Alert](/api/monitors/delete-an-alert) instead.\\n\\n Delete a specific metric alert rule.\\n\\n A metric alert rule is a configuration that defines the conditions for triggering an alert.\\n It specifies the metric type, function, time interval, and threshold\\n values that determine when an alert should be triggered. Metric alert rules are used to monitor\\n and notify you when certain metrics, like error count, latency, or failure rate, cross a\\n predefined threshold. These rules help you proactively identify and address issues in your\\n project.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 6,
+ "fingerprint": "sha256:5d93def1bfa9db7da29d9446fd4f5944df489f55033d585f951a2e4925afd4da",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "GET /api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/"
+ },
+ "description": "Operation GET /api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1organizations~1{organization_id_or_slug}~1alert-rules~1{alert_rule_id}~1/get/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Fetch a Monitor](/api/monitors/fetch-a-monitor) and [Fetch an Alert](/api/monitors/fetch-an-alert) instead.\\n\\n\\nReturn details on an individual metric alert rule.\\n\\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\\nIt specifies the metric type, function, time interval, and threshold\\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\\npredefined threshold. These rules help you proactively identify and address issues in your\\nproject.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 7,
+ "fingerprint": "sha256:90402d61a2a48a93c0c095061b6dc457e189a52d4e5d84b68953d49b16c0c052",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "PUT /api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/"
+ },
+ "description": "Operation PUT /api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1organizations~1{organization_id_or_slug}~1alert-rules~1{alert_rule_id}~1/put/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Update a Monitor by ID](/api/monitors/update-a-monitor-by-id) and [Update an Alert by ID](/api/monitors/update-an-alert-by-id) instead.\\n\\n\\nUpdates a metric alert rule. See **Metric Alert Rule Types** under\\n[Create a Metric Alert Rule for an Organization](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types)\\nto see valid request body configurations for different types of metric alert rule types.\\n\\u003e Warning: Calling this endpoint fully overwrites the specified metric alert.\\n\\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\\nIt specifies the metric type, function, time interval, and threshold\\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\\npredefined threshold. These rules help you proactively identify and address issues in your\\nproject.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 8,
+ "fingerprint": "sha256:2f145e0f7dab69af5b768ce70659ca1bc83c0adcbc3d82e0d4c8282c70c4cded",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/"
+ },
+ "description": "Operation GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1projects~1{organization_id_or_slug}~1{project_id_or_slug}~1rules~1/get/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors) and [Fetch Alerts](/api/monitors/fetch-alerts) instead.\\n\\n\\nReturn a list of active issue alert rules bound to a project.\\n\\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\\n- Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\\n- Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\\n- Actions: specify what should happen when the trigger conditions are met and the filters match.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 9,
+ "fingerprint": "sha256:9530af56a60f90dc66ad010d23cfbe27c1e4995ca7abaf025069e9a8a979c813",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/"
+ },
+ "description": "Operation POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1projects~1{organization_id_or_slug}~1{project_id_or_slug}~1rules~1/post/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Create a Monitor for a Project](/api/monitors/create-a-monitor-for-a-project) and [Create an Alert for an Organization](/api/monitors/create-an-alert-for-an-organization) instead.\\n\\n\\nCreate a new issue alert rule for the given project.\\n\\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\\n- Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\\n- Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\\n- Actions: specify what should happen when the trigger conditions are met and the filters match.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 10,
+ "fingerprint": "sha256:c4b2385ae7d1452194f50e65e09c90b5a370c23741e45655c2aef541b65aa70c",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "DELETE /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/"
+ },
+ "description": "Operation DELETE /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1projects~1{organization_id_or_slug}~1{project_id_or_slug}~1rules~1{rule_id}~1/delete/description",
+ "source_excerpt": "\"## Deprecated\\n 🚧 Use [Delete an Alert](/api/monitors/delete-an-alert) instead.\\n\\n\\n Delete a specific issue alert rule.\\n\\n An issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\\n - Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\\n - Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\\n - Actions: specify what should happen when the trigger conditions are met and the filters match.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 11,
+ "fingerprint": "sha256:67cdb8021716e9e3bdd7fbe696b87099b0301943cba1cf66b5a8973e4db45fbb",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/"
+ },
+ "description": "Operation GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1projects~1{organization_id_or_slug}~1{project_id_or_slug}~1rules~1{rule_id}~1/get/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Fetch an Alert](/api/monitors/fetch-an-alert) instead.\\n\\n\\nReturn details on an individual issue alert rule.\\n\\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\\n- Triggers - specify what type of activity you'd like monitored or when an alert should be triggered.\\n- Filters - help control noise by triggering an alert only if the issue matches the specified criteria.\\n- Actions - specify what should happen when the trigger conditions are met and the filters match.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ },
+ {
+ "id": 12,
+ "fingerprint": "sha256:4857ec490742153cbb2fc9d7acfdfe63f5fc5c1cb45f4df2a8d9c6a8de9ca484",
+ "api": "sentry",
+ "version": "2026-01-22",
+ "previous_version": "2026-01-21",
+ "change_type": "deprecation",
+ "breaking": false,
+ "subject": {
+ "type": "api_operation",
+ "kind": "operation",
+ "side": "request",
+ "operation": "PUT /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/"
+ },
+ "description": "Operation PUT /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/ marked deprecated.",
+ "source_url": "https://raw.githubusercontent.com/getsentry/sentry-api-schema/1da1f31fac696201b1a7d20046fc199c8b1324b6/openapi-derefed.json",
+ "source_pointer": "/paths/~1api~10~1projects~1{organization_id_or_slug}~1{project_id_or_slug}~1rules~1{rule_id}~1/put/description",
+ "source_excerpt": "\"## Deprecated\\n🚧 Use [Update an Alert by ID](/api/monitors/update-an-alert-by-id) instead.\\n\\n\\nUpdates an issue alert rule.\\n\\u003e Warning: Calling this endpoint fully overwrites the specified issue alert.\\n\\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\\n- Triggers - specify what type of activity you'd like monitored or when an alert should be triggered.\\n- Filters - help control noise by triggering an alert only if the issue matches the specified criteria.\\n- Actions - specify what should happen when the trigger conditions are met and the filters match.\"",
+ "confidence": 1,
+ "detected_at": "2026-11-14T12:00:00Z"
+ }
+]
diff --git a/plugins/openapi/testdata/sentry-0.223.0.json b/plugins/openapi/testdata/sentry-0.223.0.json
new file mode 100644
index 0000000..35c52b7
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-0.223.0.json
@@ -0,0 +1,963 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/": {
+ "get": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "Return a list of user feedback items within this project.\n\n*This list does not include submissions from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget). This is because it is based on an older format called User Reports - read more [here](https://develop.sentry.dev/application/feedback-architecture/#user-reports). To return a list of user feedback items from the widget, please use the [issue API](https://docs.sentry.io/api/events/list-a-projects-issues/) with the filter `issue.category:feedback`.*",
+ "operationId": "List a Project's User Feedback",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:read"
+ ]
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "*This endpoint is DEPRECATED. We document it here for older SDKs and users who are still migrating to the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) or [API](https://docs.sentry.io/platforms/javascript/user-feedback/#user-feedback-api)(multi-platform). If you are a new user, do not use this endpoint - unless you don't have a JS frontend, and your platform's SDK does not offer a feedback API.*\n\nFeedback must be received by the server no more than 30 minutes after the event was saved.\n\nAdditionally, within 5 minutes of submitting feedback it may also be overwritten. This is useful in situations where you may need to retry sending a request due to network failures.\n\nIf feedback is rejected due to a mutability threshold, a 409 status code will be returned.\n\nNote: Feedback may be submitted with DSN authentication (see auth documentation).",
+ "operationId": "Submit User Feedback",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "event_id",
+ "name",
+ "email",
+ "comments"
+ ],
+ "type": "object",
+ "properties": {
+ "event_id": {
+ "type": "string",
+ "description": "The event ID. This can be retrieved from the [beforeSend callback](https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-beforesend)."
+ },
+ "name": {
+ "type": "string",
+ "description": "User's name."
+ },
+ "email": {
+ "type": "string",
+ "description": "User's email address."
+ },
+ "comments": {
+ "type": "string",
+ "description": "Comments supplied by user."
+ }
+ }
+ },
+ "example": {
+ "event_id": "14bad9a2e3774046977a21440ddb39b2",
+ "name": "Jane Schmidt",
+ "email": "jane@empowerplant.io",
+ "comments": "It broke!"
+ }
+ }
+ },
+ "required": false
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ },
+ "example": {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ },
+ "409": {
+ "description": "Conflict"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:write"
+ ]
+ },
+ {
+ "dsn": []
+ }
+ ]
+ }
+ },
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/": {
+ "get": {
+ "tags": [
+ "Events"
+ ],
+ "description": "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint](/api/events/list-an-organizations-issues/) which\nsupports filtering on project and additional functionality.\n\nReturn a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \n\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\n\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\"\"`` (disable),``\"24h\"`` (default), ``\"14d\"``\n\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.",
+ "operationId": "List a Project's Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "statsPeriod",
+ "in": "query",
+ "description": "An optional stat period (can be one of `\"24h\"`, `\"14d\"`, and `\"\"`), defaults to \"24h\" if not provided.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "shortIdLookup",
+ "in": "query",
+ "description": "If this is set to true then short IDs are looked up by this function as well. This can cause the return value of the function to return an event issue of a different project which is why this is an opt-in. Set to 1 to enable.",
+ "schema": {
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query. If not provided an implied `\"is:unresolved\"` is assumed.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "hashes",
+ "in": "query",
+ "description": "A list of hashes of groups to return. Is not compatible with 'query' parameter. The maximum number of hashes that can be sent is 100. If more are sent, only the first 100 will be used.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "lastSeen",
+ "numComments",
+ "userCount",
+ "culprit",
+ "title",
+ "id",
+ "assignedTo",
+ "logger",
+ "stats",
+ "type",
+ "annotations",
+ "metadata",
+ "status",
+ "subscriptionDetails",
+ "isPublic",
+ "hasSeen",
+ "shortId",
+ "shareId",
+ "firstSeen",
+ "count",
+ "permalink",
+ "level",
+ "isSubscribed",
+ "isBookmarked",
+ "project",
+ "statusDetails"
+ ],
+ "properties": {
+ "annotations": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "assignedTo": {
+ "type": "object",
+ "nullable": true
+ },
+ "count": {
+ "type": "string"
+ },
+ "culprit": {
+ "type": "string"
+ },
+ "firstSeen": {
+ "type": "string"
+ },
+ "hasSeen": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "isBookmarked": {
+ "type": "boolean"
+ },
+ "isPublic": {
+ "type": "boolean"
+ },
+ "isSubscribed": {
+ "type": "boolean"
+ },
+ "lastSeen": {
+ "type": "string"
+ },
+ "level": {
+ "type": "string"
+ },
+ "logger": {
+ "type": "string",
+ "nullable": true
+ },
+ "metadata": {
+ "oneOf": [
+ {
+ "type": "object",
+ "required": [
+ "filename",
+ "type",
+ "value"
+ ],
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "title"
+ ],
+ "properties": {
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ },
+ "numComments": {
+ "type": "integer"
+ },
+ "permalink": {
+ "type": "string"
+ },
+ "project": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ }
+ }
+ },
+ "shareId": {
+ "type": "string",
+ "nullable": true
+ },
+ "shortId": {
+ "type": "string"
+ },
+ "stats": {
+ "type": "object",
+ "properties": {
+ "24h": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ },
+ "subscriptionDetails": {
+ "type": "object",
+ "nullable": true
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "userCount": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "annotations": [],
+ "assignedTo": null,
+ "count": "1",
+ "culprit": "raven.scripts.runner in main",
+ "firstSeen": "2018-11-06T21:19:55Z",
+ "hasSeen": false,
+ "id": "1",
+ "isBookmarked": false,
+ "isPublic": false,
+ "isSubscribed": true,
+ "lastSeen": "2018-11-06T21:19:55Z",
+ "level": "error",
+ "logger": null,
+ "metadata": {
+ "title": "This is an example Python exception"
+ },
+ "numComments": 0,
+ "permalink": "https://sentry.io/the-interstellar-jurisdiction/pump-station/issues/1/",
+ "project": {
+ "id": "2",
+ "name": "Pump Station",
+ "slug": "pump-station"
+ },
+ "shareId": null,
+ "shortId": "PUMP-STATION-1",
+ "stats": {
+ "24h": [
+ [
+ 1541455200,
+ 473
+ ],
+ [
+ 1541458800,
+ 914
+ ],
+ [
+ 1541462400,
+ 991
+ ],
+ [
+ 1541466000,
+ 925
+ ],
+ [
+ 1541469600,
+ 881
+ ],
+ [
+ 1541473200,
+ 182
+ ],
+ [
+ 1541476800,
+ 490
+ ],
+ [
+ 1541480400,
+ 820
+ ],
+ [
+ 1541484000,
+ 322
+ ],
+ [
+ 1541487600,
+ 836
+ ],
+ [
+ 1541491200,
+ 565
+ ],
+ [
+ 1541494800,
+ 758
+ ],
+ [
+ 1541498400,
+ 880
+ ],
+ [
+ 1541502000,
+ 677
+ ],
+ [
+ 1541505600,
+ 381
+ ],
+ [
+ 1541509200,
+ 814
+ ],
+ [
+ 1541512800,
+ 329
+ ],
+ [
+ 1541516400,
+ 446
+ ],
+ [
+ 1541520000,
+ 731
+ ],
+ [
+ 1541523600,
+ 111
+ ],
+ [
+ 1541527200,
+ 926
+ ],
+ [
+ 1541530800,
+ 772
+ ],
+ [
+ 1541534400,
+ 400
+ ],
+ [
+ 1541538000,
+ 943
+ ]
+ ]
+ },
+ "status": "unresolved",
+ "statusDetails": {},
+ "subscriptionDetails": null,
+ "title": "This is an example Python exception",
+ "type": "default",
+ "userCount": 0
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:read"
+ ]
+ }
+ ]
+ },
+ "put": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Bulk mutate various attributes on issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be modified.\n\n- For non-status updates, the `id` query parameter is required.\n- For status updates, the `id` query parameter may be omitted\nfor a batch \"update all\" query.\n- An optional `status` query parameter may be used to restrict\nmutations to only events with the given status.\n\nThe following attributes can be modified and are supplied as JSON object in the body:\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Mutate a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be mutated. This parameter shall be repeated for each issue. It is optional only if a status is mutated in which case an implicit update all is assumed.",
+ "required": false,
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "description": "Optionally limits the query to issues of the specified status. Valid values are `\"resolved\"`, `\"reprocessing\"`, `\"unresolved\"`, and `\"ignored\"`.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "The new status for the issues. Valid values are `\"resolved\"`, `\"resolvedInNextRelease\"`, `\"unresolved\"`, and `\"ignored\"`."
+ },
+ "statusDetails": {
+ "type": "object",
+ "properties": {
+ "inRelease": {
+ "type": "string"
+ },
+ "inNextRelease": {
+ "type": "boolean"
+ },
+ "inCommit": {
+ "type": "string"
+ },
+ "ignoreDuration": {
+ "type": "integer"
+ },
+ "ignoreCount": {
+ "type": "integer"
+ },
+ "ignoreWindow": {
+ "type": "integer"
+ },
+ "ignoreUserCount": {
+ "type": "integer"
+ },
+ "ignoreUserWindow": {
+ "type": "integer"
+ }
+ },
+ "description": "Additional details about the resolution. Valid values are `\"inRelease\"`, `\"inNextRelease\"`, `\"inCommit\"`, `\"ignoreDuration\"`, `\"ignoreCount\"`, `\"ignoreWindow\"`, `\"ignoreUserCount\"`, and `\"ignoreUserWindow\"`."
+ },
+ "ignoreDuration": {
+ "type": "integer",
+ "description": "The number of minutes to ignore this issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Sets the issue to public or private."
+ },
+ "merge": {
+ "type": "boolean",
+ "description": "Allows to merge or unmerge different issues."
+ },
+ "assignedTo": {
+ "type": "string",
+ "description": "The actor ID (or username) of the user or team that should be assigned to this issue."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the flag that indicates if the user has seen the event."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the bookmark flag."
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "isPublic",
+ "status",
+ "statusDetails"
+ ],
+ "properties": {
+ "isPublic": {
+ "type": "boolean"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved",
+ "statusDetails": {}
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:write"
+ ]
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Permanently remove the given issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be removed.\n\nOnly queries by 'id' are accepted.\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Remove a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be removed. This parameter shall be repeated for each issue, e.g. `?id=1&id=2&id=3`. If this parameter is not provided, it will attempt to remove the first 1000 issues.",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Project not found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:admin"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-0.224.0.json b/plugins/openapi/testdata/sentry-0.224.0.json
new file mode 100644
index 0000000..b73f7e8
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-0.224.0.json
@@ -0,0 +1,991 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/": {
+ "get": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "Return a list of user feedback items within this project.\n\n*This list does not include submissions from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget). This is because it is based on an older format called User Reports - read more [here](https://develop.sentry.dev/application/feedback-architecture/#user-reports). To return a list of user feedback items from the widget, please use the [issue API](https://docs.sentry.io/api/events/list-a-projects-issues/) with the filter `issue.category:feedback`.*",
+ "operationId": "List a Project's User Feedback",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:read"
+ ]
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "*This endpoint is DEPRECATED. We document it here for older SDKs and users who are still migrating to the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) or [API](https://docs.sentry.io/platforms/javascript/user-feedback/#user-feedback-api)(multi-platform). If you are a new user, do not use this endpoint - unless you don't have a JS frontend, and your platform's SDK does not offer a feedback API.*\n\nFeedback must be received by the server no more than 30 minutes after the event was saved.\n\nAdditionally, within 5 minutes of submitting feedback it may also be overwritten. This is useful in situations where you may need to retry sending a request due to network failures.\n\nIf feedback is rejected due to a mutability threshold, a 409 status code will be returned.\n\nNote: Feedback may be submitted with DSN authentication (see auth documentation).",
+ "operationId": "Submit User Feedback",
+ "deprecated": true,
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "event_id",
+ "name",
+ "email",
+ "comments"
+ ],
+ "type": "object",
+ "properties": {
+ "event_id": {
+ "type": "string",
+ "description": "The event ID. This can be retrieved from the [beforeSend callback](https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-beforesend)."
+ },
+ "name": {
+ "type": "string",
+ "description": "User's name."
+ },
+ "email": {
+ "type": "string",
+ "description": "User's email address."
+ },
+ "comments": {
+ "type": "string",
+ "description": "Comments supplied by user."
+ }
+ }
+ },
+ "example": {
+ "event_id": "14bad9a2e3774046977a21440ddb39b2",
+ "name": "Jane Schmidt",
+ "email": "jane@empowerplant.io",
+ "comments": "It broke!"
+ }
+ }
+ },
+ "required": false
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ },
+ "example": {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ },
+ "409": {
+ "description": "Conflict"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:write"
+ ]
+ },
+ {
+ "dsn": []
+ }
+ ]
+ }
+ },
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/": {
+ "get": {
+ "tags": [
+ "Events"
+ ],
+ "description": "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint](/api/events/list-an-organizations-issues/) which\nsupports filtering on project and additional functionality.\n\nReturn a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \n\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\n\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\"\"`` (disable),``\"24h\"`` (default), ``\"14d\"``\n\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.",
+ "operationId": "List a Project's Issues",
+ "deprecated": true,
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "statsPeriod",
+ "in": "query",
+ "description": "An optional stat period (can be one of `\"24h\"`, `\"14d\"`, and `\"\"`), defaults to \"24h\" if not provided.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "shortIdLookup",
+ "in": "query",
+ "description": "If this is set to true then short IDs are looked up by this function as well. This can cause the return value of the function to return an event issue of a different project which is why this is an opt-in. Set to 1 to enable.",
+ "schema": {
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query. If not provided an implied `\"is:unresolved\"` is assumed.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "hashes",
+ "in": "query",
+ "description": "A list of hashes of groups to return. Is not compatible with 'query' parameter. The maximum number of hashes that can be sent is 100. If more are sent, only the first 100 will be used.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "sort",
+ "in": "query",
+ "description": "The sort order of the issues. Options include 'Last Seen' (`date`), 'First Seen' (`new`), 'Trends' (`trends`), 'Events' (`freq`), 'Users' (`user`), and 'Date Added' (`inbox`).",
+ "schema": {
+ "type": "string",
+ "default": "date",
+ "enum": [
+ "date",
+ "new",
+ "trends",
+ "freq",
+ "user",
+ "inbox"
+ ]
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "The maximum number of issues to return. The maximum is 100.",
+ "schema": {
+ "type": "integer",
+ "default": 100
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "lastSeen",
+ "numComments",
+ "userCount",
+ "culprit",
+ "title",
+ "id",
+ "assignedTo",
+ "logger",
+ "stats",
+ "type",
+ "annotations",
+ "metadata",
+ "status",
+ "subscriptionDetails",
+ "isPublic",
+ "hasSeen",
+ "shortId",
+ "shareId",
+ "firstSeen",
+ "count",
+ "permalink",
+ "level",
+ "isSubscribed",
+ "isBookmarked",
+ "project",
+ "statusDetails"
+ ],
+ "properties": {
+ "annotations": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "assignedTo": {
+ "type": "object",
+ "nullable": true
+ },
+ "count": {
+ "type": "string"
+ },
+ "culprit": {
+ "type": "string"
+ },
+ "firstSeen": {
+ "type": "string"
+ },
+ "hasSeen": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "isBookmarked": {
+ "type": "boolean"
+ },
+ "isPublic": {
+ "type": "boolean"
+ },
+ "isSubscribed": {
+ "type": "boolean"
+ },
+ "lastSeen": {
+ "type": "string"
+ },
+ "level": {
+ "type": "string"
+ },
+ "logger": {
+ "type": "string",
+ "nullable": true
+ },
+ "metadata": {
+ "oneOf": [
+ {
+ "type": "object",
+ "required": [
+ "filename",
+ "type",
+ "value"
+ ],
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "title"
+ ],
+ "properties": {
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ },
+ "numComments": {
+ "type": "integer"
+ },
+ "permalink": {
+ "type": "string"
+ },
+ "project": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ }
+ }
+ },
+ "shareId": {
+ "type": "string",
+ "nullable": true
+ },
+ "shortId": {
+ "type": "string"
+ },
+ "stats": {
+ "type": "object",
+ "properties": {
+ "24h": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ },
+ "subscriptionDetails": {
+ "type": "object",
+ "nullable": true
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "userCount": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "annotations": [],
+ "assignedTo": null,
+ "count": "1",
+ "culprit": "raven.scripts.runner in main",
+ "firstSeen": "2018-11-06T21:19:55Z",
+ "hasSeen": false,
+ "id": "1",
+ "isBookmarked": false,
+ "isPublic": false,
+ "isSubscribed": true,
+ "lastSeen": "2018-11-06T21:19:55Z",
+ "level": "error",
+ "logger": null,
+ "metadata": {
+ "title": "This is an example Python exception"
+ },
+ "numComments": 0,
+ "permalink": "https://sentry.io/the-interstellar-jurisdiction/pump-station/issues/1/",
+ "project": {
+ "id": "2",
+ "name": "Pump Station",
+ "slug": "pump-station"
+ },
+ "shareId": null,
+ "shortId": "PUMP-STATION-1",
+ "stats": {
+ "24h": [
+ [
+ 1541455200,
+ 473
+ ],
+ [
+ 1541458800,
+ 914
+ ],
+ [
+ 1541462400,
+ 991
+ ],
+ [
+ 1541466000,
+ 925
+ ],
+ [
+ 1541469600,
+ 881
+ ],
+ [
+ 1541473200,
+ 182
+ ],
+ [
+ 1541476800,
+ 490
+ ],
+ [
+ 1541480400,
+ 820
+ ],
+ [
+ 1541484000,
+ 322
+ ],
+ [
+ 1541487600,
+ 836
+ ],
+ [
+ 1541491200,
+ 565
+ ],
+ [
+ 1541494800,
+ 758
+ ],
+ [
+ 1541498400,
+ 880
+ ],
+ [
+ 1541502000,
+ 677
+ ],
+ [
+ 1541505600,
+ 381
+ ],
+ [
+ 1541509200,
+ 814
+ ],
+ [
+ 1541512800,
+ 329
+ ],
+ [
+ 1541516400,
+ 446
+ ],
+ [
+ 1541520000,
+ 731
+ ],
+ [
+ 1541523600,
+ 111
+ ],
+ [
+ 1541527200,
+ 926
+ ],
+ [
+ 1541530800,
+ 772
+ ],
+ [
+ 1541534400,
+ 400
+ ],
+ [
+ 1541538000,
+ 943
+ ]
+ ]
+ },
+ "status": "unresolved",
+ "statusDetails": {},
+ "subscriptionDetails": null,
+ "title": "This is an example Python exception",
+ "type": "default",
+ "userCount": 0
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:read"
+ ]
+ }
+ ]
+ },
+ "put": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Bulk mutate various attributes on issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be modified.\n\n- For non-status updates, the `id` query parameter is required.\n- For status updates, the `id` query parameter may be omitted\nfor a batch \"update all\" query.\n- An optional `status` query parameter may be used to restrict\nmutations to only events with the given status.\n\nThe following attributes can be modified and are supplied as JSON object in the body:\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Mutate a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be mutated. This parameter shall be repeated for each issue. It is optional only if a status is mutated in which case an implicit update all is assumed.",
+ "required": false,
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "description": "Optionally limits the query to issues of the specified status. Valid values are `\"resolved\"`, `\"reprocessing\"`, `\"unresolved\"`, and `\"ignored\"`.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "The new status for the issues. Valid values are `\"resolved\"`, `\"resolvedInNextRelease\"`, `\"unresolved\"`, and `\"ignored\"`."
+ },
+ "statusDetails": {
+ "type": "object",
+ "properties": {
+ "inRelease": {
+ "type": "string"
+ },
+ "inNextRelease": {
+ "type": "boolean"
+ },
+ "inCommit": {
+ "type": "string"
+ },
+ "ignoreDuration": {
+ "type": "integer"
+ },
+ "ignoreCount": {
+ "type": "integer"
+ },
+ "ignoreWindow": {
+ "type": "integer"
+ },
+ "ignoreUserCount": {
+ "type": "integer"
+ },
+ "ignoreUserWindow": {
+ "type": "integer"
+ }
+ },
+ "description": "Additional details about the resolution. Valid values are `\"inRelease\"`, `\"inNextRelease\"`, `\"inCommit\"`, `\"ignoreDuration\"`, `\"ignoreCount\"`, `\"ignoreWindow\"`, `\"ignoreUserCount\"`, and `\"ignoreUserWindow\"`."
+ },
+ "ignoreDuration": {
+ "type": "integer",
+ "description": "The number of minutes to ignore this issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Sets the issue to public or private."
+ },
+ "merge": {
+ "type": "boolean",
+ "description": "Allows to merge or unmerge different issues."
+ },
+ "assignedTo": {
+ "type": "string",
+ "description": "The actor ID (or username) of the user or team that should be assigned to this issue."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the flag that indicates if the user has seen the event."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the bookmark flag."
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "isPublic",
+ "status",
+ "statusDetails"
+ ],
+ "properties": {
+ "isPublic": {
+ "type": "boolean"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved",
+ "statusDetails": {}
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:write"
+ ]
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Permanently remove the given issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be removed.\n\nOnly queries by 'id' are accepted.\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Remove a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be removed. This parameter shall be repeated for each issue, e.g. `?id=1&id=2&id=3`. If this parameter is not provided, it will attempt to remove the first 1000 issues.",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Project not found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:admin"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-1da1f31f.json b/plugins/openapi/testdata/sentry-1da1f31f.json
new file mode 100644
index 0000000..9baf443
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-1da1f31f.json
@@ -0,0 +1,2396 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/organizations/{organization_id_or_slug}/alert-rules/": {
+ "get": {
+ "operationId": "(DEPRECATED) List an Organization's Metric Alert Rules",
+ "description": "## Deprecated\n🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors) and [Fetch Alerts](/api/monitors/fetch-alerts) instead.\n\n\nReturn a list of active metric alert rules bound to an organization.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ }
+ },
+ "examples": {
+ "ListMetricAlertRulesForAnOrganization": {
+ "value": [
+ {
+ "id": "7",
+ "name": "Counting Bad Request and Unauthorized Errors in Prod",
+ "organizationId": "237655244234",
+ "queryType": 0,
+ "dataset": "events",
+ "query": "tags[http.status_code]:[400, 401]",
+ "aggregate": "count()",
+ "thresholdType": 0,
+ "resolveThreshold": null,
+ "timeWindow": 1440,
+ "environment": "prod",
+ "triggers": [
+ {
+ "id": "394289",
+ "alertRuleId": "17723",
+ "label": "critical",
+ "thresholdType": 0,
+ "alertThreshold": 100,
+ "resolveThreshold": null,
+ "dateCreated": "2023-09-25T22:15:26.375126Z",
+ "actions": [
+ {
+ "id": "394280",
+ "alertRuleTriggerId": "92481",
+ "type": "slack",
+ "targetType": "specific",
+ "targetIdentifier": "30489048931789",
+ "inputChannelId": "#my-channel",
+ "integrationId": "8753467",
+ "sentryAppId": null,
+ "dateCreated": "2023-09-25T22:15:26.375126Z"
+ }
+ ]
+ }
+ ],
+ "projects": [
+ "super-cool-project"
+ ],
+ "owner": "user:53256",
+ "originalAlertRuleId": null,
+ "comparisonDelta": null,
+ "dateModified": "2023-09-25T22:15:26.375126Z",
+ "dateCreated": "2023-09-25T22:15:26.375126Z",
+ "createdBy": {
+ "id": 983948,
+ "name": "John Doe",
+ "email": "john.doe@sentry.io"
+ }
+ }
+ ],
+ "summary": "List metric alert rules for an organization"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "post": {
+ "operationId": "(DEPRECATED) Create a Metric Alert Rule for an Organization",
+ "description": "## Deprecated\n🚧 Use [Create a Monitor for a Project](/api/monitors/create-a-monitor-for-a-project) and [Create an Alert for an Organization](/api/monitors/create-an-alert-for-an-organization) instead.\n\n\nCreate a new metric alert rule for the given organization.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.\n\n## Metric Alert Rule Types\nBelow are the types of metric alert rules you can create and the parameter values required\nto set them up. All other parameters can be customized based on how you want the alert\nrule to work. Scroll down to Body Parameters for more information. Visit the\n[Alert Types](/product/alerts/alert-types/#metric-alerts) docs for more details on each\nmetric alert rule type.\n\n### [Number of Errors](/product/alerts/alert-types/#number-of-errors)\n- `eventTypes`: Any of `error` or `default`.\n```json\n{\n \"queryType\": 0,\n \"dataset\": \"events\",\n \"aggregate\": \"count()\",\n \"eventTypes\": [\"error\", \"default\"]\n}\n```\n\n### [Users Experiencing Errors](/product/alerts/alert-types/#users-experiencing-errors)\n- `eventTypes`: Any of `error` or `default`.\n```json\n{\n \"queryType\": 0,\n \"dataset\": \"events\",\n \"aggregate\": \"count_unique(user)\"\n}\n```\n\n### [Crash Free Session Rate](/product/alerts/alert-types/#crash-free-session-rate)\n```json\n{\n \"queryType\": 2,\n \"dataset\": \"metrics\",\n \"aggregate\": \"percentage(sessions_crashed, sessions) AS _crash_rate_alert_aggregate\"\n}\n```\n\n### [Crash Free User Rate](/product/alerts/alert-types/#crash-free-user-rate)\n```json\n{\n \"queryType\": 2,\n \"dataset\": \"metrics\",\n \"aggregate\": \"percentage(users_crashed, users) AS _crash_rate_alert_aggregate\"\n}\n```\n\n### [Throughput](/product/alerts/alert-types/#throughput)\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"count()\"\n}\n```\n\n### [Transaction Duration](/product/alerts/alert-types/#transaction-duration)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(transaction.duration)`, `p50(transaction.duration)`, `p75(transaction.duration)`, `p95(transaction.duration)`, `p99(transaction.duration)`, `p100(transaction.duration)`, and `percentile(transaction.duration,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"avg(transaction.duration)\"\n}\n```\n\n### [Apdex](/product/alerts/alert-types/#apdex)\n- `aggregate`: `apdex(x)` where `x` is the value of the Apdex score.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"apdex(300)\"\n}\n```\n\n### [Failure Rate](/product/alerts/alert-types/#failure-rate)\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"failure_rate()\"\n}\n```\n\n### [Largest Contentful Paint](/product/alerts/alert-types/#largest-contentful-display)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(measurements.lcp)`, `p50(measurements.lcp)`, `p75(measurements.lcp)`, `p95(measurements.lcp)`, `p99(measurements.lcp)`, `p100(measurements.lcp)`, and `percentile(measurements.lcp,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"p50(measurements.lcp)\"\n}\n```\n\n### [First Input Delay](/product/alerts/alert-types/#first-input-delay)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(measurements.fid)`, `p50(measurements.fid)`, `p75(measurements.fid)`, `p95(measurements.fid)`, `p99(measurements.fid)`, `p100(measurements.fid)`, and `percentile(measurements.fid,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"p100(measurements.fid)\"\n}\n```\n\n### [Cumulative Layout Shift](/product/alerts/alert-types/#cumulative-layout-shift)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(measurements.cls)`, `p50(measurements.cls)`, `p75(measurements.cls)`, `p95(measurements.cls)`, `p99(measurements.cls)`, `p100(measurements.cls)`, and `percentile(measurements.cls,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"percentile(measurements.cls,0.2)\"\n}\n```\n\n### [Custom Metric](/product/alerts/alert-types/#custom-metric)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are:\n - `avg(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p50(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p75(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p95(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p99(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p100(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `percentile(x,y)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`, and `y` is the custom percentile.\n - `failure_rate()`\n - `apdex(x)`, where `x` is the value of the Apdex score.\n - `count()`\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"p75(measurements.ttfb)\"\n}\n```",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule, which has a maximimum length of 256 characters.",
+ "maxLength": 256
+ },
+ "aggregate": {
+ "type": "string",
+ "description": "A string representing the aggregate function used in this alert rule. Valid aggregate functions are `count`, `count_unique`, `percentage`, `avg`, `apdex`, `failure_rate`, `p50`, `p75`, `p95`, `p99`, `p100`, and `percentile`. See [Metric Alert Rule Types](#metric-alert-rule-types) for valid configurations."
+ },
+ "timeWindow": {
+ "enum": [
+ 1,
+ 5,
+ 10,
+ 15,
+ 30,
+ 60,
+ 120,
+ 240,
+ 1440
+ ],
+ "type": "integer",
+ "description": "The time period to aggregate over.\n\n* `1` - 1 minute\n* `5` - 5 minutes\n* `10` - 10 minutes\n* `15` - 15 minutes\n* `30` - 30 minutes\n* `60` - 1 hour\n* `120` - 2 hours\n* `240` - 4 hours\n* `1440` - 24 hours"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Metric alerts are currently limited to one project. The array should contain a single slug, representing the project to filter by."
+ },
+ "query": {
+ "type": "string",
+ "description": "An event search query to subscribe to and monitor for alerts. For example, to filter transactions so that only those with status code 400 are included, you could use `\"query\": \"http.status_code:400\"`. Use an empty string for no filter."
+ },
+ "thresholdType": {
+ "enum": [
+ 0,
+ 1
+ ],
+ "type": "integer",
+ "description": "The comparison operator for the critical and warning thresholds. The comparison operator for the resolved threshold is automatically set to the opposite operator. When a percentage change threshold is used, `0` is equivalent to \"Higher than\" and `1` is equivalent to \"Lower than\".\n\n* `0` - Above\n* `1` - Below"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {},
+ "description": "\nA list of triggers, where each trigger is an object with the following fields:\n- `label`: One of `critical` or `warning`. A `critical` trigger is always required.\n- `alertThreshold`: The value that the subscription needs to reach to trigger the\nalert rule.\n- `actions`: A list of actions that take place when the threshold is met.\n```json\ntriggers: [\n {\n \"label\": \"critical\",\n \"alertThreshold\": 50,\n \"actions\": [\n {\n \"type\": \"slack\",\n \"targetType\": \"specific\",\n \"targetIdentifier\": \"#get-crit\",\n \"inputChannelId\": 2454362\n \"integrationId\": 653532,\n }\n ]\n },\n {\n \"label\": \"warning\",\n \"alertThreshold\": 25,\n \"actions\": []\n }\n]\n```\nMetric alert rule trigger actions follow the following structure:\n- `type`: The type of trigger action. Valid values are `email`, `slack`, `msteams`, `pagerduty`, `sentry_app`, `sentry_notification`, and `opsgenie`.\n- `targetType`: The type of target the notification will be sent to. Valid values are `specific` (`targetIdentifier` is a direct reference used by the service, like an email address or a Slack channel ID), `user` (`targetIdentifier` is a Sentry user ID), `team` (`targetIdentifier` is a Sentry team ID), and `sentry_app` (`targetIdentifier` is a SentryApp ID).\n- `targetIdentifier`: The ID of the target. This must be an integer for PagerDuty and Sentry apps, and a string for all others. Examples of appropriate values include a Slack channel name (`#my-channel`), a user ID, a team ID, a Sentry app ID, etc.\n- `inputChannelId`: The ID of the Slack channel. This is only used for the Slack action, and can be used as an alternative to providing the `targetIdentifier`.\n- `integrationId`: The integration ID. This is required for every action type excluding `email` and `sentry_app.`\n- `sentryAppId`: The ID of the Sentry app. This is required when `type` is `sentry_app`.\n- `priority`: The severity of the Pagerduty alert or the priority of the Opsgenie alert (optional). Defaults for Pagerduty are `critical` for critical and `warning` for warning. Defaults for Opsgenie are `P1` for critical and `P2` for warning.\n"
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by. Defaults to all environments."
+ },
+ "dataset": {
+ "type": "string",
+ "description": "The name of the dataset that this query will be executed on. Valid values are `events`, `transactions`, `metrics`, `sessions`, and `generic-metrics`. Defaults to `events`. See [Metric Alert Rule Types](#metric-alert-rule-types) for valid configurations."
+ },
+ "queryType": {
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "description": "The type of query. If no value is provided, `queryType` is set to the default for the specified `dataset.` See [Metric Alert Rule Types](#metric-alert-rule-types) for valid configurations.\n\n* `0` - event.type:error\n* `1` - event.type:transaction\n* `2` - None"
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of event types that this alert will be related to. Valid values are `default` (events captured using [Capture Message](/product/sentry-basics/integrate-backend/capturing-errors/#capture-message)), `error` and `transaction`."
+ },
+ "comparisonDelta": {
+ "type": "integer",
+ "description": "An optional int representing the time delta to use as the comparison period, in minutes. Required when using a percentage change threshold (\"x%\" higher or lower compared to `comparisonDelta` minutes ago). A percentage change threshold cannot be used for [Crash Free Session Rate](#crash-free-session-rate) or [Crash Free User Rate](#crash-free-user-rate)."
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "description": "Optional value that the metric needs to reach to resolve the alert. If no value is provided, this is set automatically based on the lowest severity trigger's `alertThreshold`. For example, if the alert is set to trigger at the warning level when the number of errors is above 50, then the alert would be set to resolve when there are less than 50 errors. If `thresholdType` is `0`, `resolveThreshold` must be greater than the critical threshold, otherwise, it must be less than the critical threshold."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ }
+ },
+ "required": [
+ "aggregate",
+ "name",
+ "projects",
+ "query",
+ "thresholdType",
+ "timeWindow",
+ "triggers"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "201": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ },
+ "examples": {
+ "CreateAMetricAlertRuleForAnOrganization": {
+ "value": {
+ "id": "177104",
+ "name": "Apdex % Check",
+ "organizationId": "4505676595200000",
+ "queryType": 2,
+ "dataset": "metrics",
+ "query": "",
+ "aggregate": "percentage(sessions_crashed, sessions) AS _crash_rate_alert_aggregate",
+ "thresholdType": 0,
+ "resolveThreshold": 80,
+ "timeWindow": 120,
+ "environment": null,
+ "triggers": [
+ {
+ "id": "293990",
+ "alertRuleId": "177104",
+ "label": "critical",
+ "thresholdType": 0,
+ "alertThreshold": 75,
+ "resolveThreshold": 80,
+ "dateCreated": "2023-09-25T22:01:28.673305Z",
+ "actions": [
+ {
+ "id": "281887",
+ "alertRuleTriggerId": "293990",
+ "type": "email",
+ "targetType": "team",
+ "targetIdentifier": "2378589792734981",
+ "inputChannelId": null,
+ "integrationId": null,
+ "sentryAppId": null,
+ "dateCreated": "2023-09-25T22:01:28.680793Z"
+ }
+ ]
+ },
+ {
+ "id": "492849",
+ "alertRuleId": "482923",
+ "label": "warning",
+ "thresholdType": 1,
+ "alertThreshold": 50,
+ "resolveThreshold": 80,
+ "dateCreated": "2023-09-25T22:01:28.673305Z",
+ "actions": []
+ }
+ ],
+ "projects": [
+ "our-project"
+ ],
+ "owner": "team:4505676595200000",
+ "originalAlertRuleId": null,
+ "comparisonDelta": 10080,
+ "dateModified": "2023-09-25T22:01:28.637506Z",
+ "dateCreated": "2023-09-25T22:01:28.637514Z",
+ "createdBy": {
+ "id": 2837708,
+ "name": "Jane Doe",
+ "email": "jane.doe@sentry.io"
+ }
+ },
+ "summary": "Create a metric alert rule for an organization"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ },
+ "/api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/": {
+ "get": {
+ "operationId": "(DEPRECATED) Retrieve a Metric Alert Rule for an Organization",
+ "description": "## Deprecated\n🚧 Use [Fetch a Monitor](/api/monitors/fetch-a-monitor) and [Fetch an Alert](/api/monitors/fetch-an-alert) instead.\n\n\nReturn details on an individual metric alert rule.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "alert_rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ },
+ "examples": {
+ "GetDetailedViewAboutAMetricAlertRule": {
+ "value": {
+ "id": "177412243058",
+ "name": "My Metric Alert Rule",
+ "organizationId": "4505676595200000",
+ "queryType": 0,
+ "dataset": "events",
+ "query": "",
+ "aggregate": "count_unique(user)",
+ "thresholdType": 0,
+ "resolveThreshold": null,
+ "timeWindow": 60,
+ "environment": null,
+ "triggers": [
+ {
+ "id": "294385908",
+ "alertRuleId": "177412243058",
+ "label": "critical",
+ "thresholdType": 0,
+ "alertThreshold": 31,
+ "resolveThreshold": null,
+ "dateCreated": "2023-09-26T22:14:17.557579Z",
+ "actions": []
+ }
+ ],
+ "projects": [
+ "my-coolest-project"
+ ],
+ "owner": "team:29508397892374892",
+ "dateModified": "2023-09-26T22:14:17.522166Z",
+ "dateCreated": "2023-09-26T22:14:17.522196Z",
+ "createdBy": {
+ "id": 2834985497897,
+ "name": "Somebody That I Used to Know",
+ "email": "anon@sentry.io"
+ },
+ "eventTypes": [
+ "default",
+ "error"
+ ]
+ },
+ "summary": "Get detailed view about a metric alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "put": {
+ "operationId": "(DEPRECATED) Update a Metric Alert Rule",
+ "description": "## Deprecated\n🚧 Use [Update a Monitor by ID](/api/monitors/update-a-monitor-by-id) and [Update an Alert by ID](/api/monitors/update-an-alert-by-id) instead.\n\n\nUpdates a metric alert rule. See **Metric Alert Rule Types** under\n[Create a Metric Alert Rule for an Organization](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types)\nto see valid request body configurations for different types of metric alert rule types.\n> Warning: Calling this endpoint fully overwrites the specified metric alert.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "alert_rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule.",
+ "maxLength": 256
+ },
+ "aggregate": {
+ "type": "string",
+ "description": "A string representing the aggregate function used in this alert rule. Valid aggregate functions are `count`, `count_unique`, `percentage`, `avg`, `apdex`, `failure_rate`, `p50`, `p75`, `p95`, `p99`, `p100`, and `percentile`. See **Metric Alert Rule Types** under [Create a Metric Alert Rule](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types) for valid configurations."
+ },
+ "timeWindow": {
+ "enum": [
+ 1,
+ 5,
+ 10,
+ 15,
+ 30,
+ 60,
+ 120,
+ 240,
+ 1440
+ ],
+ "type": "integer",
+ "description": "The time period to aggregate over.\n\n* `1` - 1 minute\n* `5` - 5 minutes\n* `10` - 10 minutes\n* `15` - 15 minutes\n* `30` - 30 minutes\n* `60` - 1 hour\n* `120` - 2 hours\n* `240` - 4 hours\n* `1440` - 24 hours"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The names of the projects to filter by."
+ },
+ "query": {
+ "type": "string",
+ "description": "An event search query to subscribe to and monitor for alerts. For example, to filter transactions so that only those with status code 400 are included, you could use `\"query\": \"http.status_code:400\"`. Use an empty string for no filter."
+ },
+ "thresholdType": {
+ "enum": [
+ 0,
+ 1
+ ],
+ "type": "integer",
+ "description": "The comparison operator for the critical and warning thresholds. The comparison operator for the resolved threshold is automatically set to the opposite operator. When a percentage change threshold is used, `0` is equivalent to \"Higher than\" and `1` is equivalent to \"Lower than\".\n\n* `0` - Above\n* `1` - Below"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {},
+ "description": "\nA list of triggers, where each trigger is an object with the following fields:\n- `label`: One of `critical` or `warning`. A `critical` trigger is always required.\n- `alertThreshold`: The value that the subscription needs to reach to trigger the\nalert rule.\n- `actions`: A list of actions that take place when the threshold is met.\n```json\ntriggers: [\n {\n \"label\": \"critical\",\n \"alertThreshold\": 100,\n \"actions\": [\n {\n \"type\": \"email\",\n \"targetType\": \"user\",\n \"targetIdentifier\": \"23489853\",\n \"inputChannelId\": None\n \"integrationId\": None,\n \"sentryAppId\": None\n }\n ]\n },\n {\n \"label\": \"warning\",\n \"alertThreshold\": 75,\n \"actions\": []\n }\n]\n```\nMetric alert rule trigger actions follow the following structure:\n- `type`: The type of trigger action. Valid values are `email`, `slack`, `msteams`, `pagerduty`, `sentry_app`, `sentry_notification`, and `opsgenie`.\n- `targetType`: The type of target the notification will be sent to. Valid values are `specific`, `user`, `team`, and `sentry_app`.\n- `targetIdentifier`: The ID of the target. This must be an integer for PagerDuty and Sentry apps, and a string for all others. Examples of appropriate values include a Slack channel name (`#my-channel`), a user ID, a team ID, a Sentry app ID, etc.\n- `inputChannelId`: The ID of the Slack channel. This is only used for the Slack action, and can be used as an alternative to providing the `targetIdentifier`.\n- `integrationId`: The integration ID. This is required for every action type except `email` and `sentry_app.`\n- `sentryAppId`: The ID of the Sentry app. This is required when `type` is `sentry_app`.\n- `priority`: The severity of the Pagerduty alert or the priority of the Opsgenie alert (optional). Defaults for Pagerduty are `critical` for critical and `warning` for warning. Defaults for Opsgenie are `P1` for critical and `P2` for warning.\n"
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by. Defaults to all environments."
+ },
+ "dataset": {
+ "type": "string",
+ "description": "The name of the dataset that this query will be executed on. Valid values are `events`, `transactions`, `metrics`, `sessions`, and `generic-metrics`. Defaults to `events`. See **Metric Alert Rule Types** under [Create a Metric Alert Rule](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types) for valid configurations."
+ },
+ "queryType": {
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "description": "The type of query. If no value is provided, `queryType` is set to the default for the specified `dataset.` See **Metric Alert Rule Types** under [Create a Metric Alert Rule](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types) for valid configurations.\n\n* `0` - event.type:error\n* `1` - event.type:transaction\n* `2` - None"
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of event types that this alert will be related to. Valid values are `default` (events captured using [Capture Message](/product/sentry-basics/integrate-backend/capturing-errors/#capture-message)), `error` and `transaction`."
+ },
+ "comparisonDelta": {
+ "type": "integer",
+ "description": "An optional int representing the time delta to use as the comparison period, in minutes. Required when using a percentage change threshold (\"x%\" higher or lower compared to `comparisonDelta` minutes ago). A percentage change threshold cannot be used for [Crash Free Session Rate](/api/alerts/create-a-metric-alert-rule-for-an-organization/#crash-free-session-rate) or [Crash Free User Rate](/api/alerts/create-a-metric-alert-rule-for-an-organization/#crash-free-user-rate)."
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "description": "Optional value that the metric needs to reach to resolve the alert. If no value is provided, this is set automatically based on the lowest severity trigger's `alertThreshold`. For example, if the alert is set to trigger at the warning level when the number of errors is above 50, then the alert would be set to resolve when there are less than 50 errors. If `thresholdType` is `0`, `resolveThreshold` must be greater than the critical threshold. Otherwise, it must be less than the critical threshold."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ }
+ },
+ "required": [
+ "aggregate",
+ "name",
+ "projects",
+ "query",
+ "thresholdType",
+ "timeWindow",
+ "triggers"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "org:admin",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ },
+ "examples": {
+ "UpdateAMetricAlertRule": {
+ "value": {
+ "id": "345989573",
+ "name": "P30 Transaction Duration",
+ "organizationId": "02403489017",
+ "queryType": 1,
+ "dataset": "transactions",
+ "query": "",
+ "aggregate": "percentile(transaction.duration,0.3)",
+ "thresholdType": 1,
+ "resolveThreshold": null,
+ "timeWindow": 60,
+ "environment": null,
+ "triggers": [
+ {
+ "id": "0543809890",
+ "alertRuleId": "345989573",
+ "label": "critical",
+ "thresholdType": 1,
+ "alertThreshold": 70,
+ "resolveThreshold": null,
+ "dateCreated": "2023-09-25T23:35:31.832084Z",
+ "actions": []
+ }
+ ],
+ "projects": [
+ "backend"
+ ],
+ "owner": "team:9390258908",
+ "originalAlertRuleId": null,
+ "comparisonDelta": 10080,
+ "dateModified": "2023-09-25T23:35:31.787866Z",
+ "dateCreated": "2023-09-25T23:35:31.787875Z",
+ "createdBy": {
+ "id": 902843590658,
+ "name": "Spongebob Squarepants",
+ "email": "spongebob.s@example.com"
+ }
+ },
+ "summary": "Update a metric alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "(DEPRECATED) Delete a Metric Alert Rule",
+ "description": "## Deprecated\n 🚧 Use [Delete a Monitor](/api/monitors/delete-a-monitor) and [Delete an Alert](/api/monitors/delete-an-alert) instead.\n\n Delete a specific metric alert rule.\n\n A metric alert rule is a configuration that defines the conditions for triggering an alert.\n It specifies the metric type, function, time interval, and threshold\n values that determine when an alert should be triggered. Metric alert rules are used to monitor\n and notify you when certain metrics, like error count, latency, or failure rate, cross a\n predefined threshold. These rules help you proactively identify and address issues in your\n project.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "alert_rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "org:admin",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "202": {
+ "description": "Accepted"
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ },
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/": {
+ "get": {
+ "operationId": "(DEPRECATED) List a Project's Issue Alert Rules",
+ "description": "## Deprecated\n🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors) and [Fetch Alerts](/api/monitors/fetch-alerts) instead.\n\n\nReturn a list of active issue alert rules bound to a project.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions: specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "alerts:write",
+ "project:admin",
+ "project:read",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ }
+ },
+ "examples": {
+ "ListIssueAlertRulesForAProject": {
+ "value": [
+ {
+ "id": "3",
+ "conditions": [
+ {
+ "interval": "1h",
+ "id": "sentry.rules.conditions.event_frequency.EventFrequencyCondition",
+ "value": 1000
+ }
+ ],
+ "filters": [
+ {
+ "value": "1",
+ "id": "sentry.rules.filters.issue_category.IssueCategoryFilter"
+ },
+ {
+ "value": "2",
+ "id": "sentry.rules.filters.issue_category.IssueCategoryFilter"
+ }
+ ],
+ "actions": [
+ {
+ "targetType": "Team",
+ "fallthroughType": "ActiveMembers",
+ "id": "sentry.mail.actions.NotifyEmailAction",
+ "targetIdentifier": 4367234414355
+ }
+ ],
+ "actionMatch": "any",
+ "filterMatch": "any",
+ "frequency": 60,
+ "name": "High Number of Issues with Production",
+ "dateCreated": "2023-01-15T06:45:34.353346Z",
+ "owner": "team:63562",
+ "createdBy": {
+ "id": 2435786,
+ "name": "John Doe",
+ "email": "john.doe@example.com"
+ },
+ "environment": "prod",
+ "projects": [
+ "melody"
+ ],
+ "status": "active",
+ "lastTriggered": "2023-07-15T00:00:00.351236Z",
+ "snooze": false
+ }
+ ],
+ "summary": "List issue alert rules for a project"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "post": {
+ "operationId": "(DEPRECATED) Create an Issue Alert Rule for a Project",
+ "description": "## Deprecated\n🚧 Use [Create a Monitor for a Project](/api/monitors/create-a-monitor-for-a-project) and [Create an Alert for an Organization](/api/monitors/create-an-alert-for-an-organization) instead.\n\n\nCreate a new issue alert rule for the given project.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions: specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule.",
+ "maxLength": 256
+ },
+ "frequency": {
+ "type": "integer",
+ "maximum": 43200,
+ "minimum": 5,
+ "description": "How often to perform the actions once for an issue, in minutes. The valid range is `5` to `43200`."
+ },
+ "actionMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which of the conditions need to be true before any filters are evaluated.\n\n* `all` - All conditions must evaluate to true.\n* `any` - At least one of the conditions must evaluate to true.\n* `none` - All conditions must evaluate to false."
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "\nA list of triggers that determine when the rule fires. See below for a list of possible conditions.\n\n**A new issue is created**\n```json\n{\n \"id\": \"sentry.rules.conditions.first_seen_event.FirstSeenEventCondition\"\n}\n```\n\n**The issue changes state from resolved to unresolved**\n```json\n{\n \"id\": \"sentry.rules.conditions.regression_event.RegressionEventCondition\"\n}\n```\n\n**The issue is seen more than `value` times in `interval`**\n- `value` - An integer\n- `interval` - Valid values are `1m`, `5m`, `15m`, `1h`, `1d`, `1w` and `30d` (`m` for minutes, `h` for hours, `d` for days, and `w` for weeks).\n```json\n{\n \"id\": \"sentry.rules.conditions.event_frequency.EventFrequencyCondition\",\n \"value\": 500,\n \"interval\": \"1h\"\n}\n```\n\n**The issue is seen by more than `value` users in `interval`**\n- `value` - An integer\n- `interval` - Valid values are `1m`, `5m`, `15m`, `1h`, `1d`, `1w` and `30d` (`m` for minutes, `h` for hours, `d` for days, and `w` for weeks).\n```json\n{\n \"id\": \"sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition\",\n \"value\": 1000,\n \"interval\": \"15m\"\n}\n```\n\n**The issue affects more than `value` percent of sessions in `interval`**\n- `value` - A float\n- `interval` - Valid values are `5m`, `10m`, `30m`, and `1h` (`m` for minutes, `h` for hours).\n```json\n{\n \"id\": \"sentry.rules.conditions.event_frequency.EventFrequencyPercentCondition\",\n \"value\": 50.0,\n \"interval\": \"10m\"\n}\n```\n"
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "\nA list of actions that take place when all required conditions and filters for the rule are met. See below for a list of possible actions.\n\n**Send a notification to Suggested Assignees**\n- `fallthroughType` - Who the notification should be sent to if there are no suggested assignees. Valid values are `ActiveMembers`, `AllMembers`, and `NoOne`.\n```json\n{\n \"id\" - \"sentry.mail.actions.NotifyEmailAction\",\n \"targetType\" - \"IssueOwners\",\n \"fallthroughType\" - \"ActiveMembers\"\n}\n```\n\n**Send a notification to a Member or a Team**\n- `targetType` - One of `Member` or `Team`.\n- `fallthroughType` - Who the notification should be sent to if it cannot be sent to the original target. Valid values are `ActiveMembers`, `AllMembers`, and `NoOne`.\n- `targetIdentifier` - The ID of the Member or Team the notification should be sent to.\n```json\n{\n \"id\": \"sentry.mail.actions.NotifyEmailAction\",\n \"targetType\": \"Team\"\n \"fallthroughType\": \"AllMembers\"\n \"targetIdentifier\": 4524986223\n}\n```\n\n**Send a Slack notification**\n- `workspace` - The integration ID associated with the Slack workspace.\n- `channel` - The name of the channel to send the notification to (e.g., #critical, Jane Schmidt).\n- `channel_id` (optional) - The ID of the channel to send the notification to.\n- `tags` (optional) - A string of tags to show in the notification, separated by commas (e.g., \"environment, user, my_tag\").\n- `notes` (optional) - Text to show alongside the notification. To @ a user, include their user id like `@`. To include a clickable link, format the link and title like ``.\n```json\n{\n \"id\": \"sentry.integrations.slack.notify_action.SlackNotifyServiceAction\",\n \"workspace\": 293854098,\n \"channel\": \"#warning\",\n \"tags\": \"environment,level\"\n \"notes\": \"Please for triage information\"\n}\n```\n\n**Send a Microsoft Teams notification**\n- `team` - The integration ID associated with the Microsoft Teams team.\n- `channel` - The name of the channel to send the notification to.\n```json\n{\n \"id\": \"sentry.integrations.msteams.notify_action.MsTeamsNotifyServiceAction\",\n \"team\": 23465424,\n \"channel\": \"General\"\n}\n```\n\n**Send a Discord notification**\n- `server` - The integration ID associated with the Discord server.\n- `channel_id` - The ID of the channel to send the notification to.\n- `tags` (optional) - A string of tags to show in the notification, separated by commas (e.g., \"environment, user, my_tag\").\n```json\n{\n \"id\": \"sentry.integrations.discord.notify_action.DiscordNotifyServiceAction\",\n \"server\": 63408298,\n \"channel_id\": 94732897,\n \"tags\": \"browser,user\"\n}\n```\n\n**Create a Jira Ticket**\n- `integration` - The integration ID associated with Jira.\n- `project` - The ID of the Jira project.\n- `issuetype` - The ID of the type of issue that the ticket should be created as.\n- `dynamic_form_fields` - A list of any custom fields you want to include in the ticket as objects.\n```json\n{\n \"id\": \"sentry.integrations.jira.notify_action.JiraCreateTicketAction\",\n \"integration\": 321424,\n \"project\": \"349719\"\n \"issueType\": \"1\"\n}\n```\n\n**Create a Jira Server Ticket**\n- `integration` - The integration ID associated with Jira Server.\n- `project` - The ID of the Jira Server project.\n- `issuetype` - The ID of the type of issue that the ticket should be created as.\n- `dynamic_form_fields` - A list of any custom fields you want to include in the ticket as objects.\n```json\n{\n \"id\": \"sentry.integrations.jira_server.notify_action.JiraServerCreateTicketAction\",\n \"integration\": 321424,\n \"project\": \"349719\"\n \"issueType\": \"1\"\n}\n```\n\n**Create a GitHub Issue**\n- `integration` - The integration ID associated with GitHub.\n- `repo` - The name of the repository to create the issue in.\n- `title` - The title of the issue.\n- `body` (optional) - The contents of the issue.\n- `assignee` (optional) - The GitHub user to assign the issue to.\n- `labels` (optional) - A list of labels to assign to the issue.\n```json\n{\n \"id\": \"sentry.integrations.github.notify_action.GitHubCreateTicketAction\",\n \"integration\": 93749,\n \"repo\": default,\n \"title\": \"My Test Issue\",\n \"assignee\": \"Baxter the Hacker\",\n \"labels\": [\"bug\", \"p1\"]\n \"\"\n}\n```\n\n**Create a GitHub Enterprise Issue**\n- `integration` - The integration ID associated with GitHub Enterprise.\n- `repo` - The name of the repository to create the issue in.\n- `title` - The title of the issue.\n- `body` (optional) - The contents of the issue.\n- `assignee` (optional) - The GitHub user to assign the issue to.\n- `labels` (optional) - A list of labels to assign to the issue.\n```json\n{\n \"id\": \"sentry.integrations.github_enterprise.notify_action.GitHubEnterpriseCreateTicketAction\",\n \"integration\": 93749,\n \"repo\": default,\n \"title\": \"My Test Issue\",\n \"assignee\": \"Baxter the Hacker\",\n \"labels\": [\"bug\", \"p1\"]\n \"\"\n}\n```\n\n**Create an Azure DevOps work item**\n- `integration` - The integration ID.\n- `project` - The ID of the Azure DevOps project.\n- `work_item_type` - The type of work item to create.\n- `dynamic_form_fields` - A list of any custom fields you want to include in the work item as objects.\n```json\n{\n \"id\": \"sentry.integrations.vsts.notify_action.AzureDevopsCreateTicketAction\",\n \"integration\": 294838,\n \"project\": \"0389485\",\n \"work_item_type\": \"Microsoft.VSTS.WorkItemTypes.Task\",\n}\n```\n\n**Send a PagerDuty notification**\n- `account` - The integration ID associated with the PagerDuty account.\n- `service` - The ID of the service to send the notification to.\n- `severity` - The severity of the Pagerduty alert. This is optional, the default is `critical` for fatal issues, `error` for error issues, `warning` for warning issues, and `info` for info and debug issues.\n```json\n{\n \"id\": \"sentry.integrations.pagerduty.notify_action.PagerDutyNotifyServiceAction\",\n \"account\": 92385907,\n \"service\": 9823924,\n \"severity\": \"critical\"\n}\n```\n\n**Send an Opsgenie notification**\n- `account` - The integration ID associated with the Opsgenie account.\n- `team` - The ID of the Opsgenie team to send the notification to.\n- `priority` - The priority of the Opsgenie alert. This is optional, the default is `P3`.\n```json\n{\n \"id\": \"sentry.integrations.opsgenie.notify_action.OpsgenieNotifyTeamAction\",\n \"account\": 8723897589,\n \"team\": \"9438930258-fairy\",\n \"priority\": \"P1\"\n}\n```\n\n**Send a notification to a service**\n- `service` - The plugin slug.\n```json\n{\n \"id\": \"sentry.rules.actions.notify_event_service.NotifyEventServiceAction\",\n \"service\": \"mail\"\n}\n```\n\n**Send a notification to a Sentry app with a custom webhook payload**\n- `settings` - A list of objects denoting the settings each action will be created with. All required fields must be included.\n- `sentryAppInstallationUuid` - The ID for the Sentry app\n```json\n{\n \"id\": \"sentry.rules.actions.notify_event_sentry_app.NotifyEventSentryAppAction\",\n \"settings\": [\n {\"name\": \"title\", \"value\": \"Team Rocket\"},\n {\"name\": \"summary\", \"value\": \"We're blasting off again.\"},\n ],\n \"sentryAppInstallationUuid\": 643522\n \"hasSchemaFormConfig\": true\n}\n```\n\n**Send a notification (for all legacy integrations)**\n```json\n{\n \"id\": \"sentry.rules.actions.notify_event.NotifyEventAction\"\n}\n```\n"
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ },
+ "filterMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which filters need to be true before any actions take place. Required when a value is provided for `filters`.\n\n* `all` - All filters must evaluate to true.\n* `any` - At least one of the filters must evaluate to true.\n* `none` - All filters must evaluate to false."
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "\nA list of filters that determine if a rule fires after the necessary conditions have been met. See below for a list of possible filters.\n\n**The issue is `comparison_type` than `value` `time`**\n- `comparison_type` - One of `older` or `newer`\n- `value` - An integer\n- `time` - The unit of time. Valid values are `minute`, `hour`, `day`, and `week`.\n```json\n{\n \"id\": \"sentry.rules.filters.age_comparison.AgeComparisonFilter\",\n \"comparison_type\": \"older\",\n \"value\": 3,\n \"time\": \"week\"\n}\n```\n\n**The issue has happened at least `value` times**\n- `value` - An integer\n```json\n{\n \"id\": \"sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter\",\n \"value\": 120\n}\n```\n\n**The issue is assigned to No One**\n```json\n{\n \"id\": \"sentry.rules.filters.assigned_to.AssignedToFilter\",\n \"targetType\": \"Unassigned\"\n}\n```\n\n**The issue is assigned to `targetType`**\n- `targetType` - One of `Team` or `Member`\n- `targetIdentifier` - The target's ID\n```json\n{\n \"id\": \"sentry.rules.filters.assigned_to.AssignedToFilter\",\n \"targetType\": \"Member\",\n \"targetIdentifier\": 895329789\n}\n```\n\n**The event is from the latest release**\n```json\n{\n \"id\": \"sentry.rules.filters.latest_release.LatestReleaseFilter\"\n}\n```\n\n**The issue's category is equal to `value`**\n- `value` - An integer correlated with a category. Valid values are `1` (Error), `2` (Performance), `3` (Profile), `4` (Cron), and `5` (Replay).\n```json\n{\n \"id\": \"sentry.rules.filters.issue_category.IssueCategoryFilter\",\n \"value\": 2\n}\n```\n\n**The event's `attribute` value `match` `value`**\n- `attribute` - Valid values are `message`, `platform`, `environment`, `type`, `error.handled`, `error.unhandled`, `error.main_thread`, `exception.type`, `exception.value`, `user.id`, `user.email`, `user.username`, `user.ip_address`, `http.method`, `http.url`, `http.status_code`, `sdk.name`, `stacktrace.code`, `stacktrace.module`, `stacktrace.filename`, `stacktrace.abs_path`, `stacktrace.package`, `unreal.crash_type`, `app.in_foreground`.\n- `match` - The comparison operator. Valid values are `eq` (equals), `ne` (does not equal), `sw` (starts with), `ew` (ends with), `co` (contains), `nc` (does not contain), `is` (is set), and `ns` (is not set).\n- `value` - A string. Not required when `match` is `is` or `ns`.\n```json\n{\n \"id\": \"sentry.rules.conditions.event_attribute.EventAttributeCondition\",\n \"attribute\": \"http.url\",\n \"match\": \"nc\",\n \"value\": \"localhost\"\n}\n```\n\n**The event's tags match `key` `match` `value`**\n- `key` - The tag\n- `match` - The comparison operator. Valid values are `eq` (equals), `ne` (does not equal), `sw` (starts with), `ew` (ends with), `co` (contains), `nc` (does not contain), `is` (is set), and `ns` (is not set).\n- `value` - A string. Not required when `match` is `is` or `ns`.\n```json\n{\n \"id\": \"sentry.rules.filters.tagged_event.TaggedEventFilter\",\n \"key\": \"level\",\n \"match\": \"eq\"\n \"value\": \"error\"\n}\n```\n\n**The event's level is `match` `level`**\n- `match` - Valid values are `eq`, `gte`, and `lte`.\n- `level` - Valid values are `50` (fatal), `40` (error), `30` (warning), `20` (info), `10` (debug), `0` (sample).\n```json\n{\n \"id\": \"sentry.rules.filters.level.LevelFilter\",\n \"match\": \"gte\"\n \"level\": \"50\"\n}\n```\n"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "frequency",
+ "name"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "project:admin",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "201": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ },
+ "examples": {
+ "IssueAlertSuccessfullyCreated": {
+ "value": {
+ "id": "1",
+ "conditions": [
+ {
+ "id": "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
+ }
+ ],
+ "filters": [
+ {
+ "targetType": "Unassigned",
+ "id": "sentry.rules.filters.assigned_to.AssignedToFilter",
+ "targetIdentifier": ""
+ }
+ ],
+ "actions": [
+ {
+ "targetType": "Member",
+ "fallthroughType": "ActiveMembers",
+ "id": "sentry.mail.actions.NotifyEmailAction",
+ "targetIdentifier": 1523125
+ }
+ ],
+ "actionMatch": "any",
+ "filterMatch": "all",
+ "frequency": 1440,
+ "name": "Owner Alert",
+ "dateCreated": "2023-09-08T20:00:07.244602Z",
+ "owner": "team:74234",
+ "createdBy": {
+ "id": 24601,
+ "name": "Jean Valjean",
+ "email": "jean@example.com"
+ },
+ "environment": null,
+ "projects": [
+ "python"
+ ],
+ "status": "active",
+ "snooze": false
+ },
+ "summary": "Issue alert successfully created"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ },
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/": {
+ "get": {
+ "operationId": "(DEPRECATED) Retrieve an Issue Alert Rule for a Project",
+ "description": "## Deprecated\n🚧 Use [Fetch an Alert](/api/monitors/fetch-an-alert) instead.\n\n\nReturn details on an individual issue alert rule.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers - specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters - help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions - specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "alerts:write",
+ "project:admin",
+ "project:read",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ },
+ "examples": {
+ "GetDetailedViewAboutAnIssueAlertRule": {
+ "value": {
+ "id": "7",
+ "conditions": [
+ {
+ "id": "sentry.rules.conditions.regression_event.RegressionEventCondition"
+ }
+ ],
+ "filters": [
+ {
+ "id": "sentry.rules.filters.age_comparison.AgeComparisonFilter",
+ "comparison_type": "older",
+ "value": 4,
+ "time": "week"
+ },
+ {
+ "id": "sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter",
+ "value": 1000
+ }
+ ],
+ "actions": [
+ {
+ "id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
+ "workspace": 976462356,
+ "channel": "#fatal",
+ "tags": "browser,release"
+ }
+ ],
+ "actionMatch": "all",
+ "filterMatch": "all",
+ "frequency": 60,
+ "name": "Many Old Regressions!",
+ "dateCreated": "2023-02-17T18:31:14.246012Z",
+ "owner": "user:635623",
+ "createdBy": {
+ "id": 635623,
+ "name": "John Doe",
+ "email": "john.doe@email.com"
+ },
+ "environment": null,
+ "projects": [
+ "javascript"
+ ],
+ "status": "active",
+ "snooze": false
+ },
+ "summary": "Get detailed view about an issue alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "put": {
+ "operationId": "(DEPRECATED) Update an Issue Alert Rule",
+ "description": "## Deprecated\n🚧 Use [Update an Alert by ID](/api/monitors/update-an-alert-by-id) instead.\n\n\nUpdates an issue alert rule.\n> Warning: Calling this endpoint fully overwrites the specified issue alert.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers - specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters - help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions - specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule.",
+ "maxLength": 256
+ },
+ "actionMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which of the conditions need to be true before any filters are evaluated.\n\n* `all` - All conditions must evaluate to true.\n* `any` - At least one of the conditions must evaluate to true.\n* `none` - All conditions must evaluate to false."
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "A list of triggers that determine when the rule fires. See [Create an Issue Alert Rule](/api/alerts/create-an-issue-alert-rule-for-a-project) for valid conditions."
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "A list of actions that take place when all required conditions and filters for the rule are met. See [Create an Issue Alert Rule](/api/alerts/create-an-issue-alert-rule-for-a-project) for valid actions."
+ },
+ "frequency": {
+ "type": "integer",
+ "maximum": 43200,
+ "minimum": 5,
+ "description": "How often to perform the actions once for an issue, in minutes. The valid range is `5` to `43200`."
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by."
+ },
+ "filterMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which filters need to be true before any actions take place.\n\n* `all` - All filters must evaluate to true.\n* `any` - At least one of the filters must evaluate to true.\n* `none` - All filters must evaluate to false."
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "A list of filters that determine if a rule fires after the necessary conditions have been met. See [Create an Issue Alert Rule](/api/alerts/create-an-issue-alert-rule-for-a-project) for valid filters."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "frequency",
+ "name"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "project:admin",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ },
+ "examples": {
+ "GetDetailedViewAboutAnIssueAlertRule": {
+ "value": {
+ "id": "7",
+ "conditions": [
+ {
+ "id": "sentry.rules.conditions.regression_event.RegressionEventCondition"
+ }
+ ],
+ "filters": [
+ {
+ "id": "sentry.rules.filters.age_comparison.AgeComparisonFilter",
+ "comparison_type": "older",
+ "value": 4,
+ "time": "week"
+ },
+ {
+ "id": "sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter",
+ "value": 1000
+ },
+ {
+ "id": "sentry.rules.filters.level.LevelFilter",
+ "match": "gte",
+ "level": "40"
+ }
+ ],
+ "actions": [
+ {
+ "id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
+ "workspace": 976462356,
+ "channel": "#fatal",
+ "tags": "browser,release"
+ }
+ ],
+ "actionMatch": "all",
+ "filterMatch": "all",
+ "frequency": 60,
+ "name": "Many Old Regressions!",
+ "dateCreated": "2023-02-17T18:31:14.246012Z",
+ "owner": "user:635623",
+ "createdBy": {
+ "id": 635623,
+ "name": "John Doe",
+ "email": "john.doe@email.com"
+ },
+ "environment": null,
+ "projects": [
+ "javascript"
+ ],
+ "status": "active",
+ "snooze": false
+ },
+ "summary": "Get detailed view about an issue alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "(DEPRECATED) Delete an Issue Alert Rule",
+ "description": "## Deprecated\n 🚧 Use [Delete an Alert](/api/monitors/delete-an-alert) instead.\n\n\n Delete a specific issue alert rule.\n\n An issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n - Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\n - Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\n - Actions: specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "project:admin",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "202": {
+ "description": "Accepted"
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-1ef7f21a.json b/plugins/openapi/testdata/sentry-1ef7f21a.json
new file mode 100644
index 0000000..575ec6b
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-1ef7f21a.json
@@ -0,0 +1,348 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/organizations/{organization_id_or_slug}/trace-items/attributes/": {
+ "get": {
+ "operationId": "listOrganizationTraceItemAttributes",
+ "description": "List the attribute keys available on a given trace item dataset (spans, logs,\ntrace metrics, etc.), with optional substring and structured filtering.\n\nPass `expand=context` (experimental) to include each attribute's metadata:\na brief description, examples, and deprecation details.",
+ "summary": "List Trace Item Attributes",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "statsPeriod",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The period of time for the query, will override the start & end parameters, a number followed by one of:\n- `d` for days\n- `h` for hours\n- `m` for minutes\n- `s` for seconds\n- `w` for weeks\n\nFor example, `24h`, to mean query data starting from 24 hours ago to now."
+ },
+ {
+ "in": "query",
+ "name": "start",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The start of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`."
+ },
+ {
+ "in": "query",
+ "name": "end",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The end of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`."
+ },
+ {
+ "in": "query",
+ "name": "environment",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": "The name of environments to filter by."
+ },
+ {
+ "in": "query",
+ "name": "project",
+ "schema": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
+ "description": "The IDs or slugs of projects to filter by. Project slugs are unique within each organization. Omit this parameter to include all accessible projects. `-1` is also accepted to include all accessible projects.\nFor example, the following are valid parameters:\n- `/?project=1234&project=56789`\n- `/?project=android&project=javascript-react`\n- `/?project=-1`\n"
+ },
+ {
+ "in": "query",
+ "name": "dataset",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "logs",
+ "preprod",
+ "processing_errors",
+ "spans",
+ "tracemetrics"
+ ]
+ },
+ "description": "The trace item dataset to list attributes for. One of `itemType` or `dataset` is required."
+ },
+ {
+ "in": "query",
+ "name": "itemType",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "logs",
+ "preprod",
+ "processing_errors",
+ "spans",
+ "tracemetrics"
+ ]
+ },
+ "description": "Deprecated alias of `dataset`. Use `dataset` instead.",
+ "deprecated": true
+ },
+ {
+ "in": "query",
+ "name": "attributeType",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "array",
+ "boolean",
+ "number",
+ "string"
+ ]
+ }
+ },
+ "description": "Filter to attributes of one or more types. Defaults to all types."
+ },
+ {
+ "in": "query",
+ "name": "substringMatch",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Restrict results to attribute names containing this substring (case-sensitive)."
+ },
+ {
+ "in": "query",
+ "name": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Sentry [search syntax](https://docs.sentry.io/concepts/search/) to filter trace items before computing attributes."
+ },
+ {
+ "in": "query",
+ "name": "expand",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "context"
+ ]
+ }
+ },
+ "description": "**Experimental:** This parameter is under active development and may change.\n\nOptional fields to expand. Pass `context` to include attribute metadata (brief, examples, deprecation, etc.).",
+ "x-sentry-experimental": true
+ },
+ {
+ "in": "query",
+ "name": "cursor",
+ "schema": {
+ "type": "string",
+ "minLength": 1
+ },
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/"
+ }
+ ],
+ "tags": [
+ "Discover"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "secondaryAliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attributeSource": {
+ "type": "object",
+ "properties": {
+ "source_type": {
+ "enum": [
+ "sentry",
+ "user"
+ ],
+ "type": "string"
+ },
+ "is_transformed_alias": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "source_type"
+ ]
+ },
+ "attributeType": {
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "array"
+ ],
+ "type": "string"
+ },
+ "context": {
+ "type": "object",
+ "description": "Additional, mostly-static metadata about an attribute.\n\nWhen ``expand=context`` is requested, context is attached to every attribute.\nMetadata comes from the sentry conventions, Sentry's own column definitions,\nor user-authored context (gated behind ``data-browsing-attribute-context``),\nin that precedence order. Only the fields available are included, so an\nattribute with no metadata gets an empty context.",
+ "properties": {
+ "isConvention": {
+ "type": "boolean"
+ },
+ "isCustom": {
+ "type": "boolean"
+ },
+ "brief": {
+ "type": "string"
+ },
+ "isDeprecated": {
+ "type": "boolean"
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "examples": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "integer"
+ },
+ {
+ "type": "number",
+ "format": "double"
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ }
+ },
+ "replacementAttribute": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "required": [
+ "attributeSource",
+ "attributeType",
+ "key",
+ "name"
+ ]
+ }
+ },
+ "examples": {
+ "ReturnAListOfTraceItemAttributeKeys": {
+ "value": [
+ {
+ "key": "device.class",
+ "name": "device.class",
+ "attributeSource": {
+ "source_type": "sentry"
+ },
+ "attributeType": "string"
+ },
+ {
+ "key": "tags[Batch Size,number]",
+ "name": "Batch Size",
+ "attributeSource": {
+ "source_type": "user"
+ },
+ "attributeType": "number"
+ }
+ ],
+ "summary": "Return a list of trace item attribute keys"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-2.0.1.json b/plugins/openapi/testdata/sentry-2.0.1.json
new file mode 100644
index 0000000..f5eaba9
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-2.0.1.json
@@ -0,0 +1,1748 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/": {
+ "get": {
+ "operationId": "retrieveApiIndex",
+ "description": "Return the API version, the scopes of the token that authenticated the request,\nand the authenticated user. Use it to check which scopes a token has.\n\nAuthentication is optional. `auth` is null unless the request uses a token or API\nkey. `user` is null for anonymous requests and for credentials that don't belong\nto a user, such as API keys and organization auth tokens.",
+ "summary": "Retrieve the Current Credentials",
+ "tags": [
+ "Users"
+ ],
+ "security": [
+ {
+ "auth_token": []
+ },
+ {}
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "description": "API version. Always \"0\""
+ },
+ "auth": {
+ "type": "object",
+ "properties": {
+ "scopes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Scopes stored on the token or API key that authenticated the request"
+ }
+ },
+ "required": [
+ "scopes"
+ ],
+ "nullable": true,
+ "description": "The credentials that authenticated the request, or null for session and anonymous requests"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "identities": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "SSO identity ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "User's identifier at the auth provider"
+ },
+ "organization": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string",
+ "description": "Organization slug"
+ },
+ "name": {
+ "type": "string",
+ "description": "Organization name"
+ }
+ },
+ "required": [
+ "name",
+ "slug"
+ ],
+ "description": "Organization the auth provider belongs to"
+ },
+ "provider": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Auth provider key, such as google or saml2"
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name of the auth provider"
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "description": "Auth provider of the identity"
+ },
+ "dateVerified": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the identity was last verified by signing in through the auth provider"
+ },
+ "dateSynced": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the identity was last synced from the auth provider"
+ }
+ },
+ "required": [
+ "dateSynced",
+ "dateVerified",
+ "id",
+ "name",
+ "organization",
+ "provider"
+ ]
+ },
+ "description": "SSO identities of the user. Only included for the requesting user, unless the request has active superuser or staff access"
+ },
+ "avatar": {
+ "type": "object",
+ "properties": {
+ "avatarType": {
+ "enum": [
+ "letter_avatar",
+ "upload",
+ "gravatar"
+ ],
+ "type": "string",
+ "description": "Avatar type"
+ },
+ "avatarUuid": {
+ "type": "string",
+ "pattern": "^[0-9a-f]{32}$",
+ "nullable": true,
+ "description": "ID of the uploaded avatar image, or null"
+ },
+ "avatarUrl": {
+ "type": "string",
+ "nullable": true,
+ "description": "URL of the avatar image, or null if none is set"
+ }
+ },
+ "description": "User avatar"
+ },
+ "authenticators": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Authenticator ID"
+ },
+ "type": {
+ "type": "string",
+ "description": "Authenticator type, such as totp, sms, u2f or recovery"
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name of the authenticator type"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the authenticator was added"
+ },
+ "dateUsed": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the authenticator was last used, or null"
+ }
+ },
+ "required": [
+ "dateCreated",
+ "dateUsed",
+ "id",
+ "name",
+ "type"
+ ]
+ },
+ "description": "Two-factor authenticators of the user, without backup methods such as recovery codes"
+ },
+ "canReset2fa": {
+ "type": "boolean",
+ "description": "Whether the organization can reset the user's two-factor authentication. True only if the user is a member of exactly one active organization"
+ },
+ "id": {
+ "type": "string",
+ "pattern": "^[0-9]+$",
+ "description": "User ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name: the user's name, or their email or username if no name is set"
+ },
+ "username": {
+ "type": "string",
+ "description": "Username"
+ },
+ "email": {
+ "type": "string",
+ "description": "Primary email address"
+ },
+ "avatarUrl": {
+ "type": "string",
+ "description": "Gravatar URL for the primary email address"
+ },
+ "isActive": {
+ "type": "boolean",
+ "description": "Whether the account is active"
+ },
+ "isSuspended": {
+ "type": "boolean",
+ "description": "Whether the account is suspended. Suspended users can't sign in"
+ },
+ "hasPasswordAuth": {
+ "type": "boolean",
+ "description": "Whether the user has a password set"
+ },
+ "isManaged": {
+ "type": "boolean",
+ "description": "Whether the account is managed, which stops the user from changing their username, password and similar details"
+ },
+ "dateJoined": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the account was created"
+ },
+ "lastLogin": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the user last signed in, or null"
+ },
+ "has2fa": {
+ "type": "boolean",
+ "description": "Whether the user has two-factor authentication enabled"
+ },
+ "lastActive": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the user was last active, or null"
+ },
+ "isSuperuser": {
+ "type": "boolean",
+ "description": "Whether the user is a superuser"
+ },
+ "isStaff": {
+ "type": "boolean",
+ "description": "Whether the user has staff status"
+ },
+ "experiments": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Deprecated. Always an empty object"
+ },
+ "emails": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Email ID"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email address"
+ },
+ "is_verified": {
+ "type": "boolean",
+ "description": "Whether the email address is verified"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "is_verified"
+ ]
+ },
+ "description": "Email addresses of the user. Only included for the requesting user or superusers; empty otherwise"
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "theme": {
+ "type": "string",
+ "description": "UI theme: \"light\", \"dark\" or \"system\". Defaults to \"system\""
+ },
+ "language": {
+ "type": "string",
+ "description": "UI language code, such as `en`"
+ },
+ "stacktraceOrder": {
+ "enum": [
+ -1,
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "description": "Stack trace frame order: -1 for the default (most recent first), 1 for most recent last, 2 for most recent first"
+ },
+ "defaultIssueEvent": {
+ "type": "string",
+ "description": "Event shown by default on issue details: \"recommended\", \"latest\" or \"oldest\""
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Time zone for displayed dates, such as `UTC`"
+ },
+ "clock24Hours": {
+ "type": "boolean",
+ "description": "Whether times are shown in 24-hour format"
+ },
+ "prefersIssueDetailsStreamlinedUI": {
+ "type": "boolean",
+ "nullable": true,
+ "description": "Whether the user prefers the streamlined issue details UI, or null if they haven't chosen"
+ }
+ },
+ "required": [
+ "clock24Hours",
+ "defaultIssueEvent",
+ "language",
+ "prefersIssueDetailsStreamlinedUI",
+ "stacktraceOrder",
+ "theme",
+ "timezone"
+ ],
+ "description": "Preferences of the user"
+ },
+ "flags": {
+ "type": "object",
+ "properties": {
+ "newsletter_consent_prompt": {
+ "type": "boolean",
+ "description": "Whether to ask the user for newsletter consent"
+ }
+ },
+ "required": [
+ "newsletter_consent_prompt"
+ ],
+ "description": "Account flags of the user"
+ }
+ },
+ "required": [
+ "avatarUrl",
+ "dateJoined",
+ "email",
+ "emails",
+ "experiments",
+ "flags",
+ "has2fa",
+ "hasPasswordAuth",
+ "id",
+ "isActive",
+ "isManaged",
+ "isStaff",
+ "isSuperuser",
+ "isSuspended",
+ "lastActive",
+ "lastLogin",
+ "name",
+ "options",
+ "username"
+ ],
+ "nullable": true,
+ "description": "The authenticated user, or null for anonymous requests and requests made with an API key or organization auth token"
+ }
+ },
+ "required": [
+ "auth",
+ "user",
+ "version"
+ ]
+ },
+ "examples": {
+ "RetrieveTheCurrentCredentials": {
+ "value": {
+ "version": "0",
+ "auth": {
+ "scopes": [
+ "org:read",
+ "project:read"
+ ]
+ },
+ "user": {
+ "id": "1",
+ "name": "Jane Bloggs",
+ "username": "jane@example.com",
+ "email": "jane@example.com",
+ "avatarUrl": "https://gravatar.com/avatar/1d4e7f2c9b3a?s=32&d=mm",
+ "isActive": true,
+ "isSuspended": false,
+ "hasPasswordAuth": true,
+ "isManaged": false,
+ "dateJoined": "2023-03-01T18:12:42.000000Z",
+ "lastLogin": "2026-11-02T09:31:05.000000Z",
+ "has2fa": true,
+ "lastActive": "2026-11-07T15:20:11.000000Z",
+ "isSuperuser": false,
+ "isStaff": false,
+ "emails": [
+ {
+ "id": "1",
+ "email": "jane@example.com",
+ "is_verified": true
+ }
+ ],
+ "experiments": {},
+ "options": {
+ "theme": "system",
+ "language": "en",
+ "stacktraceOrder": -1,
+ "defaultIssueEvent": "recommended",
+ "timezone": "UTC",
+ "clock24Hours": false,
+ "prefersIssueDetailsStreamlinedUI": null
+ },
+ "flags": {
+ "newsletter_consent_prompt": false
+ },
+ "avatar": {
+ "avatarType": "letter_avatar",
+ "avatarUuid": null,
+ "avatarUrl": null
+ },
+ "identities": []
+ }
+ },
+ "summary": "Retrieve the current credentials"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "429": {
+ "description": "Too Many Requests"
+ }
+ },
+ "x-sentry-routing": {
+ "silo": "control"
+ }
+ }
+ },
+ "/api/0/organizations/": {
+ "get": {
+ "operationId": "listOrganizations",
+ "description": "Return a list of organizations available to the authenticated session in a region.\nThis is particularly useful for requests with a user bound context. For API key-based requests this will only return the organization that belongs to the key.",
+ "summary": "List Your Organizations",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "owner",
+ "schema": {
+ "type": "boolean"
+ },
+ "description": "Specify `true` to restrict results to organizations in which you are an owner."
+ },
+ {
+ "in": "query",
+ "name": "cursor",
+ "schema": {
+ "type": "string",
+ "minLength": 1
+ },
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/"
+ },
+ {
+ "in": "query",
+ "name": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Filters results by using [query syntax](/product/sentry-basics/search/).\n\nValid query fields include:\n- `id`: The organization ID\n- `slug`: The organization slug\n- `status`: The organization's current status (one of `active`, `pending_deletion`, or `deletion_in_progress`)\n- `email` or `member_id`: Filter your organizations by the emails or [organization member IDs](/api/organizations/list-an-organizations-members/) of specific members included\n- `query`: Filter your organizations by name, slug, and members that contain this substring\n\nExample: `query=(slug:foo AND status:active) OR (email:[thing-one@example.com,thing-two@example.com] AND query:bar)`\n"
+ },
+ {
+ "in": "query",
+ "name": "sortBy",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The field to sort results by, in descending order. If not specified the results are sorted by the date they were created.\n\nValid fields include:\n- `members`: By number of members\n- `events`: By number of events in the past 24 hours\n"
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "Limit the number of rows to return in the result. Default and maximum allowed is 100."
+ }
+ ],
+ "tags": [
+ "Users"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "features": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Features enabled for the organization"
+ },
+ "extraOptions": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "Server-wide options that the Sentry UI reads"
+ },
+ "access": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Scopes the requesting user has in the organization"
+ },
+ "onboardingTasks": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "nullable": true,
+ "description": "Onboarding task key, such as create_project"
+ },
+ "status": {
+ "type": "string",
+ "description": "Task status: complete or skipped"
+ },
+ "completionSeen": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the task's completion was marked as seen, or null"
+ },
+ "dateCompleted": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the task was completed or skipped"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "invited_member_id": {
+ "type": "integer",
+ "description": "ID of the member whose invite completed the invite_member task"
+ },
+ "platform": {
+ "type": "string",
+ "nullable": true,
+ "description": "Platform of the first event, for the first_event task"
+ },
+ "plugin": {
+ "type": "string",
+ "description": "Slug of the plugin enabled for the task"
+ },
+ "providers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Integration providers installed for the integrations task"
+ }
+ },
+ "description": "Data recorded for the task. Most tasks record none, so it's often empty"
+ }
+ },
+ "required": [
+ "completionSeen",
+ "data",
+ "dateCompleted",
+ "status",
+ "task"
+ ]
+ },
+ "description": "Onboarding tasks the organization has completed or skipped"
+ },
+ "id": {
+ "type": "string",
+ "pattern": "^[0-9]+$",
+ "description": "Organization ID"
+ },
+ "slug": {
+ "type": "string",
+ "pattern": "^[-a-zA-Z0-9_]+$",
+ "description": "Organization slug"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Status ID: active, pending_deletion, deletion_in_progress or relocation_pending_approval"
+ },
+ "name": {
+ "type": "string",
+ "description": "Status label, such as active or pending deletion"
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "description": "Organization status"
+ },
+ "name": {
+ "type": "string",
+ "description": "Organization name, or its slug when it has no name"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the organization was created (ISO 8601)"
+ },
+ "isEarlyAdopter": {
+ "type": "boolean",
+ "description": "Whether the organization is an early adopter"
+ },
+ "require2FA": {
+ "type": "boolean",
+ "description": "Whether members must use two-factor authentication"
+ },
+ "avatar": {
+ "type": "object",
+ "properties": {
+ "avatarType": {
+ "enum": [
+ "letter_avatar",
+ "upload",
+ "gravatar"
+ ],
+ "type": "string",
+ "description": "Avatar type"
+ },
+ "avatarUuid": {
+ "type": "string",
+ "pattern": "^[0-9a-f]{32}$",
+ "nullable": true,
+ "description": "ID of the uploaded avatar image, or null"
+ },
+ "avatarUrl": {
+ "type": "string",
+ "nullable": true,
+ "description": "URL of the avatar image, or null if none is set"
+ }
+ },
+ "description": "Organization avatar"
+ },
+ "links": {
+ "type": "object",
+ "properties": {
+ "organizationUrl": {
+ "type": "string",
+ "description": "Base URL of the organization"
+ },
+ "regionUrl": {
+ "type": "string",
+ "description": "Base URL of the API for the organization's region"
+ }
+ },
+ "required": [
+ "organizationUrl",
+ "regionUrl"
+ ],
+ "description": "Organization and region URLs"
+ },
+ "hasAuthProvider": {
+ "type": "boolean",
+ "description": "Whether SSO is configured for the organization"
+ },
+ "allowMemberInvite": {
+ "type": "boolean",
+ "description": "Whether members can invite other members"
+ },
+ "allowMemberProjectCreation": {
+ "type": "boolean",
+ "description": "Whether members can create projects"
+ },
+ "allowSuperuserAccess": {
+ "type": "boolean",
+ "description": "Whether Sentry superusers can access the organization"
+ }
+ },
+ "required": [
+ "allowMemberInvite",
+ "allowMemberProjectCreation",
+ "allowSuperuserAccess",
+ "avatar",
+ "dateCreated",
+ "hasAuthProvider",
+ "id",
+ "isEarlyAdopter",
+ "links",
+ "name",
+ "require2FA",
+ "slug",
+ "status"
+ ]
+ }
+ },
+ "examples": {
+ "ListYourOrganizations": {
+ "value": [
+ {
+ "avatar": {
+ "avatarType": "letter_avatar",
+ "avatarUuid": null
+ },
+ "dateCreated": "2018-11-06T21:19:55.101Z",
+ "features": [
+ "session-replay-video",
+ "onboarding",
+ "advanced-search",
+ "monitor-seat-billing",
+ "issue-platform"
+ ],
+ "hasAuthProvider": false,
+ "id": "2",
+ "isEarlyAdopter": false,
+ "allowMemberInvite": true,
+ "allowMemberProjectCreation": true,
+ "allowSuperuserAccess": false,
+ "links": {
+ "organizationUrl": "https://the-interstellar-jurisdiction.sentry.io",
+ "regionUrl": "https://us.sentry.io"
+ },
+ "name": "The Interstellar Jurisdiction",
+ "require2FA": false,
+ "slug": "the-interstellar-jurisdiction",
+ "status": {
+ "id": "active",
+ "name": "active"
+ }
+ }
+ ],
+ "summary": "List your organizations"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ },
+ "x-sentry-routing": {
+ "silo": "both"
+ }
+ }
+ },
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/": {
+ "get": {
+ "tags": [
+ "Events"
+ ],
+ "description": "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint](/api/events/list-an-organizations-issues/) which\nsupports filtering on project and additional functionality.\n\nReturn a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \n\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\n\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\"\"`` (disable),``\"24h\"`` (default), ``\"14d\"``\n\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.",
+ "operationId": "List a Project's Issues",
+ "deprecated": true,
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "statsPeriod",
+ "in": "query",
+ "description": "An optional stat period (can be one of `\"24h\"`, `\"14d\"`, and `\"\"`), defaults to \"24h\" if not provided.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "shortIdLookup",
+ "in": "query",
+ "description": "If this is set to `1` then short IDs are looked up by this function as well. This can cause the return value of the function to return an event issue of a different project which is why this is an opt-in.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ]
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query. If not provided an implied `\"is:unresolved\"` is assumed.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "hashes",
+ "in": "query",
+ "description": "A list of hashes of groups to return. Is not compatible with 'query' parameter. The maximum number of hashes that can be sent is 100. If more are sent, only the first 100 will be used.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "sort",
+ "in": "query",
+ "description": "The sort order of the issues. Options include 'Last Seen' (`date`), 'First Seen' (`new`), 'Trends' (`trends`), 'Events' (`freq`), 'Users' (`user`), and 'Recommended' (`recommended`).",
+ "schema": {
+ "type": "string",
+ "default": "date",
+ "enum": [
+ "date",
+ "new",
+ "trends",
+ "freq",
+ "user",
+ "recommended"
+ ]
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "The maximum number of issues to return. The maximum is 100.",
+ "schema": {
+ "type": "integer",
+ "default": 100
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "lastSeen",
+ "numComments",
+ "userCount",
+ "culprit",
+ "title",
+ "id",
+ "assignedTo",
+ "logger",
+ "stats",
+ "type",
+ "annotations",
+ "metadata",
+ "status",
+ "subscriptionDetails",
+ "isPublic",
+ "hasSeen",
+ "shortId",
+ "shareId",
+ "firstSeen",
+ "count",
+ "permalink",
+ "level",
+ "isSubscribed",
+ "isBookmarked",
+ "project",
+ "statusDetails"
+ ],
+ "properties": {
+ "annotations": {
+ "type": "array",
+ "description": "Annotations on the issue, such as links to external issues.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "assignedTo": {
+ "type": "object",
+ "description": "The user or team the issue is assigned to. Null when the issue is unassigned.",
+ "nullable": true,
+ "required": [
+ "type",
+ "id",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "user",
+ "team"
+ ],
+ "description": "Whether the assignee is a user or a team."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the user or team."
+ },
+ "name": {
+ "type": "string",
+ "description": "The display name of the user, or the slug of the team."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the user. Only set for users."
+ }
+ }
+ },
+ "count": {
+ "type": "string",
+ "description": "The total number of events in the issue."
+ },
+ "culprit": {
+ "type": "string",
+ "description": "The function or module where the issue occurs."
+ },
+ "firstSeen": {
+ "type": "string",
+ "description": "When the issue was first seen (ISO 8601)."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "Whether the requesting user has seen the issue since it last occurred."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the issue."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "Whether the requesting user bookmarked the issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Whether the issue is shared publicly."
+ },
+ "isSubscribed": {
+ "type": "boolean",
+ "description": "Whether the requesting user is subscribed to the issue."
+ },
+ "lastSeen": {
+ "type": "string",
+ "description": "When the issue was last seen (ISO 8601)."
+ },
+ "level": {
+ "type": "string",
+ "description": "The severity level of the issue, such as `error` or `warning`."
+ },
+ "logger": {
+ "type": "string",
+ "description": "The logger of the issue's events.",
+ "nullable": true
+ },
+ "metadata": {
+ "description": "Metadata of the issue. Its keys depend on the issue type.",
+ "oneOf": [
+ {
+ "type": "object",
+ "required": [
+ "filename",
+ "type",
+ "value"
+ ],
+ "properties": {
+ "filename": {
+ "type": "string",
+ "description": "The file where the error was raised."
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of the error."
+ },
+ "value": {
+ "type": "string",
+ "description": "The error message."
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "title"
+ ],
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the issue."
+ }
+ }
+ }
+ ]
+ },
+ "numComments": {
+ "type": "integer",
+ "description": "The number of comments on the issue."
+ },
+ "permalink": {
+ "type": "string",
+ "description": "The URL of the issue in Sentry."
+ },
+ "project": {
+ "type": "object",
+ "description": "The project the issue belongs to.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the project."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the project."
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the project."
+ }
+ }
+ },
+ "shareId": {
+ "type": "string",
+ "description": "The ID used in the issue's public share URL. Null when the issue isn't shared.",
+ "nullable": true
+ },
+ "shortId": {
+ "type": "string",
+ "description": "The short ID of the issue, such as `PROJECT-1A`."
+ },
+ "stats": {
+ "type": "object",
+ "description": "Event counts for the issue over time.",
+ "properties": {
+ "24h": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "description": "Hourly event counts for the last 24 hours, as [timestamp, count] pairs."
+ }
+ }
+ },
+ "status": {
+ "type": "string",
+ "description": "The status of the issue.",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object",
+ "description": "Details of the issue's status, such as when an ignore expires or which release resolves it. Empty when the status has no details.",
+ "properties": {
+ "ignoreCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional events after which the issue stops being ignored."
+ },
+ "ignoreUntil": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the issue stops being ignored."
+ },
+ "ignoreUserCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional affected users after which the issue stops being ignored."
+ },
+ "ignoreUserWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreUserCount."
+ },
+ "ignoreWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreCount."
+ },
+ "actor": {
+ "type": "object",
+ "nullable": true,
+ "description": "User who ignored or resolved the issue.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "ID of the user."
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the user."
+ },
+ "username": {
+ "type": "string",
+ "description": "Username of the user."
+ },
+ "email": {
+ "type": "string",
+ "description": "Email address of the user."
+ }
+ }
+ },
+ "inNextRelease": {
+ "type": "boolean",
+ "description": "Whether the issue is resolved in the next release."
+ },
+ "inRelease": {
+ "type": "string",
+ "description": "Version of the release the issue is resolved in."
+ },
+ "inCommit": {
+ "type": "string",
+ "description": "Commit the issue is resolved in."
+ },
+ "pendingEvents": {
+ "type": "integer",
+ "description": "Number of events still waiting to be reprocessed."
+ },
+ "info": {
+ "type": "object",
+ "nullable": true,
+ "description": "Reprocessing progress details.",
+ "required": [
+ "dateCreated",
+ "syncCount",
+ "totalEvents"
+ ],
+ "properties": {
+ "dateCreated": {
+ "type": "string",
+ "description": "When reprocessing started (ISO 8601)."
+ },
+ "syncCount": {
+ "type": "integer",
+ "description": "Number of events in the issue when reprocessing started."
+ },
+ "totalEvents": {
+ "type": "integer",
+ "description": "Number of events to reprocess, at most the requested maximum."
+ }
+ }
+ }
+ }
+ },
+ "subscriptionDetails": {
+ "type": "object",
+ "description": "Why the requesting user is subscribed to the issue. Null when there's no subscription.",
+ "nullable": true,
+ "properties": {
+ "disabled": {
+ "type": "boolean",
+ "description": "Whether the requesting user turned off notifications for the issue."
+ },
+ "reason": {
+ "type": "string",
+ "description": "Why the requesting user is subscribed, such as `commented`, `assigned`, `bookmarked`, `changed_status`, `mentioned` or `unknown`."
+ }
+ }
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the issue."
+ },
+ "type": {
+ "type": "string",
+ "description": "The event type of the issue, such as `error` or `default`."
+ },
+ "userCount": {
+ "type": "integer",
+ "description": "The number of users affected by the issue."
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "annotations": [],
+ "assignedTo": null,
+ "count": "1",
+ "culprit": "raven.scripts.runner in main",
+ "firstSeen": "2018-11-06T21:19:55Z",
+ "hasSeen": false,
+ "id": "1",
+ "isBookmarked": false,
+ "isPublic": false,
+ "isSubscribed": true,
+ "lastSeen": "2018-11-06T21:19:55Z",
+ "level": "error",
+ "logger": null,
+ "metadata": {
+ "title": "This is an example Python exception"
+ },
+ "numComments": 0,
+ "permalink": "https://sentry.io/the-interstellar-jurisdiction/pump-station/issues/1/",
+ "project": {
+ "id": "2",
+ "name": "Pump Station",
+ "slug": "pump-station"
+ },
+ "shareId": null,
+ "shortId": "PUMP-STATION-1",
+ "stats": {
+ "24h": [
+ [
+ 1541455200,
+ 473
+ ],
+ [
+ 1541458800,
+ 914
+ ],
+ [
+ 1541462400,
+ 991
+ ],
+ [
+ 1541466000,
+ 925
+ ],
+ [
+ 1541469600,
+ 881
+ ],
+ [
+ 1541473200,
+ 182
+ ],
+ [
+ 1541476800,
+ 490
+ ],
+ [
+ 1541480400,
+ 820
+ ],
+ [
+ 1541484000,
+ 322
+ ],
+ [
+ 1541487600,
+ 836
+ ],
+ [
+ 1541491200,
+ 565
+ ],
+ [
+ 1541494800,
+ 758
+ ],
+ [
+ 1541498400,
+ 880
+ ],
+ [
+ 1541502000,
+ 677
+ ],
+ [
+ 1541505600,
+ 381
+ ],
+ [
+ 1541509200,
+ 814
+ ],
+ [
+ 1541512800,
+ 329
+ ],
+ [
+ 1541516400,
+ 446
+ ],
+ [
+ 1541520000,
+ 731
+ ],
+ [
+ 1541523600,
+ 111
+ ],
+ [
+ 1541527200,
+ 926
+ ],
+ [
+ 1541530800,
+ 772
+ ],
+ [
+ 1541534400,
+ 400
+ ],
+ [
+ 1541538000,
+ 943
+ ]
+ ]
+ },
+ "status": "unresolved",
+ "statusDetails": {},
+ "subscriptionDetails": null,
+ "title": "This is an example Python exception",
+ "type": "default",
+ "userCount": 0
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:read"
+ ]
+ }
+ ],
+ "x-sentry-routing": {
+ "silo": "unknown",
+ "organizationParameter": "organization_id_or_slug"
+ }
+ },
+ "put": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Bulk mutate various attributes on issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be modified.\n\n- For non-status updates, the `id` query parameter is required.\n- For status updates, the `id` query parameter may be omitted\nfor a batch \"update all\" query.\n- To restrict a batch \"update all\" to issues with a given status,\nuse the `query` parameter, e.g. `query=is:resolved`.\n\nThe following attributes can be modified and are supplied as JSON object in the body:\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Mutate a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be mutated. This parameter shall be repeated for each issue. It is optional only if a status is mutated in which case an implicit update all is assumed.",
+ "required": false,
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query that selects the issues to update when `id` is not provided. If not provided an implied `\"is:unresolved\"` is assumed. Use `is:` (e.g. `is:resolved`) to limit it to issues with that status.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "The new status for the issues. Valid values are `\"resolved\"`, `\"resolvedInNextRelease\"`, `\"unresolved\"`, and `\"ignored\"`."
+ },
+ "statusDetails": {
+ "type": "object",
+ "properties": {
+ "inRelease": {
+ "type": "string"
+ },
+ "inNextRelease": {
+ "type": "boolean"
+ },
+ "inCommit": {
+ "type": "string"
+ },
+ "ignoreDuration": {
+ "type": "integer"
+ },
+ "ignoreCount": {
+ "type": "integer"
+ },
+ "ignoreWindow": {
+ "type": "integer"
+ },
+ "ignoreUserCount": {
+ "type": "integer"
+ },
+ "ignoreUserWindow": {
+ "type": "integer"
+ }
+ },
+ "description": "Additional details about the resolution. Valid values are `\"inRelease\"`, `\"inNextRelease\"`, `\"inCommit\"`, `\"ignoreDuration\"`, `\"ignoreCount\"`, `\"ignoreWindow\"`, `\"ignoreUserCount\"`, and `\"ignoreUserWindow\"`."
+ },
+ "ignoreDuration": {
+ "type": "integer",
+ "description": "The number of minutes to ignore this issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Sets the issue to public or private."
+ },
+ "merge": {
+ "type": "boolean",
+ "description": "Allows to merge or unmerge different issues."
+ },
+ "assignedTo": {
+ "type": "string",
+ "description": "The actor ID (or username) of the user or team that should be assigned to this issue."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the flag that indicates if the user has seen the event."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the bookmark flag."
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "isPublic",
+ "status",
+ "statusDetails"
+ ],
+ "properties": {
+ "isPublic": {
+ "type": "boolean",
+ "description": "Whether the issues are shared publicly."
+ },
+ "status": {
+ "type": "string",
+ "description": "The new status of the issues.",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object",
+ "description": "Details of the new status, such as the release that resolves the issues or when an ignore expires. Empty when the new status has no details.",
+ "properties": {
+ "ignoreCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional events after which the issues stop being ignored."
+ },
+ "ignoreUntil": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the issues stop being ignored."
+ },
+ "ignoreUserCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional affected users after which the issues stop being ignored."
+ },
+ "ignoreUserWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreUserCount."
+ },
+ "ignoreWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreCount."
+ },
+ "ignoreUntilEscalating": {
+ "type": "boolean",
+ "description": "Whether the issues stay ignored until they escalate."
+ },
+ "actor": {
+ "type": "object",
+ "nullable": true,
+ "description": "User who ignored or resolved the issues.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "ID of the user."
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the user."
+ },
+ "username": {
+ "type": "string",
+ "description": "Username of the user."
+ },
+ "email": {
+ "type": "string",
+ "description": "Email address of the user."
+ }
+ }
+ },
+ "inNextRelease": {
+ "type": "boolean",
+ "description": "Whether the issues are resolved in the next release."
+ },
+ "inRelease": {
+ "type": "string",
+ "description": "Version of the release the issues are resolved in."
+ },
+ "inCommit": {
+ "type": "object",
+ "description": "Commit the issues are resolved in.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Commit SHA."
+ },
+ "message": {
+ "type": "string",
+ "nullable": true,
+ "description": "Commit message."
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the commit was made."
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved",
+ "statusDetails": {}
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:write"
+ ]
+ }
+ ],
+ "x-sentry-routing": {
+ "silo": "unknown",
+ "organizationParameter": "organization_id_or_slug"
+ }
+ },
+ "delete": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Permanently remove the given issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be removed.\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Remove a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be removed. This parameter shall be repeated for each issue, e.g. `?id=1&id=2&id=3`. If this parameter is not provided, it will attempt to remove the first 1000 issues.",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query that selects the issues to remove when `id` is not provided. If not provided an implied `\"is:unresolved\"` is assumed. Use `is:` (e.g. `is:resolved`) to limit it to issues with that status.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Project not found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:admin"
+ ]
+ }
+ ],
+ "x-sentry-routing": {
+ "silo": "unknown",
+ "organizationParameter": "organization_id_or_slug"
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-2.1.0.json b/plugins/openapi/testdata/sentry-2.1.0.json
new file mode 100644
index 0000000..c7f2866
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-2.1.0.json
@@ -0,0 +1,1748 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io/api/0",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/": {
+ "get": {
+ "operationId": "retrieveApiIndex",
+ "description": "Return the API version, the scopes of the token that authenticated the request,\nand the authenticated user. Use it to check which scopes a token has.\n\nAuthentication is optional. `auth` is null unless the request uses a token or API\nkey. `user` is null for anonymous requests and for credentials that don't belong\nto a user, such as API keys and organization auth tokens.",
+ "summary": "Retrieve the Current Credentials",
+ "tags": [
+ "Users"
+ ],
+ "security": [
+ {
+ "auth_token": []
+ },
+ {}
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "description": "API version. Always \"0\""
+ },
+ "auth": {
+ "type": "object",
+ "properties": {
+ "scopes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Scopes stored on the token or API key that authenticated the request"
+ }
+ },
+ "required": [
+ "scopes"
+ ],
+ "nullable": true,
+ "description": "The credentials that authenticated the request, or null for session and anonymous requests"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "identities": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "SSO identity ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "User's identifier at the auth provider"
+ },
+ "organization": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string",
+ "description": "Organization slug"
+ },
+ "name": {
+ "type": "string",
+ "description": "Organization name"
+ }
+ },
+ "required": [
+ "name",
+ "slug"
+ ],
+ "description": "Organization the auth provider belongs to"
+ },
+ "provider": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Auth provider key, such as google or saml2"
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name of the auth provider"
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "description": "Auth provider of the identity"
+ },
+ "dateVerified": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the identity was last verified by signing in through the auth provider"
+ },
+ "dateSynced": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the identity was last synced from the auth provider"
+ }
+ },
+ "required": [
+ "dateSynced",
+ "dateVerified",
+ "id",
+ "name",
+ "organization",
+ "provider"
+ ]
+ },
+ "description": "SSO identities of the user. Only included for the requesting user, unless the request has active superuser or staff access"
+ },
+ "avatar": {
+ "type": "object",
+ "properties": {
+ "avatarType": {
+ "enum": [
+ "letter_avatar",
+ "upload",
+ "gravatar"
+ ],
+ "type": "string",
+ "description": "Avatar type"
+ },
+ "avatarUuid": {
+ "type": "string",
+ "pattern": "^[0-9a-f]{32}$",
+ "nullable": true,
+ "description": "ID of the uploaded avatar image, or null"
+ },
+ "avatarUrl": {
+ "type": "string",
+ "nullable": true,
+ "description": "URL of the avatar image, or null if none is set"
+ }
+ },
+ "description": "User avatar"
+ },
+ "authenticators": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Authenticator ID"
+ },
+ "type": {
+ "type": "string",
+ "description": "Authenticator type, such as totp, sms, u2f or recovery"
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name of the authenticator type"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the authenticator was added"
+ },
+ "dateUsed": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the authenticator was last used, or null"
+ }
+ },
+ "required": [
+ "dateCreated",
+ "dateUsed",
+ "id",
+ "name",
+ "type"
+ ]
+ },
+ "description": "Two-factor authenticators of the user, without backup methods such as recovery codes"
+ },
+ "canReset2fa": {
+ "type": "boolean",
+ "description": "Whether the organization can reset the user's two-factor authentication. True only if the user is a member of exactly one active organization"
+ },
+ "id": {
+ "type": "string",
+ "pattern": "^[0-9]+$",
+ "description": "User ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name: the user's name, or their email or username if no name is set"
+ },
+ "username": {
+ "type": "string",
+ "description": "Username"
+ },
+ "email": {
+ "type": "string",
+ "description": "Primary email address"
+ },
+ "avatarUrl": {
+ "type": "string",
+ "description": "Gravatar URL for the primary email address"
+ },
+ "isActive": {
+ "type": "boolean",
+ "description": "Whether the account is active"
+ },
+ "isSuspended": {
+ "type": "boolean",
+ "description": "Whether the account is suspended. Suspended users can't sign in"
+ },
+ "hasPasswordAuth": {
+ "type": "boolean",
+ "description": "Whether the user has a password set"
+ },
+ "isManaged": {
+ "type": "boolean",
+ "description": "Whether the account is managed, which stops the user from changing their username, password and similar details"
+ },
+ "dateJoined": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the account was created"
+ },
+ "lastLogin": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the user last signed in, or null"
+ },
+ "has2fa": {
+ "type": "boolean",
+ "description": "Whether the user has two-factor authentication enabled"
+ },
+ "lastActive": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the user was last active, or null"
+ },
+ "isSuperuser": {
+ "type": "boolean",
+ "description": "Whether the user is a superuser"
+ },
+ "isStaff": {
+ "type": "boolean",
+ "description": "Whether the user has staff status"
+ },
+ "experiments": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Deprecated. Always an empty object"
+ },
+ "emails": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Email ID"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email address"
+ },
+ "is_verified": {
+ "type": "boolean",
+ "description": "Whether the email address is verified"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "is_verified"
+ ]
+ },
+ "description": "Email addresses of the user. Only included for the requesting user or superusers; empty otherwise"
+ },
+ "options": {
+ "type": "object",
+ "properties": {
+ "theme": {
+ "type": "string",
+ "description": "UI theme: \"light\", \"dark\" or \"system\". Defaults to \"system\""
+ },
+ "language": {
+ "type": "string",
+ "description": "UI language code, such as `en`"
+ },
+ "stacktraceOrder": {
+ "enum": [
+ -1,
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "description": "Stack trace frame order: -1 for the default (most recent first), 1 for most recent last, 2 for most recent first"
+ },
+ "defaultIssueEvent": {
+ "type": "string",
+ "description": "Event shown by default on issue details: \"recommended\", \"latest\" or \"oldest\""
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Time zone for displayed dates, such as `UTC`"
+ },
+ "clock24Hours": {
+ "type": "boolean",
+ "description": "Whether times are shown in 24-hour format"
+ },
+ "prefersIssueDetailsStreamlinedUI": {
+ "type": "boolean",
+ "nullable": true,
+ "description": "Whether the user prefers the streamlined issue details UI, or null if they haven't chosen"
+ }
+ },
+ "required": [
+ "clock24Hours",
+ "defaultIssueEvent",
+ "language",
+ "prefersIssueDetailsStreamlinedUI",
+ "stacktraceOrder",
+ "theme",
+ "timezone"
+ ],
+ "description": "Preferences of the user"
+ },
+ "flags": {
+ "type": "object",
+ "properties": {
+ "newsletter_consent_prompt": {
+ "type": "boolean",
+ "description": "Whether to ask the user for newsletter consent"
+ }
+ },
+ "required": [
+ "newsletter_consent_prompt"
+ ],
+ "description": "Account flags of the user"
+ }
+ },
+ "required": [
+ "avatarUrl",
+ "dateJoined",
+ "email",
+ "emails",
+ "experiments",
+ "flags",
+ "has2fa",
+ "hasPasswordAuth",
+ "id",
+ "isActive",
+ "isManaged",
+ "isStaff",
+ "isSuperuser",
+ "isSuspended",
+ "lastActive",
+ "lastLogin",
+ "name",
+ "options",
+ "username"
+ ],
+ "nullable": true,
+ "description": "The authenticated user, or null for anonymous requests and requests made with an API key or organization auth token"
+ }
+ },
+ "required": [
+ "auth",
+ "user",
+ "version"
+ ]
+ },
+ "examples": {
+ "RetrieveTheCurrentCredentials": {
+ "value": {
+ "version": "0",
+ "auth": {
+ "scopes": [
+ "org:read",
+ "project:read"
+ ]
+ },
+ "user": {
+ "id": "1",
+ "name": "Jane Bloggs",
+ "username": "jane@example.com",
+ "email": "jane@example.com",
+ "avatarUrl": "https://gravatar.com/avatar/1d4e7f2c9b3a?s=32&d=mm",
+ "isActive": true,
+ "isSuspended": false,
+ "hasPasswordAuth": true,
+ "isManaged": false,
+ "dateJoined": "2023-03-01T18:12:42.000000Z",
+ "lastLogin": "2026-11-02T09:31:05.000000Z",
+ "has2fa": true,
+ "lastActive": "2026-11-07T15:20:11.000000Z",
+ "isSuperuser": false,
+ "isStaff": false,
+ "emails": [
+ {
+ "id": "1",
+ "email": "jane@example.com",
+ "is_verified": true
+ }
+ ],
+ "experiments": {},
+ "options": {
+ "theme": "system",
+ "language": "en",
+ "stacktraceOrder": -1,
+ "defaultIssueEvent": "recommended",
+ "timezone": "UTC",
+ "clock24Hours": false,
+ "prefersIssueDetailsStreamlinedUI": null
+ },
+ "flags": {
+ "newsletter_consent_prompt": false
+ },
+ "avatar": {
+ "avatarType": "letter_avatar",
+ "avatarUuid": null,
+ "avatarUrl": null
+ },
+ "identities": []
+ }
+ },
+ "summary": "Retrieve the current credentials"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "429": {
+ "description": "Too Many Requests"
+ }
+ },
+ "x-sentry-routing": {
+ "silo": "control"
+ }
+ }
+ },
+ "/organizations/": {
+ "get": {
+ "operationId": "listOrganizations",
+ "description": "Return a list of organizations available to the authenticated session in a region.\nThis is particularly useful for requests with a user bound context. For API key-based requests this will only return the organization that belongs to the key.",
+ "summary": "List Your Organizations",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "owner",
+ "schema": {
+ "type": "boolean"
+ },
+ "description": "Specify `true` to restrict results to organizations in which you are an owner."
+ },
+ {
+ "in": "query",
+ "name": "cursor",
+ "schema": {
+ "type": "string",
+ "minLength": 1
+ },
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/"
+ },
+ {
+ "in": "query",
+ "name": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Filters results by using [query syntax](/product/sentry-basics/search/).\n\nValid query fields include:\n- `id`: The organization ID\n- `slug`: The organization slug\n- `status`: The organization's current status (one of `active`, `pending_deletion`, or `deletion_in_progress`)\n- `email` or `member_id`: Filter your organizations by the emails or [organization member IDs](/api/organizations/list-an-organizations-members/) of specific members included\n- `query`: Filter your organizations by name, slug, and members that contain this substring\n\nExample: `query=(slug:foo AND status:active) OR (email:[thing-one@example.com,thing-two@example.com] AND query:bar)`\n"
+ },
+ {
+ "in": "query",
+ "name": "sortBy",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The field to sort results by, in descending order. If not specified the results are sorted by the date they were created.\n\nValid fields include:\n- `members`: By number of members\n- `events`: By number of events in the past 24 hours\n"
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "Limit the number of rows to return in the result. Default and maximum allowed is 100."
+ }
+ ],
+ "tags": [
+ "Users"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "features": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Features enabled for the organization"
+ },
+ "extraOptions": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "Server-wide options that the Sentry UI reads"
+ },
+ "access": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Scopes the requesting user has in the organization"
+ },
+ "onboardingTasks": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "task": {
+ "type": "string",
+ "nullable": true,
+ "description": "Onboarding task key, such as create_project"
+ },
+ "status": {
+ "type": "string",
+ "description": "Task status: complete or skipped"
+ },
+ "completionSeen": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the task's completion was marked as seen, or null"
+ },
+ "dateCompleted": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the task was completed or skipped"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "invited_member_id": {
+ "type": "integer",
+ "description": "ID of the member whose invite completed the invite_member task"
+ },
+ "platform": {
+ "type": "string",
+ "nullable": true,
+ "description": "Platform of the first event, for the first_event task"
+ },
+ "plugin": {
+ "type": "string",
+ "description": "Slug of the plugin enabled for the task"
+ },
+ "providers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Integration providers installed for the integrations task"
+ }
+ },
+ "description": "Data recorded for the task. Most tasks record none, so it's often empty"
+ }
+ },
+ "required": [
+ "completionSeen",
+ "data",
+ "dateCompleted",
+ "status",
+ "task"
+ ]
+ },
+ "description": "Onboarding tasks the organization has completed or skipped"
+ },
+ "id": {
+ "type": "string",
+ "pattern": "^[0-9]+$",
+ "description": "Organization ID"
+ },
+ "slug": {
+ "type": "string",
+ "pattern": "^[-a-zA-Z0-9_]+$",
+ "description": "Organization slug"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Status ID: active, pending_deletion, deletion_in_progress or relocation_pending_approval"
+ },
+ "name": {
+ "type": "string",
+ "description": "Status label, such as active or pending deletion"
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ],
+ "description": "Organization status"
+ },
+ "name": {
+ "type": "string",
+ "description": "Organization name, or its slug when it has no name"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the organization was created (ISO 8601)"
+ },
+ "isEarlyAdopter": {
+ "type": "boolean",
+ "description": "Whether the organization is an early adopter"
+ },
+ "require2FA": {
+ "type": "boolean",
+ "description": "Whether members must use two-factor authentication"
+ },
+ "avatar": {
+ "type": "object",
+ "properties": {
+ "avatarType": {
+ "enum": [
+ "letter_avatar",
+ "upload",
+ "gravatar"
+ ],
+ "type": "string",
+ "description": "Avatar type"
+ },
+ "avatarUuid": {
+ "type": "string",
+ "pattern": "^[0-9a-f]{32}$",
+ "nullable": true,
+ "description": "ID of the uploaded avatar image, or null"
+ },
+ "avatarUrl": {
+ "type": "string",
+ "nullable": true,
+ "description": "URL of the avatar image, or null if none is set"
+ }
+ },
+ "description": "Organization avatar"
+ },
+ "links": {
+ "type": "object",
+ "properties": {
+ "organizationUrl": {
+ "type": "string",
+ "description": "Base URL of the organization"
+ },
+ "regionUrl": {
+ "type": "string",
+ "description": "Base URL of the API for the organization's region"
+ }
+ },
+ "required": [
+ "organizationUrl",
+ "regionUrl"
+ ],
+ "description": "Organization and region URLs"
+ },
+ "hasAuthProvider": {
+ "type": "boolean",
+ "description": "Whether SSO is configured for the organization"
+ },
+ "allowMemberInvite": {
+ "type": "boolean",
+ "description": "Whether members can invite other members"
+ },
+ "allowMemberProjectCreation": {
+ "type": "boolean",
+ "description": "Whether members can create projects"
+ },
+ "allowSuperuserAccess": {
+ "type": "boolean",
+ "description": "Whether Sentry superusers can access the organization"
+ }
+ },
+ "required": [
+ "allowMemberInvite",
+ "allowMemberProjectCreation",
+ "allowSuperuserAccess",
+ "avatar",
+ "dateCreated",
+ "hasAuthProvider",
+ "id",
+ "isEarlyAdopter",
+ "links",
+ "name",
+ "require2FA",
+ "slug",
+ "status"
+ ]
+ }
+ },
+ "examples": {
+ "ListYourOrganizations": {
+ "value": [
+ {
+ "avatar": {
+ "avatarType": "letter_avatar",
+ "avatarUuid": null
+ },
+ "dateCreated": "2018-11-06T21:19:55.101Z",
+ "features": [
+ "session-replay-video",
+ "onboarding",
+ "advanced-search",
+ "monitor-seat-billing",
+ "issue-platform"
+ ],
+ "hasAuthProvider": false,
+ "id": "2",
+ "isEarlyAdopter": false,
+ "allowMemberInvite": true,
+ "allowMemberProjectCreation": true,
+ "allowSuperuserAccess": false,
+ "links": {
+ "organizationUrl": "https://the-interstellar-jurisdiction.sentry.io",
+ "regionUrl": "https://us.sentry.io"
+ },
+ "name": "The Interstellar Jurisdiction",
+ "require2FA": false,
+ "slug": "the-interstellar-jurisdiction",
+ "status": {
+ "id": "active",
+ "name": "active"
+ }
+ }
+ ],
+ "summary": "List your organizations"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ },
+ "x-sentry-routing": {
+ "silo": "both"
+ }
+ }
+ },
+ "/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/": {
+ "get": {
+ "tags": [
+ "Events"
+ ],
+ "description": "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint](/api/events/list-an-organizations-issues/) which\nsupports filtering on project and additional functionality.\n\nReturn a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \n\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\n\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\"\"`` (disable),``\"24h\"`` (default), ``\"14d\"``\n\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.",
+ "operationId": "List a Project's Issues",
+ "deprecated": true,
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "statsPeriod",
+ "in": "query",
+ "description": "An optional stat period (can be one of `\"24h\"`, `\"14d\"`, and `\"\"`), defaults to \"24h\" if not provided.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "shortIdLookup",
+ "in": "query",
+ "description": "If this is set to `1` then short IDs are looked up by this function as well. This can cause the return value of the function to return an event issue of a different project which is why this is an opt-in.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ]
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query. If not provided an implied `\"is:unresolved\"` is assumed.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "hashes",
+ "in": "query",
+ "description": "A list of hashes of groups to return. Is not compatible with 'query' parameter. The maximum number of hashes that can be sent is 100. If more are sent, only the first 100 will be used.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "sort",
+ "in": "query",
+ "description": "The sort order of the issues. Options include 'Last Seen' (`date`), 'First Seen' (`new`), 'Trends' (`trends`), 'Events' (`freq`), 'Users' (`user`), and 'Recommended' (`recommended`).",
+ "schema": {
+ "type": "string",
+ "default": "date",
+ "enum": [
+ "date",
+ "new",
+ "trends",
+ "freq",
+ "user",
+ "recommended"
+ ]
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "The maximum number of issues to return. The maximum is 100.",
+ "schema": {
+ "type": "integer",
+ "default": 100
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "lastSeen",
+ "numComments",
+ "userCount",
+ "culprit",
+ "title",
+ "id",
+ "assignedTo",
+ "logger",
+ "stats",
+ "type",
+ "annotations",
+ "metadata",
+ "status",
+ "subscriptionDetails",
+ "isPublic",
+ "hasSeen",
+ "shortId",
+ "shareId",
+ "firstSeen",
+ "count",
+ "permalink",
+ "level",
+ "isSubscribed",
+ "isBookmarked",
+ "project",
+ "statusDetails"
+ ],
+ "properties": {
+ "annotations": {
+ "type": "array",
+ "description": "Annotations on the issue, such as links to external issues.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "assignedTo": {
+ "type": "object",
+ "description": "The user or team the issue is assigned to. Null when the issue is unassigned.",
+ "nullable": true,
+ "required": [
+ "type",
+ "id",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "user",
+ "team"
+ ],
+ "description": "Whether the assignee is a user or a team."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the user or team."
+ },
+ "name": {
+ "type": "string",
+ "description": "The display name of the user, or the slug of the team."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the user. Only set for users."
+ }
+ }
+ },
+ "count": {
+ "type": "string",
+ "description": "The total number of events in the issue."
+ },
+ "culprit": {
+ "type": "string",
+ "description": "The function or module where the issue occurs."
+ },
+ "firstSeen": {
+ "type": "string",
+ "description": "When the issue was first seen (ISO 8601)."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "Whether the requesting user has seen the issue since it last occurred."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the issue."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "Whether the requesting user bookmarked the issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Whether the issue is shared publicly."
+ },
+ "isSubscribed": {
+ "type": "boolean",
+ "description": "Whether the requesting user is subscribed to the issue."
+ },
+ "lastSeen": {
+ "type": "string",
+ "description": "When the issue was last seen (ISO 8601)."
+ },
+ "level": {
+ "type": "string",
+ "description": "The severity level of the issue, such as `error` or `warning`."
+ },
+ "logger": {
+ "type": "string",
+ "description": "The logger of the issue's events.",
+ "nullable": true
+ },
+ "metadata": {
+ "description": "Metadata of the issue. Its keys depend on the issue type.",
+ "oneOf": [
+ {
+ "type": "object",
+ "required": [
+ "filename",
+ "type",
+ "value"
+ ],
+ "properties": {
+ "filename": {
+ "type": "string",
+ "description": "The file where the error was raised."
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of the error."
+ },
+ "value": {
+ "type": "string",
+ "description": "The error message."
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "title"
+ ],
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the issue."
+ }
+ }
+ }
+ ]
+ },
+ "numComments": {
+ "type": "integer",
+ "description": "The number of comments on the issue."
+ },
+ "permalink": {
+ "type": "string",
+ "description": "The URL of the issue in Sentry."
+ },
+ "project": {
+ "type": "object",
+ "description": "The project the issue belongs to.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the project."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the project."
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the project."
+ }
+ }
+ },
+ "shareId": {
+ "type": "string",
+ "description": "The ID used in the issue's public share URL. Null when the issue isn't shared.",
+ "nullable": true
+ },
+ "shortId": {
+ "type": "string",
+ "description": "The short ID of the issue, such as `PROJECT-1A`."
+ },
+ "stats": {
+ "type": "object",
+ "description": "Event counts for the issue over time.",
+ "properties": {
+ "24h": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "description": "Hourly event counts for the last 24 hours, as [timestamp, count] pairs."
+ }
+ }
+ },
+ "status": {
+ "type": "string",
+ "description": "The status of the issue.",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object",
+ "description": "Details of the issue's status, such as when an ignore expires or which release resolves it. Empty when the status has no details.",
+ "properties": {
+ "ignoreCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional events after which the issue stops being ignored."
+ },
+ "ignoreUntil": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the issue stops being ignored."
+ },
+ "ignoreUserCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional affected users after which the issue stops being ignored."
+ },
+ "ignoreUserWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreUserCount."
+ },
+ "ignoreWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreCount."
+ },
+ "actor": {
+ "type": "object",
+ "nullable": true,
+ "description": "User who ignored or resolved the issue.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "ID of the user."
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the user."
+ },
+ "username": {
+ "type": "string",
+ "description": "Username of the user."
+ },
+ "email": {
+ "type": "string",
+ "description": "Email address of the user."
+ }
+ }
+ },
+ "inNextRelease": {
+ "type": "boolean",
+ "description": "Whether the issue is resolved in the next release."
+ },
+ "inRelease": {
+ "type": "string",
+ "description": "Version of the release the issue is resolved in."
+ },
+ "inCommit": {
+ "type": "string",
+ "description": "Commit the issue is resolved in."
+ },
+ "pendingEvents": {
+ "type": "integer",
+ "description": "Number of events still waiting to be reprocessed."
+ },
+ "info": {
+ "type": "object",
+ "nullable": true,
+ "description": "Reprocessing progress details.",
+ "required": [
+ "dateCreated",
+ "syncCount",
+ "totalEvents"
+ ],
+ "properties": {
+ "dateCreated": {
+ "type": "string",
+ "description": "When reprocessing started (ISO 8601)."
+ },
+ "syncCount": {
+ "type": "integer",
+ "description": "Number of events in the issue when reprocessing started."
+ },
+ "totalEvents": {
+ "type": "integer",
+ "description": "Number of events to reprocess, at most the requested maximum."
+ }
+ }
+ }
+ }
+ },
+ "subscriptionDetails": {
+ "type": "object",
+ "description": "Why the requesting user is subscribed to the issue. Null when there's no subscription.",
+ "nullable": true,
+ "properties": {
+ "disabled": {
+ "type": "boolean",
+ "description": "Whether the requesting user turned off notifications for the issue."
+ },
+ "reason": {
+ "type": "string",
+ "description": "Why the requesting user is subscribed, such as `commented`, `assigned`, `bookmarked`, `changed_status`, `mentioned` or `unknown`."
+ }
+ }
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the issue."
+ },
+ "type": {
+ "type": "string",
+ "description": "The event type of the issue, such as `error` or `default`."
+ },
+ "userCount": {
+ "type": "integer",
+ "description": "The number of users affected by the issue."
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "annotations": [],
+ "assignedTo": null,
+ "count": "1",
+ "culprit": "raven.scripts.runner in main",
+ "firstSeen": "2018-11-06T21:19:55Z",
+ "hasSeen": false,
+ "id": "1",
+ "isBookmarked": false,
+ "isPublic": false,
+ "isSubscribed": true,
+ "lastSeen": "2018-11-06T21:19:55Z",
+ "level": "error",
+ "logger": null,
+ "metadata": {
+ "title": "This is an example Python exception"
+ },
+ "numComments": 0,
+ "permalink": "https://sentry.io/the-interstellar-jurisdiction/pump-station/issues/1/",
+ "project": {
+ "id": "2",
+ "name": "Pump Station",
+ "slug": "pump-station"
+ },
+ "shareId": null,
+ "shortId": "PUMP-STATION-1",
+ "stats": {
+ "24h": [
+ [
+ 1541455200,
+ 473
+ ],
+ [
+ 1541458800,
+ 914
+ ],
+ [
+ 1541462400,
+ 991
+ ],
+ [
+ 1541466000,
+ 925
+ ],
+ [
+ 1541469600,
+ 881
+ ],
+ [
+ 1541473200,
+ 182
+ ],
+ [
+ 1541476800,
+ 490
+ ],
+ [
+ 1541480400,
+ 820
+ ],
+ [
+ 1541484000,
+ 322
+ ],
+ [
+ 1541487600,
+ 836
+ ],
+ [
+ 1541491200,
+ 565
+ ],
+ [
+ 1541494800,
+ 758
+ ],
+ [
+ 1541498400,
+ 880
+ ],
+ [
+ 1541502000,
+ 677
+ ],
+ [
+ 1541505600,
+ 381
+ ],
+ [
+ 1541509200,
+ 814
+ ],
+ [
+ 1541512800,
+ 329
+ ],
+ [
+ 1541516400,
+ 446
+ ],
+ [
+ 1541520000,
+ 731
+ ],
+ [
+ 1541523600,
+ 111
+ ],
+ [
+ 1541527200,
+ 926
+ ],
+ [
+ 1541530800,
+ 772
+ ],
+ [
+ 1541534400,
+ 400
+ ],
+ [
+ 1541538000,
+ 943
+ ]
+ ]
+ },
+ "status": "unresolved",
+ "statusDetails": {},
+ "subscriptionDetails": null,
+ "title": "This is an example Python exception",
+ "type": "default",
+ "userCount": 0
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:read"
+ ]
+ }
+ ],
+ "x-sentry-routing": {
+ "silo": "unknown",
+ "organizationParameter": "organization_id_or_slug"
+ }
+ },
+ "put": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Bulk mutate various attributes on issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be modified.\n\n- For non-status updates, the `id` query parameter is required.\n- For status updates, the `id` query parameter may be omitted\nfor a batch \"update all\" query.\n- To restrict a batch \"update all\" to issues with a given status,\nuse the `query` parameter, e.g. `query=is:resolved`.\n\nThe following attributes can be modified and are supplied as JSON object in the body:\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Mutate a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be mutated. This parameter shall be repeated for each issue. It is optional only if a status is mutated in which case an implicit update all is assumed.",
+ "required": false,
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query that selects the issues to update when `id` is not provided. If not provided an implied `\"is:unresolved\"` is assumed. Use `is:` (e.g. `is:resolved`) to limit it to issues with that status.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "The new status for the issues. Valid values are `\"resolved\"`, `\"resolvedInNextRelease\"`, `\"unresolved\"`, and `\"ignored\"`."
+ },
+ "statusDetails": {
+ "type": "object",
+ "properties": {
+ "inRelease": {
+ "type": "string"
+ },
+ "inNextRelease": {
+ "type": "boolean"
+ },
+ "inCommit": {
+ "type": "string"
+ },
+ "ignoreDuration": {
+ "type": "integer"
+ },
+ "ignoreCount": {
+ "type": "integer"
+ },
+ "ignoreWindow": {
+ "type": "integer"
+ },
+ "ignoreUserCount": {
+ "type": "integer"
+ },
+ "ignoreUserWindow": {
+ "type": "integer"
+ }
+ },
+ "description": "Additional details about the resolution. Valid values are `\"inRelease\"`, `\"inNextRelease\"`, `\"inCommit\"`, `\"ignoreDuration\"`, `\"ignoreCount\"`, `\"ignoreWindow\"`, `\"ignoreUserCount\"`, and `\"ignoreUserWindow\"`."
+ },
+ "ignoreDuration": {
+ "type": "integer",
+ "description": "The number of minutes to ignore this issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Sets the issue to public or private."
+ },
+ "merge": {
+ "type": "boolean",
+ "description": "Allows to merge or unmerge different issues."
+ },
+ "assignedTo": {
+ "type": "string",
+ "description": "The actor ID (or username) of the user or team that should be assigned to this issue."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the flag that indicates if the user has seen the event."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the bookmark flag."
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "isPublic",
+ "status",
+ "statusDetails"
+ ],
+ "properties": {
+ "isPublic": {
+ "type": "boolean",
+ "description": "Whether the issues are shared publicly."
+ },
+ "status": {
+ "type": "string",
+ "description": "The new status of the issues.",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object",
+ "description": "Details of the new status, such as the release that resolves the issues or when an ignore expires. Empty when the new status has no details.",
+ "properties": {
+ "ignoreCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional events after which the issues stop being ignored."
+ },
+ "ignoreUntil": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When the issues stop being ignored."
+ },
+ "ignoreUserCount": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of additional affected users after which the issues stop being ignored."
+ },
+ "ignoreUserWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreUserCount."
+ },
+ "ignoreWindow": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Time window in minutes for ignoreCount."
+ },
+ "ignoreUntilEscalating": {
+ "type": "boolean",
+ "description": "Whether the issues stay ignored until they escalate."
+ },
+ "actor": {
+ "type": "object",
+ "nullable": true,
+ "description": "User who ignored or resolved the issues.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "ID of the user."
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the user."
+ },
+ "username": {
+ "type": "string",
+ "description": "Username of the user."
+ },
+ "email": {
+ "type": "string",
+ "description": "Email address of the user."
+ }
+ }
+ },
+ "inNextRelease": {
+ "type": "boolean",
+ "description": "Whether the issues are resolved in the next release."
+ },
+ "inRelease": {
+ "type": "string",
+ "description": "Version of the release the issues are resolved in."
+ },
+ "inCommit": {
+ "type": "object",
+ "description": "Commit the issues are resolved in.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Commit SHA."
+ },
+ "message": {
+ "type": "string",
+ "nullable": true,
+ "description": "Commit message."
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the commit was made."
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved",
+ "statusDetails": {}
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:write"
+ ]
+ }
+ ],
+ "x-sentry-routing": {
+ "silo": "unknown",
+ "organizationParameter": "organization_id_or_slug"
+ }
+ },
+ "delete": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Permanently remove the given issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be removed.\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Remove a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be removed. This parameter shall be repeated for each issue, e.g. `?id=1&id=2&id=3`. If this parameter is not provided, it will attempt to remove the first 1000 issues.",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query that selects the issues to remove when `id` is not provided. If not provided an implied `\"is:unresolved\"` is assumed. Use `is:` (e.g. `is:resolved`) to limit it to issues with that status.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Project not found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:admin"
+ ]
+ }
+ ],
+ "x-sentry-routing": {
+ "silo": "unknown",
+ "organizationParameter": "organization_id_or_slug"
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-4650a66a.json b/plugins/openapi/testdata/sentry-4650a66a.json
new file mode 100644
index 0000000..e9aa303
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-4650a66a.json
@@ -0,0 +1,313 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://sentry.io"
+ }
+ ],
+ "paths": {
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/": {
+ "get": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "Return a list of user feedback items within this project.\n\n*This list does not include submissions from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget). This is because it is based on an older format called User Reports - read more [here](https://develop.sentry.dev/application/feedback-architecture/#user-reports).*",
+ "operationId": "List a Project's User Feedback",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:read"
+ ]
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "*This endpoint is DEPRECATED. We document it here for older SDKs and users who are still migrating to the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) or [API](https://docs.sentry.io/platforms/javascript/user-feedback/#user-feedback-api)(multi-platform). If you are a new user, do not use this endpoint - unless you don't have a JS frontend, and your platform's SDK does not offer a feedback API.*\n\nFeedback must be received by the server no more than 30 minutes after the event was saved.\n\nAdditionally, within 5 minutes of submitting feedback it may also be overwritten. This is useful in situations where you may need to retry sending a request due to network failures.\n\nIf feedback is rejected due to a mutability threshold, a 409 status code will be returned.\n\nNote: Feedback may be submitted with DSN authentication (see auth documentation).",
+ "operationId": "Submit User Feedback",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "event_id",
+ "name",
+ "email",
+ "comments"
+ ],
+ "type": "object",
+ "properties": {
+ "event_id": {
+ "type": "string",
+ "description": "The event ID. This can be retrieved from the [beforeSend callback](https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-beforesend)."
+ },
+ "name": {
+ "type": "string",
+ "description": "User's name."
+ },
+ "email": {
+ "type": "string",
+ "description": "User's email address."
+ },
+ "comments": {
+ "type": "string",
+ "description": "Comments supplied by user."
+ }
+ }
+ },
+ "example": {
+ "event_id": "14bad9a2e3774046977a21440ddb39b2",
+ "name": "Jane Schmidt",
+ "email": "jane@empowerplant.io",
+ "comments": "It broke!"
+ }
+ }
+ },
+ "required": false
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ },
+ "example": {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ },
+ "409": {
+ "description": "Conflict"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:write"
+ ]
+ },
+ {
+ "dsn": []
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-47231e61.json b/plugins/openapi/testdata/sentry-47231e61.json
new file mode 100644
index 0000000..d2b35d1
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-47231e61.json
@@ -0,0 +1,2396 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/organizations/{organization_id_or_slug}/alert-rules/": {
+ "get": {
+ "operationId": "List an Organization's Metric Alert Rules",
+ "description": "Return a list of active metric alert rules bound to an organization.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ }
+ },
+ "examples": {
+ "ListMetricAlertRulesForAnOrganization": {
+ "value": [
+ {
+ "id": "7",
+ "name": "Counting Bad Request and Unauthorized Errors in Prod",
+ "organizationId": "237655244234",
+ "queryType": 0,
+ "dataset": "events",
+ "query": "tags[http.status_code]:[400, 401]",
+ "aggregate": "count()",
+ "thresholdType": 0,
+ "resolveThreshold": null,
+ "timeWindow": 1440,
+ "environment": "prod",
+ "triggers": [
+ {
+ "id": "394289",
+ "alertRuleId": "17723",
+ "label": "critical",
+ "thresholdType": 0,
+ "alertThreshold": 100,
+ "resolveThreshold": null,
+ "dateCreated": "2023-09-25T22:15:26.375126Z",
+ "actions": [
+ {
+ "id": "394280",
+ "alertRuleTriggerId": "92481",
+ "type": "slack",
+ "targetType": "specific",
+ "targetIdentifier": "30489048931789",
+ "inputChannelId": "#my-channel",
+ "integrationId": "8753467",
+ "sentryAppId": null,
+ "dateCreated": "2023-09-25T22:15:26.375126Z"
+ }
+ ]
+ }
+ ],
+ "projects": [
+ "super-cool-project"
+ ],
+ "owner": "user:53256",
+ "originalAlertRuleId": null,
+ "comparisonDelta": null,
+ "dateModified": "2023-09-25T22:15:26.375126Z",
+ "dateCreated": "2023-09-25T22:15:26.375126Z",
+ "createdBy": {
+ "id": 983948,
+ "name": "John Doe",
+ "email": "john.doe@sentry.io"
+ }
+ }
+ ],
+ "summary": "List metric alert rules for an organization"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Create a Metric Alert Rule for an Organization",
+ "description": "Create a new metric alert rule for the given organization.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.\n\n## Metric Alert Rule Types\nBelow are the types of metric alert rules you can create and the parameter values required\nto set them up. All other parameters can be customized based on how you want the alert\nrule to work. Scroll down to Body Parameters for more information. Visit the\n[Alert Types](/product/alerts/alert-types/#metric-alerts) docs for more details on each\nmetric alert rule type.\n\n### [Number of Errors](/product/alerts/alert-types/#number-of-errors)\n- `eventTypes`: Any of `error` or `default`.\n```json\n{\n \"queryType\": 0,\n \"dataset\": \"events\",\n \"aggregate\": \"count()\",\n \"eventTypes\": [\"error\", \"default\"]\n}\n```\n\n### [Users Experiencing Errors](/product/alerts/alert-types/#users-experiencing-errors)\n- `eventTypes`: Any of `error` or `default`.\n```json\n{\n \"queryType\": 0,\n \"dataset\": \"events\",\n \"aggregate\": \"count_unique(user)\"\n}\n```\n\n### [Crash Free Session Rate](/product/alerts/alert-types/#crash-free-session-rate)\n```json\n{\n \"queryType\": 2,\n \"dataset\": \"metrics\",\n \"aggregate\": \"percentage(sessions_crashed, sessions) AS _crash_rate_alert_aggregate\"\n}\n```\n\n### [Crash Free User Rate](/product/alerts/alert-types/#crash-free-user-rate)\n```json\n{\n \"queryType\": 2,\n \"dataset\": \"metrics\",\n \"aggregate\": \"percentage(users_crashed, users) AS _crash_rate_alert_aggregate\"\n}\n```\n\n### [Throughput](/product/alerts/alert-types/#throughput)\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"count()\"\n}\n```\n\n### [Transaction Duration](/product/alerts/alert-types/#transaction-duration)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(transaction.duration)`, `p50(transaction.duration)`, `p75(transaction.duration)`, `p95(transaction.duration)`, `p99(transaction.duration)`, `p100(transaction.duration)`, and `percentile(transaction.duration,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"avg(transaction.duration)\"\n}\n```\n\n### [Apdex](/product/alerts/alert-types/#apdex)\n- `aggregate`: `apdex(x)` where `x` is the value of the Apdex score.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"apdex(300)\"\n}\n```\n\n### [Failure Rate](/product/alerts/alert-types/#failure-rate)\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"failure_rate()\"\n}\n```\n\n### [Largest Contentful Paint](/product/alerts/alert-types/#largest-contentful-display)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(measurements.lcp)`, `p50(measurements.lcp)`, `p75(measurements.lcp)`, `p95(measurements.lcp)`, `p99(measurements.lcp)`, `p100(measurements.lcp)`, and `percentile(measurements.lcp,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"p50(measurements.lcp)\"\n}\n```\n\n### [First Input Delay](/product/alerts/alert-types/#first-input-delay)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(measurements.fid)`, `p50(measurements.fid)`, `p75(measurements.fid)`, `p95(measurements.fid)`, `p99(measurements.fid)`, `p100(measurements.fid)`, and `percentile(measurements.fid,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"p100(measurements.fid)\"\n}\n```\n\n### [Cumulative Layout Shift](/product/alerts/alert-types/#cumulative-layout-shift)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are `avg(measurements.cls)`, `p50(measurements.cls)`, `p75(measurements.cls)`, `p95(measurements.cls)`, `p99(measurements.cls)`, `p100(measurements.cls)`, and `percentile(measurements.cls,x)`, where `x` is your custom percentile.\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"transactions\",\n \"aggregate\": \"percentile(measurements.cls,0.2)\"\n}\n```\n\n### [Custom Metric](/product/alerts/alert-types/#custom-metric)\n- `dataset`: If a custom percentile is used, `dataset` is `transactions`. Otherwise, `dataset` is `generic_metrics`.\n- `aggregate`: Valid values are:\n - `avg(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p50(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p75(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p95(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p99(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `p100(x)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`.\n - `percentile(x,y)`, where `x` is `transaction.duration`, `measurements.cls`, `measurements.fcp`, `measurements.fid`, `measurements.fp`, `measurements.lcp`, `measurements.ttfb`, or `measurements.ttfb.requesttime`, and `y` is the custom percentile.\n - `failure_rate()`\n - `apdex(x)`, where `x` is the value of the Apdex score.\n - `count()`\n```json\n{\n \"queryType\": 1,\n \"dataset\": \"generic_metrics\",\n \"aggregate\": \"p75(measurements.ttfb)\"\n}\n```",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule, which has a maximimum length of 256 characters.",
+ "maxLength": 256
+ },
+ "aggregate": {
+ "type": "string",
+ "description": "A string representing the aggregate function used in this alert rule. Valid aggregate functions are `count`, `count_unique`, `percentage`, `avg`, `apdex`, `failure_rate`, `p50`, `p75`, `p95`, `p99`, `p100`, and `percentile`. See [Metric Alert Rule Types](#metric-alert-rule-types) for valid configurations."
+ },
+ "timeWindow": {
+ "enum": [
+ 1,
+ 5,
+ 10,
+ 15,
+ 30,
+ 60,
+ 120,
+ 240,
+ 1440
+ ],
+ "type": "integer",
+ "description": "The time period to aggregate over.\n\n* `1` - 1 minute\n* `5` - 5 minutes\n* `10` - 10 minutes\n* `15` - 15 minutes\n* `30` - 30 minutes\n* `60` - 1 hour\n* `120` - 2 hours\n* `240` - 4 hours\n* `1440` - 24 hours"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Metric alerts are currently limited to one project. The array should contain a single slug, representing the project to filter by."
+ },
+ "query": {
+ "type": "string",
+ "description": "An event search query to subscribe to and monitor for alerts. For example, to filter transactions so that only those with status code 400 are included, you could use `\"query\": \"http.status_code:400\"`. Use an empty string for no filter."
+ },
+ "thresholdType": {
+ "enum": [
+ 0,
+ 1
+ ],
+ "type": "integer",
+ "description": "The comparison operator for the critical and warning thresholds. The comparison operator for the resolved threshold is automatically set to the opposite operator. When a percentage change threshold is used, `0` is equivalent to \"Higher than\" and `1` is equivalent to \"Lower than\".\n\n* `0` - Above\n* `1` - Below"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {},
+ "description": "\nA list of triggers, where each trigger is an object with the following fields:\n- `label`: One of `critical` or `warning`. A `critical` trigger is always required.\n- `alertThreshold`: The value that the subscription needs to reach to trigger the\nalert rule.\n- `actions`: A list of actions that take place when the threshold is met.\n```json\ntriggers: [\n {\n \"label\": \"critical\",\n \"alertThreshold\": 50,\n \"actions\": [\n {\n \"type\": \"slack\",\n \"targetType\": \"specific\",\n \"targetIdentifier\": \"#get-crit\",\n \"inputChannelId\": 2454362\n \"integrationId\": 653532,\n }\n ]\n },\n {\n \"label\": \"warning\",\n \"alertThreshold\": 25,\n \"actions\": []\n }\n]\n```\nMetric alert rule trigger actions follow the following structure:\n- `type`: The type of trigger action. Valid values are `email`, `slack`, `msteams`, `pagerduty`, `sentry_app`, `sentry_notification`, and `opsgenie`.\n- `targetType`: The type of target the notification will be sent to. Valid values are `specific` (`targetIdentifier` is a direct reference used by the service, like an email address or a Slack channel ID), `user` (`targetIdentifier` is a Sentry user ID), `team` (`targetIdentifier` is a Sentry team ID), and `sentry_app` (`targetIdentifier` is a SentryApp ID).\n- `targetIdentifier`: The ID of the target. This must be an integer for PagerDuty and Sentry apps, and a string for all others. Examples of appropriate values include a Slack channel name (`#my-channel`), a user ID, a team ID, a Sentry app ID, etc.\n- `inputChannelId`: The ID of the Slack channel. This is only used for the Slack action, and can be used as an alternative to providing the `targetIdentifier`.\n- `integrationId`: The integration ID. This is required for every action type excluding `email` and `sentry_app.`\n- `sentryAppId`: The ID of the Sentry app. This is required when `type` is `sentry_app`.\n- `priority`: The severity of the Pagerduty alert or the priority of the Opsgenie alert (optional). Defaults for Pagerduty are `critical` for critical and `warning` for warning. Defaults for Opsgenie are `P1` for critical and `P2` for warning.\n"
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by. Defaults to all environments."
+ },
+ "dataset": {
+ "type": "string",
+ "description": "The name of the dataset that this query will be executed on. Valid values are `events`, `transactions`, `metrics`, `sessions`, and `generic-metrics`. Defaults to `events`. See [Metric Alert Rule Types](#metric-alert-rule-types) for valid configurations."
+ },
+ "queryType": {
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "description": "The type of query. If no value is provided, `queryType` is set to the default for the specified `dataset.` See [Metric Alert Rule Types](#metric-alert-rule-types) for valid configurations.\n\n* `0` - event.type:error\n* `1` - event.type:transaction\n* `2` - None"
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of event types that this alert will be related to. Valid values are `default` (events captured using [Capture Message](/product/sentry-basics/integrate-backend/capturing-errors/#capture-message)), `error` and `transaction`."
+ },
+ "comparisonDelta": {
+ "type": "integer",
+ "description": "An optional int representing the time delta to use as the comparison period, in minutes. Required when using a percentage change threshold (\"x%\" higher or lower compared to `comparisonDelta` minutes ago). A percentage change threshold cannot be used for [Crash Free Session Rate](#crash-free-session-rate) or [Crash Free User Rate](#crash-free-user-rate)."
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "description": "Optional value that the metric needs to reach to resolve the alert. If no value is provided, this is set automatically based on the lowest severity trigger's `alertThreshold`. For example, if the alert is set to trigger at the warning level when the number of errors is above 50, then the alert would be set to resolve when there are less than 50 errors. If `thresholdType` is `0`, `resolveThreshold` must be greater than the critical threshold, otherwise, it must be less than the critical threshold."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ }
+ },
+ "required": [
+ "aggregate",
+ "name",
+ "projects",
+ "query",
+ "thresholdType",
+ "timeWindow",
+ "triggers"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "201": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ },
+ "examples": {
+ "CreateAMetricAlertRuleForAnOrganization": {
+ "value": {
+ "id": "177104",
+ "name": "Apdex % Check",
+ "organizationId": "4505676595200000",
+ "queryType": 2,
+ "dataset": "metrics",
+ "query": "",
+ "aggregate": "percentage(sessions_crashed, sessions) AS _crash_rate_alert_aggregate",
+ "thresholdType": 0,
+ "resolveThreshold": 80,
+ "timeWindow": 120,
+ "environment": null,
+ "triggers": [
+ {
+ "id": "293990",
+ "alertRuleId": "177104",
+ "label": "critical",
+ "thresholdType": 0,
+ "alertThreshold": 75,
+ "resolveThreshold": 80,
+ "dateCreated": "2023-09-25T22:01:28.673305Z",
+ "actions": [
+ {
+ "id": "281887",
+ "alertRuleTriggerId": "293990",
+ "type": "email",
+ "targetType": "team",
+ "targetIdentifier": "2378589792734981",
+ "inputChannelId": null,
+ "integrationId": null,
+ "sentryAppId": null,
+ "dateCreated": "2023-09-25T22:01:28.680793Z"
+ }
+ ]
+ },
+ {
+ "id": "492849",
+ "alertRuleId": "482923",
+ "label": "warning",
+ "thresholdType": 1,
+ "alertThreshold": 50,
+ "resolveThreshold": 80,
+ "dateCreated": "2023-09-25T22:01:28.673305Z",
+ "actions": []
+ }
+ ],
+ "projects": [
+ "our-project"
+ ],
+ "owner": "team:4505676595200000",
+ "originalAlertRuleId": null,
+ "comparisonDelta": 10080,
+ "dateModified": "2023-09-25T22:01:28.637506Z",
+ "dateCreated": "2023-09-25T22:01:28.637514Z",
+ "createdBy": {
+ "id": 2837708,
+ "name": "Jane Doe",
+ "email": "jane.doe@sentry.io"
+ }
+ },
+ "summary": "Create a metric alert rule for an organization"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ },
+ "/api/0/organizations/{organization_id_or_slug}/alert-rules/{alert_rule_id}/": {
+ "get": {
+ "operationId": "Retrieve a Metric Alert Rule for an Organization",
+ "description": "Return details on an individual metric alert rule.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "alert_rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ },
+ "examples": {
+ "GetDetailedViewAboutAMetricAlertRule": {
+ "value": {
+ "id": "177412243058",
+ "name": "My Metric Alert Rule",
+ "organizationId": "4505676595200000",
+ "queryType": 0,
+ "dataset": "events",
+ "query": "",
+ "aggregate": "count_unique(user)",
+ "thresholdType": 0,
+ "resolveThreshold": null,
+ "timeWindow": 60,
+ "environment": null,
+ "triggers": [
+ {
+ "id": "294385908",
+ "alertRuleId": "177412243058",
+ "label": "critical",
+ "thresholdType": 0,
+ "alertThreshold": 31,
+ "resolveThreshold": null,
+ "dateCreated": "2023-09-26T22:14:17.557579Z",
+ "actions": []
+ }
+ ],
+ "projects": [
+ "my-coolest-project"
+ ],
+ "owner": "team:29508397892374892",
+ "dateModified": "2023-09-26T22:14:17.522166Z",
+ "dateCreated": "2023-09-26T22:14:17.522196Z",
+ "createdBy": {
+ "id": 2834985497897,
+ "name": "Somebody That I Used to Know",
+ "email": "anon@sentry.io"
+ },
+ "eventTypes": [
+ "default",
+ "error"
+ ]
+ },
+ "summary": "Get detailed view about a metric alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "put": {
+ "operationId": "Update a Metric Alert Rule",
+ "description": "Updates a metric alert rule. See **Metric Alert Rule Types** under\n[Create a Metric Alert Rule for an Organization](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types)\nto see valid request body configurations for different types of metric alert rule types.\n> Warning: Calling this endpoint fully overwrites the specified metric alert.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "alert_rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule.",
+ "maxLength": 256
+ },
+ "aggregate": {
+ "type": "string",
+ "description": "A string representing the aggregate function used in this alert rule. Valid aggregate functions are `count`, `count_unique`, `percentage`, `avg`, `apdex`, `failure_rate`, `p50`, `p75`, `p95`, `p99`, `p100`, and `percentile`. See **Metric Alert Rule Types** under [Create a Metric Alert Rule](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types) for valid configurations."
+ },
+ "timeWindow": {
+ "enum": [
+ 1,
+ 5,
+ 10,
+ 15,
+ 30,
+ 60,
+ 120,
+ 240,
+ 1440
+ ],
+ "type": "integer",
+ "description": "The time period to aggregate over.\n\n* `1` - 1 minute\n* `5` - 5 minutes\n* `10` - 10 minutes\n* `15` - 15 minutes\n* `30` - 30 minutes\n* `60` - 1 hour\n* `120` - 2 hours\n* `240` - 4 hours\n* `1440` - 24 hours"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The names of the projects to filter by."
+ },
+ "query": {
+ "type": "string",
+ "description": "An event search query to subscribe to and monitor for alerts. For example, to filter transactions so that only those with status code 400 are included, you could use `\"query\": \"http.status_code:400\"`. Use an empty string for no filter."
+ },
+ "thresholdType": {
+ "enum": [
+ 0,
+ 1
+ ],
+ "type": "integer",
+ "description": "The comparison operator for the critical and warning thresholds. The comparison operator for the resolved threshold is automatically set to the opposite operator. When a percentage change threshold is used, `0` is equivalent to \"Higher than\" and `1` is equivalent to \"Lower than\".\n\n* `0` - Above\n* `1` - Below"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {},
+ "description": "\nA list of triggers, where each trigger is an object with the following fields:\n- `label`: One of `critical` or `warning`. A `critical` trigger is always required.\n- `alertThreshold`: The value that the subscription needs to reach to trigger the\nalert rule.\n- `actions`: A list of actions that take place when the threshold is met.\n```json\ntriggers: [\n {\n \"label\": \"critical\",\n \"alertThreshold\": 100,\n \"actions\": [\n {\n \"type\": \"email\",\n \"targetType\": \"user\",\n \"targetIdentifier\": \"23489853\",\n \"inputChannelId\": None\n \"integrationId\": None,\n \"sentryAppId\": None\n }\n ]\n },\n {\n \"label\": \"warning\",\n \"alertThreshold\": 75,\n \"actions\": []\n }\n]\n```\nMetric alert rule trigger actions follow the following structure:\n- `type`: The type of trigger action. Valid values are `email`, `slack`, `msteams`, `pagerduty`, `sentry_app`, `sentry_notification`, and `opsgenie`.\n- `targetType`: The type of target the notification will be sent to. Valid values are `specific`, `user`, `team`, and `sentry_app`.\n- `targetIdentifier`: The ID of the target. This must be an integer for PagerDuty and Sentry apps, and a string for all others. Examples of appropriate values include a Slack channel name (`#my-channel`), a user ID, a team ID, a Sentry app ID, etc.\n- `inputChannelId`: The ID of the Slack channel. This is only used for the Slack action, and can be used as an alternative to providing the `targetIdentifier`.\n- `integrationId`: The integration ID. This is required for every action type except `email` and `sentry_app.`\n- `sentryAppId`: The ID of the Sentry app. This is required when `type` is `sentry_app`.\n- `priority`: The severity of the Pagerduty alert or the priority of the Opsgenie alert (optional). Defaults for Pagerduty are `critical` for critical and `warning` for warning. Defaults for Opsgenie are `P1` for critical and `P2` for warning.\n"
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by. Defaults to all environments."
+ },
+ "dataset": {
+ "type": "string",
+ "description": "The name of the dataset that this query will be executed on. Valid values are `events`, `transactions`, `metrics`, `sessions`, and `generic-metrics`. Defaults to `events`. See **Metric Alert Rule Types** under [Create a Metric Alert Rule](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types) for valid configurations."
+ },
+ "queryType": {
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "description": "The type of query. If no value is provided, `queryType` is set to the default for the specified `dataset.` See **Metric Alert Rule Types** under [Create a Metric Alert Rule](/api/alerts/create-a-metric-alert-rule-for-an-organization/#metric-alert-rule-types) for valid configurations.\n\n* `0` - event.type:error\n* `1` - event.type:transaction\n* `2` - None"
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of event types that this alert will be related to. Valid values are `default` (events captured using [Capture Message](/product/sentry-basics/integrate-backend/capturing-errors/#capture-message)), `error` and `transaction`."
+ },
+ "comparisonDelta": {
+ "type": "integer",
+ "description": "An optional int representing the time delta to use as the comparison period, in minutes. Required when using a percentage change threshold (\"x%\" higher or lower compared to `comparisonDelta` minutes ago). A percentage change threshold cannot be used for [Crash Free Session Rate](/api/alerts/create-a-metric-alert-rule-for-an-organization/#crash-free-session-rate) or [Crash Free User Rate](/api/alerts/create-a-metric-alert-rule-for-an-organization/#crash-free-user-rate)."
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "description": "Optional value that the metric needs to reach to resolve the alert. If no value is provided, this is set automatically based on the lowest severity trigger's `alertThreshold`. For example, if the alert is set to trigger at the warning level when the number of errors is above 50, then the alert would be set to resolve when there are less than 50 errors. If `thresholdType` is `0`, `resolveThreshold` must be greater than the critical threshold. Otherwise, it must be less than the critical threshold."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ }
+ },
+ "required": [
+ "aggregate",
+ "name",
+ "projects",
+ "query",
+ "thresholdType",
+ "timeWindow",
+ "triggers"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "org:admin",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Metric Alert Rule.",
+ "properties": {
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "queryType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "resolveThreshold": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "dataset": {
+ "type": "string",
+ "nullable": true
+ },
+ "thresholdType": {
+ "type": "integer",
+ "nullable": true
+ },
+ "eventTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "originalAlertRuleId": {
+ "type": "string",
+ "nullable": true
+ },
+ "comparisonDelta": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "snooze": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "extrapolationMode": {
+ "type": "string",
+ "nullable": true
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "query": {
+ "type": "string"
+ },
+ "aggregate": {
+ "type": "string"
+ },
+ "timeWindow": {
+ "type": "number",
+ "format": "double"
+ },
+ "triggers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "dateModified": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdBy": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "required": [
+ "aggregate",
+ "createdBy",
+ "dateCreated",
+ "dateModified",
+ "id",
+ "name",
+ "organizationId",
+ "query",
+ "timeWindow",
+ "triggers"
+ ]
+ },
+ "examples": {
+ "UpdateAMetricAlertRule": {
+ "value": {
+ "id": "345989573",
+ "name": "P30 Transaction Duration",
+ "organizationId": "02403489017",
+ "queryType": 1,
+ "dataset": "transactions",
+ "query": "",
+ "aggregate": "percentile(transaction.duration,0.3)",
+ "thresholdType": 1,
+ "resolveThreshold": null,
+ "timeWindow": 60,
+ "environment": null,
+ "triggers": [
+ {
+ "id": "0543809890",
+ "alertRuleId": "345989573",
+ "label": "critical",
+ "thresholdType": 1,
+ "alertThreshold": 70,
+ "resolveThreshold": null,
+ "dateCreated": "2023-09-25T23:35:31.832084Z",
+ "actions": []
+ }
+ ],
+ "projects": [
+ "backend"
+ ],
+ "owner": "team:9390258908",
+ "originalAlertRuleId": null,
+ "comparisonDelta": 10080,
+ "dateModified": "2023-09-25T23:35:31.787866Z",
+ "dateCreated": "2023-09-25T23:35:31.787875Z",
+ "createdBy": {
+ "id": 902843590658,
+ "name": "Spongebob Squarepants",
+ "email": "spongebob.s@example.com"
+ }
+ },
+ "summary": "Update a metric alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "Delete a Metric Alert Rule",
+ "description": "Delete a specific metric alert rule.\n\nA metric alert rule is a configuration that defines the conditions for triggering an alert.\nIt specifies the metric type, function, time interval, and threshold\nvalues that determine when an alert should be triggered. Metric alert rules are used to monitor\nand notify you when certain metrics, like error count, latency, or failure rate, cross a\npredefined threshold. These rules help you proactively identify and address issues in your\nproject.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "alert_rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "org:admin",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "202": {
+ "description": "Accepted"
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ },
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/": {
+ "get": {
+ "operationId": "List a Project's Issue Alert Rules",
+ "description": "Return a list of active issue alert rules bound to a project.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions: specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "alerts:write",
+ "project:admin",
+ "project:read",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ }
+ },
+ "examples": {
+ "ListIssueAlertRulesForAProject": {
+ "value": [
+ {
+ "id": "3",
+ "conditions": [
+ {
+ "interval": "1h",
+ "id": "sentry.rules.conditions.event_frequency.EventFrequencyCondition",
+ "value": 1000
+ }
+ ],
+ "filters": [
+ {
+ "value": "1",
+ "id": "sentry.rules.filters.issue_category.IssueCategoryFilter"
+ },
+ {
+ "value": "2",
+ "id": "sentry.rules.filters.issue_category.IssueCategoryFilter"
+ }
+ ],
+ "actions": [
+ {
+ "targetType": "Team",
+ "fallthroughType": "ActiveMembers",
+ "id": "sentry.mail.actions.NotifyEmailAction",
+ "targetIdentifier": 4367234414355
+ }
+ ],
+ "actionMatch": "any",
+ "filterMatch": "any",
+ "frequency": 60,
+ "name": "High Number of Issues with Production",
+ "dateCreated": "2023-01-15T06:45:34.353346Z",
+ "owner": "team:63562",
+ "createdBy": {
+ "id": 2435786,
+ "name": "John Doe",
+ "email": "john.doe@example.com"
+ },
+ "environment": "prod",
+ "projects": [
+ "melody"
+ ],
+ "status": "active",
+ "lastTriggered": "2023-07-15T00:00:00.351236Z",
+ "snooze": false
+ }
+ ],
+ "summary": "List issue alert rules for a project"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Create an Issue Alert Rule for a Project",
+ "description": "Create a new issue alert rule for the given project.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions: specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule.",
+ "maxLength": 256
+ },
+ "frequency": {
+ "type": "integer",
+ "maximum": 43200,
+ "minimum": 5,
+ "description": "How often to perform the actions once for an issue, in minutes. The valid range is `5` to `43200`."
+ },
+ "actionMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which of the conditions need to be true before any filters are evaluated.\n\n* `all` - All conditions must evaluate to true.\n* `any` - At least one of the conditions must evaluate to true.\n* `none` - All conditions must evaluate to false."
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "\nA list of triggers that determine when the rule fires. See below for a list of possible conditions.\n\n**A new issue is created**\n```json\n{\n \"id\": \"sentry.rules.conditions.first_seen_event.FirstSeenEventCondition\"\n}\n```\n\n**The issue changes state from resolved to unresolved**\n```json\n{\n \"id\": \"sentry.rules.conditions.regression_event.RegressionEventCondition\"\n}\n```\n\n**The issue is seen more than `value` times in `interval`**\n- `value` - An integer\n- `interval` - Valid values are `1m`, `5m`, `15m`, `1h`, `1d`, `1w` and `30d` (`m` for minutes, `h` for hours, `d` for days, and `w` for weeks).\n```json\n{\n \"id\": \"sentry.rules.conditions.event_frequency.EventFrequencyCondition\",\n \"value\": 500,\n \"interval\": \"1h\"\n}\n```\n\n**The issue is seen by more than `value` users in `interval`**\n- `value` - An integer\n- `interval` - Valid values are `1m`, `5m`, `15m`, `1h`, `1d`, `1w` and `30d` (`m` for minutes, `h` for hours, `d` for days, and `w` for weeks).\n```json\n{\n \"id\": \"sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition\",\n \"value\": 1000,\n \"interval\": \"15m\"\n}\n```\n\n**The issue affects more than `value` percent of sessions in `interval`**\n- `value` - A float\n- `interval` - Valid values are `5m`, `10m`, `30m`, and `1h` (`m` for minutes, `h` for hours).\n```json\n{\n \"id\": \"sentry.rules.conditions.event_frequency.EventFrequencyPercentCondition\",\n \"value\": 50.0,\n \"interval\": \"10m\"\n}\n```\n"
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "\nA list of actions that take place when all required conditions and filters for the rule are met. See below for a list of possible actions.\n\n**Send a notification to Suggested Assignees**\n- `fallthroughType` - Who the notification should be sent to if there are no suggested assignees. Valid values are `ActiveMembers`, `AllMembers`, and `NoOne`.\n```json\n{\n \"id\" - \"sentry.mail.actions.NotifyEmailAction\",\n \"targetType\" - \"IssueOwners\",\n \"fallthroughType\" - \"ActiveMembers\"\n}\n```\n\n**Send a notification to a Member or a Team**\n- `targetType` - One of `Member` or `Team`.\n- `fallthroughType` - Who the notification should be sent to if it cannot be sent to the original target. Valid values are `ActiveMembers`, `AllMembers`, and `NoOne`.\n- `targetIdentifier` - The ID of the Member or Team the notification should be sent to.\n```json\n{\n \"id\": \"sentry.mail.actions.NotifyEmailAction\",\n \"targetType\": \"Team\"\n \"fallthroughType\": \"AllMembers\"\n \"targetIdentifier\": 4524986223\n}\n```\n\n**Send a Slack notification**\n- `workspace` - The integration ID associated with the Slack workspace.\n- `channel` - The name of the channel to send the notification to (e.g., #critical, Jane Schmidt).\n- `channel_id` (optional) - The ID of the channel to send the notification to.\n- `tags` (optional) - A string of tags to show in the notification, separated by commas (e.g., \"environment, user, my_tag\").\n- `notes` (optional) - Text to show alongside the notification. To @ a user, include their user id like `@`. To include a clickable link, format the link and title like ``.\n```json\n{\n \"id\": \"sentry.integrations.slack.notify_action.SlackNotifyServiceAction\",\n \"workspace\": 293854098,\n \"channel\": \"#warning\",\n \"tags\": \"environment,level\"\n \"notes\": \"Please for triage information\"\n}\n```\n\n**Send a Microsoft Teams notification**\n- `team` - The integration ID associated with the Microsoft Teams team.\n- `channel` - The name of the channel to send the notification to.\n```json\n{\n \"id\": \"sentry.integrations.msteams.notify_action.MsTeamsNotifyServiceAction\",\n \"team\": 23465424,\n \"channel\": \"General\"\n}\n```\n\n**Send a Discord notification**\n- `server` - The integration ID associated with the Discord server.\n- `channel_id` - The ID of the channel to send the notification to.\n- `tags` (optional) - A string of tags to show in the notification, separated by commas (e.g., \"environment, user, my_tag\").\n```json\n{\n \"id\": \"sentry.integrations.discord.notify_action.DiscordNotifyServiceAction\",\n \"server\": 63408298,\n \"channel_id\": 94732897,\n \"tags\": \"browser,user\"\n}\n```\n\n**Create a Jira Ticket**\n- `integration` - The integration ID associated with Jira.\n- `project` - The ID of the Jira project.\n- `issuetype` - The ID of the type of issue that the ticket should be created as.\n- `dynamic_form_fields` - A list of any custom fields you want to include in the ticket as objects.\n```json\n{\n \"id\": \"sentry.integrations.jira.notify_action.JiraCreateTicketAction\",\n \"integration\": 321424,\n \"project\": \"349719\"\n \"issueType\": \"1\"\n}\n```\n\n**Create a Jira Server Ticket**\n- `integration` - The integration ID associated with Jira Server.\n- `project` - The ID of the Jira Server project.\n- `issuetype` - The ID of the type of issue that the ticket should be created as.\n- `dynamic_form_fields` - A list of any custom fields you want to include in the ticket as objects.\n```json\n{\n \"id\": \"sentry.integrations.jira_server.notify_action.JiraServerCreateTicketAction\",\n \"integration\": 321424,\n \"project\": \"349719\"\n \"issueType\": \"1\"\n}\n```\n\n**Create a GitHub Issue**\n- `integration` - The integration ID associated with GitHub.\n- `repo` - The name of the repository to create the issue in.\n- `title` - The title of the issue.\n- `body` (optional) - The contents of the issue.\n- `assignee` (optional) - The GitHub user to assign the issue to.\n- `labels` (optional) - A list of labels to assign to the issue.\n```json\n{\n \"id\": \"sentry.integrations.github.notify_action.GitHubCreateTicketAction\",\n \"integration\": 93749,\n \"repo\": default,\n \"title\": \"My Test Issue\",\n \"assignee\": \"Baxter the Hacker\",\n \"labels\": [\"bug\", \"p1\"]\n \"\"\n}\n```\n\n**Create a GitHub Enterprise Issue**\n- `integration` - The integration ID associated with GitHub Enterprise.\n- `repo` - The name of the repository to create the issue in.\n- `title` - The title of the issue.\n- `body` (optional) - The contents of the issue.\n- `assignee` (optional) - The GitHub user to assign the issue to.\n- `labels` (optional) - A list of labels to assign to the issue.\n```json\n{\n \"id\": \"sentry.integrations.github_enterprise.notify_action.GitHubEnterpriseCreateTicketAction\",\n \"integration\": 93749,\n \"repo\": default,\n \"title\": \"My Test Issue\",\n \"assignee\": \"Baxter the Hacker\",\n \"labels\": [\"bug\", \"p1\"]\n \"\"\n}\n```\n\n**Create an Azure DevOps work item**\n- `integration` - The integration ID.\n- `project` - The ID of the Azure DevOps project.\n- `work_item_type` - The type of work item to create.\n- `dynamic_form_fields` - A list of any custom fields you want to include in the work item as objects.\n```json\n{\n \"id\": \"sentry.integrations.vsts.notify_action.AzureDevopsCreateTicketAction\",\n \"integration\": 294838,\n \"project\": \"0389485\",\n \"work_item_type\": \"Microsoft.VSTS.WorkItemTypes.Task\",\n}\n```\n\n**Send a PagerDuty notification**\n- `account` - The integration ID associated with the PagerDuty account.\n- `service` - The ID of the service to send the notification to.\n- `severity` - The severity of the Pagerduty alert. This is optional, the default is `critical` for fatal issues, `error` for error issues, `warning` for warning issues, and `info` for info and debug issues.\n```json\n{\n \"id\": \"sentry.integrations.pagerduty.notify_action.PagerDutyNotifyServiceAction\",\n \"account\": 92385907,\n \"service\": 9823924,\n \"severity\": \"critical\"\n}\n```\n\n**Send an Opsgenie notification**\n- `account` - The integration ID associated with the Opsgenie account.\n- `team` - The ID of the Opsgenie team to send the notification to.\n- `priority` - The priority of the Opsgenie alert. This is optional, the default is `P3`.\n```json\n{\n \"id\": \"sentry.integrations.opsgenie.notify_action.OpsgenieNotifyTeamAction\",\n \"account\": 8723897589,\n \"team\": \"9438930258-fairy\",\n \"priority\": \"P1\"\n}\n```\n\n**Send a notification to a service**\n- `service` - The plugin slug.\n```json\n{\n \"id\": \"sentry.rules.actions.notify_event_service.NotifyEventServiceAction\",\n \"service\": \"mail\"\n}\n```\n\n**Send a notification to a Sentry app with a custom webhook payload**\n- `settings` - A list of objects denoting the settings each action will be created with. All required fields must be included.\n- `sentryAppInstallationUuid` - The ID for the Sentry app\n```json\n{\n \"id\": \"sentry.rules.actions.notify_event_sentry_app.NotifyEventSentryAppAction\",\n \"settings\": [\n {\"name\": \"title\", \"value\": \"Team Rocket\"},\n {\"name\": \"summary\", \"value\": \"We're blasting off again.\"},\n ],\n \"sentryAppInstallationUuid\": 643522\n \"hasSchemaFormConfig\": true\n}\n```\n\n**Send a notification (for all legacy integrations)**\n```json\n{\n \"id\": \"sentry.rules.actions.notify_event.NotifyEventAction\"\n}\n```\n"
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ },
+ "filterMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which filters need to be true before any actions take place. Required when a value is provided for `filters`.\n\n* `all` - All filters must evaluate to true.\n* `any` - At least one of the filters must evaluate to true.\n* `none` - All filters must evaluate to false."
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "\nA list of filters that determine if a rule fires after the necessary conditions have been met. See below for a list of possible filters.\n\n**The issue is `comparison_type` than `value` `time`**\n- `comparison_type` - One of `older` or `newer`\n- `value` - An integer\n- `time` - The unit of time. Valid values are `minute`, `hour`, `day`, and `week`.\n```json\n{\n \"id\": \"sentry.rules.filters.age_comparison.AgeComparisonFilter\",\n \"comparison_type\": \"older\",\n \"value\": 3,\n \"time\": \"week\"\n}\n```\n\n**The issue has happened at least `value` times**\n- `value` - An integer\n```json\n{\n \"id\": \"sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter\",\n \"value\": 120\n}\n```\n\n**The issue is assigned to No One**\n```json\n{\n \"id\": \"sentry.rules.filters.assigned_to.AssignedToFilter\",\n \"targetType\": \"Unassigned\"\n}\n```\n\n**The issue is assigned to `targetType`**\n- `targetType` - One of `Team` or `Member`\n- `targetIdentifier` - The target's ID\n```json\n{\n \"id\": \"sentry.rules.filters.assigned_to.AssignedToFilter\",\n \"targetType\": \"Member\",\n \"targetIdentifier\": 895329789\n}\n```\n\n**The event is from the latest release**\n```json\n{\n \"id\": \"sentry.rules.filters.latest_release.LatestReleaseFilter\"\n}\n```\n\n**The issue's category is equal to `value`**\n- `value` - An integer correlated with a category. Valid values are `1` (Error), `2` (Performance), `3` (Profile), `4` (Cron), and `5` (Replay).\n```json\n{\n \"id\": \"sentry.rules.filters.issue_category.IssueCategoryFilter\",\n \"value\": 2\n}\n```\n\n**The event's `attribute` value `match` `value`**\n- `attribute` - Valid values are `message`, `platform`, `environment`, `type`, `error.handled`, `error.unhandled`, `error.main_thread`, `exception.type`, `exception.value`, `user.id`, `user.email`, `user.username`, `user.ip_address`, `http.method`, `http.url`, `http.status_code`, `sdk.name`, `stacktrace.code`, `stacktrace.module`, `stacktrace.filename`, `stacktrace.abs_path`, `stacktrace.package`, `unreal.crash_type`, `app.in_foreground`.\n- `match` - The comparison operator. Valid values are `eq` (equals), `ne` (does not equal), `sw` (starts with), `ew` (ends with), `co` (contains), `nc` (does not contain), `is` (is set), and `ns` (is not set).\n- `value` - A string. Not required when `match` is `is` or `ns`.\n```json\n{\n \"id\": \"sentry.rules.conditions.event_attribute.EventAttributeCondition\",\n \"attribute\": \"http.url\",\n \"match\": \"nc\",\n \"value\": \"localhost\"\n}\n```\n\n**The event's tags match `key` `match` `value`**\n- `key` - The tag\n- `match` - The comparison operator. Valid values are `eq` (equals), `ne` (does not equal), `sw` (starts with), `ew` (ends with), `co` (contains), `nc` (does not contain), `is` (is set), and `ns` (is not set).\n- `value` - A string. Not required when `match` is `is` or `ns`.\n```json\n{\n \"id\": \"sentry.rules.filters.tagged_event.TaggedEventFilter\",\n \"key\": \"level\",\n \"match\": \"eq\"\n \"value\": \"error\"\n}\n```\n\n**The event's level is `match` `level`**\n- `match` - Valid values are `eq`, `gte`, and `lte`.\n- `level` - Valid values are `50` (fatal), `40` (error), `30` (warning), `20` (info), `10` (debug), `0` (sample).\n```json\n{\n \"id\": \"sentry.rules.filters.level.LevelFilter\",\n \"match\": \"gte\"\n \"level\": \"50\"\n}\n```\n"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "frequency",
+ "name"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "project:admin",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "201": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ },
+ "examples": {
+ "IssueAlertSuccessfullyCreated": {
+ "value": {
+ "id": "1",
+ "conditions": [
+ {
+ "id": "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
+ }
+ ],
+ "filters": [
+ {
+ "targetType": "Unassigned",
+ "id": "sentry.rules.filters.assigned_to.AssignedToFilter",
+ "targetIdentifier": ""
+ }
+ ],
+ "actions": [
+ {
+ "targetType": "Member",
+ "fallthroughType": "ActiveMembers",
+ "id": "sentry.mail.actions.NotifyEmailAction",
+ "targetIdentifier": 1523125
+ }
+ ],
+ "actionMatch": "any",
+ "filterMatch": "all",
+ "frequency": 1440,
+ "name": "Owner Alert",
+ "dateCreated": "2023-09-08T20:00:07.244602Z",
+ "owner": "team:74234",
+ "createdBy": {
+ "id": 24601,
+ "name": "Jean Valjean",
+ "email": "jean@example.com"
+ },
+ "environment": null,
+ "projects": [
+ "python"
+ ],
+ "status": "active",
+ "snooze": false
+ },
+ "summary": "Issue alert successfully created"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ },
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/": {
+ "get": {
+ "operationId": "Retrieve an Issue Alert Rule for a Project",
+ "description": "Return details on an individual issue alert rule.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers - specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters - help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions - specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:read",
+ "alerts:write",
+ "project:admin",
+ "project:read",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ },
+ "examples": {
+ "GetDetailedViewAboutAnIssueAlertRule": {
+ "value": {
+ "id": "7",
+ "conditions": [
+ {
+ "id": "sentry.rules.conditions.regression_event.RegressionEventCondition"
+ }
+ ],
+ "filters": [
+ {
+ "id": "sentry.rules.filters.age_comparison.AgeComparisonFilter",
+ "comparison_type": "older",
+ "value": 4,
+ "time": "week"
+ },
+ {
+ "id": "sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter",
+ "value": 1000
+ }
+ ],
+ "actions": [
+ {
+ "id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
+ "workspace": 976462356,
+ "channel": "#fatal",
+ "tags": "browser,release"
+ }
+ ],
+ "actionMatch": "all",
+ "filterMatch": "all",
+ "frequency": 60,
+ "name": "Many Old Regressions!",
+ "dateCreated": "2023-02-17T18:31:14.246012Z",
+ "owner": "user:635623",
+ "createdBy": {
+ "id": 635623,
+ "name": "John Doe",
+ "email": "john.doe@email.com"
+ },
+ "environment": null,
+ "projects": [
+ "javascript"
+ ],
+ "status": "active",
+ "snooze": false
+ },
+ "summary": "Get detailed view about an issue alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "put": {
+ "operationId": "Update an Issue Alert Rule",
+ "description": "Updates an issue alert rule.\n> Warning: Calling this endpoint fully overwrites the specified issue alert.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers - specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters - help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions - specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name for the rule.",
+ "maxLength": 256
+ },
+ "actionMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which of the conditions need to be true before any filters are evaluated.\n\n* `all` - All conditions must evaluate to true.\n* `any` - At least one of the conditions must evaluate to true.\n* `none` - All conditions must evaluate to false."
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "A list of triggers that determine when the rule fires. See [Create an Issue Alert Rule](/api/alerts/create-an-issue-alert-rule-for-a-project) for valid conditions."
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "A list of actions that take place when all required conditions and filters for the rule are met. See [Create an Issue Alert Rule](/api/alerts/create-an-issue-alert-rule-for-a-project) for valid actions."
+ },
+ "frequency": {
+ "type": "integer",
+ "maximum": 43200,
+ "minimum": 5,
+ "description": "How often to perform the actions once for an issue, in minutes. The valid range is `5` to `43200`."
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the environment to filter by."
+ },
+ "filterMatch": {
+ "enum": [
+ "all",
+ "any",
+ "none"
+ ],
+ "type": "string",
+ "description": "A string determining which filters need to be true before any actions take place.\n\n* `all` - All filters must evaluate to true.\n* `any` - At least one of the filters must evaluate to true.\n* `none` - All filters must evaluate to false."
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "description": "A list of filters that determine if a rule fires after the necessary conditions have been met. See [Create an Issue Alert Rule](/api/alerts/create-an-issue-alert-rule-for-a-project) for valid filters."
+ },
+ "owner": {
+ "type": "string",
+ "nullable": true,
+ "description": "The ID of the team or user that owns the rule."
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "frequency",
+ "name"
+ ]
+ }
+ }
+ },
+ "required": true
+ },
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "project:admin",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "This represents a Sentry Rule.",
+ "properties": {
+ "owner": {
+ "type": "string",
+ "nullable": true
+ },
+ "createdBy": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "id",
+ "name"
+ ],
+ "nullable": true
+ },
+ "environment": {
+ "type": "string",
+ "nullable": true
+ },
+ "lastTriggered": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeCreatedBy": {
+ "type": "string",
+ "nullable": true
+ },
+ "snoozeForEveryone": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "disableReason": {
+ "type": "string"
+ },
+ "disableDate": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "detail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "detail"
+ ]
+ }
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "filters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "actionMatch": {
+ "type": "string"
+ },
+ "filterMatch": {
+ "type": "string"
+ },
+ "frequency": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "projects": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "type": "string"
+ },
+ "snooze": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "actionMatch",
+ "actions",
+ "conditions",
+ "dateCreated",
+ "filterMatch",
+ "filters",
+ "frequency",
+ "id",
+ "name",
+ "projects",
+ "snooze",
+ "status"
+ ]
+ },
+ "examples": {
+ "GetDetailedViewAboutAnIssueAlertRule": {
+ "value": {
+ "id": "7",
+ "conditions": [
+ {
+ "id": "sentry.rules.conditions.regression_event.RegressionEventCondition"
+ }
+ ],
+ "filters": [
+ {
+ "id": "sentry.rules.filters.age_comparison.AgeComparisonFilter",
+ "comparison_type": "older",
+ "value": 4,
+ "time": "week"
+ },
+ {
+ "id": "sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter",
+ "value": 1000
+ },
+ {
+ "id": "sentry.rules.filters.level.LevelFilter",
+ "match": "gte",
+ "level": "40"
+ }
+ ],
+ "actions": [
+ {
+ "id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
+ "workspace": 976462356,
+ "channel": "#fatal",
+ "tags": "browser,release"
+ }
+ ],
+ "actionMatch": "all",
+ "filterMatch": "all",
+ "frequency": 60,
+ "name": "Many Old Regressions!",
+ "dateCreated": "2023-02-17T18:31:14.246012Z",
+ "owner": "user:635623",
+ "createdBy": {
+ "id": 635623,
+ "name": "John Doe",
+ "email": "john.doe@email.com"
+ },
+ "environment": null,
+ "projects": [
+ "javascript"
+ ],
+ "status": "active",
+ "snooze": false
+ },
+ "summary": "Get detailed view about an issue alert rule"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "Delete an Issue Alert Rule",
+ "description": "Delete a specific issue alert rule.\n\nAn issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:\n- Triggers: specify what type of activity you'd like monitored or when an alert should be triggered.\n- Filters: help control noise by triggering an alert only if the issue matches the specified criteria.\n- Actions: specify what should happen when the trigger conditions are met and the filters match.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "project_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the project the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "rule_id",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "The ID of the rule you'd like to query.",
+ "required": true
+ }
+ ],
+ "tags": [
+ "Alerts"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "alerts:write",
+ "project:admin",
+ "project:write"
+ ]
+ }
+ ],
+ "responses": {
+ "202": {
+ "description": "Accepted"
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-94bc6e59.json b/plugins/openapi/testdata/sentry-94bc6e59.json
new file mode 100644
index 0000000..8add77e
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-94bc6e59.json
@@ -0,0 +1,215 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://sentry.io/"
+ }
+ ],
+ "paths": {
+ "/api/0/organizations/{organization_slug}/events/": {
+ "get": {
+ "operationId": "Query Discover Events in Table Format",
+ "description": "Retrieves discover (also known as events) data for a given organization.\n\n**Note**: This endpoint is intended to get a table of results, and is not for doing a full export of data sent to\nSentry.\n\nThe `field` query parameter determines what fields will be selected in the `data` and `meta` keys of the endpoint response.\n- The `data` key contains a list of results row by row that match the `query` made\n- The `meta` key contains information about the response, including the unit or type of the fields requested",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "end",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The end of the period of time for the query, expected in ISO-8601 format. For example `2001-12-14T12:34:56.7890`"
+ },
+ {
+ "in": "query",
+ "name": "environment",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": "The name of environments to filter by."
+ },
+ {
+ "in": "path",
+ "name": "organization_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "project",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "description": "The ids of projects to filter by. `-1` means all available projects. If this parameter is omitted, the request will default to using 'My Projects'"
+ },
+ {
+ "in": "query",
+ "name": "start",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The start of the period of time for the query, expected in ISO-8601 format. For example `2001-12-14T12:34:56.7890`"
+ },
+ {
+ "in": "query",
+ "name": "statsPeriod",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The period of time for the query, will override the start & end parameters, a number followed by one of:\n- `d` for days\n- `h` for hours\n- `m` for minutes\n- `s` for seconds\n- `w` for weeks\n\nFor example `24h`, to mean query data starting from 24 hours ago to now."
+ },
+ {
+ "in": "query",
+ "name": "field",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": "The fields, functions, or equations to request for the query. At most 20 fields can be selected per request. Each field can be one of the following types:\n- A built-in key field. See possible fields in the [properties table](/product/sentry-basics/search/searchable-properties/#properties-table), under any field that is an event property\n - example: `field=transaction`\n- A tag. Tags should use the `tag[]` formatting to avoid ambiguity with any fields\n - example: `field=tag[isEnterprise]`\n- A function which will be in the format of `function_name(parameters,...)`. See possible functions in the [query builder documentation](/product/discover-queries/query-builder/#stacking-functions)\n - when a function is included, Discover will group by any tags or fields\n - example: `field=count_if(transaction.duration,greater,300)`\n- An equation when prefixed with `equation|`. Read more about [equations here](https://docs.sentry.io/product/discover-queries/query-builder/query-equations/)\n - example: `field=equation|count_if(transaction.duration,greater,300) / count() * 100`\n",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "Limit the number of rows to return in the result. Default and maximum allowed is 100."
+ },
+ {
+ "in": "query",
+ "name": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The search filter for your query, read more about query syntax [here](https://docs.sentry.io/product/sentry-basics/search/)\n\nexample: `query=(transaction:foo AND release:abc) OR (transaction:[bar,baz] AND release:def)`\n"
+ },
+ {
+ "in": "query",
+ "name": "sort",
+ "schema": {
+ "type": "string"
+ },
+ "description": "What to order the results of the query by. Must be something in the `field` list, excluding equations."
+ }
+ ],
+ "tags": [
+ "Discover"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "meta": {
+ "type": "object",
+ "properties": {
+ "fields": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "fields"
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "meta"
+ ]
+ },
+ "examples": {
+ "Success": {
+ "value": {
+ "data": [
+ {
+ "count_if(transaction.duration,greater,300)": 5,
+ "count()": 10,
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": 50,
+ "transaction": "foo"
+ },
+ {
+ "count_if(transaction.duration,greater,300)": 3,
+ "count()": 20,
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": 15,
+ "transaction": "bar"
+ },
+ {
+ "count_if(transaction.duration,greater,300)": 8,
+ "count()": 40,
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": 20,
+ "transaction": "baz"
+ }
+ ],
+ "meta": {
+ "fields": {
+ "count_if(transaction.duration,greater,300)": "integer",
+ "count()": "integer",
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": "number",
+ "transaction": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "400": {
+ "description": "Invalid Query"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-c2f638f6.json b/plugins/openapi/testdata/sentry-c2f638f6.json
new file mode 100644
index 0000000..18b0a6e
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-c2f638f6.json
@@ -0,0 +1,663 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/": {
+ "get": {
+ "tags": [
+ "Events"
+ ],
+ "description": "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint](/api/events/list-an-organizations-issues/) which\nsupports filtering on project and additional functionality.\n\nReturn a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \n\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\n\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\"\"`` (disable),``\"24h\"`` (default), ``\"14d\"``\n\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.",
+ "operationId": "List a Project's Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "statsPeriod",
+ "in": "query",
+ "description": "An optional stat period (can be one of `\"24h\"`, `\"14d\"`, and `\"\"`), defaults to \"24h\" if not provided.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "shortIdLookup",
+ "in": "query",
+ "description": "If this is set to true then short IDs are looked up by this function as well. This can cause the return value of the function to return an event issue of a different project which is why this is an opt-in. Set to 1 to enable.",
+ "schema": {
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query. If not provided an implied `\"is:unresolved\"` is assumed.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "hashes",
+ "in": "query",
+ "description": "A list of hashes of groups to return. Is not compatible with 'query' parameter. The maximum number of hashes that can be sent is 100. If more are sent, only the first 100 will be used.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "lastSeen",
+ "numComments",
+ "userCount",
+ "culprit",
+ "title",
+ "id",
+ "assignedTo",
+ "logger",
+ "stats",
+ "type",
+ "annotations",
+ "metadata",
+ "status",
+ "subscriptionDetails",
+ "isPublic",
+ "hasSeen",
+ "shortId",
+ "shareId",
+ "firstSeen",
+ "count",
+ "permalink",
+ "level",
+ "isSubscribed",
+ "isBookmarked",
+ "project",
+ "statusDetails"
+ ],
+ "properties": {
+ "annotations": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "assignedTo": {
+ "type": "object",
+ "nullable": true
+ },
+ "count": {
+ "type": "string"
+ },
+ "culprit": {
+ "type": "string"
+ },
+ "firstSeen": {
+ "type": "string"
+ },
+ "hasSeen": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "isBookmarked": {
+ "type": "boolean"
+ },
+ "isPublic": {
+ "type": "boolean"
+ },
+ "isSubscribed": {
+ "type": "boolean"
+ },
+ "lastSeen": {
+ "type": "string"
+ },
+ "level": {
+ "type": "string"
+ },
+ "logger": {
+ "type": "string",
+ "nullable": true
+ },
+ "metadata": {
+ "oneOf": [
+ {
+ "type": "object",
+ "required": [
+ "filename",
+ "type",
+ "value"
+ ],
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "title"
+ ],
+ "properties": {
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ },
+ "numComments": {
+ "type": "integer"
+ },
+ "permalink": {
+ "type": "string"
+ },
+ "project": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ }
+ }
+ },
+ "shareId": {
+ "type": "string",
+ "nullable": true
+ },
+ "shortId": {
+ "type": "string"
+ },
+ "stats": {
+ "type": "object",
+ "properties": {
+ "24h": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ },
+ "subscriptionDetails": {
+ "type": "object",
+ "nullable": true
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "userCount": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "annotations": [],
+ "assignedTo": null,
+ "count": "1",
+ "culprit": "raven.scripts.runner in main",
+ "firstSeen": "2018-11-06T21:19:55Z",
+ "hasSeen": false,
+ "id": "1",
+ "isBookmarked": false,
+ "isPublic": false,
+ "isSubscribed": true,
+ "lastSeen": "2018-11-06T21:19:55Z",
+ "level": "error",
+ "logger": null,
+ "metadata": {
+ "title": "This is an example Python exception"
+ },
+ "numComments": 0,
+ "permalink": "https://sentry.io/the-interstellar-jurisdiction/pump-station/issues/1/",
+ "project": {
+ "id": "2",
+ "name": "Pump Station",
+ "slug": "pump-station"
+ },
+ "shareId": null,
+ "shortId": "PUMP-STATION-1",
+ "stats": {
+ "24h": [
+ [
+ 1541455200,
+ 473
+ ],
+ [
+ 1541458800,
+ 914
+ ],
+ [
+ 1541462400,
+ 991
+ ],
+ [
+ 1541466000,
+ 925
+ ],
+ [
+ 1541469600,
+ 881
+ ],
+ [
+ 1541473200,
+ 182
+ ],
+ [
+ 1541476800,
+ 490
+ ],
+ [
+ 1541480400,
+ 820
+ ],
+ [
+ 1541484000,
+ 322
+ ],
+ [
+ 1541487600,
+ 836
+ ],
+ [
+ 1541491200,
+ 565
+ ],
+ [
+ 1541494800,
+ 758
+ ],
+ [
+ 1541498400,
+ 880
+ ],
+ [
+ 1541502000,
+ 677
+ ],
+ [
+ 1541505600,
+ 381
+ ],
+ [
+ 1541509200,
+ 814
+ ],
+ [
+ 1541512800,
+ 329
+ ],
+ [
+ 1541516400,
+ 446
+ ],
+ [
+ 1541520000,
+ 731
+ ],
+ [
+ 1541523600,
+ 111
+ ],
+ [
+ 1541527200,
+ 926
+ ],
+ [
+ 1541530800,
+ 772
+ ],
+ [
+ 1541534400,
+ 400
+ ],
+ [
+ 1541538000,
+ 943
+ ]
+ ]
+ },
+ "status": "unresolved",
+ "statusDetails": {},
+ "subscriptionDetails": null,
+ "title": "This is an example Python exception",
+ "type": "default",
+ "userCount": 0
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:read"
+ ]
+ }
+ ]
+ },
+ "put": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Bulk mutate various attributes on issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be modified.\n\n- For non-status updates, the `id` query parameter is required.\n- For status updates, the `id` query parameter may be omitted\nfor a batch \"update all\" query.\n- An optional `status` query parameter may be used to restrict\nmutations to only events with the given status.\n\nThe following attributes can be modified and are supplied as JSON object in the body:\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Mutate a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be mutated. This parameter shall be repeated for each issue. It is optional only if a status is mutated in which case an implicit update all is assumed.",
+ "required": false,
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "description": "Optionally limits the query to issues of the specified status. Valid values are `\"resolved\"`, `\"reprocessing\"`, `\"unresolved\"`, and `\"ignored\"`.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "The new status for the issues. Valid values are `\"resolved\"`, `\"resolvedInNextRelease\"`, `\"unresolved\"`, and `\"ignored\"`."
+ },
+ "statusDetails": {
+ "type": "object",
+ "properties": {
+ "inRelease": {
+ "type": "string"
+ },
+ "inNextRelease": {
+ "type": "boolean"
+ },
+ "inCommit": {
+ "type": "string"
+ },
+ "ignoreDuration": {
+ "type": "integer"
+ },
+ "ignoreCount": {
+ "type": "integer"
+ },
+ "ignoreWindow": {
+ "type": "integer"
+ },
+ "ignoreUserCount": {
+ "type": "integer"
+ },
+ "ignoreUserWindow": {
+ "type": "integer"
+ }
+ },
+ "description": "Additional details about the resolution. Valid values are `\"inRelease\"`, `\"inNextRelease\"`, `\"inCommit\"`, `\"ignoreDuration\"`, `\"ignoreCount\"`, `\"ignoreWindow\"`, `\"ignoreUserCount\"`, and `\"ignoreUserWindow\"`."
+ },
+ "ignoreDuration": {
+ "type": "integer",
+ "description": "The number of minutes to ignore this issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Sets the issue to public or private."
+ },
+ "merge": {
+ "type": "boolean",
+ "description": "Allows to merge or unmerge different issues."
+ },
+ "assignedTo": {
+ "type": "string",
+ "description": "The actor ID (or username) of the user or team that should be assigned to this issue."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the flag that indicates if the user has seen the event."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the bookmark flag."
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "isPublic",
+ "status",
+ "statusDetails"
+ ],
+ "properties": {
+ "isPublic": {
+ "type": "boolean"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved",
+ "statusDetails": {}
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:write"
+ ]
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Permanently remove the given issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be removed.\n\nOnly queries by 'id' are accepted.\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Remove a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be removed. This parameter shall be repeated for each issue, e.g. `?id=1&id=2&id=3`. If this parameter is not provided, it will attempt to remove the first 1000 issues.",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Project not found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:admin"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-d15557ff.json b/plugins/openapi/testdata/sentry-d15557ff.json
new file mode 100644
index 0000000..5de006d
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-d15557ff.json
@@ -0,0 +1,215 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://sentry.io/"
+ }
+ ],
+ "paths": {
+ "/api/0/organizations/{organization_slug}/events/": {
+ "get": {
+ "operationId": "Query Discover Events in Table Format",
+ "description": "Retrieves discover (also known as events) data for a given organization.\n\n**Eventsv2 Deprecation Note**: Users who may be using the `eventsv2` endpoint should update their requests to the `events` endpoint outline in this document.\nThe `eventsv2` endpoint is not a public endpoint and has no guaranteed availability. If you are not making any API calls to `eventsv2`, you can safely ignore this.\nChanges between `eventsv2` and `events` include:\n- Field keys in the response now match the keys in the requested `field` param exactly.\n- The `meta` object in the response now shows types in the nested `field` object.\n\nAside from the url change, there are no changes to the request payload itself.\n\n**Note**: This endpoint is intended to get a table of results, and is not for doing a full export of data sent to\nSentry.\n\nThe `field` query parameter determines what fields will be selected in the `data` and `meta` keys of the endpoint response.\n- The `data` key contains a list of results row by row that match the `query` made\n- The `meta` key contains information about the response, including the unit or type of the fields requested",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "end",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The end of the period of time for the query, expected in ISO-8601 format. For example `2001-12-14T12:34:56.7890`"
+ },
+ {
+ "in": "query",
+ "name": "environment",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": "The name of environments to filter by."
+ },
+ {
+ "in": "path",
+ "name": "organization_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "project",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "description": "The ids of projects to filter by. `-1` means all available projects. If this parameter is omitted, the request will default to using 'My Projects'"
+ },
+ {
+ "in": "query",
+ "name": "start",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The start of the period of time for the query, expected in ISO-8601 format. For example `2001-12-14T12:34:56.7890`"
+ },
+ {
+ "in": "query",
+ "name": "statsPeriod",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The period of time for the query, will override the start & end parameters, a number followed by one of:\n- `d` for days\n- `h` for hours\n- `m` for minutes\n- `s` for seconds\n- `w` for weeks\n\nFor example `24h`, to mean query data starting from 24 hours ago to now."
+ },
+ {
+ "in": "query",
+ "name": "field",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": "The fields, functions, or equations to request for the query. At most 20 fields can be selected per request. Each field can be one of the following types:\n- A built-in key field. See possible fields in the [properties table](/product/sentry-basics/search/searchable-properties/#properties-table), under any field that is an event property\n - example: `field=transaction`\n- A tag. Tags should use the `tag[]` formatting to avoid ambiguity with any fields\n - example: `field=tag[isEnterprise]`\n- A function which will be in the format of `function_name(parameters,...)`. See possible functions in the [query builder documentation](/product/discover-queries/query-builder/#stacking-functions)\n - when a function is included, Discover will group by any tags or fields\n - example: `field=count_if(transaction.duration,greater,300)`\n- An equation when prefixed with `equation|`. Read more about [equations here](https://docs.sentry.io/product/discover-queries/query-builder/query-equations/)\n - example: `field=equation|count_if(transaction.duration,greater,300) / count() * 100`\n",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "schema": {
+ "type": "integer"
+ },
+ "description": "Limit the number of rows to return in the result. Default and maximum allowed is 100."
+ },
+ {
+ "in": "query",
+ "name": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The search filter for your query, read more about query syntax [here](https://docs.sentry.io/product/sentry-basics/search/)\n\nexample: `query=(transaction:foo AND release:abc) OR (transaction:[bar,baz] AND release:def)`\n"
+ },
+ {
+ "in": "query",
+ "name": "sort",
+ "schema": {
+ "type": "string"
+ },
+ "description": "What to order the results of the query by. Must be something in the `field` list, excluding equations."
+ }
+ ],
+ "tags": [
+ "Discover"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
+ }
+ },
+ "meta": {
+ "type": "object",
+ "properties": {
+ "fields": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "fields"
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "meta"
+ ]
+ },
+ "examples": {
+ "Success": {
+ "value": {
+ "data": [
+ {
+ "count_if(transaction.duration,greater,300)": 5,
+ "count()": 10,
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": 50,
+ "transaction": "foo"
+ },
+ {
+ "count_if(transaction.duration,greater,300)": 3,
+ "count()": 20,
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": 15,
+ "transaction": "bar"
+ },
+ {
+ "count_if(transaction.duration,greater,300)": 8,
+ "count()": 40,
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": 20,
+ "transaction": "baz"
+ }
+ ],
+ "meta": {
+ "fields": {
+ "count_if(transaction.duration,greater,300)": "integer",
+ "count()": "integer",
+ "equation|count_if(transaction.duration,greater,300) / count() * 100": "number",
+ "transaction": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "400": {
+ "description": "Invalid Query"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-d64149d6.json b/plugins/openapi/testdata/sentry-d64149d6.json
new file mode 100644
index 0000000..ead9ae2
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-d64149d6.json
@@ -0,0 +1,663 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/": {
+ "get": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Return a list of issues (groups) bound to a project. All parameters are supplied as query string parameters. \n\n A default query of ``is:unresolved`` is applied. To return results with other statuses send an new query value (i.e. ``?query=`` for all results).\n\nThe ``statsPeriod`` parameter can be used to select the timeline stats which should be present. Possible values are: ``\"\"`` (disable),``\"24h\"`` (default), ``\"14d\"``\n\nUser feedback items from the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget) are built off the issue platform, so to return a list of user feedback items for a specific project, filter for `issue.category:feedback`.",
+ "operationId": "List a Project's Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "statsPeriod",
+ "in": "query",
+ "description": "An optional stat period (can be one of `\"24h\"`, `\"14d\"`, and `\"\"`), defaults to \"24h\" if not provided.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "shortIdLookup",
+ "in": "query",
+ "description": "If this is set to true then short IDs are looked up by this function as well. This can cause the return value of the function to return an event issue of a different project which is why this is an opt-in. Set to 1 to enable.",
+ "schema": {
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "query",
+ "in": "query",
+ "description": "An optional Sentry structured search query. If not provided an implied `\"is:unresolved\"` is assumed.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "hashes",
+ "in": "query",
+ "description": "A list of hashes of groups to return. Is not compatible with 'query' parameter. The maximum number of hashes that can be sent is 100. If more are sent, only the first 100 will be used.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "lastSeen",
+ "numComments",
+ "userCount",
+ "culprit",
+ "title",
+ "id",
+ "assignedTo",
+ "logger",
+ "stats",
+ "type",
+ "annotations",
+ "metadata",
+ "status",
+ "subscriptionDetails",
+ "isPublic",
+ "hasSeen",
+ "shortId",
+ "shareId",
+ "firstSeen",
+ "count",
+ "permalink",
+ "level",
+ "isSubscribed",
+ "isBookmarked",
+ "project",
+ "statusDetails"
+ ],
+ "properties": {
+ "annotations": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "assignedTo": {
+ "type": "object",
+ "nullable": true
+ },
+ "count": {
+ "type": "string"
+ },
+ "culprit": {
+ "type": "string"
+ },
+ "firstSeen": {
+ "type": "string"
+ },
+ "hasSeen": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "isBookmarked": {
+ "type": "boolean"
+ },
+ "isPublic": {
+ "type": "boolean"
+ },
+ "isSubscribed": {
+ "type": "boolean"
+ },
+ "lastSeen": {
+ "type": "string"
+ },
+ "level": {
+ "type": "string"
+ },
+ "logger": {
+ "type": "string",
+ "nullable": true
+ },
+ "metadata": {
+ "oneOf": [
+ {
+ "type": "object",
+ "required": [
+ "filename",
+ "type",
+ "value"
+ ],
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": [
+ "title"
+ ],
+ "properties": {
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ },
+ "numComments": {
+ "type": "integer"
+ },
+ "permalink": {
+ "type": "string"
+ },
+ "project": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ }
+ }
+ },
+ "shareId": {
+ "type": "string",
+ "nullable": true
+ },
+ "shortId": {
+ "type": "string"
+ },
+ "stats": {
+ "type": "object",
+ "properties": {
+ "24h": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ },
+ "subscriptionDetails": {
+ "type": "object",
+ "nullable": true
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "userCount": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "annotations": [],
+ "assignedTo": null,
+ "count": "1",
+ "culprit": "raven.scripts.runner in main",
+ "firstSeen": "2018-11-06T21:19:55Z",
+ "hasSeen": false,
+ "id": "1",
+ "isBookmarked": false,
+ "isPublic": false,
+ "isSubscribed": true,
+ "lastSeen": "2018-11-06T21:19:55Z",
+ "level": "error",
+ "logger": null,
+ "metadata": {
+ "title": "This is an example Python exception"
+ },
+ "numComments": 0,
+ "permalink": "https://sentry.io/the-interstellar-jurisdiction/pump-station/issues/1/",
+ "project": {
+ "id": "2",
+ "name": "Pump Station",
+ "slug": "pump-station"
+ },
+ "shareId": null,
+ "shortId": "PUMP-STATION-1",
+ "stats": {
+ "24h": [
+ [
+ 1541455200,
+ 473
+ ],
+ [
+ 1541458800,
+ 914
+ ],
+ [
+ 1541462400,
+ 991
+ ],
+ [
+ 1541466000,
+ 925
+ ],
+ [
+ 1541469600,
+ 881
+ ],
+ [
+ 1541473200,
+ 182
+ ],
+ [
+ 1541476800,
+ 490
+ ],
+ [
+ 1541480400,
+ 820
+ ],
+ [
+ 1541484000,
+ 322
+ ],
+ [
+ 1541487600,
+ 836
+ ],
+ [
+ 1541491200,
+ 565
+ ],
+ [
+ 1541494800,
+ 758
+ ],
+ [
+ 1541498400,
+ 880
+ ],
+ [
+ 1541502000,
+ 677
+ ],
+ [
+ 1541505600,
+ 381
+ ],
+ [
+ 1541509200,
+ 814
+ ],
+ [
+ 1541512800,
+ 329
+ ],
+ [
+ 1541516400,
+ 446
+ ],
+ [
+ 1541520000,
+ 731
+ ],
+ [
+ 1541523600,
+ 111
+ ],
+ [
+ 1541527200,
+ 926
+ ],
+ [
+ 1541530800,
+ 772
+ ],
+ [
+ 1541534400,
+ 400
+ ],
+ [
+ 1541538000,
+ 943
+ ]
+ ]
+ },
+ "status": "unresolved",
+ "statusDetails": {},
+ "subscriptionDetails": null,
+ "title": "This is an example Python exception",
+ "type": "default",
+ "userCount": 0
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:read"
+ ]
+ }
+ ]
+ },
+ "put": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Bulk mutate various attributes on issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be modified.\n\n- For non-status updates, the `id` query parameter is required.\n- For status updates, the `id` query parameter may be omitted\nfor a batch \"update all\" query.\n- An optional `status` query parameter may be used to restrict\nmutations to only events with the given status.\n\nThe following attributes can be modified and are supplied as JSON object in the body:\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Mutate a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be mutated. This parameter shall be repeated for each issue. It is optional only if a status is mutated in which case an implicit update all is assumed.",
+ "required": false,
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "description": "Optionally limits the query to issues of the specified status. Valid values are `\"resolved\"`, `\"reprocessing\"`, `\"unresolved\"`, and `\"ignored\"`.",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "The new status for the issues. Valid values are `\"resolved\"`, `\"resolvedInNextRelease\"`, `\"unresolved\"`, and `\"ignored\"`."
+ },
+ "statusDetails": {
+ "type": "object",
+ "properties": {
+ "inRelease": {
+ "type": "string"
+ },
+ "inNextRelease": {
+ "type": "boolean"
+ },
+ "inCommit": {
+ "type": "string"
+ },
+ "ignoreDuration": {
+ "type": "integer"
+ },
+ "ignoreCount": {
+ "type": "integer"
+ },
+ "ignoreWindow": {
+ "type": "integer"
+ },
+ "ignoreUserCount": {
+ "type": "integer"
+ },
+ "ignoreUserWindow": {
+ "type": "integer"
+ }
+ },
+ "description": "Additional details about the resolution. Valid values are `\"inRelease\"`, `\"inNextRelease\"`, `\"inCommit\"`, `\"ignoreDuration\"`, `\"ignoreCount\"`, `\"ignoreWindow\"`, `\"ignoreUserCount\"`, and `\"ignoreUserWindow\"`."
+ },
+ "ignoreDuration": {
+ "type": "integer",
+ "description": "The number of minutes to ignore this issue."
+ },
+ "isPublic": {
+ "type": "boolean",
+ "description": "Sets the issue to public or private."
+ },
+ "merge": {
+ "type": "boolean",
+ "description": "Allows to merge or unmerge different issues."
+ },
+ "assignedTo": {
+ "type": "string",
+ "description": "The actor ID (or username) of the user or team that should be assigned to this issue."
+ },
+ "hasSeen": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the flag that indicates if the user has seen the event."
+ },
+ "isBookmarked": {
+ "type": "boolean",
+ "description": "In case this API call is invoked with a user context this allows changing of the bookmark flag."
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "isPublic",
+ "status",
+ "statusDetails"
+ ],
+ "properties": {
+ "isPublic": {
+ "type": "boolean"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "resolved",
+ "unresolved",
+ "ignored"
+ ]
+ },
+ "statusDetails": {
+ "type": "object"
+ }
+ }
+ },
+ "example": {
+ "isPublic": false,
+ "status": "unresolved",
+ "statusDetails": {}
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:write"
+ ]
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Events"
+ ],
+ "description": "Permanently remove the given issues. The list of issues to modify is given through the `id` query parameter. It is repeated for each issue that should be removed.\n\nOnly queries by 'id' are accepted.\n\nIf any IDs are out of scope this operation will succeed without any data mutation.",
+ "operationId": "Bulk Remove a List of Issues",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the organization the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The ID or slug of the project the issues belong to.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "description": "A list of IDs of the issues to be removed. This parameter shall be repeated for each issue, e.g. `?id=1&id=2&id=3`. If this parameter is not provided, it will attempt to remove the first 1000 issues.",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Project not found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "event:admin"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-e8ec23b4.json b/plugins/openapi/testdata/sentry-e8ec23b4.json
new file mode 100644
index 0000000..f0c4575
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-e8ec23b4.json
@@ -0,0 +1,286 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://{region}.sentry.io",
+ "variables": {
+ "region": {
+ "default": "us",
+ "description": "The data-storage-location for an organization",
+ "enum": [
+ "us",
+ "de"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/api/0/organizations/{organization_id_or_slug}/trace-items/attributes/": {
+ "get": {
+ "operationId": "listOrganizationTraceItemAttributes",
+ "description": "List the attribute keys available on a given trace item dataset (spans, logs,\ntrace metrics, etc.), with optional substring and structured filtering.",
+ "summary": "List Trace Item Attributes",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "organization_id_or_slug",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The ID or slug of the organization the resource belongs to.",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "statsPeriod",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The period of time for the query, will override the start & end parameters, a number followed by one of:\n- `d` for days\n- `h` for hours\n- `m` for minutes\n- `s` for seconds\n- `w` for weeks\n\nFor example, `24h`, to mean query data starting from 24 hours ago to now."
+ },
+ {
+ "in": "query",
+ "name": "start",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The start of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`."
+ },
+ {
+ "in": "query",
+ "name": "end",
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "The end of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`."
+ },
+ {
+ "in": "query",
+ "name": "environment",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": "The name of environments to filter by."
+ },
+ {
+ "in": "query",
+ "name": "project",
+ "schema": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
+ "description": "The IDs or slugs of projects to filter by. Project slugs are unique within each organization. Omit this parameter to include all accessible projects. `-1` is also accepted to include all accessible projects.\nFor example, the following are valid parameters:\n- `/?project=1234&project=56789`\n- `/?project=android&project=javascript-react`\n- `/?project=-1`\n"
+ },
+ {
+ "in": "query",
+ "name": "dataset",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "logs",
+ "preprod",
+ "processing_errors",
+ "spans",
+ "tracemetrics"
+ ]
+ },
+ "description": "The trace item dataset to list attributes for. One of `itemType` or `dataset` is required."
+ },
+ {
+ "in": "query",
+ "name": "itemType",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "logs",
+ "preprod",
+ "processing_errors",
+ "spans",
+ "tracemetrics"
+ ]
+ },
+ "description": "Deprecated alias of `dataset`. Use `dataset` instead.",
+ "deprecated": true
+ },
+ {
+ "in": "query",
+ "name": "attributeType",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "array",
+ "boolean",
+ "number",
+ "string"
+ ]
+ }
+ },
+ "description": "Filter to attributes of one or more types. Defaults to all types."
+ },
+ {
+ "in": "query",
+ "name": "substringMatch",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Restrict results to attribute names containing this substring (case-sensitive)."
+ },
+ {
+ "in": "query",
+ "name": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Sentry [search syntax](https://docs.sentry.io/concepts/search/) to filter trace items before computing attributes."
+ },
+ {
+ "in": "query",
+ "name": "cursor",
+ "schema": {
+ "type": "string",
+ "minLength": 1
+ },
+ "description": "A pointer to the last object fetched and its sort order; used to retrieve the next or previous results.",
+ "x-learn-more": "https://docs.sentry.io/api/pagination/"
+ }
+ ],
+ "tags": [
+ "Discover"
+ ],
+ "security": [
+ {
+ "auth_token": [
+ "org:admin",
+ "org:read",
+ "org:write"
+ ]
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "secondaryAliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attributeSource": {
+ "type": "object",
+ "properties": {
+ "source_type": {
+ "enum": [
+ "sentry",
+ "user"
+ ],
+ "type": "string"
+ },
+ "is_transformed_alias": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "source_type"
+ ]
+ },
+ "attributeType": {
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "array"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "attributeSource",
+ "attributeType",
+ "key",
+ "name"
+ ]
+ }
+ },
+ "examples": {
+ "ReturnAListOfTraceItemAttributeKeys": {
+ "value": [
+ {
+ "key": "device.class",
+ "name": "device.class",
+ "attributeSource": {
+ "source_type": "sentry"
+ },
+ "attributeType": "string"
+ },
+ {
+ "key": "tags[Batch Size,number]",
+ "name": "Batch Size",
+ "attributeSource": {
+ "source_type": "user"
+ },
+ "attributeType": "number"
+ }
+ ],
+ "summary": "Return a list of trace item attribute keys"
+ }
+ }
+ }
+ },
+ "description": ""
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/openapi/testdata/sentry-ead7f0cf.json b/plugins/openapi/testdata/sentry-ead7f0cf.json
new file mode 100644
index 0000000..d8dfe94
--- /dev/null
+++ b/plugins/openapi/testdata/sentry-ead7f0cf.json
@@ -0,0 +1,313 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "API Reference",
+ "version": "v0",
+ "description": "Sentry Public API",
+ "termsOfService": "http://sentry.io/terms/",
+ "contact": {
+ "email": "partners@sentry.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://sentry.io"
+ }
+ ],
+ "paths": {
+ "/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/user-feedback/": {
+ "get": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "Return a list of user feedback items within this project.",
+ "operationId": "List a Project's User Feedback",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ },
+ "example": [
+ {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ ]
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not Found"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:read"
+ ]
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Projects"
+ ],
+ "description": "Submit and associate user feedback with an issue.\n\nFeedback must be received by the server no more than 30 minutes after the event was saved.\n\nAdditionally, within 5 minutes of submitting feedback it may also be overwritten. This is useful in situations where you may need to retry sending a request due to network failures.\n\nIf feedback is rejected due to a mutability threshold, a 409 status code will be returned.\n\nNote: Feedback may be submitted with DSN authentication (see auth documentation).",
+ "operationId": "Submit User Feedback",
+ "parameters": [
+ {
+ "name": "organization_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the organization.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id_or_slug",
+ "in": "path",
+ "description": "The id or slug of the project.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "event_id",
+ "name",
+ "email",
+ "comments"
+ ],
+ "type": "object",
+ "properties": {
+ "event_id": {
+ "type": "string",
+ "description": "The event ID. This can be retrieved from the [beforeSend callback](https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-beforesend)."
+ },
+ "name": {
+ "type": "string",
+ "description": "User's name."
+ },
+ "email": {
+ "type": "string",
+ "description": "User's email address."
+ },
+ "comments": {
+ "type": "string",
+ "description": "Comments supplied by user."
+ }
+ }
+ },
+ "example": {
+ "event_id": "14bad9a2e3774046977a21440ddb39b2",
+ "name": "Jane Schmidt",
+ "email": "jane@empowerplant.io",
+ "comments": "It broke!"
+ }
+ }
+ },
+ "required": false
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "comments",
+ "dateCreated",
+ "email",
+ "event",
+ "eventID",
+ "id",
+ "issue",
+ "name",
+ "user"
+ ],
+ "properties": {
+ "comments": {
+ "type": "string"
+ },
+ "dateCreated": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "event": {
+ "type": "object",
+ "properties": {
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ },
+ "eventID": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue": {
+ "type": "object",
+ "nullable": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ },
+ "example": {
+ "comments": "It broke!",
+ "dateCreated": "2018-11-06T21:20:11.468Z",
+ "email": "jane@example.com",
+ "event": {
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": null
+ },
+ "eventID": "14bad9a2e3774046977a21440ddb39b2",
+ "id": "1",
+ "issue": null,
+ "name": "Jane Smith",
+ "user": null
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Input"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "The requested resource does not exist"
+ },
+ "409": {
+ "description": "Conflict"
+ }
+ },
+ "security": [
+ {
+ "auth_token": [
+ "project:write"
+ ]
+ },
+ {
+ "dsn": []
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/providers/README.md b/providers/README.md
index 11d3f80..daadf28 100644
--- a/providers/README.md
+++ b/providers/README.md
@@ -18,6 +18,7 @@ One page per plugin id: `providers/.md`. Start from [`_template.md`](_templ
| [supabase.md](supabase.md) | `supabase` | `openapi` |
| [algolia.md](algolia.md) | `algolia-search`, `algolia-ingestion`, `algolia-recommend` | `openapi` |
| [elasticsearch.md](elasticsearch.md) | `elasticsearch` | `openapi` |
+| [sentry.md](sentry.md) | `sentry` | `openapi` |
| [openai-models.md](openai-models.md) | `openai-models` | `retirements` |
| [anthropic-models.md](anthropic-models.md) | `anthropic-models` | `retirements` |
| [anthropic.md](anthropic.md) | `anthropic` | `migrationguide` |
diff --git a/providers/sentry.md b/providers/sentry.md
new file mode 100644
index 0000000..c851d03
--- /dev/null
+++ b/providers/sentry.md
@@ -0,0 +1,58 @@
+# Sentry (`sentry`)
+
+## What it watches
+
+Sentry's public REST API (`https://{region}.sentry.io/api/0/...`): operations Sentry deprecates, between releases of its OpenAPI spec. Most of them it deprecates in the operation's description, not with the `deprecated` flag.
+
+Format plugin: `openapi` (`plugins/openapi`), with `adapter.Sentry`.
+
+## Why this source
+
+- **Source:** `openapi-derefed.json`, an asset of each `api@X.Y.Z` release of [getsentry/sentry](https://github.com/getsentry/sentry/releases), e.g. `https://github.com/getsentry/sentry/releases/download/api%402.16.0/openapi-derefed.json`.
+ - The plugin reads the release with the highest `api@` version, not the newest by date (GitHub lists releases in an order that isn't version order), leaving out drafts, prereleases and releases without the spec.
+ - A release asset is pinned by its release tag: the URL names the tag, and the tag names one release. GitHub does let a maintainer replace an asset in place, which a commit SHA would rule out; there's no SHA-pinned copy of the spec since it moved here.
+ - Checked on 2026-11-19: 19 `api@` releases, `api@2.5.0` (2026-11-14) to `api@2.16.0` (2026-11-18).
+- **History:** until 2026-11-14 the spec was published in [getsentry/sentry-api-schema](https://github.com/getsentry/sentry-api-schema), committed as `openapi-derefed.json` (1,130 commits that changed it since 2020-08-25) and tagged `0.1.0` to `2.4.0` from 2026-02-10. That repo is archived ("@sentry/api has moved"); its `2.4.0` is byte for byte `api@2.5.0`. The adapter reads a tag or a commit of it too (`https://raw.githubusercontent.com/getsentry/sentry-api-schema//openapi-derefed.json`), so that history can be replayed.
+- **Why this one:** it's Sentry's own OpenAPI spec of its public REST API, with every `$ref` resolved, published with `@sentry/api` ("The official, auto-generated TypeScript client for Sentry's public REST API"). It's the one machine-readable record of which endpoints Sentry documents and deprecates, and it carries the deprecation notices.
+- **Alternatives considered:**
+ - **The [changelog](https://sentry.io/changelog/)** (RSS). It's product news. Its items around the alert-rule deprecation ("Monitors & Alerts are in Early Access", 2026-04-20; "Monitors & Alerts — Now Generally Available", 2026-05-07) don't name an endpoint, and the feed carries titles only.
+ - **The SDKs' changelogs** (`sentry-python`, `sentry-javascript`). They're about the event-ingestion SDKs, not the REST API.
+ - **`src/sentry/api/urls.py` in getsentry/sentry.** It lists the routes, but not which are public, documented or deprecated.
+- **Quote:** "## Deprecated 🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors) and [Fetch Alerts](/api/monitors/fetch-alerts) instead." (the description of `GET /api/0/organizations/{organization_id_or_slug}/alert-rules/` from sentry-api-schema `1da1f31f`, 2026-01-22; a line break after the heading)
+
+## How the provider announces changes
+
+- **No API versions.** Every path is under `/api/0/`, and `info.version` is `v0`. The spec's own versions (`api@2.16.0`, `0.224.0`) are the `@sentry/api` package's, released several times a day lately, not the API's.
+- **The event's `version` is a date:** the spec release's publication date (`2026-11-18` for `api@2.16.0`), or a commit's date when replaying the history before tags. Several releases a day share one. The patch-it client keeps a date-versioned API's events only if it's in its list of date-versioned APIs, so `sentry` needs to be in it.
+- **Deprecations are in words.** Over the whole history (1,130 commits, then the 19 `api@` releases) the `deprecated` flag is set on 3 operations, and the description deprecates 13, always no later than the flag:
+ - **2022-03-01:** `GET .../stats/`, words and flag together: "This endpoint is deprecated in favor of [Organization Stats V2]".
+ - **2024-07-31:** `POST .../user-feedback/`: "*This endpoint is DEPRECATED. We document it here for older SDKs ...". Flagged on 2026-06-16.
+ - **2025-07-25:** `GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/`: "**Deprecated**: This endpoint has been replaced with the [Organization Issues endpoint]". Flagged on 2026-06-16.
+ - **2026-01-22:** the 10 issue and metric alert-rule operations (`.../alert-rules/`, `.../alert-rules/{alert_rule_id}/`, `.../rules/`, `.../rules/{rule_id}/`): "## Deprecated 🚧 Use [...] instead." Never flagged.
+- **Endpoints leave the spec without a word.** See the removals below.
+
+## What the plugin reads and ignores
+
+- **Reads:** the spec of the newest `api@` release, diffed against the last one read.
+- **One event comes out of it: a deprecation,** when an operation is newly deprecated, by the flag or by its description. Matched by path template.
+ - **A description deprecates an operation** when it has a `## Deprecated` heading, a line starting `**Deprecated**:`, or says "This endpoint is deprecated" (any case). Those are the three ways the history says it. The event cites the description.
+ - **Not "deprecat" anywhere.** That also matches three descriptions that only mention deprecation: `GET .../events/`'s "**Eventsv2 Deprecation Note**" (about the old `eventsv2` endpoint; 2022-06-16, and again under the 2024-05-10 parameter rename) and `GET .../trace-items/attributes/`'s "examples, and deprecation details" (2026-10-15).
+ - **A flagged operation is quoted whole,** `"deprecated":true` first and the description after it.
+ - **The flag after the words is no new event:** user-feedback and issues were deprecated when their descriptions said so, not on 2026-06-16.
+- **Reads every path as a caller sends it, `/api/0/...`.** Until sentry-api-schema 2.0.1 the server was `https://{region}.sentry.io` and every path started `/api/0/`. From 2.1.0 (2026-11-13) the server is `https://{region}.sentry.io/api/0` and the paths don't. Same URLs, but compared as published all 289 operations would read as removed and added again. So the adapter moves the server URL's path back into every path, and maps each event's `source_pointer` back to the path as published.
+- **Ignores everything else:**
+ - **Removals, even of deprecated operations.** An operation leaving the spec means Sentry stopped documenting it, and the history doesn't show when, or whether, it stopped working. With `/api/0` in every path, 157 operations left the spec (by path template), 11 of them deprecated first:
+ - `GET /api/0/organizations/{organization_slug}/stats/`, gone on 2024-01-22, is still routed in getsentry/sentry's `src/sentry/api/urls.py` (checked 2026-11-19).
+ - The 10 alert-rule operations left on 2026-05-08, the day after "Monitors & Alerts — Now Generally Available". Their routes aren't in `urls.py` today, but nothing from Sentry says they stopped answering on 2026-05-08.
+ - Compared as published, 446 operations left the spec: the 289 more are the 2026-11-13 move of `/api/0`, `GET .../issues/` and `POST .../user-feedback/` among them, both flagged deprecated. A rule keeping removals of deprecated operations would report those two shut down.
+ - **Property changes, and new operations.**
+- **History:** 13 events over the whole history, all deprecations: the 13 above, none withdrawn. By the flag alone it would be 3, two of them dated 2026-06-16 instead of 2024 and 2025.
+- **Replays** the three description deprecations in the golden test (sentry-api-schema commits `ead7f0cf` → `4650a66a`, `d64149d6` → `c2f638f6`, `47231e61` → `1da1f31f`). The drop test replays `2.0.1` → `2.1.0`, the `/api/0` move. Other tests replay `0.223.0` → `0.224.0` (the flag after the words) and the two commits that added the "deprecation" wording that isn't a deprecation.
+
+## Known gaps
+
+- **No removals.** When Sentry turns an endpoint off, the plugin has already reported its deprecation, if Sentry said so in the spec, and reports nothing else.
+- **The same deprecation can be reported twice** if Sentry removes the words from a description and puts them back on a later day: the diff keeps no memory, and each event is dated by its release. It hasn't happened in the history, and the two operations still deprecated today also carry the flag, which keeps them from it.
+- **A deprecation said another way isn't seen,** like "has been replaced" with no "deprecated", or a parameter deprecated in prose.
+- **Undocumented endpoints aren't watched.** The spec covers what Sentry documents publicly: 199 path items in `api@2.16.0`.
+- **Request and response property changes aren't events,** including deprecated parameters and fields.
]