Skip to main content

Webhook authentication

Authenticate agent event deliveries before accepting their payloads. UponAI's agent webhook settings support Basic authentication, a Bearer token, or an API-key header. Configure a dedicated receiving-endpoint secret and validate it in your application.

Choose an authentication method​

Agent webhook settingHeader delivered to your endpoint
BasicAuthorization: Basic <base64-encoded credentials>
BearerAuthorization: Bearer <configured token>
API keyX-API-Key: <configured value>

For Basic authentication, configure the expected username/password credential pair in the format required by the settings control. Base64 is encoding, not encryption; use HTTPS for every method.

The receiving-endpoint secret is separate from the UponAI API key your server uses to call the public API. Store it in your application's secret configuration and exclude authorization headers from routine logs.

Validate the request​

For Bearer authentication, compare the complete expected Authorization value before processing the body. This Node.js helper uses a timing-safe comparison:

import { timingSafeEqual } from 'node:crypto';

export function acceptsWebhook(authorization, configuredToken) {
if (!configuredToken || typeof authorization !== 'string') return false;
const actual = Buffer.from(authorization);
const expected = Buffer.from(`Bearer ${configuredToken}`);
return actual.length === expected.length && timingSafeEqual(actual, expected);
}

Return 401 when authentication fails. Validate the event and payload structure next, then persist the accepted work and return 2xx. The complete receiver example shows this pattern with an asynchronous work queue.

These deliveries use the configured authentication header. Do not assume a platform HMAC-signature header or an SDK signature-verification helper exists for this forwarding path.

Rotate a secret​

Coordinate the receiving application and agent settings so requests remain acceptable during the change. For example, temporarily accept the old and new secrets on the receiver, save the new agent value, verify a new delivery, and then remove the old secret. Do not publish the secret in screenshots, sample payloads, or shared support messages.

Separate authentication from replay handling​

A valid credential does not mean an event has never been processed before. Deduplicate lifecycle events by event and session identifier. Keep multiple transcript updates and transfer attempts distinct, as described in Webhooks overview.

Apply request-size limits appropriate to your transcript volume and validate which fields your application uses. Treat transcript text and tool results as untrusted conversation data rather than executable instructions.

Scope​

These settings apply to the agent event webhook. A phone number's inbound-context webhook and per-call custom callback integrations have their own request paths; do not assume they inherit the agent event webhook's authentication headers.

Search documentation

Type to filter pages. Use ↑ ↓ to choose, then Enter to open.

0 matching pages
AI questions are sent only when you select Ask AI or press Enter on it. Don’t include API keys or customer data.