# Remove a trigger.

`DELETE /o/{org}/p/{project}/automations/{automation}/triggers/{trigger}`

An automation keeps at least one trigger, so removing its last one is refused; switch it off (`enabled`) to pause it.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `project` | path | string | yes | A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning "no Project" (a direct-repo / repo-less dispatch on `POST`; "no Project constraint, resolve by session id alone" everywhere else). A real handle that doesn't match the session's actual Project is `404`. |
| `automation` | path | string | yes | The automation's id. |
| `trigger` | path | string | yes | The trigger's id. |

## Example request

```bash
curl -X DELETE "https://api.phoenix.so/o/$RUSH_ORG/p/_/automations/$AUTOMATION/triggers/$TRIGGER" \
  -H "Authorization: Bearer $RUSH_TOKEN"
```

```typescript
const org = process.env.RUSH_ORG;
const automation = process.env.AUTOMATION;
const trigger = process.env.TRIGGER;

const res = await fetch(`https://api.phoenix.so/o/${org}/p/_/automations/${automation}/triggers/${trigger}`, {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.RUSH_TOKEN}`,
  },
});

console.log(res.status, await res.text());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]
automation = os.environ["AUTOMATION"]
trigger = os.environ["TRIGGER"]

res = requests.delete(
    f"https://api.phoenix.so/o/{org}/p/_/automations/{automation}/triggers/{trigger}",
    headers={"Authorization": f"Bearer {os.environ['RUSH_TOKEN']}"},
)

print(res.status_code, res.text)
```

## Responses

### 204

Removed.

### 400

It is the automation's last trigger (`VALIDATION_ERROR`).

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 403

The caller is neither the automation's creator nor an org admin (`FORBIDDEN`).

### 404

No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.

### 429

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (`RATE_LIMITED`). The error names the limit. Wait `Retry-After` seconds.

## Example response (204)

```http
HTTP 204 Removed.
```
