Prerequisites
- A Sagepilot workspace with at least one published AI agent.
- Admin access to Settings → Channels.
- An HTTPS response URL that Sagepilot can reach.
- A backend that can generate HMAC-SHA256 signatures.
1. Create the channel
- In the dashboard, go to Settings → Channels and click Add channel.
- Choose Agent API.
- Enter a channel name and select the default AI agent.
- Enter the HTTPS Response URL where Sagepilot should deliver replies.
- Click Save.
- Copy the shared inbound endpoint, channel ID, and one-time signing key.
- Confirm that you saved the signing key before closing the dialog.
2. Build a customer-message event
Send this strict V1 JSON shape. Unknown fields are rejected.Event fields
Do not include
conversation_id, thread_id, or chat_id. These are not accepted inbound fields.
Attachment object
urlmust use HTTPS, contain no credentials or fragment, require no authentication, and return the file directly without redirects.- The URL hostname must be included in Sagepilot’s configured attachment-source allowlist.
sizeis the exact byte size and cannot exceed 10 MiB.- Supported MIME types are PDF, PNG, JPEG, GIF, and WebP.
sha256is optional. When supplied, it must be the lowercase SHA-256 digest of the file bytes.
3. Sign the exact request body
Generate one timestamp as Unix seconds or RFC 3339. Build the canonical byte sequence:v1={hex_digest}.
SAGEPILOT_AGENT_API_ENDPOINT to the shared endpoint shown in your dashboard. Its path must be exactly /webhooks/custom_channel, and the signed raw bytes must be identical to the HTTP request body. Requests outside the configured replay window are rejected.
4. Handle the acknowledgment
A newly accepted event returns HTTP202:
202 with idempotent_replay: true. Acknowledgment means Sagepilot accepted the inbound message; the AI or human-agent reply arrives later at your response URL.
See Receiving replies for the callback contract.