import type * as Pinnacle from "../../../../index.mjs"; /** * @example * { * senders: ["+14155551234", "agent_abc123"] * } */ export interface AttachWebhookParams { /** Array of senders to attach the webhook to. Can be phone numbers in E.164 format or RCS agent IDs. */ senders: string[]; /** * Existing webhook ID (starts with `wh_`). Provide this OR `name` + `url` to create a new webhook. The webhook must be in ENABLED status. Disabled webhooks can be re-enabled from the [dashboard](https://app.pinnacle.sh/dashboard/development/webhooks). * * Supplying `headers` alongside `webhookId` **overwrites** the stored headers on the webhook. Omit `headers` to leave them unchanged. */ webhookId?: string; /** Name for a new webhook (required if no `webhookId`). */ name?: string; /** HTTPS endpoint URL for a new webhook (required if no `webhookId`). */ url?: string; /** * Event type filter for the subscription. Set to `null` to receive all events.
* * `USER.TYPING` and `CAMPAIGN.STATUS` are only supported for RCS agent senders, not phone numbers — attempting to attach either of these events to a phone number returns `400 Bad Request`. */ event?: Pinnacle.WebhookEventEnum | null; /** * Optional custom HTTP headers (key-value map) to include when dispatching webhook events to the endpoint. * * Header names must start with a letter or digit and contain only letters, digits, `-`, or `_` (matching the pattern `^[A-Za-z0-9][A-Za-z0-9_-]*$`). Names are case-insensitive per [RFC 9110](https://datatracker.ietf.org/doc/html/rfc9110#name-field-names) and are normalized to uppercase before storage and sending. * * When provided with an existing `webhookId`, these headers **overwrite** any headers currently stored on that webhook. Omit to leave existing headers unchanged. * * The reserved `PINNACLE-SIGNING-SECRET` header is silently ignored and cannot be overridden. */ headers?: Record | null; }