{"openapi":"3.1.0","info":{"title":"SpanSlice API","version":"0.1.0","description":"Read and change SpanSlice organizations, projects and rules: everything the app does, for scripts and\nagents.\n\n## Authentication\n\nSend an access token as a bearer token: `Authorization: Bearer ss_pat_…`. Make one in the app under Settings ›\nAccess tokens. A token belongs to one organization and acts with a role no higher than the one it was made with:\n\n- **Personal tokens** (`ss_pat_…`) act as you, and stop working if you leave the organization.\n- **Organization tokens** (`ss_org_…`) belong to the organization, for automation that shouldn't depend on one\n  person. Admins make them.\n\nSDK API keys (`ss_…`, what `spanSliceInit` takes) are a different credential and don't work here.\n\n## MCP\n\nEvery operation is also an MCP tool, at `https://api.spanslice.com/mcp` (streamable HTTP) with the same token.\n\n## Errors\n\nEvery error is an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem (`application/problem+json`) with a\nstable `code` to branch on and a `detail` that says what to change. Anything you can't reach, including other\norganizations, is a 404, as if it didn't exist.\n\n## Lists\n\nLists return `{ data, next_cursor }`. Pass `next_cursor` back as `cursor` for the next page; it is null on the\nlast one.","contact":{"name":"SpanSlice","url":"https://spanslice.com"}},"servers":[{"url":"https://api.spanslice.com"}],"security":[{"accessToken":[]}],"tags":[{"name":"Account","description":"Who a credential acts as."},{"name":"Organizations","description":"Organizations you belong to."},{"name":"Projects","description":"Projects, their environments and their services."},{"name":"Rules","description":"Span rules: conditions on a span and the actions to take when it matches. They are what SpanSlice runs in your SDKs."},{"name":"Commits","description":"Environments that require commit run their latest commit. Changes wait as pending changes until someone commits them."}],"paths":{"/v1/me":{"get":{"operationId":"getMe","tags":["Account"],"summary":"Describe the access token","description":"Who this request acts as: the token, its organization and role, and for a personal token the person it belongs to. Call it first to check a token works and to find the organization slug the other operations take.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","responses":{"200":{"description":"Describe the access token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMeResponse"},"examples":{"example":{"value":{"token":{"name":"Rules agent","kind":"personal","role":"member","organization":"snugghome","expires_at":"2027-01-06T14:03:12.000Z","created_at":"2026-10-08T14:03:12.000Z"},"user":{"name":"Ada","email":"ada@snugghome.com"}}}}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs":{"get":{"operationId":"listOrgs","tags":["Organizations"],"summary":"List organizations","description":"The organizations this token reaches: an access token reaches just its own, so this is one item.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200.","schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"A previous page's `next_cursor`, to fetch the page after it. Omit for the first page.","schema":{"type":"string"}}],"responses":{"200":{"description":"List organizations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrgsResponse"},"examples":{"example":{"value":{"data":[{"slug":"snugghome","name":"SnuggHome","role":"member","created_at":"2026-09-18T12:00:00.000Z"}],"next_cursor":null}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}":{"get":{"operationId":"getOrg","tags":["Organizations"],"summary":"Get an organization","description":"One organization, with your role in it as this token acts.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}}],"responses":{"200":{"description":"Get an organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"},"examples":{"example":{"value":{"slug":"snugghome","name":"SnuggHome","role":"member","created_at":"2026-09-18T12:00:00.000Z"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"List projects","description":"An organization's projects. Rules, environments and services all belong to a project.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200.","schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"A previous page's `next_cursor`, to fetch the page after it. Omit for the first page.","schema":{"type":"string"}}],"responses":{"200":{"description":"List projects","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProjectsResponse"},"examples":{"example":{"value":{"data":[{"slug":"snugghome-app","name":"SnuggHome App","organization":"snugghome","created_at":"2026-09-18T12:00:00.000Z"}],"next_cursor":null}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}":{"get":{"operationId":"getProject","tags":["Projects"],"summary":"Get a project","description":"One project. A slug the project or its organization had before a rename still finds it.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}}],"responses":{"200":{"description":"Get a project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"},"examples":{"example":{"value":{"slug":"snugghome-app","name":"SnuggHome App","organization":"snugghome","created_at":"2026-09-18T12:00:00.000Z"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}/environments":{"get":{"operationId":"listEnvironments","tags":["Projects"],"summary":"List environments","description":"A project's runtime environments in order. Check `requires_commit` before changing rules: in an environment that requires commit, changes wait for a commit before its SDKs see them.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200.","schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"A previous page's `next_cursor`, to fetch the page after it. Omit for the first page.","schema":{"type":"string"}}],"responses":{"200":{"description":"List environments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEnvironmentsResponse"},"examples":{"example":{"value":{"data":[{"slug":"staging","name":"Staging","description":null,"requires_commit":false,"position":0},{"slug":"production","name":"Production","description":null,"requires_commit":true,"position":1}],"next_cursor":null}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}/environments/{environment}":{"get":{"operationId":"getEnvironment","tags":["Projects"],"summary":"Get an environment","description":"One runtime environment of a project: whether it requires commit, and so whether changes reach its SDKs at once or wait as pending changes.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"environment","in":"path","required":true,"description":"The environment's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["production"]}}],"responses":{"200":{"description":"Get an environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"},"examples":{"example":{"value":{"slug":"production","name":"Production","description":null,"requires_commit":true,"position":1}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}/services":{"get":{"operationId":"listServices","tags":["Projects"],"summary":"List services","description":"A project's services, by name, with the environments each is deployed to. A rule can apply to the whole project or to one service.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200.","schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"A previous page's `next_cursor`, to fetch the page after it. Omit for the first page.","schema":{"type":"string"}}],"responses":{"200":{"description":"List services","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListServicesResponse"},"examples":{"example":{"value":{"data":[{"slug":"api","name":"Api","description":null,"language":"nodejs","repository_url":"https://github.com/acme/api","environments":["staging","production"]},{"slug":"worker","name":"Worker","description":null,"language":"ruby","repository_url":null,"environments":["staging"]}],"next_cursor":null}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}/rules":{"get":{"operationId":"listRules","tags":["Rules"],"summary":"List rules","description":"A project's span rules, in the order they run: rules with stage `created` before rules with stage `completed`, and within a stage each service's own rules before the project's.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200.","schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"A previous page's `next_cursor`, to fetch the page after it. Omit for the first page.","schema":{"type":"string"}}],"responses":{"200":{"description":"List rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRulesResponse"},"examples":{"example":{"value":{"data":[{"id":"rule_RVeVNOTP","name":"Drop health checks","title":"Drop traces with http.route = /healthz","stage":"created","target":"root","service":null,"when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}],"position":0,"version":1,"disabled":[{"service":"worker","environment":"staging"}],"keys":{"staging":"gZHXJsCM","production":"ZWMVUY0p"},"created_at":"2026-10-08T14:03:12.000Z","updated_at":"2026-10-08T14:03:12.000Z"}],"next_cursor":null}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}},"post":{"operationId":"createRule","tags":["Rules"],"summary":"Create a rule","description":"Adds a rule at the end of its list (stage and service). It runs everywhere it applies at once, except in environments that require commit, where it waits as a pending change until someone commits.\n\nRequires the **member** role or higher.","x-required-role":"member","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}}],"responses":{"201":{"description":"Create a rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"},"examples":{"example":{"value":{"id":"rule_RVeVNOTP","name":"Drop health checks","title":"Drop traces with http.route = /healthz","stage":"created","target":"root","service":null,"when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}],"position":0,"version":1,"disabled":[{"service":"worker","environment":"staging"}],"keys":{"staging":"gZHXJsCM","production":"ZWMVUY0p"},"created_at":"2026-10-08T14:03:12.000Z","updated_at":"2026-10-08T14:03:12.000Z"}}}}}},"400":{"description":"The rule is invalid: `detail` names the field, as the editor would.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"},"examples":{"example":{"value":{"name":"Drop health checks","stage":"created","target":"root","when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}]}}}}}}}},"/v1/orgs/{org}/projects/{project}/rules/{rule}":{"get":{"operationId":"getRule","tags":["Rules"],"summary":"Get a rule","description":"One rule, by its id or by a key from a span's `spanslice.rules` attribute: to find what changed a span, look up each key it carries.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"rule","in":"path","required":true,"description":"The rule's id (`rule_…`), or a key a span carries in `spanslice.rules`. Each environment has its own key, so a span leads straight to its rule.","schema":{"type":"string","examples":["rule_RVeVNOTP"]}}],"responses":{"200":{"description":"Get a rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"},"examples":{"example":{"value":{"id":"rule_RVeVNOTP","name":"Drop health checks","title":"Drop traces with http.route = /healthz","stage":"created","target":"root","service":null,"when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}],"position":0,"version":1,"disabled":[{"service":"worker","environment":"staging"}],"keys":{"staging":"gZHXJsCM","production":"ZWMVUY0p"},"created_at":"2026-10-08T14:03:12.000Z","updated_at":"2026-10-08T14:03:12.000Z"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}},"patch":{"operationId":"updateRule","tags":["Rules"],"summary":"Update a rule","description":"Changes the fields sent and leaves the rest. Moving a rule to another stage or service puts it at the end of that list; moving it to one service keeps only that service's switches. Send `If-Match` with the version you read so you never overwrite someone else's edit.\n\nRequires the **member** role or higher.","x-required-role":"member","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"rule","in":"path","required":true,"description":"The rule's id (`rule_…`), or a key a span carries in `spanslice.rules`. Each environment has its own key, so a span leads straight to its rule.","schema":{"type":"string","examples":["rule_RVeVNOTP"]}},{"name":"if-match","in":"header","required":false,"description":"The rule's `version` you read. If it has changed since, nothing is written and you get a 412.","schema":{"type":"string","pattern":"^(W\\/)?\"?\\d+\"?$"}}],"responses":{"200":{"description":"Update a rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"},"examples":{"example":{"value":{"id":"rule_RVeVNOTP","name":"Drop health checks","title":"Drop traces with http.route = /healthz","stage":"created","target":"root","service":null,"when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}],"position":0,"version":2,"disabled":[{"service":"worker","environment":"staging"}],"keys":{"staging":"gZHXJsCM","production":"ZWMVUY0p"},"created_at":"2026-10-08T14:03:12.000Z","updated_at":"2026-10-08T14:03:12.000Z"}}}}}},"400":{"description":"The rule as edited is invalid: `detail` names the field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"412":{"description":"The rule changed since the version in `If-Match`; read it again.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleRequest"},"examples":{"example":{"value":{"name":"Drop health and readiness checks"}}}}}}},"delete":{"operationId":"deleteRule","tags":["Rules"],"summary":"Delete a rule","description":"Deletes the rule and its history. In environments that require commit, SDKs keep running it until the deletion is committed. To stop it somewhere without deleting it, use setRuleEnabled.\n\nRequires the **member** role or higher.","x-required-role":"member","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"rule","in":"path","required":true,"description":"The rule's id (`rule_…`), or a key a span carries in `spanslice.rules`. Each environment has its own key, so a span leads straight to its rule.","schema":{"type":"string","examples":["rule_RVeVNOTP"]}}],"responses":{"204":{"description":"Delete a rule"},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}/rules/{rule}/enabled":{"patch":{"operationId":"setRuleEnabled","tags":["Rules"],"summary":"Switch a rule on or off","description":"Switches the rule on or off for the (service, environment) pairs named, leaving the others as they are. A pair must be a deployment the rule applies to. This is not a versioned edit.\n\nRequires the **member** role or higher.","x-required-role":"member","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"rule","in":"path","required":true,"description":"The rule's id (`rule_…`), or a key a span carries in `spanslice.rules`. Each environment has its own key, so a span leads straight to its rule.","schema":{"type":"string","examples":["rule_RVeVNOTP"]}}],"responses":{"200":{"description":"Switch a rule on or off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"},"examples":{"example":{"value":{"id":"rule_RVeVNOTP","name":"Drop health checks","title":"Drop traces with http.route = /healthz","stage":"created","target":"root","service":null,"when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}],"position":0,"version":1,"disabled":[{"service":"worker","environment":"staging"}],"keys":{"staging":"gZHXJsCM","production":"ZWMVUY0p"},"created_at":"2026-10-08T14:03:12.000Z","updated_at":"2026-10-08T14:03:12.000Z"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetRuleEnabledRequest"},"examples":{"example":{"value":{"cells":[{"service":"worker","environment":"staging","enabled":false}]}}}}}}}},"/v1/orgs/{org}/projects/{project}/rules/order":{"put":{"operationId":"reorderRules","tags":["Rules"],"summary":"Reorder a list of rules","description":"Sets the order of one list: the rules of one stage at project scope (`service: null`) or for one service. `order` must name every rule in that list exactly once.\n\nRequires the **member** role or higher.","x-required-role":"member","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}}],"responses":{"200":{"description":"Reorder a list of rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderRulesResponse"},"examples":{"example":{"value":{"data":[{"id":"rule_q13u1f9T","name":"Name spans by route","title":"Drop traces with http.route = /healthz","stage":"created","target":"root","service":null,"when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}],"position":0,"version":1,"disabled":[{"service":"worker","environment":"staging"}],"keys":{"staging":"gZHXJsCM","production":"ZWMVUY0p"},"created_at":"2026-10-08T14:03:12.000Z","updated_at":"2026-10-08T14:03:12.000Z"},{"id":"rule_RVeVNOTP","name":"Drop health checks","title":"Drop traces with http.route = /healthz","stage":"created","target":"root","service":null,"when":{"type":"group","operator":"and","children":[{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"is","value":"/healthz"}]},"then_actions":[{"action":"dropTrace"}],"position":1,"version":1,"disabled":[{"service":"worker","environment":"staging"}],"keys":{"staging":"gZHXJsCM","production":"ZWMVUY0p"},"created_at":"2026-10-08T14:03:12.000Z","updated_at":"2026-10-08T14:03:12.000Z"}]}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderRulesRequest"},"examples":{"example":{"value":{"stage":"created","service":null,"order":["rule_q13u1f9T","rule_RVeVNOTP"]}}}}}}}},"/v1/rule-language":{"get":{"operationId":"getRuleLanguage","tags":["Rules"],"summary":"Describe the rule language","description":"Everything a rule's `when` and `then_actions` can say: each condition subject with its operators and value shapes, each action with its fields, example rules, and the exact JSON Schemas. Read it before writing a rule.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","responses":{"200":{"description":"Describe the rule language","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRuleLanguageResponse"},"examples":{"example":{"value":{"conditions":"`when` is a clause or a group: { \"type\": \"group\", \"operator\": \"and\" | \"or\", \"children\": [...] }.","subjects":[{"subject":"spanName","description":"The span's name.","argument":null,"stage":null,"root_only":false,"choices":null,"operators":[{"operator":"is","label":"is","value":"text"}]}],"values":{"text":"A non-empty string. For regex, an RE2 pattern: no lookaround or backreferences."},"actions":[{"action":"dropTrace","description":"Drops every span of the trace. It beats every sample rate.","scope":"trace","once":true,"in_descendants":false,"fields":{},"required":[]}],"examples":[{"name":"Drop health checks","stage":"created","target":"root","when":{"type":"clause","subject":"spanAttribute","argument":"http.route","operator":"in","value":["/healthz","/readyz"]},"then_actions":[{"action":"dropTrace"}]}],"json_schema":{"condition":{},"action":{}}}}}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}/environments/{environment}/pending":{"get":{"operationId":"getPendingChanges","tags":["Commits"],"summary":"List pending changes","description":"What committing would change in an environment that requires commit: each difference between what its SDKs run (the latest commit) and the settings as they are now. Empty for an environment that applies changes at once. Review these, then commitEnvironment with `working_version`.\n\nRequires the **viewer** role or higher.","x-required-role":"viewer","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"environment","in":"path","required":true,"description":"The environment's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["production"]}}],"responses":{"200":{"description":"List pending changes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPendingChangesResponse"},"examples":{"example":{"value":{"environment":"production","requires_commit":true,"working_version":"5f0c2e9a41d3b7c8","committed":{"message":"Sample checkout at 1 in 10","created_at":"2026-10-07T09:12:44.000Z","by":"Ada"},"changes":[{"id":"WyJydWxlIiwiYWRkZWQiLDE3LG51bGxd","kind":"rule","change":"added","rule":"rule_RVeVNOTP","services":["Api","Main"],"after":{"key":"ZWMVUY0p","name":"Drop health checks","stage":"created","target":"root"},"revertible":true}]}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"}}}},"/v1/orgs/{org}/projects/{project}/environments/{environment}/commits":{"post":{"operationId":"commitEnvironment","tags":["Commits"],"summary":"Commit pending changes","description":"Makes the environment's SDKs run its settings as they are now: every pending change at once. Only for environments that require commit. Commits are how changes reach production there, so commit only what a person asked for or approved.\n\nRequires the **member** role or higher.","x-required-role":"member","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"environment","in":"path","required":true,"description":"The environment's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["production"]}}],"responses":{"201":{"description":"Commit pending changes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Commit"},"examples":{"example":{"value":{"message":"Drop health checks","created_at":"2026-10-08T14:20:01.000Z","by":"Ada"}}}}}},"400":{"description":"The environment doesn't require commit; its changes already apply.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"description":"The settings changed since `working_version`; review the pending changes again.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitEnvironmentRequest"},"examples":{"example":{"value":{"working_version":"5f0c2e9a41d3b7c8","message":"Drop health checks"}}}}}}}},"/v1/orgs/{org}/projects/{project}/environments/{environment}/pending/{change}/revert":{"post":{"operationId":"revertChange","tags":["Commits"],"summary":"Revert a pending change","description":"Undoes one pending change, putting that setting back as the latest commit has it. Other environments that share the setting (rules are shared) change too, as they would in the app.\n\nRequires the **member** role or higher.","x-required-role":"member","parameters":[{"name":"org","in":"path","required":true,"description":"The organization's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome"]}},{"name":"project","in":"path","required":true,"description":"The project's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["snugghome-app"]}},{"name":"environment","in":"path","required":true,"description":"The environment's slug, as in its URL in the app.","schema":{"type":"string","minLength":1,"examples":["production"]}},{"name":"change","in":"path","required":true,"description":"A pending change's `id`.","schema":{"type":"string"}}],"responses":{"204":{"description":"Revert a pending change"},"400":{"description":"The change is to an organization-wide setting, which only its own settings page changes.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"description":"The settings changed since `working_version`; review the pending changes again.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevertChangeRequest"},"examples":{"example":{"value":{"working_version":"5f0c2e9a41d3b7c8"}}}}}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","description":"A personal (`ss_pat_…`) or organization (`ss_org_…`) access token."}},"schemas":{"Action":{"oneOf":[{"$ref":"#/components/schemas/SetSpanAttributeAction"},{"$ref":"#/components/schemas/SetTraceSpanAttributeAction"},{"$ref":"#/components/schemas/SetRootSpanAttributeAction"},{"$ref":"#/components/schemas/RedactSpanAttributeAction"},{"$ref":"#/components/schemas/DropSpanAction"},{"$ref":"#/components/schemas/DropTraceAction"},{"$ref":"#/components/schemas/DropNonErrorsAction"},{"$ref":"#/components/schemas/SetSampleRateAction"},{"$ref":"#/components/schemas/SetSpanSampleRateAction"},{"$ref":"#/components/schemas/RenameSpanAction"},{"$ref":"#/components/schemas/DropAttributesAction"},{"$ref":"#/components/schemas/DropMatchedAttributesAction"},{"$ref":"#/components/schemas/PrefixMatchedAttributesAction"},{"$ref":"#/components/schemas/CollapseSpanAction"},{"$ref":"#/components/schemas/ForDescendantsAction"},{"$ref":"#/components/schemas/RollupSpansAction"},{"$ref":"#/components/schemas/StopRuleAction"}],"description":"Something a rule does to the span or trace it matched. Actions run in list order."},"CollapseSpanAction":{"type":"object","properties":{"action":{"type":"string","const":"collapseSpan"},"attributes":{"type":"string","enum":["all","excluding","only"]},"attributeList":{"type":"array","items":{"type":"string"}},"onConflict":{"type":"string","enum":["ignore","keepChild","keepParent"]}},"required":["action","attributes","onConflict"],"description":"Removes the span and copies its attributes onto its children, which move up to its parent. `attributes`: all, excluding `attributeList`, or only `attributeList`. `onConflict` when a child has the key: keepChild keeps the child's value; keepParent and ignore write the collapsed span's."},"Commit":{"type":"object","properties":{"message":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time","examples":["2026-10-08T14:03:12.000Z"]},"by":{"description":"Who committed: a person's name; null for an organization token.","type":["string","null"]}},"required":["message","created_at","by"],"description":"A snapshot of an environment's settings, which its SDKs run until the next commit."},"CommitEnvironmentRequest":{"type":"object","properties":{"working_version":{"type":"string","minLength":1,"description":"The `working_version` from getPendingChanges: what you reviewed. If anything changed since, you get a 409 and nothing happens, so you never commit or revert what you haven't seen.","examples":["5f0c2e9a41d3b7c8"]},"message":{"description":"Why, shown in the commit history.","type":"string","maxLength":500}},"required":["working_version"]},"Condition":{"oneOf":[{"oneOf":[{"$ref":"#/components/schemas/ServiceNameClause"},{"$ref":"#/components/schemas/SpanNameClause"},{"$ref":"#/components/schemas/LibraryNameClause"},{"$ref":"#/components/schemas/SpanKindClause"},{"$ref":"#/components/schemas/SpanAttributeClause"},{"$ref":"#/components/schemas/ResourceAttributeClause"},{"$ref":"#/components/schemas/SpanAttributeKeyClause"},{"$ref":"#/components/schemas/SpanDurationClause"},{"$ref":"#/components/schemas/TraceDurationClause"},{"$ref":"#/components/schemas/IsRootClause"},{"$ref":"#/components/schemas/IsChildClause"},{"$ref":"#/components/schemas/HasErrorClause"},{"$ref":"#/components/schemas/TraceSpanCountClause"},{"$ref":"#/components/schemas/SpansInTraceClause"},{"$ref":"#/components/schemas/CurrentTimeClause"}]},{"type":"object","properties":{"type":{"type":"string","const":"group"},"operator":{"type":"string","enum":["and","or"]},"children":{"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/Condition"}}},"required":["type","operator","children"]}],"description":"What a rule matches: a clause, or a group of conditions joined by `and` / `or`. A group with no children matches every span the rule targets."},"CreateRuleRequest":{"type":"object","properties":{"name":{"default":"","description":"Optional; an unnamed rule goes by its `title`, generated from what it does.","type":"string"},"stage":{"type":"string","enum":["created","completed"],"description":"When the rule runs: `created` as a span starts (it can change, sample or drop it before children see it), `completed` once it ends (duration and, for roots, trace facts are known)."},"target":{"default":"root","type":"string","enum":["root","child","any"],"description":"Which spans the rule looks at before its conditions: root (no local parent), child or any."},"service":{"default":null,"description":"A service's slug to apply to that service only; null for all.","type":["string","null"]},"when":{"anyOf":[{"$ref":"#/components/schemas/Condition"},{"type":"null"}]},"then_actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}}},"required":["stage","then_actions"]},"CurrentTimeClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"currentTime"},"operator":{"type":"string","enum":["between"]},"value":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"24-hour HH:MM","examples":["22:00"]},"to":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"24-hour HH:MM","examples":["22:00"]}},"required":["from","to"]}},"required":["type","subject","operator","value"]}],"description":"The time of day on the SDK's own clock, between `from` and `to` (HH:MM). A window that crosses midnight (22:00 to 06:00) wraps."},"DescendantAction":{"oneOf":[{"$ref":"#/components/schemas/SetSpanAttributeAction"},{"$ref":"#/components/schemas/RedactSpanAttributeAction"},{"$ref":"#/components/schemas/DropSpanAction"},{"$ref":"#/components/schemas/SetSpanSampleRateAction"},{"$ref":"#/components/schemas/RenameSpanAction"},{"$ref":"#/components/schemas/DropAttributesAction"},{"$ref":"#/components/schemas/DropMatchedAttributesAction"},{"$ref":"#/components/schemas/PrefixMatchedAttributesAction"},{"$ref":"#/components/schemas/CollapseSpanAction"},{"$ref":"#/components/schemas/RollupSpansAction"},{"$ref":"#/components/schemas/StopRuleAction"}],"description":"An action inside forDescendants: span actions only, no nesting."},"DescendantCondition":{"oneOf":[{"oneOf":[{"$ref":"#/components/schemas/ServiceNameClause"},{"$ref":"#/components/schemas/SpanNameClause"},{"$ref":"#/components/schemas/LibraryNameClause"},{"$ref":"#/components/schemas/SpanKindClause"},{"$ref":"#/components/schemas/SpanAttributeClause"},{"$ref":"#/components/schemas/ResourceAttributeClause"},{"$ref":"#/components/schemas/SpanAttributeKeyClause"},{"$ref":"#/components/schemas/SpanDurationClause"},{"$ref":"#/components/schemas/TraceDurationClause"},{"$ref":"#/components/schemas/IsRootClause"},{"$ref":"#/components/schemas/IsChildClause"},{"$ref":"#/components/schemas/HasErrorClause"},{"$ref":"#/components/schemas/TraceSpanCountClause"},{"$ref":"#/components/schemas/CurrentTimeClause"}]},{"type":"object","properties":{"type":{"type":"string","const":"group"},"operator":{"type":"string","enum":["and","or"]},"children":{"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/DescendantCondition"}}},"required":["type","operator","children"]}],"description":"Which descendants a forDescendants action's actions run on; no children means all of them."},"DropAttributesAction":{"type":"object","properties":{"action":{"type":"string","const":"dropAttributes"},"attributes":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","minLength":1}}},"required":["action","attributes"],"description":"Removes the attributes listed in `attributes`, by exact key. `spanslice.*` attributes and `SampleRate` are never touched."},"DropMatchedAttributesAction":{"type":"object","properties":{"action":{"type":"string","const":"dropMatchedAttributes"}},"required":["action"],"description":"Removes every attribute whose key matches one of the rule's spanAttributeKey conditions, so the rule needs one. `spanslice.*` attributes and `SampleRate` are never touched."},"DropNonErrorsAction":{"type":"object","properties":{"action":{"type":"string","const":"dropNonErrors"}},"required":["action"],"description":"Drops the trace unless a span in it has an error."},"DropSpanAction":{"type":"object","properties":{"action":{"type":"string","const":"dropSpan"},"reparent":{"type":"boolean"}},"required":["action","reparent"],"description":"Removes the span. With `reparent: true` its children move up to the nearest kept ancestor; with false they're dropped with it."},"DropTraceAction":{"type":"object","properties":{"action":{"type":"string","const":"dropTrace"}},"required":["action"],"description":"Drops every span of the trace. It beats every sample rate."},"Environment":{"type":"object","properties":{"slug":{"type":"string","examples":["production"]},"name":{"type":"string","examples":["Production"]},"description":{"type":["string","null"]},"requires_commit":{"type":"boolean","description":"When true, the environment's SDKs keep running its last commit: changes to rules and settings wait as pending changes until someone commits them. When false, changes reach its SDKs as they are made."},"position":{"type":"integer","description":"Its place in the project. The first is 0."}},"required":["slug","name","description","requires_commit","position"],"description":"A runtime environment of a project, such as production or staging. Each has its own SDK API keys, and rules are switched on and off per (service, environment)."},"ForDescendantsAction":{"type":"object","properties":{"action":{"type":"string","const":"forDescendants"},"when":{"$ref":"#/components/schemas/DescendantCondition"},"then_actions":{"type":"array","items":{"$ref":"#/components/schemas/DescendantAction"}}},"required":["action","when","then_actions"],"description":"Runs nested span actions (`then_actions`) on the matched span's descendants that match `when` (all of them when it has no conditions). Trace actions and further nesting are not allowed inside."},"GetMeResponse":{"type":"object","properties":{"token":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["personal","organization"],"description":"personal: acts as its user, capped at `role`. organization: belongs to the organization itself."},"role":{"description":"The highest role the token acts with.","$ref":"#/components/schemas/Role"},"organization":{"type":"string","description":"Its organization's slug; the only one it reaches."},"expires_at":{"anyOf":[{"type":"string","format":"date-time","examples":["2026-10-08T14:03:12.000Z"]},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","examples":["2026-10-08T14:03:12.000Z"]}},"required":["name","kind","role","organization","expires_at","created_at"]},"user":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["name","email"]},{"type":"null"}],"description":"A personal token's user; null for an organization token."}},"required":["token","user"]},"GetPendingChangesResponse":{"type":"object","properties":{"environment":{"type":"string"},"requires_commit":{"type":"boolean"},"working_version":{"type":"string","minLength":1,"description":"The `working_version` from getPendingChanges: what you reviewed. If anything changed since, you get a 409 and nothing happens, so you never commit or revert what you haven't seen.","examples":["5f0c2e9a41d3b7c8"]},"committed":{"anyOf":[{"$ref":"#/components/schemas/Commit"},{"type":"null"}],"description":"The commit its SDKs run; null unless it requires commit."},"changes":{"type":"array","items":{"$ref":"#/components/schemas/PendingChange"}}},"required":["environment","requires_commit","working_version","committed","changes"]},"GetRuleLanguageResponse":{"type":"object","properties":{"conditions":{"type":"string"},"subjects":{"type":"array","items":{"type":"object","properties":{"subject":{"type":"string"},"description":{"type":"string"},"argument":{"description":"What `argument` names, when the subject takes one.","type":["string","null"]},"stage":{"anyOf":[{"type":"string","enum":["created","completed"]},{"type":"null"}],"description":"The only stage it works at, if just one."},"root_only":{"type":"boolean","description":"Only on rules with `target: root`."},"choices":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The values a `choice` or `choiceList` operator takes, when the subject has them."},"operators":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string"},"label":{"type":"string"},"value":{"type":"string","enum":["none","text","textList","choice","choiceList","number","numberRange","duration","durationRange","timeRange","condition","countedCondition"]}},"required":["operator","label","value"]}}},"required":["subject","description","argument","stage","root_only","choices","operators"]}},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The shape of `value` for each kind."},"actions":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string","enum":["span","trace"],"description":"Trace actions act on the whole trace."},"once":{"type":"boolean","description":"At most once in an action list."},"in_descendants":{"type":"boolean","description":"Allowed inside forDescendants."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"JSON Schema of each field."},"required":{"type":"array","items":{"type":"string"}}},"required":["action","description","scope","once","in_descendants","fields","required"]}},"examples":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"json_schema":{"type":"object","properties":{"condition":{},"action":{}},"required":["condition","action"]}},"required":["conditions","subjects","values","actions","examples","json_schema"]},"HasErrorClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"hasError"},"operator":{"type":"string","enum":["yes","no"]}},"required":["type","subject","operator"]}],"description":"Whether the span's status is error (yes) or not (no)."},"IsChildClause":{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"isChild"}},"required":["type","subject"],"description":"The span has a local parent. Prefer the rule's `target: child`."},"IsRootClause":{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"isRoot"}},"required":["type","subject"],"description":"The span has no local parent. Prefer the rule's `target: root`."},"LibraryNameClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"libraryName"},"operator":{"type":"string","enum":["is","isNot","contains","notContains","startsWith","regex"]},"value":{"type":"string","minLength":1}},"required":["type","subject","operator","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"libraryName"},"operator":{"type":"string","enum":["in","notIn"]},"value":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","subject","operator","value"]}],"description":"The instrumentation scope that made the span, such as `@opentelemetry/instrumentation-http`."},"ListEnvironmentsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Environment"}},"next_cursor":{"description":"Pass as `cursor` to get the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"]},"ListOrgsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}},"next_cursor":{"description":"Pass as `cursor` to get the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"]},"ListProjectsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"next_cursor":{"description":"Pass as `cursor` to get the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"]},"ListRulesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}},"next_cursor":{"description":"Pass as `cursor` to get the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"]},"ListServicesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Service"}},"next_cursor":{"description":"Pass as `cursor` to get the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"]},"Organization":{"type":"object","properties":{"slug":{"type":"string","examples":["snugghome"]},"name":{"type":"string","examples":["SnuggHome"]},"role":{"description":"Your role here. An access token acts with no more than the role it was made with.","$ref":"#/components/schemas/Role"},"created_at":{"type":"string","format":"date-time","examples":["2026-10-08T14:03:12.000Z"]}},"required":["slug","name","role","created_at"],"description":"A team that owns projects, members and credentials."},"PendingChange":{"type":"object","properties":{"id":{"type":"string","description":"Names the change for revertChange."},"kind":{"type":"string","enum":["rule","sync_rule","stuck_timer","stuck_rule","sync_drop","trace_counts","archive_spans","instrumentation","auto_target","metrics","metric_view","span_metric","exporter","honeycomb","deployment","archive"],"description":"What kind of setting changed."},"change":{"type":"string","enum":["added","removed","edited","on","off","order"]},"rule":{"description":"For a span rule's change, the rule's id (getRule takes it).","examples":["rule_RVeVNOTP"],"type":"string"},"name":{"description":"For settings that are not rows: which one.","type":"string"},"services":{"description":"The names of the services it affects.","type":"array","items":{"type":"string"}},"before":{"description":"The setting as SDKs run it now; absent for an addition."},"after":{"description":"The setting once committed; absent for a removal."},"revertible":{"type":"boolean","description":"False for organization-wide settings, which only their own settings pages change."}},"required":["id","kind","change","revertible"],"description":"One difference between what an environment runs (its latest commit) and what committing would make it run."},"PrefixMatchedAttributesAction":{"type":"object","properties":{"action":{"type":"string","const":"prefixMatchedAttributes"},"prefix":{"type":"string","minLength":1}},"required":["action","prefix"],"description":"Moves every attribute whose key matches one of the rule's spanAttributeKey conditions under `prefix`, such as `legacy.`. The rule needs a spanAttributeKey condition."},"Problem":{"type":"object","properties":{"type":{"type":"string","description":"A URL naming the kind of problem; its fragment is the `code`."},"title":{"type":"string","description":"A short summary of the kind of problem."},"status":{"type":"integer","description":"The HTTP status code."},"detail":{"type":"string","description":"What went wrong with this request, and how to fix it where possible."},"code":{"type":"string","description":"Stable, machine-readable: invalid_request, unauthorized, forbidden, not_found, conflict, precondition_failed, internal_error, or a more specific code an operation documents."},"errors":{"description":"For invalid_request: each problem found with the request.","type":"array","items":{"type":"object","properties":{"detail":{"type":"string"},"pointer":{"description":"Where in the request body, as a JSON Pointer.","type":"string"},"parameter":{"description":"Which path or query parameter.","type":"string"},"header":{"description":"Which header.","type":"string"}},"required":["detail"]}}},"required":["type","title","status","detail","code"],"description":"An RFC 9457 problem details object, sent with `Content-Type: application/problem+json` for every error."},"Project":{"type":"object","properties":{"slug":{"type":"string","examples":["snugghome-app"]},"name":{"type":"string","examples":["SnuggHome App"]},"organization":{"type":"string","description":"The organization's slug.","examples":["snugghome"]},"created_at":{"type":"string","format":"date-time","examples":["2026-10-08T14:03:12.000Z"]}},"required":["slug","name","organization","created_at"],"description":"A product whose services send telemetry through SpanSlice. Rules belong to a project."},"RedactSpanAttributeAction":{"type":"object","properties":{"action":{"type":"string","const":"redactSpanAttribute"},"name":{"type":"string","minLength":1},"style":{"type":"string","enum":["replace","mask","shape"]},"text":{"type":"string"}},"required":["action","name","style"],"description":"Replaces an attribute's value before it leaves the process: `replace` with `text` (default `[Redacted]`), `mask` (like p****d) or `shape` (like String<8>). The original is never exported or archived."},"RenameSpanAction":{"type":"object","properties":{"action":{"type":"string","const":"renameSpan"},"value":{"type":"string","minLength":1}},"required":["action","value"],"description":"Renames the span. `value` may be a template: `{http.method} {http.route}`."},"ReorderRulesRequest":{"type":"object","properties":{"stage":{"type":"string","enum":["created","completed"],"description":"When the rule runs: `created` as a span starts (it can change, sample or drop it before children see it), `completed` once it ends (duration and, for roots, trace facts are known)."},"service":{"description":"The list's service slug; null for the project's list.","type":["string","null"]},"order":{"type":"array","items":{"type":"string","description":"The rule's id (`rule_…`), or a key a span carries in `spanslice.rules`. Each environment has its own key, so a span leads straight to its rule.","examples":["rule_RVeVNOTP"]},"description":"Every rule of the list, in the order they should run."}},"required":["stage","service","order"]},"ReorderRulesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}}},"required":["data"]},"ResourceAttributeClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"resourceAttribute"},"operator":{"type":"string","enum":["is","isNot","contains","notContains","startsWith","regex"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"type":"string","minLength":1}},"required":["type","subject","operator","argument","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"resourceAttribute"},"operator":{"type":"string","enum":["in","notIn"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","subject","operator","argument","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"resourceAttribute"},"operator":{"type":"string","enum":["exists","notExists"]},"argument":{"type":"string","minLength":1,"description":"Attribute"}},"required":["type","subject","operator","argument"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"resourceAttribute"},"operator":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"type":"number"}},"required":["type","subject","operator","argument","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"resourceAttribute"},"operator":{"type":"string","enum":["between"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}},"required":["from","to"]}},"required":["type","subject","operator","argument","value"]}],"description":"The value of the resource attribute named by `argument`: a fact about the process that made the span, such as `deployment.environment.name` or `host.name`. Operators work as for spanAttribute."},"RevertChangeRequest":{"type":"object","properties":{"working_version":{"type":"string","minLength":1,"description":"The `working_version` from getPendingChanges: what you reviewed. If anything changed since, you get a 409 and nothing happens, so you never commit or revert what you haven't seen.","examples":["5f0c2e9a41d3b7c8"]}},"required":["working_version"]},"Role":{"type":"string","enum":["viewer","member","admin","owner"],"description":"What a member may do, lowest first: viewer (read), member (change settings and rules), admin (manage people, credentials and destinations), owner (everything, including deleting the organization)."},"RollupSpansAction":{"type":"object","properties":{"action":{"type":"string","const":"rollupSpans"},"groupBy":{"type":"array","items":{"type":"string"}},"minCount":{"type":"integer","minimum":2},"rename":{"type":"boolean"}},"required":["action","minCount"],"description":"Replaces a run of like spans with one summary span when the trace is sent. Spans are grouped by parent, name and the values of the `groupBy` attributes; a group needs at least `minCount` (2 or more). With `rename`, the summary is named `{name} (rollup)`; without it, it keeps the spans' name."},"Rule":{"type":"object","properties":{"id":{"type":"string","description":"Stable across environments and renames.","examples":["rule_RVeVNOTP"]},"name":{"type":"string","description":"The name it was given; '' when unnamed."},"title":{"type":"string","description":"Generated from what the rule does. For an unnamed rule, spans carry this title in `spanslice.rule_names`."},"stage":{"type":"string","enum":["created","completed"],"description":"When the rule runs: `created` as a span starts (it can change, sample or drop it before children see it), `completed` once it ends (duration and, for roots, trace facts are known)."},"target":{"type":"string","enum":["root","child","any"],"description":"Which spans the rule looks at before its conditions: root (no local parent), child or any."},"service":{"description":"The one service the rule applies to, by slug; null for every service in the project.","type":["string","null"]},"when":{"anyOf":[{"$ref":"#/components/schemas/Condition"},{"type":"null"}],"description":"What it matches; null, like an empty group, matches every span."},"then_actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}},"position":{"type":"integer","description":"Its place among the rules with the same stage and service. The first is 0. A service's rules run before the project's."},"version":{"type":"integer","description":"Bumped by each edit to what the rule does. Send it as `If-Match` to update only that version."},"disabled":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string","description":"A service's slug.","examples":["api"]},"environment":{"type":"string","description":"An environment's slug.","examples":["production"]}},"required":["service","environment"]},"description":"Where the rule is switched off. A rule runs in every (service, environment) it applies to where the service is deployed, except these."},"keys":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Per environment slug, the key spans carry in `spanslice.rules` when this rule acts on them.","examples":[{"staging":"gZHXJsCM","production":"ZWMVUY0p"}]},"created_at":{"type":"string","format":"date-time","examples":["2026-10-08T14:03:12.000Z"]},"updated_at":{"type":"string","format":"date-time","examples":["2026-10-08T14:03:12.000Z"]}},"required":["id","name","title","stage","target","service","when","then_actions","position","version","disabled","keys","created_at","updated_at"],"description":"A span rule: when a span matches `when`, its actions run. Rules belong to a project, apply to all its services or one, and are switched off per (service, environment)."},"Service":{"type":"object","properties":{"slug":{"type":"string","examples":["api"]},"name":{"type":"string","examples":["Api"]},"description":{"type":["string","null"]},"language":{"anyOf":[{"type":"string","enum":["nodejs","webjs","python","go","java","ruby","dotnet","php","rust"]},{"type":"null"}],"description":"The language its SDK is written in, as OpenTelemetry's `telemetry.sdk.language`; null if unset.","examples":["nodejs"]},"repository_url":{"description":"The Git repository it is built from, which links the commits its processes run; null if unset.","examples":["https://github.com/acme/api"],"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"},"description":"Slugs of the environments the service is deployed to, in project order.","examples":[["staging","production"]]}},"required":["slug","name","description","language","repository_url","environments"],"description":"A program that runs the SpanSlice SDK, named by its OpenTelemetry `service.name`."},"ServiceNameClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"serviceName"},"operator":{"type":"string","enum":["is","isNot","contains","notContains","startsWith","regex"]},"value":{"type":"string","minLength":1}},"required":["type","subject","operator","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"serviceName"},"operator":{"type":"string","enum":["in","notIn"]},"value":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","subject","operator","value"]}],"description":"The span's service: its OpenTelemetry `service.name`."},"SetRootSpanAttributeAction":{"type":"object","properties":{"action":{"type":"string","const":"setRootSpanAttribute"},"name":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"required":["action","name","value"],"description":"Sets an attribute on the trace's local root span, replacing any value. `value` may be a template, read from the span that matched."},"SetRuleEnabledRequest":{"type":"object","properties":{"cells":{"minItems":1,"type":"array","items":{"type":"object","properties":{"service":{"type":"string","description":"A service's slug.","examples":["api"]},"environment":{"type":"string","description":"An environment's slug.","examples":["production"]},"enabled":{"type":"boolean"}},"required":["service","environment","enabled"]},"description":"The pairs to change."}},"required":["cells"]},"SetSampleRateAction":{"type":"object","properties":{"action":{"type":"string","const":"setSampleRate"},"oneIn":{"type":"integer","minimum":1},"mode":{"type":"string","enum":["ifNotSet","override"]}},"required":["action","oneIn"],"description":"Keeps 1 in `oneIn` traces, decided by trace ID, and sets `SampleRate` on the spans sent. `mode` ifNotSet (default) leaves a rate an earlier rule set; override replaces it."},"SetSpanAttributeAction":{"type":"object","properties":{"action":{"type":"string","const":"setSpanAttribute"},"name":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"required":["action","name","value"],"description":"Sets an attribute on the span. `value` may be a template that reads the span's other attributes: `{http.method} {http.route}`."},"SetSpanSampleRateAction":{"type":"object","properties":{"action":{"type":"string","const":"setSpanSampleRate"},"oneIn":{"type":"integer","minimum":1},"mode":{"type":"string","enum":["ifNotSet","override"]}},"required":["action","oneIn"],"description":"Keeps 1 in `oneIn` of the matched spans inside a kept trace, decided by span ID. A span not kept is dropped and its children move up. Same modes as setSampleRate."},"SetTraceSpanAttributeAction":{"type":"object","properties":{"action":{"type":"string","const":"setTraceSpanAttribute"},"name":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"required":["action","name","value"],"description":"Sets an attribute on every span of the trace, ended or not. A span's own value for the key wins. `value` may be a template, read from the span that matched."},"SpanAttributeClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanAttribute"},"operator":{"type":"string","enum":["is","isNot","contains","notContains","startsWith","regex"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"type":"string","minLength":1}},"required":["type","subject","operator","argument","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanAttribute"},"operator":{"type":"string","enum":["in","notIn"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","subject","operator","argument","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanAttribute"},"operator":{"type":"string","enum":["exists","notExists"]},"argument":{"type":"string","minLength":1,"description":"Attribute"}},"required":["type","subject","operator","argument"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanAttribute"},"operator":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"type":"number"}},"required":["type","subject","operator","argument","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanAttribute"},"operator":{"type":"string","enum":["between"]},"argument":{"type":"string","minLength":1,"description":"Attribute"},"value":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"}},"required":["from","to"]}},"required":["type","subject","operator","argument","value"]}],"description":"The value of the span attribute named by `argument`. Text operators compare it as text; eq, gt, gte, lt, lte and between compare it as a number; exists and notExists test whether it is set."},"SpanAttributeKeyClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanAttributeKey"},"operator":{"type":"string","enum":["is","contains","startsWith","regex"]},"value":{"type":"string","minLength":1}},"required":["type","subject","operator","value"]}],"description":"Whether any of the span's attribute keys matches. The matched-attribute actions act on the keys it matches. Every key is checked, so narrow the rule with other conditions first; it runs after its siblings."},"SpanCondition":{"oneOf":[{"oneOf":[{"$ref":"#/components/schemas/ServiceNameClause"},{"$ref":"#/components/schemas/SpanNameClause"},{"$ref":"#/components/schemas/LibraryNameClause"},{"$ref":"#/components/schemas/SpanKindClause"},{"$ref":"#/components/schemas/SpanAttributeClause"},{"$ref":"#/components/schemas/ResourceAttributeClause"},{"$ref":"#/components/schemas/SpanAttributeKeyClause"},{"$ref":"#/components/schemas/SpanDurationClause"},{"$ref":"#/components/schemas/TraceDurationClause"},{"$ref":"#/components/schemas/IsRootClause"},{"$ref":"#/components/schemas/IsChildClause"},{"$ref":"#/components/schemas/HasErrorClause"},{"$ref":"#/components/schemas/TraceSpanCountClause"},{"$ref":"#/components/schemas/CurrentTimeClause"}]},{"type":"object","properties":{"type":{"type":"string","const":"group"},"operator":{"type":"string","enum":["and","or"]},"children":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/SpanCondition"}}},"required":["type","operator","children"]}],"description":"A condition on one span of the trace, for spansInTrace. Trace subjects are not allowed."},"SpanDurationClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanDuration"},"operator":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"value":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"unit":{"type":"string","enum":["ms","s","m"]}},"required":["amount","unit"]}},"required":["type","subject","operator","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanDuration"},"operator":{"type":"string","enum":["between"]},"value":{"type":"object","properties":{"from":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"unit":{"type":"string","enum":["ms","s","m"]}},"required":["amount","unit"]},"to":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"unit":{"type":"string","enum":["ms","s","m"]}},"required":["amount","unit"]}},"required":["from","to"]}},"required":["type","subject","operator","value"]}],"description":"How long the span took. Completed stage only."},"SpanKindClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanKind"},"operator":{"type":"string","enum":["is","isNot"]},"value":{"type":"string","enum":["internal","server","client","producer","consumer"]}},"required":["type","subject","operator","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanKind"},"operator":{"type":"string","enum":["in","notIn"]},"value":{"minItems":1,"type":"array","items":{"type":"string","enum":["internal","server","client","producer","consumer"]}}},"required":["type","subject","operator","value"]}],"description":"The span's OpenTelemetry kind: internal, server, client, producer or consumer."},"SpanNameClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanName"},"operator":{"type":"string","enum":["is","isNot","contains","notContains","startsWith","regex"]},"value":{"type":"string","minLength":1}},"required":["type","subject","operator","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spanName"},"operator":{"type":"string","enum":["in","notIn"]},"value":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","subject","operator","value"]}],"description":"The span's name."},"SpansInTraceClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spansInTrace"},"operator":{"type":"string","enum":["any","none","all"]},"value":{"$ref":"#/components/schemas/SpanCondition"}},"required":["type","subject","operator","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"spansInTrace"},"operator":{"type":"string","enum":["atLeast","atMost"]},"value":{"type":"object","properties":{"count":{"type":"integer","minimum":0},"condition":{"$ref":"#/components/schemas/SpanCondition"}},"required":["count","condition"]}},"required":["type","subject","operator","value"]}],"description":"How many of the trace's spans match a condition: any, none, all, or atLeast / atMost `count` of them. Completed stage only, on rules that target root spans."},"StopRuleAction":{"type":"object","properties":{"action":{"type":"string","const":"stopRule"}},"required":["action"],"description":"Ends rule evaluation for the span at this stage: the actions after it, and the rules after this one, don't run."},"TraceDurationClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"traceDuration"},"operator":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"value":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"unit":{"type":"string","enum":["ms","s","m"]}},"required":["amount","unit"]}},"required":["type","subject","operator","value"]},{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"traceDuration"},"operator":{"type":"string","enum":["between"]},"value":{"type":"object","properties":{"from":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"unit":{"type":"string","enum":["ms","s","m"]}},"required":["amount","unit"]},"to":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"unit":{"type":"string","enum":["ms","s","m"]}},"required":["amount","unit"]}},"required":["from","to"]}},"required":["type","subject","operator","value"]}],"description":"How long the whole trace took. Completed stage only, on rules that target root spans."},"TraceSpanCountClause":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"clause"},"subject":{"type":"string","const":"traceSpanCount"},"operator":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"value":{"type":"number"}},"required":["type","subject","operator","value"]}],"description":"How many spans the trace has. Completed stage only, on rules that target root spans."},"UpdateRuleRequest":{"type":"object","properties":{"name":{"default":"","description":"Optional; an unnamed rule goes by its `title`, generated from what it does.","type":"string"},"stage":{"type":"string","enum":["created","completed"],"description":"When the rule runs: `created` as a span starts (it can change, sample or drop it before children see it), `completed` once it ends (duration and, for roots, trace facts are known)."},"target":{"type":"string","enum":["root","child","any"],"description":"Which spans the rule looks at before its conditions: root (no local parent), child or any."},"service":{"description":"A service's slug to apply to that service only; null for all.","type":["string","null"]},"when":{"anyOf":[{"$ref":"#/components/schemas/Condition"},{"type":"null"}]},"then_actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}}},"required":[]}},"responses":{"400":{"description":"The request is invalid; `errors` says where.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"The access token is missing, unknown, expired or revoked.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The token's role is too low for this operation.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"It doesn't exist, or this token can't reach it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}