# Delete an app trigger

> Removes the trigger from where it is attached, in one call: the workflow's trigger step with its edges (a deployed latest version needs a new draft first, 409), or the genie's Trigger interface, and the watch of the app.

Source: https://docs.stacksync.com/api-reference/app-triggers/delete_app_trigger

`DELETE https://api.stacksync.com/v1/workspaces/{workspace_id}/app-triggers/{app_trigger_id}`

- Operation: `delete_app_trigger`
- Resource: App triggers
- Access: writes data

## Authentication

- `Authorization: Bearer <key>`: A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace. List the ones your key can reach with GET /v1/workspaces. |
| `app_trigger_id` | string (uuid) | Yes | The app trigger. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `region` | string (besg \| usnv) | Yes | Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them |

## Returns

### 200 OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `app_trigger_id` | string | Yes |  |
| `is_target_unlinked` | boolean | Yes | The workflow step or genie interface it was attached to is removed |
| `target_unlink_message` | string \| null | No | Why the step or interface is still attached, when it could not be removed |

## Example request

```bash
curl -X DELETE "https://api.stacksync.com/v1/workspaces/{workspace_id}/app-triggers/{app_trigger_id}?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

## Example response (200)

```json
{
  "app_trigger_id": "<app_trigger_id>",
  "is_target_unlinked": false,
  "target_unlink_message": "<target_unlink_message>"
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | Bad Request | `{ "error": string, "msg": string, "field": string \| null }` |
| 403 | Forbidden | `{ "error": string, "msg": string, "field": string \| null }` |
| 404 | Not Found | `{ "error": string, "msg": string, "field": string \| null }` |
| 409 | Conflict | `{ "error": string, "msg": string, "field": string \| null }` |

## Related

- [API Reference overview](https://docs.stacksync.com/api-reference): base URLs, regions, pagination, idempotency and errors
- [Authentication](https://docs.stacksync.com/api-reference/authentication): API keys and the 403 answers
- OpenAPI document: https://docs.stacksync.com/openapi.json
- [Get an app trigger](https://docs.stacksync.com/api-reference/app-triggers/get_app_trigger)
- [Create an app trigger](https://docs.stacksync.com/api-reference/app-triggers/create_app_trigger)
- [Update an app trigger](https://docs.stacksync.com/api-reference/app-triggers/update_app_trigger)