# Pause or resume a sync trigger

> Pause a trigger so it stops running, or resume it. A paused trigger keeps its definition.

Source: https://docs.stacksync.com/api-reference/syncs/triggers/update_sync_trigger_status

`POST https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/triggers/{trigger_id}/update-status`

- Operation: `update_sync_trigger_status`
- Resource: Sync 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.
- `Content-Type: application/json` on every request with a body.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace the resources belong to |
| `base_id` | string (uuid) | Yes | The sync (a sync is called a base in these paths) |
| `trigger_id` | string | Yes | The trigger |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `region` | string (besg \| usnv) | Yes | Data region of the sync |

## Request body

`application/json`. Pause or resume

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | string (pause \| unpause) | Yes | `pause` stops the trigger from running, `unpause` resumes it |

## Returns

### 200 The trigger paused or resumed

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `msg` | string | Yes | What was done |

## Example request

```bash
curl -X POST "https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/triggers/{trigger_id}/update-status?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "pause"
}'
```

## Example response (200)

```json
{
  "msg": "Trigger status updated successfully"
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | The body is not valid JSON; `action` is missing or not `pause` or `unpause` (`Invalid action`); The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the trigger could not be read or changed (`An error occurred while fetching the trigger`, `Error pausing trigger`) | `{ "error": string }` |
| 403 | Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json` | `{ "error": string }` |
| 404 | No trigger of the sync has this id | `{ "msg": string }` |

## 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
- [List sync triggers](https://docs.stacksync.com/api-reference/syncs/triggers/list_sync_triggers)
- [Get a sync trigger](https://docs.stacksync.com/api-reference/syncs/triggers/get_sync_trigger)
- [Create a sync trigger](https://docs.stacksync.com/api-reference/syncs/triggers/create_sync_trigger)
- [Update a sync trigger](https://docs.stacksync.com/api-reference/syncs/triggers/update_sync_trigger)
- [Delete a sync trigger](https://docs.stacksync.com/api-reference/syncs/triggers/delete_sync_trigger)