Guides/How to create an NPS survey via API

How to create an NPS survey via API

Collect scores. See the distribution. One preset.

Updated March 2026

NPS surveys work because they are dead simple. One question, 0-10 scale, done. You know how customers feel. Sutrena has an NPS preset with the score field and an optional follow-up. Create the form, collect scores, export as CSV to see the distribution. This guide covers the whole thing.

1. Create an NPS form from a preset

The NPS preset gives you a 0-10 score selector, an optional reason textarea, an optional email field.

curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer st_trial_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowId": "nps"
  }'

# Response:
# {
#   "id": "frm_nps01",
#   "hostedUrl": "https://sutrena.com/f/frm_nps01"
# }

2. Collect scores

Put the hosted form URL in an email, on your site, or in your product. Works on mobile, any browser. Or POST scores from your own UI if you want custom design.

# Submit programmatically:
curl -X POST https://sutrena.com/api/forms/frm_nps01/submit \
  -H "Content-Type: application/json" \
  -d '{
    "score": "8",
    "reason": "Great product, would love faster support.",
    "email": "[email protected]"
  }'

# Or embed in email:
# Link to https://sutrena.com/f/frm_nps01

3. Analyze and act on results

Export as CSV to calculate your actual NPS (promoters minus detractors, as percentages). The bar chart shows where scores cluster. Set up a Slack webhook for alerts on new scores.

# Export data as CSV (Pro/Scale):
curl https://sutrena.com/api/forms/frm_nps01/export \
  -H "Authorization: Bearer st_live_your_key" \
  -o nps-data.csv

# Set up Slack alert for new responses:
curl -X POST https://sutrena.com/api/webhooks \
  -H "Authorization: Bearer st_trial_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "formId": "frm_nps01",
    "url": "https://hooks.slack.com/services/T00/B00/xxx",
    "template": "slack",
    "events": ["form.submission"]
  }'

FAQ

How do I calculate the actual NPS score?

Percentage of promoters (9-10) minus percentage of detractors (0-6). Export as CSV, run this in a spreadsheet or script.

Can I customize the 0-10 scale labels?

The preset uses a select field with options 0-10. After creation, PATCH the form to add labels like "Not at all likely" and "Extremely likely" as helper text.

Can I send the NPS survey via email?

Yes. Link to the hosted form URL. Works on mobile and desktop. Nothing to set up.

How many responses can I collect on the free plan?

100 per form. Pro gives you unlimited submissions at $29/month.

Can I segment NPS by customer type?

Add a custom field like "segment" or "plan" to your form. Then export as CSV and filter by that field in a spreadsheet.

What is Sutrena?

Sutrena is the web runtime for AI agents. Forms, Pages, Analytics, Webhooks, Automations — all through 67 MCP tools and one REST API. Your agent creates web artifacts, humans interact with them, and your agent gets the data back. Use any one feature or all of them together.

Pages

Deploy HTML instantly

Forms

Collect structured data

Automations

DSL-based pipelines with 14 step types

Analytics

Privacy-first, no cookies

Webhooks

Slack, Discord, Telegram

Get started in two API calls

1. Get a trial key (no auth, no signup)

curl -X POST https://sutrena.com/api/trial

2. Create anything — a page, form, automation, or analytics site

# Create a form
curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "waitlist", "fields": [{"name": "email", "label": "Email", "type": "email", "required": true}]}'

# Or deploy a page
curl -X POST https://sutrena.com/api/pages \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"slug": "index", "title": "My Site", "html": "<h1>Live</h1>"}'

Ready to build?

Get a trial API key instantly with no signup, or create an account for the full experience.

How to create an NPS survey via API — Sutrena | Sutrena