Documentation Index
Fetch the complete documentation index at: https://docs.apten.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
External Compliance Checks are a per-organization product feature: your org can wire a custom HTTPS endpoint into Apten’s send pipeline. Before outbound sends on the channels you select, Apten POSTs a check request to your middleware. If your middleware says the contact is not allowed on that channel, Apten suppresses the send, writes an audit record, and surfaces aCOMPLIANCE_BLOCKED event in the conversation timeline and events export.
Use this when you have an internal compliance system (state DNC lists, litigator scrubbers, vendor-provided suppression sources, internal customer-preference databases) that must be the source of truth for whether a given lead can be contacted right now.
Apten-managed DNC runs on every outbound SMS and voice call, regardless of
these settings. Numbers on Apten’s standing Do Not Contact list are blocked
before send. Manage that list via the
Do Not Contact API. This feature composes with
— it does not replace — Apten’s built-in
opt-out handling.
Setup
External compliance is configured per-organization in the Settings → Compliance tab. Only users with the Admin role can change these settings.Apten-managed DNC
Apten always checks outbound SMS / RCS and voice against our standing DNC list. This is not configurable in the Compliance tab.Enable the external API
Toggle External compliance API on to POST to your middleware before sends on selected channels.External API channels
Select which channels (SMS / RCS, Voice, Email) should also be checked against your middleware. Channels you don’t select skip the external check. Unchecking all channels (or turning the external API off) does not disable Apten-managed DNC on SMS and voice.Failure mode
You must explicitly choose how Apten behaves when your middleware is unreachable, returns a non-2xx response, or times out:- Fail Closed — block the send. Safer for regulatory compliance, but a middleware outage will pause outbound traffic.
- Fail Open — allow the send. Avoids dropped sends during outages, but a malfunctioning middleware will not suppress contacts.
Endpoint URL
The HTTPS URL of your middleware. Apten will POST every check request here. The URL must usehttps://.
Signing secret
Apten signs every request with an HMAC-SHA256 of the request body, using a shared secret you control. Your middleware uses this to verify that requests genuinely came from Apten. In the Signing Secret field you can:- Generate — produces a random 32-byte base64url secret in your browser and fills the field. Click before saving and copy the value to your middleware.
- Paste — paste a secret you generated elsewhere.
- View saved — appears once a secret has been saved. Click to fetch and display the currently saved secret so you can copy it to a new middleware deployment. (Saved secrets are encrypted at rest with AWS KMS and only revealed to admins on demand.)
- Eye toggle / Copy — show or hide the secret in the field, or copy it to the clipboard.
Timeout
How long Apten waits for your middleware to respond before applying the failure mode. Default1500ms, configurable from 100ms to 10000ms.
Compliance check API
For every gated send, Apten makes the following request to your endpoint:Request properties
| Property | Type | Description |
|---|---|---|
leadId | string | The Apten lead ID being contacted. |
channel | string | The channel about to be used. One of sms (also covers RCS), voice, or email. |
phone | string | Lead phone number in E.164 format. Set when channel is sms or voice. null for email checks. |
email | string | Lead email address. Set when channel is email. null for SMS / voice checks. |
externalLeadId | string | CRM lead ID, when known (Salesforce / HubSpot / Dynamics / Close CRM). |
triggeredBy | string | Internal label for which send path triggered the check, e.g. send-text-message, queue-call, voice-poller-dial. Useful for diagnostics; not part of a stable contract. |
customerMetadata | object | An opaque object you can pre-configure with Apten support. Forwarded verbatim on every request. |
Only the identifier relevant to the channel is included. SMS / voice checks
send only
phone; email checks send only email. The unused field is
null. This minimizes the PII surface forwarded to your middleware.Expected response
The only field Apten reads is a top-levelallowed boolean. The minimum valid response is:
| Property | Type | Description |
|---|---|---|
allowed | boolean | Required. true to allow the send; false to suppress it. Any other type is treated as a provider error. |
allowed field is treated as a provider error — your org’s configured failure mode then decides whether the send proceeds.
Optional extra fields
Anything else you include in the JSON body is recorded verbatim in Apten’s audit row for your own debugging. Apten does not interpret these fields or use them to make decisions. Two conventional fields:reason— a short tag explaining why you blocked. Stored on Apten’s internal audit row so you can correlate the block back to your own systems if you ever request an audit export.metadata— any additional context you want preserved alongside the audit row.
allowed and only allowed.
Verifying the signature
Apten signs the request body with the same HMAC-SHA256 scheme used for outbound webhooks. Verify in your middleware by recomputing the HMAC using the shared signing secret and comparing it to theX-Signature-SHA256 header.
Every request also carries an
X-Apten-Signature header in the form
sha256=<hex>. It is the same HMAC value as X-Signature-SHA256 with a
scheme prefix. Verify against X-Signature-SHA256 (raw hex) — that is
the canonical header for this endpoint.Always sign and verify the raw request body bytes, exactly as they arrived
on the wire. Re-serializing a parsed JSON object can change whitespace and
key ordering and break the signature.
Provider behavior
Apten DNC and external HTTP ordering
Apten-managed DNC runs first on every outbound SMS and voice send (phone-keyed list via the Do Not Contact API). It does not apply to email. If External compliance API is enabled and the channel is in yourchannels set, Apten then POSTs to your middleware. A DNC block returns before that HTTP call. Provider errors on the HTTP leg follow your Failure Mode; a definitive DNC block is never overridden by fail-open.
Per-channel decisions
Each channel is checked independently. If a lead is blocked onsms but allowed on email, only the SMS send is suppressed. For the first-message Text + Email outreach pattern, a block on one channel does not prevent the other from sending.
No caching
Every send triggers a fresh check against your middleware. Apten does not cache responses, because follow-up cadences typically space outbound attempts hours or days apart — a useful cache TTL would expire before the next send anyway. Size your middleware capacity for your peak send volume.Audit log
Every check — allowed or blocked — is written to Apten’s internal audit table including the request, response, source, channel, and timestamp. This is the system of record for SOC 2 evidence. Blocked checks also appear asCOMPLIANCE_BLOCKED events on GET /leads/{leadId}/events; allowed checks are audit-only. Contact Apten support if you need a full audit export (including allowed checks) for a specific time range.
Failure modes at a glance
| Scenario | Outcome |
|---|---|
Middleware returns { "allowed": true } | Send proceeds. |
Middleware returns { "allowed": false } | Send is suppressed; audit row written. |
Middleware returns 5xx, times out, or non-boolean allowed | Provider error — your Failure Mode decides whether the send proceeds. |
External API disabled or channel not in channels | That channel skips the external middleware check. SMS/voice still run Apten-managed DNC. |
phone and email both missing for the requested channel | Send is suppressed with reason COMPLIANCE_TARGET_MISSING. Audit row written. |
Best practices
- Always start in fail-open while bringing your middleware online; flip to fail-closed once you’ve watched real traffic and tuned your latency.
- Keep middleware p99 latency well under your configured timeout. A 1500ms timeout with a 1400ms p99 will produce sporadic fail-mode activations.
- Rotate the signing secret quarterly from the Settings UI. Use View saved to retrieve the current value before rotation; then Generate, save, and deploy the new value to your middleware.
- Log the
X-Apten-Timestampheader and reject requests older than a few minutes to protect against replay if your endpoint is ever publicly reachable.

