/api/v1/trigger-voiceTrigger voice feedback
Create a unique SurvX feedback link and deliver it to a customer from your website or backend. SurvX does not need to host that portal — you call this API at checkout, discharge, or appointment close.
Snippets use YOUR_API_KEY / YOUR_API_SECRET as placeholders. Running them unchanged returns 401 Invalid API credentials. Paste live keys from the dashboard (Integration → API Keys). Call this API from your server, not a public browser page.
How it works
- Your system already knows the customer (phone or email) after a visit, order, or appointment.
- Your server (never a public browser bundle) sends
POST /api/v1/trigger-voicewith API credentials stored as environment variables. - SurvX creates a short-lived feedback URL. Send now, or pass
delayMinutes/scheduledAtso SMS/email goes later. One credit is deducted only after delivery succeeds. - The customer opens the link and records voice. Results appear in the SurvX dashboard under Voices.
X-API-Secret on the server. Do not embed keys in a public website, mobile app, or GitHub. If the frontend must fire the invite, proxy through your own backend.Prerequisites
- An active API key for the same branch you send in
business_unit— generate it in the dashboard under Integration → API Keys. - Available invite credits for that channel (SMS or email) on the branch.
- SMS: an active DLT Feedback template selected in Business settings. DLT variable slots are ~30 characters; SurvX keeps the feedback URL short (no
www). - Email: no DLT template. A valid
emailis enough (demo:customer@example.com).
Authentication
Send both headers on every request. The key is bound to one business unit; the body must use that same unit.
Header
X-API-KeyRequired
Replace with
YOUR_API_KEYHeader
X-API-SecretRequired
Replace with
YOUR_API_SECRETHeader
Content-TypeRequired
Replace with
application/json| Header | Required | Replace with |
|---|---|---|
X-API-Key | Yes | YOUR_API_KEY |
X-API-Secret | Yes | YOUR_API_SECRET |
Content-Type | Yes | application/json |
Endpoint
Production base URL: https://api.survx.co
Method
Path
/api/v1/trigger-voiceNotes
Method
Path
/v1/integration/trigger-voiceNotes
| Method | Path | Notes |
|---|---|---|
| POST | /api/v1/trigger-voice | Partner alias — use this from external systems. |
| POST | /v1/integration/trigger-voice | Same handler under the integration router. |
Request body
JSON object. Fields are validated before any message is sent.
Field
channelType
Required
Description
Field
msg_templateType
Required
Description
Field
business_unitType
Required
Description
Field
mobileType
Required
Description
Field
emailType
Required
Description
Field
campaignNameType
Required
Description
Field
expiresInHoursType
Required
Description
Field
delayMinutesType
Required
Description
Field
scheduledAtType
Required
Description
| Field | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Delivery channel. One of sms or email. |
msg_template | string | Yes | Voice form shown after the customer opens the link. One of basic, t1, or t2 (case-insensitive). |
business_unit | string | Yes | Five-character branch code that owns the API key. Demo value: ABC12. |
mobile | string | sms | Customer mobile. 10-digit Indian number, or +91 / 91 prefix. Demo value: 9000012345. |
email | string | Recipient email. Required when channel is email. Demo value: customer@example.com. | |
campaignName | string | No | Optional label in SurvX (2–120 characters). Defaults to Triggered Voice Invite. |
expiresInHours | integer | No | Link lifetime in hours, 1–168 (7 days). Starts when the invite is actually sent. Defaults to 168 hours. |
delayMinutes | integer | No | Wait this many minutes, then send SMS/email. 1–43200 (30 days). Ignored if scheduledAt is set. Omit or 0 to send now. |
scheduledAt | string | No | ISO date-time to send the invite (must be in the future, max 30 days). Example: 2026-09-10T18:30:00.000Z. SMS/email is not sent until this time. |
msg_template values
basic— voice note, star rating, written comment, photo/video.t1— hold-to-record voice plus a single overall rating.t2— custom question groups configured for the branch.
Code samples
Replace YOUR_API_KEY, YOUR_API_SECRET, ABC12, and the sample mobile/email with values from your dashboard and your customer. Placeholders never send a real invite (401).
curl -sS -X POST "https://api.survx.co/api/v1/trigger-voice" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-API-Secret: YOUR_API_SECRET" \
-d '{"channel":"sms","mobile":"9000012345","msg_template":"basic","business_unit":"ABC12"}'Email channel
Use channel: "email" and email instead of mobile.
{
"channel": "email",
"email": "customer@example.com",
"msg_template": "basic",
"business_unit": "ABC12"
}Delay and schedule
Same as dashboard Outreach → When to send. Call the API from your server when the visit ends; SurvX waits, then sends SMS/email. Credits and daily limits apply at send time. The feedback URL stays inactive until then. If many invites are due at once, SurvX sends them at the branch pace and retries for up to 24 hours.
delayMinutes— wait this many minutes (dashboard presets: 5, 15, 30, 60, 120, 360, 1440).scheduledAt— ISO UTC clock time, must be in the future, max 30 days. If both are sent,scheduledAtwins.- Success is still HTTP
201withscheduled: trueanddeliveredVia: null.
curl -sS -X POST "https://api.survx.co/api/v1/trigger-voice" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-API-Secret: YOUR_API_SECRET" \
-d '{"channel":"sms","mobile":"9000012345","msg_template":"basic","business_unit":"ABC12","delayMinutes":30}'curl -sS -X POST "https://api.survx.co/api/v1/trigger-voice" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-API-Secret: YOUR_API_SECRET" \
-d '{"channel":"email","email":"customer@example.com","msg_template":"basic","business_unit":"ABC12","scheduledAt":"2026-09-12T18:30:00.000Z"}'Success — 201 Created
Immediate send: HTTP 201 and deliveredVia is sms or email. Delayed/scheduled send: also 201, with scheduled: true, scheduledAt, and deliveredVia: null until the worker sends the message (checks every 15 seconds).
{
"ok": true,
"scheduled": false,
"business_unit": "ABC12",
"channel": "sms",
"msg_template": "basic",
"feedbackUrl": "https://survx.co/?V=XXXXX",
"broadcastId": "0000000000000000001",
"linkId": "0000000000000000002",
"expiresAt": "2026-08-30T12:00:00.000Z",
"deliveredVia": "sms"
}{
"ok": true,
"scheduled": true,
"scheduledAt": "2026-09-10T18:30:00.000Z",
"business_unit": "ABC12",
"channel": "sms",
"msg_template": "basic",
"feedbackUrl": "https://survx.co/?V=XXXXX",
"broadcastId": "0000000000000000001",
"linkId": "0000000000000000002",
"expiresAt": "2026-09-17T18:30:00.000Z",
"deliveredVia": null
}Error format
Failures return JSON { "error": string, "code"?: string }. Do not retry blindly on 400 / 401 / 403.
HTTP
401code
—When it happens
HTTP
400code
VALIDATION_ERRORWhen it happens
HTTP
403code
BU_MISMATCHWhen it happens
HTTP
404code
BU_NOT_FOUNDWhen it happens
HTTP
402code
CREDITS_EXHAUSTEDWhen it happens
HTTP
429code
SEND_RATE_LIMITEDWhen it happens
HTTP
429code
DAILY_RATE_LIMIT_EXCEEDEDWhen it happens
HTTP
429code
—When it happens
HTTP
502code
DELIVERY_FAILED / SMS_PROVIDER_ERRORWhen it happens
| HTTP | code | When it happens |
|---|---|---|
401 | — | Missing or invalid X-API-Key / X-API-Secret, or the key is expired or inactive. |
400 | VALIDATION_ERROR | JSON body fails schema (wrong channel, missing mobile/email, invalid BU format, etc.). |
403 | BU_MISMATCH | business_unit does not match the branch scoped to this API key. |
404 | BU_NOT_FOUND | The business unit is missing or inactive. |
402 | CREDITS_EXHAUSTED | This branch has no remaining SMS or email credits. The invite is not sent. |
429 | SEND_RATE_LIMITED | This branch is sending SMS/email faster than its paced rate. Wait retryAfterSeconds (typically 1–5s) and retry. |
429 | DAILY_RATE_LIMIT_EXCEEDED | This branch used its rolling 24-hour SMS or email quota (default 2000 each). Wait until the window resets. |
429 | — | More than 300 requests per minute for this IP + API key. |
502 | DELIVERY_FAILED / SMS_PROVIDER_ERROR | Invite was created but SMS or email delivery failed. Credits are not charged in that case. |
{
"error": "business_unit does not match the business unit scoped to this API key",
"code": "BU_MISMATCH"
}Limits and billing
- Per-branch pacing: a short burst, then about one SMS/email every 1–5 seconds (configurable). Faster calls return
429withSEND_RATE_LIMITEDandretryAfterSeconds. - Per-branch daily quota: default 2000 SMS and 2000 emails per rolling 24 hours. Over the quota you receive
429withDAILY_RATE_LIMIT_EXCEEDED. - Edge rate limit: 300 requests per minute per client IP and API key (
429when exceeded). - One invite credit is charged only after delivery succeeds.
- Typical pattern: after checkout or discharge, your backend calls SurvX once per customer — not on every page view.
Need access? Request a demo and generate live keys in the dashboard.
