---
title: "Create one glitch rule for this project."
method: POST
path: "/v1/glitches/rules"
tags: ["Glitches"]
---

# Create one glitch rule for this project.

`POST /v1/glitches/rules`

## Request

- Base URL: `https://api.scalix.world`
- URL: `https://api.scalix.world/v1/glitches/rules`
- Auth: HTTP bearer

The tenant decides what counts as a glitch for their own app. `action:
"ignore"` suppresses matching observations; `action: "track"` records
them under `label` (the tenant's own category name, which becomes the
group key, class `custom`) with an optional tenant-authored remediation
`hint`. At most 50 rules per project; at most 32 statuses per rule;
`path_prefix` must start with `/`; `host` is a bare hostname. Rules
apply within a minute, and only affect FUTURE observations.

Requires the `glitches:write` scope and a project-scoped credential.

## Request body

- GlitchRuleCreate: A tenant-authored glitch rule creation request (doc-only mirror of the router's `CreateGlitchRuleBody`).
  - `action` string, required: `ignore` (never a glitch for my app) or `track` (record under my label).
  - `label` string, nullable: Required for `track`: the tenant's own category name (becomes the group key, 1-64 chars).
  - `hint` string, nullable: Optional: the tenant's own remediation note shown with the group (max 280 chars).
  - `match_statuses` integer[], required: HTTP status codes this rule matches (100-599, 1-32 codes).
  - `path_prefix` string, nullable: Optional path prefix the rule is scoped to (must start with `/`, max 256 chars).
  - `host` string, nullable: Optional exact host the rule is scoped to (bare hostname, max 253 chars).

## Response `201`

Rule created

## Other responses

- `400`: Invalid rule (bad action, statuses, label, prefix or host)
- `401`: Missing or invalid API key
- `403`: Token lacks the glitches:write scope or is not project-scoped
- `500`: Internal error

---

[API](https://skmtc.dev/scalix/apis/scalix-cloud-api.md) · [All operations](https://skmtc.dev/scalix/apis/scalix-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scalix/apis/scalix-cloud-api/revisions/2c04ca0a90bb?raw)
