API
Updated
On this page
The SurveyNinja REST API lets your applications work with surveys and responses: get the list of surveys, read responses, export them, manage hidden variables and webhooks. The API returns JSON.
This article covers the basics. The full reference with all endpoints and parameters is at surveyninja.io/dev/api.
Before you start
An API key belongs to the account that created it, and requests made with it have the same rights as that account. The key works with your own workspaces and with the workspaces where you're a member: there it sees only the folders shared with you and does only what your role allows. In someone else's workspace, the API / MCP section opens only if your role has access to it.
Creating an API key
- Click your profile icon in the top right corner and choose API / MCP.
- Click Create key (1).
- In the New API key window, enter the Key name (at least 3 characters), for example "CRM sync", and click Create key.
- In the Key created window, click Copy next to the key and store it in a safe place. Under How to connect, the window also shows a sample request with your key. Click Done.

Important. The key is shown only once. If you lose it, delete it and create a new one.
The page shows how many keys you've created and the limit. The list shows the last characters of each key and when it was Created and Last used. To rename or delete a key, open the menu (2) next to it and choose Rename or Delete. Deleting asks for confirmation in the Delete API key window. To stop an application from using the API, delete its key: requests with a deleted key get the 401 code.
API access in someone else's workspace
The owner of a workspace where you're a member can let you work with it through the API with a key of your own.
- The owner opens Members, opens your settings and turns on API access. In Access until, they can set the last day of access. Without a date, access has no end.
- While you're in that workspace, click your profile icon and choose My API access.
- Click Create key, enter a name and copy the key.
This key works only in that workspace and only with the folders shared with you. It gives access to folders, surveys and responses: listing, creating, saving and publishing. Other API methods and the MCP server don't accept it. You can have one such key: Reissue replaces it with a new one, Revoke turns it off.
Making requests
All requests go to this base URL:
https://api.surveyninja.io/api/v3/service
Pass the key in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY
For example, this request returns the list of your surveys:
curl -X GET "https://api.surveyninja.io/api/v3/service/quiz" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
If the key is missing or wrong, the API responds with the 401 code.
Integrations built on the old API paths (/api/service) work with the new keys too. For new integrations, use API v3.
Main endpoints
Paths are relative to the base URL.
| Method | Path | What it does |
|---|---|---|
| GET | /user | Information about the key owner |
| GET | /workspaces | Your workspaces |
| GET | /folders | Folders of your workspace |
| GET | /quiz | List of surveys |
| GET | /quiz/{id} | Survey data and questions |
| POST | /quiz | Create a survey |
| POST | /quiz/{id}/publish | Publish a survey |
| GET | /quiz/{id}/answers | List of responses |
| GET | /quiz/{id}/answers/csv | Responses as a CSV file |
| GET | /quiz/{id}/answers/xlsx | Responses as an Excel file |
| GET | /quiz/{id}/summary | Summary: visits, completed responses, completion rate |
| GET | /quiz/{id}/hidden/variables | Hidden variables of a survey |
| GET | /quiz/{id}/webhooks | Webhooks of a survey |
The API also covers survey settings, themes, folders, members, promo codes, unique links and reports. See the full list in the API reference.
Getting the list of surveys
GET /quiz accepts these query parameters:
| Parameter | Description |
|---|---|
| limit, offset | Pagination |
| sort | created_at, updated_at, name, id or last_answer_at. Default: id |
| order | desc or asc. Default: desc |
| folder_id | Return surveys from one folder only |
| workspace_id | Return surveys from this workspace. It must be yours or one where you're a member |
The response is an array of surveys. Without workspace_id, they are from your own workspace (the oldest one if you own several). In a workspace where you're a member, only the surveys from the folders shared with you are returned. Without limit, the array contains all surveys. Each survey has id, name, type, url_shared (the public link), is_published, created_at, updated_at, last_answer_at (when the last response was completed), folder and notes.
Getting responses
GET /quiz/{id}/answers returns responses to a survey, newest first by default (sorted by response ID).
| Parameter | Description |
|---|---|
| limit | Number of responses, up to 100. Default: 20 |
| offset | How many responses to skip. Default: 0 |
| date | Responses for one day, in the YYYY-MM-DD format |
| is_complete | true for completed responses only, false for incomplete ones |
| sort | date_end, date_start, score, duration (time spent), or q: followed by the ID of a question with a number, such as a rating or NPS |
| order | desc or asc. Default: desc |
| locale[] | For a survey in several languages: only responses in these languages (language codes). none returns responses without a language |
Request example:
curl -X GET "https://api.surveyninja.io/api/v3/service/quiz/123/answers?limit=50&is_complete=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Response example (shortened):
{
"answers": [
{
"id": 4813,
"visit_id": 46139,
"date": "2026-08-24T12:51:33",
"date_start": "2026-08-24T12:50:52",
"date_end": "2026-08-24T12:51:33",
"filling_time_seconds": 41,
"extra_fields": { "utm_source": "newsletter" },
"is_complete": true,
"is_respondent": false,
"answers": [
{
"type": "input",
"rowId": "87a748c3-43e5-4ecc-bba2-413deb908864",
"title": "What should we improve?",
"result": "Faster support",
"min_val": null,
"max_val": null,
"hidden_options": []
},
{
"type": "userInfo",
"title": "User info",
"result": {
"ip": "203.0.113.10",
"browser": "Chrome",
"country": "Germany",
"user_agent": "Mozilla/5.0 ...",
"password_number": null,
"import_source": null,
"is_anonymous": false
},
"is_anonymous": false
}
],
"locale": null,
"over_upload_limit": false,
"unique_link": null
}
],
"answer_total_count": 128
}
In each response, answers contains one object per question. rowId is the question ID, result is the answer. The last object with the userInfo type holds the respondent's technical data. In anonymous surveys, the IP address, browser, country and user agent are null. locale is the language the respondent chose, or null if the survey has one language. If no responses match the request, answers is an empty array [].
answer_total_count is the number of responses that match the same filters as the list (date, is_complete, locale[] and unique links), without limit and offset. Hidden, disqualified and deleted responses are not counted. Use it to count pages.
MCP for AI assistants
The same API key connects SurveyNinja to AI assistants that support the Model Context Protocol (MCP), such as Claude or Cursor. MCP is available on every plan, including Free. How to set it up is described in Connecting AI Assistants (MCP).
Limits
- An account can have up to 20 API keys. The limit is the same on every plan.
- Up to 1,200 requests per minute per user, for all API versions together. Over the limit, the API responds with the 429 code and the Retry-After header.
- Response exports: up to 30 files per minute, and up to 12 PDF files per minute, one at a time.
- Up to 30 new surveys a day on the Free plan and the trial, 100 on paid plans.
- GET /quiz/{id}/answers returns up to 100 responses per request. To get the rest, use limit and offset.
- GET /quiz/{id}/answers doesn't return hidden, disqualified and deleted responses.
- A key name must have at least 3 characters.
If something doesn't work
- The API responds with the 401 code. The key is missing, mistyped or deleted. Check the header: the word Bearer, a space, then the key.
- "You can't create more API keys on your plan" when you click Create key. The account already has 20 keys. A higher plan doesn't raise this limit. Delete a key you no longer use.
- The API responds with the 429 code. You sent too many requests in a minute or hit an export limit. Wait the number of seconds from the Retry-After header and repeat the request.
- GET /quiz returns surveys from another workspace. Without workspace_id, the list comes from your own workspace. Pass workspace_id to choose the workspace.
- The API returns only 20 responses. That is the default limit. Pass limit (up to 100) and offset to get more.
Types of Research: 5 Ways to Classify a Study, With Examples