# API reference — Gates

CI gates: run a suite on matching refs, fail the check on regression.

## POST /v1/gates

Create a CI gate

Runs the suite on every ref matching `on` and fails the check when any `fail_if` condition trips. Pair with the `regression.detected` webhook.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| on | body | `string` | yes | Ref pattern, e.g. `release/*`. |
| suite | body | `string` | yes |  |
| robots | body | `array<string>` | yes |  |
| fail_if | body | `object` | yes |  |

Example request:

```json
{
 "on": "release/*",
 "suite": "rbr-manip-core@v3",
 "robots": [
  "g1-edu-pro@fw2.3"
 ],
 "fail_if": {
  "success_rate_drop_pts": 2,
  "new_collision": true
 }
}
```

Example response (201):

```json
{
 "object": "gate",
 "id": "gate_312",
 "on": "release/*",
 "suite": "rbr-manip-core@v3",
 "robots": [
  "g1-edu-pro@fw2.3"
 ],
 "fail_if": {
  "success_rate_drop_pts": 2,
  "new_collision": true
 },
 "status": "active"
}
```
