import type { CreateWebhookInput, ListWebhooksQuery, Page, UpdateWebhookInput, Webhook } from '../../types'; import type { HttpClient } from '../../http'; /** * Audience webhooks: HTTPS endpoints the platform POSTs contact events to. * * Distinct from `crm.crmTriggers`, which fires a single configured request per * rule, and from `crm.channelWebhooks`, which carries message traffic. This one * is a plain subscription to `contact.created`, `contact.updated` and * `contact.deleted`, delivered as a `WebhookEnvelope`. * * Deliveries are signed. The body arrives with `x-crm-timestamp` and * `x-crm-signature: v1=`, where the digest is * `HMAC-SHA256(secret, ".")`. Compare against the raw * bytes, before any JSON parsing. * * Unlike the rest of the audience module, these rows are scoped by tenant * rather than by the calling user. */ export declare class Webhooks { private readonly http; constructor(http: HttpClient); /** * `GET /v1/audience/webhooks` -- cursor paginated; page with `cursor` from * the previous response's `nextCursor`. * * `enabled` is accepted by the contract but not yet applied by the service: * the list comes back unfiltered. Filter client-side until that lands. * * Scope: `webhooks:read`. */ list(query?: Partial): Promise>; /** * `GET /v1/audience/webhooks/:id`. The signing secret is never returned here * -- it is shown once, by `create`. * * Scope: `webhooks:read`. */ get(id: string): Promise; /** * `POST /v1/audience/webhooks` -- 201 with the created webhook **plus its * `secret`**. This is the only response that carries the secret; store it * when you get it. * * The URL has to be public https: a non-https URL, or a hostname resolving * to a loopback, link-local or private address, is rejected with * 422 `invalid_webhook_url`. * * Scope: `webhooks:write`. */ create(input: CreateWebhookInput): Promise; /** * `PATCH /v1/audience/webhooks/:id` -- a partial update. A new `url` is * checked the same way as on create; `events` replaces the subscription list. * The secret does not change, and cannot be rotated through this route. * * Scope: `webhooks:write`. */ update(id: string, input: UpdateWebhookInput): Promise; /** * `DELETE /v1/audience/webhooks/:id` -- 204, no body. Delivery stops * immediately; queued attempts are dropped. * * Scope: `webhooks:write`. */ delete(id: string): Promise; }