API integrations: a complete usage guide

17 min read533
Copy for AI:

The WiseData NPS API lets another system β€” your CRM, e-commerce or ERP β€” read and maintain your contacts and contact lists and fetch your survey responses automatically, without anyone touching the panel. It's a REST API: you make HTTP requests and get JSON responses. This guide's example is a CRM that adds every new customer to the "Active customers" list.

Tokens live in Collect β€Ί Integrations, available on the Business and Enterprise plans β€” Free and Pro don't include the API. Neither does the 14-day free trial, but if you want to test the integration before subscribing, talk to our support: the API can be enabled on your account while the trial is running, and the tokens are revoked when it ends without a subscription. Only account administrators create and revoke tokens: for other members, the screen hides the New Token button and the revoke trash icon, and says that only administrators create and revoke tokens. If the account goes back to a plan without API access, tokens stop working: the first call with each one returns 403 and the token is revoked.

Overview

  • Base URL: https://api.wisedatanps.com (every path starts with /api/v1)
  • Authentication: token in the Authorization: Bearer YOUR_TOKEN header
  • Format: JSON in requests (with Content-Type: application/json) and in responses
  • What you can do: list, create, read, update and delete contacts; find contacts by your system's ID; list, create, read, rename and delete contact lists; fetch survey responses
  • What you can't: create or change surveys, see reports or touch the response webhook. Those calls with a token return 403.

Step 1 β€” Create a token

In Collect β€Ί Integrations, click New Token. Fill in the Token name (3 to 100 characters, e.g. "CRM integration") and, under What this token can do, check only what the integration needs:

  • Read contacts β€” query contacts and their data.
  • Create and edit contacts β€” add, edit and delete contacts.
  • Read contact lists β€” query existing lists.
  • Create and edit lists β€” create, rename and delete lists.
  • Read responses β€” fetch survey responses, with score, comment and who answered.

The form opens with the three read permissions checked, and at least one must stay checked. When you check a write permission, the screen warns that it changes and removes data in your account. The example CRM needs Read contact lists (to find the list) and Create and edit contacts (to add people). Permissions can't be edited later: to change them, create a new token and revoke the old one.

Click Create Token. The token is shown only once: copy it and store it somewhere safe before clicking Got it, already copied. Use the whole value exactly as shown β€” it starts with a number and a slash (12|...), and that part belongs to the token.

The token is valid for 365 days. In the list, each token shows its permissions, the last digits, Created by, Created, Last used and Expires (the date is highlighted when it's close to expiring). An expired token returns 401: create a new one and swap it in the integration before the date. The administrator sees and revokes the tokens of the whole account.

If a token leaks or is no longer used, revoke it β€” any system using it loses access immediately. Use one token per integration so you can revoke only what you need.

Restrict where the token can be called from

In the same form, the Where this token can be called from block has the Allowed addresses field. Type your integration server's address and press Enter (or Tab, comma or space): it becomes a tag. You can paste several at once. Each token accepts up to 20 addresses, as IPv4 (203.0.113.7), IPv6 (2001:db8::1) or a CIDR range (203.0.113.0/24). An invalid address doesn't become a tag: it stays in the field with the message, and the save button is locked until you fix it.

With the list filled in, a call coming from any other address is refused with 403, even with the right token β€” that's what stops a leaked token. The response says where the call came from, so you know what to allow:

{
  "message": "This API token cannot be used from the address 198.51.100.9. ...",
  "code": "ip_not_allowed",
  "ip": "198.51.100.9"
}

A refused call doesn't count as Last used and shows up in API usage (see below). An empty list accepts any address, which is how older tokens keep working. If your server goes out to the internet over IPv6, include its IPv6 address: registering only the IPv4 doesn't allow the same machine's IPv6 traffic.

Edit a token

In the list, the pencil (Edit) next to each token changes its name and allowed addresses without changing the token value β€” the integration keeps working without being reconfigured. Only administrators edit, and a token can't edit itself through the API. Permissions stay as they were created.

Step 2 β€” Authenticate your requests

Send the token on every call, in the authorization header:

Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

Step 3 β€” Your first request

Start by listing your contact lists to find each one's id (permission Read contact lists):

curl https://api.wisedatanps.com/api/v1/contact-lists/all \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "data": [
    {
      "id": 1,
      "name": "Active customers",
      "description": null,
      "contactsCount": 42,
      "updatedAt": "2026-06-05T13:40:00.000000Z"
    }
  ]
}

That id is the {listId} in the contact endpoints. It doesn't change, so you only need to look it up once and keep it in your integration's settings.

Send the survey to whoever comes in through the API

This is the most common use: the CRM adds the customer and they get the survey on their own. To set it up, in the panel, create a survey with the Continuous schedule, choose the "Active customers" list in the Channels step and activate it. From then on, every contact the integration creates in that list receives the survey only once, on each of the survey's channels (email and/or WhatsApp), as soon as the contact's check finishes β€” usually a few seconds. A contact with an invalid email or no WhatsApp is left out of that channel, as in any send. A list that isn't in an active Continuous survey just stores the contact.

List endpoints

List all lists

GET /api/v1/contact-lists/all β€” Read contact lists. Returns every list, in alphabetical order and without pagination.

List lists with pagination

GET /api/v1/contact-lists β€” Read contact lists. Optional parameters: search (searches the name), sort (name, created_at, updated_at or contacts_count), order (asc or desc), page and per_page (1 to 100; default 10). Without sort, the newest come first.

Read a list

GET /api/v1/contact-lists/{listId} β€” Read contact lists. Returns the list in data.

Create a list

POST /api/v1/contact-lists β€” Create and edit lists. Fields: name (required, 2 to 100 characters, not repeating another list's name in the account) and description (optional, up to 500 characters). Returns 201 with message and the list in data.

Update a list

PUT /api/v1/contact-lists/{listId} β€” Create and edit lists. Same fields as creation; name is required here too.

Delete a list

DELETE /api/v1/contact-lists/{listId} β€” Create and edit lists. Deletes the list and its contacts. A list used by an active survey isn't deleted: the response is 409, and the survey has to be paused first.

Contact endpoints

List a list's contacts

GET /api/v1/contact-lists/{listId}/contacts β€” Read contacts. Returns the list's contacts, paginated. Optional parameters:

  • search β€” search by name, email or phone (part of the text), or by external ID (the whole value).
  • external_id and external_account_id β€” only the contacts with that external ID, compared exactly (ABC-1 doesn't return abc-1). This is how your system finds its own contact. Since the same person can be in two lists, the lookup is per list.
  • sort β€” name, email, phone or created_at (default).
  • order β€” asc or desc (default).
  • page β€” page number.
  • per_page β€” items per page, 1 to 100 (default 10).

The items come in data; meta carries the pagination (among other fields, current_page, per_page, total and last_page) and links carries the page URLs. Excerpt of the response:

{
  "data": [
    {
      "id": 123,
      "name": "John Smith",
      "email": "john@company.com",
      "phone": "+15551234567",
      "externalId": "C-00123",
      "externalAccountId": "EMP-9",
      "emailStatus": "valid",
      "phoneStatus": "valid",
      "createdAt": "2026-06-05T13:40:00.000000Z"
    }
  ],
  "meta": { "current_page": 1, "per_page": 10, "total": 42, "last_page": 5 }
}

Create a contact

POST /api/v1/contact-lists/{listId}/contacts β€” Create and edit contacts. Creates a contact and adds it to the given list. Body fields:

  • name β€” required, 2 to 100 characters.
  • email β€” optional, must be a valid email. Disposable emails are rejected, and the same email can't repeat within a list.
  • phone β€” optional. Use the international format, like +15551234567; without the +, the number is read in the country of the account's billing details. A number that isn't valid for that country returns 422, and the response brings the phone already in international format.
  • external_id β€” optional. The person's code in your system (ERP, CRM).
  • external_account_id β€” optional. The code of the company they belong to in your system.

Both external IDs come back with every response in the CSV export, in the external_id and external_account_id columns: they're the key to take the score to the right record on your side. Each takes up to 100 characters, with no line breaks, and can't start with =, +, - or @ (Excel would read it as a formula); otherwise the response is 422. Send it as text ("00123", not 123) so you don't lose the leading zero.

curl -X POST https://api.wisedatanps.com/api/v1/contact-lists/LIST_ID/contacts \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "John Smith", "email": "john@company.com", "phone": "+15551234567", "external_id": "C-00123", "external_account_id": "EMP-9" }'

On success, the response is 201 with the created contact:

{
  "message": "Contact created successfully.",
  "data": {
    "id": 123,
    "name": "John Smith",
    "email": "john@company.com",
    "phone": "+15551234567",
    "externalId": "C-00123",
    "externalAccountId": "EMP-9",
    "emailStatus": "pending",
    "phoneStatus": "pending",
    "createdAt": "2026-06-05T13:40:00.000000Z"
  }
}

Email and phone start with a pending status and go through an automatic check right after. emailStatus becomes valid, invalid, catch_all, disposable or unknown; phoneStatus becomes valid when the number has WhatsApp, or not_whatsapp. Read the contact later to see the result.

Read a contact

GET /api/v1/contacts/{contactId} β€” Read contacts. Returns the contact in data.

Update a contact

PUT /api/v1/contacts/{contactId} β€” Create and edit contacts. Send only what changes among name, email, phone, external_id and external_account_id (same rules as creation). A field that isn't in the body doesn't change; external_id set to null clears the ID. Changing the email or the phone sets its status back to pending and runs the check again. The response includes a message and the updated contact in data.

Delete a contact

DELETE /api/v1/contacts/{contactId} β€” Create and edit contacts. Removes the contact from the list. The response is just a confirmation message.

Find contacts by your system's ID

GET /api/v1/contacts/lookup?external_id=C-00123 β€” Read contacts. Searches every list in the account, so you don't need to know which list the contact is in. Send external_id, external_account_id or both; the match is exact. Since the same ID can be in more than one list, the response is always a list in data (up to 100 contacts).

Responses endpoint

GET /api/v1/responses β€” Read responses. Returns the account's responses with the same fields as the CSV from the results screen (response_id, survey_id, responded_at, score, category, comment, sentiment, external_id and the rest), plus updated_at, analyzed (whether the AI has analyzed it), topics and, for questionnaires, answers with one entry per question. If you already import the CSV, you can reuse the same mapping. Anonymity rules are also the CSV's: an anonymous survey carries nothing that identifies the person and shows only the date. Test responses don't appear.

Optional parameters:

  • survey_id β€” a single survey (its id, as shown in the CSV).
  • responded_from and responded_to β€” a period, in YYYY-MM-DD format, in your account's time zone.
  • updated_since β€” only responses created or changed from that moment on. It accepts the very updated_at the API returns: date and time with the offset (2026-11-23T10:15:00-03:00, 2026-11-23T13:15:00Z, with or without milliseconds) or just the date (2026-11-23, which counts from midnight in your account's time zone). In the URL, the + of the offset must go as %2B; otherwise it arrives as a space and the response is 422. In anonymous surveys, the cut is always by the whole day.
  • per_page β€” 1 to 100 (default 50).
  • cursor β€” the next page, which comes in meta.next_cursor (and already built into links.next). It's a sealed code: use it as it came. An altered or invalid cursor returns 422; in that case, start over with updated_since.

Each item has exactly these fields β€” the same format as the response webhook, where each one is described:

{
  "data": [
    {
      "response_id": 8812,
      "survey_id": "01jd8zq6x9m3t4v7c2b5n8k1wr",
      "responded_at": "2026-11-23T10:15:00-03:00",
      "metric": "nps",
      "score": 4,
      "category": "detractor",
      "comment": "Took too long to arrive",
      "follow_up_answer": null,
      "sentiment": "negative",
      "channel": "email",
      "contact_id": 3051,
      "external_id": "C-00123",
      "external_account_id": "EMP-9",
      "name": "Ana Souza",
      "email": "ana@example.com",
      "phone": "+5511999999999",
      "updated_at": "2026-11-23T14:02:11-03:00",
      "analyzed": true,
      "topics": ["delivery time"],
      "answers": null
    }
  ],
  "links": { "first": null, "last": null, "prev": null, "next": "https://api.wisedatanps.com/api/v1/responses?per_page=50&cursor=..." },
  "meta": { "path": "https://api.wisedatanps.com/api/v1/responses", "per_page": 50, "next_cursor": "...", "prev_cursor": null }
}

To sync without missing anything: keep the updated_at of the last response you received and send it as updated_since on the next call, following the cursor to the end. The order is by change: when the AI finishes analyzing a response (a few hours later), it comes back on the next sync with the sentiment filled in. Use the response_id to update the response you already have instead of duplicating it.

curl "https://api.wisedatanps.com/api/v1/responses?updated_since=2026-11-23T10:00:00-03:00" \
  -H "Authorization: Bearer YOUR_TOKEN"

To receive each response right away, without polling, use the response webhook (its own article, in this same collection).

How to read responses

A single resource comes inside data; when there is an action (create, update, delete), a message comes too; and paginated listings carry data, meta and links. Contact and list fields are in camelCase (emailStatus, createdAt); response fields use the CSV names (response_id, external_id). The parameters you send are the ones shown above (per_page, created_at).

Common errors

Every error comes as JSON with message.

  • 401 β€” missing, invalid, revoked or expired token. Check the Authorization header and that the whole value was copied.
  • 402 β€” the account has a pending payment or a blocked subscription. The API comes back once billing is settled.
  • 403 β€” the token lacks the call's permission (the response includes missing_abilities, for example ["contacts:write"]); the call targets a resource outside the API (only contacts, lists and responses); the plan doesn't include the API (and the token is revoked); or whoever created the token needs to log in to the panel and accept updated terms. With "code": "ip_not_allowed", the call came from an address outside the token's list β€” the ip field says which.
  • 404 β€” the given list or contact does not exist (or isn't in your account). A survey from another account in survey_id returns 422.
  • 409 β€” attempt to delete a list used by an active survey.
  • 422 β€” invalid data, including an email already in the list or a repeated list name. The body includes a message and an errors object pointing to each problematic field.
  • 429 β€” you exceeded the request limit; wait the seconds given in the Retry-After header (see below).

Usage limits

  • All requests: up to 300 per minute on Business and 600 on Enterprise (or whatever the contract sets). The limit is counted per user who created the token, adding up all of that user's tokens.
  • Creating, updating and deleting contacts: on top of the limit above, up to 30 per minute.
  • When you hit a limit, the API returns 429 with the Retry-After header, which says how many seconds to wait before trying again. Use that value in your integration instead of a fixed interval. The same response carries X-RateLimit-Limit (the limit) and X-RateLimit-Remaining (how many calls are left).

Best practices and security

  • Never expose the token in code that runs in the browser or in public repositories β€” use it only from your server.
  • Give the token only the permissions the integration uses: a read token handed to a vendor can't delete anything.
  • For large loads, respect the 30 contacts per minute: send at a steady pace instead of firing everything at once.
  • Note the Expires date and replace the token before it.

The Integrations page itself includes ready-made examples in cURL, JavaScript and PHP for you to copy and adapt.

See API usage

At the top of Collect β€Ί Integrations, the View API usage button opens the history of everything the account's tokens called. Only administrators see it, because the page shows where the integrations call from.

  • Period β€” last 7, 30 or 90 days. The cards add up Calls, With errors, Blocked by IP and the Average time, and the chart shows calls per day.
  • API calls β€” one row per call: date, token, call (method and route, such as GET /responses), status, duration and origin (the IP and the program that called, such as curl/8.4.0). Filter by Token (including revoked ones) and by Result: success, integration error (4xx), our error (5xx) or blocked by IP.
  • Webhook deliveries β€” each delivery attempt of the response webhook (see its own article).

Each call's details are kept for 90 days. The page doesn't show the content sent or returned, only the call itself. Calls with a nonexistent, expired or revoked token don't appear: without a valid token, there's no way to know which account they belong to. An unknown IP in the origin column, or blocked calls you don't recognize, are the sign of a leaked token: revoke it and create another.

Where to go next

  • Contacts and lists β€” the same lists and contacts, viewed and managed in the panel.
  • Integrating the survey into your app β€” the in-app survey, which uses public calls and needs no token.
  • Response webhook β€” each response sent to your system as soon as it arrives.

In short: an administrator creates a token in Collect β€Ί Integrations with only the permissions needed, your integration sends that token in the Authorization header and uses the list, contact and response endpoints, respecting the per-minute limits and replacing the token before it expires.

Was this article helpful?