# Webhooks

Source: https://docs.globagift.io/docs/api/reference/webhooks
Description: Event subscriptions and the event log.


## Create a webhook subscription

`POST /v1/webhook-subscriptions`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Retries: not idempotent. After an unclear failure, read the current state before trying again.

Request body:

- `url` (string, required)
- `types` (array of string, required)

Responses:

- 201: Subscription created
- 400: Validation failed
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- default: Unexpected server error

## List webhook subscriptions

`GET /v1/webhook-subscriptions`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Responses:

- 200: Subscriptions
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- default: Unexpected server error

## Delete a webhook subscription

`DELETE /v1/webhook-subscriptions/{id}`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Retries: not idempotent. After an unclear failure, read the current state before trying again.

Parameters:

- `id` (path, required, string)

Responses:

- 204: Deleted
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- 404: Not found
- default: Unexpected server error

## List webhook events with cursor pagination

`GET /v1/events`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Parameters:

- `after_cursor` (query, string)
- `types` (query, string)
- `limit` (query, integer)

Responses:

- 200: Events page
- 400: Validation failed
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- default: Unexpected server error
