API Documentation

Build fast integrations with the NPS API. Base URL: /api

Try with your token

Paste your token below and use it in your terminal commands.

This value is only used in your browser and is never sent from this page.
Endpoints overview
Method Path Auth Description
GET/api/campaignsBearer tokenList campaigns
GET/api/campaigns/{id}Bearer tokenGet campaign by id
POST/api/campaignsBearer tokenCreate campaign
GET/api/metricsBearer tokenGet overall metrics
POST/api/responsesRespondent tokenSubmit response
How to get a user API token
  1. Log in to the NPS app.
  2. Go to Settings.
  3. In API Tokens, enter a token name and click Generate.
  4. Copy the token immediately (it is only shown once).
How to use the API

Include your token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN
List campaigns
curl -X GET "http://localhost:8080/api/campaigns" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Get a campaign by id
curl -X GET "http://localhost:8080/api/campaigns/1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Create a campaign
curl -X POST "http://localhost:8080/api/campaigns" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q1 NPS",
    "description": "First quarter survey"
  }'
Submit a response (public survey token)
curl -X POST "http://localhost:8080/api/responses?token=RESPONDENT_TOKEN&rating=10&comment=Great"
Get overall metrics
curl -X GET "http://localhost:8080/api/metrics" \
  -H "Authorization: Bearer YOUR_API_TOKEN"