# List sync webhooks

> List the webhooks of a sync: the URLs Stacksync posts its notifications to.

Source: https://docs.stacksync.com/api-reference/syncs/webhooks/list_sync_webhooks

`GET https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/webhooks`

- Operation: `list_sync_webhooks`
- Resource: Sync webhooks
- Access: read-only

## 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 the resources belong to |
| `base_id` | string (uuid) | Yes | The sync (a sync is called a base in these paths) |

## Query parameters

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

## Returns

### 200 The webhooks of the sync

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `msg` | string | Yes | `Successfully retrieved webhooks` |
| `webhooks` | array of object (SyncWebhook) | Yes | The webhooks, in creation order |
| `webhooks[].webhook_id` | string (uuid) | Yes | The webhook |
| `webhooks[].url` | string (uri) | Yes | The https URL Stacksync posts the notification to: a public internet host that answers an OPTIONS request within 2 seconds, with none of the characters space < > # % { } \| \ ^ ~ [ ] ` |
| `webhooks[].notification_type` | string (base_activity \| real_time_issue_notification \| backfill) | Yes | `base_activity` (the sync was switched, edited or failed), `real_time_issue_notification` (records failed to sync) or `backfill` (an initial full read finished) |
| `webhooks[].api_key` | string | Yes | Sent as `Authorization: Bearer <api_key>` with every notification, so your endpoint can check the caller |

## Example request

```bash
curl -X GET "https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/webhooks?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

## Example response (200)

```json
{
  "msg": "Successfully retrieved webhooks",
  "webhooks": [
    {
      "webhook_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
      "url": "https://hooks.example.com/stacksync",
      "notification_type": "real_time_issue_notification",
      "api_key": "whsec_7f3a9c2e4b1d"
    }
  ]
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | The `region` is missing or not one of besg, usnv; `base_id` is not a UUID; the webhooks could not be read (`Error retrieving webhooks`) | `{ "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 sync with this id exists in the workspace (`Error retrieving webhooks`: `Sync does not exist.`) | `{ "error": 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
- [Get a sync webhook](https://docs.stacksync.com/api-reference/syncs/webhooks/get_sync_webhook)
- [Create a sync webhook](https://docs.stacksync.com/api-reference/syncs/webhooks/create_sync_webhook)
- [Update a sync webhook](https://docs.stacksync.com/api-reference/syncs/webhooks/update_sync_webhook)
- [Delete a sync webhook](https://docs.stacksync.com/api-reference/syncs/webhooks/delete_sync_webhook)