{
  "opencollection": "1.0.0",
  "info": {
    "name": "Brale Accounts Webhooks API",
    "version": "1.0"
  },
  "items": [
    {
      "info": {
        "name": "Webhooks",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "List webhook delivery logs",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks/deliveries",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Paging query parameters"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Returns outbound delivery attempts for webhook subscriptions owned by the account, newest first, with cursor pagination (`page[size]`, and either `page[after]` or `page[before]` — not both)."
        },
        {
          "info": {
            "name": "Update webhook subscription",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks/subscriptions/:subscription_id",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              },
              {
                "name": "subscription_id",
                "value": "",
                "type": "path",
                "description": "Webhook subscription ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Updates URL and/or subscribed event types for an **active** subscription. When `events` is sent, it replaces the full set. **Archived** subscriptions return **409**."
        },
        {
          "info": {
            "name": "Archive webhook subscription",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks/subscriptions/:subscription_id",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              },
              {
                "name": "subscription_id",
                "value": "",
                "type": "path",
                "description": "Webhook subscription ID"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Sets an **active** subscription to **archived** so it no longer receives webhooks. Event subscriptions and delivery history are retained. Returns **409** if the subscription is already archived."
        },
        {
          "info": {
            "name": "Get webhook subscription",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks/:subscription_id",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              },
              {
                "name": "subscription_id",
                "value": "",
                "type": "path",
                "description": "Webhook subscription ID"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Get webhook subscription"
        },
        {
          "info": {
            "name": "List webhook subscriptions",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "List webhook subscriptions"
        },
        {
          "info": {
            "name": "Create webhook subscription",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Registers a destination URL and one or more event types. The signing secret is returned once in the response."
        },
        {
          "info": {
            "name": "Replay webhook deliveries for an event",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks/events/:event_id/resend",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              },
              {
                "name": "event_id",
                "value": "",
                "type": "path",
                "description": "Canonical webhook event id (envelope `id`; e.g. payment id for `payment.completed`, order id for transfer events)"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Queues one outbound replay delivery job per **active** webhook subscription for this account that subscribes to the event type of the given **`event_id`** (canonical envelope id; e.g. payment id for `payment.completed`, order id for `transfer.completed`, `transfer.canceled`, or `transfer.failed`). Requires **`Idempotency-Key`**. Payload is taken from `webhook_event_payloads` when present, otherwise rebuilt from domain data."
        },
        {
          "info": {
            "name": "List supported webhook event types",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.brale.xyz/accounts/:account_id/webhooks/event_types",
            "params": [
              {
                "name": "account_id",
                "value": "",
                "type": "path",
                "description": "Account ID"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "client_credentials",
              "accessTokenUrl": "https://auth.brale.xyz/oauth2/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Returns the event type strings (and short descriptions) that may be passed in `POST .../webhooks` `events` when creating a subscription."
        }
      ]
    }
  ],
  "bundled": true
}