Skip to content

Referenz der öffentlichen API v1 ​

Diese Referenz wird beim Bauen der Doku aus dem OpenAPI-Dokument der öffentlichen API erzeugt (openapi-v1.json, PollYou Public API 1.0.0). Die laufende API liefert dasselbe Dokument unter GET /api/v1/openapi.json – ohne Anmeldung, zum Import in Postman, Insomnia oder einen Code-Generator.

Alle Endpunkte verlangen einen API-Schlüssel (Authorization: Bearer py_live_…) mit dem jeweils genannten Scope. Einstieg, Scopes, Rate-Limits und Beispiele: Öffentliche API.

Surveys

GET /api/v1/surveys

List surveys (scope surveys:read)

Most recently updated first. Archived surveys only appear with `status=archived`.

ParameterOrtPflichtBeschreibung
statusqueryneinOnly surveys with this status
typequeryneinOnly polls or only surveys
pagequeryneinPage number (1-based)
StatusBedeutungSchema
200V1Survey resourceV1Survey.V1SurveyPage
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
404Not foundError
429Rate limit of the API key exceeded (see Retry-After)

POST /api/v1/surveys

Create a draft (scope surveys:write)

A poll starts with one page holding one single choice question with two options, a survey with one empty page. Questions are edited in the dashboard.

Request-Body (V1Survey.V1SurveyCreateInput):

FeldTypBeschreibung
typestring (poll, survey)
titlestring
descriptionstring | null
StatusBedeutungSchema
201V1Survey resource createdV1Survey
400Invalid inputError
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
422An error occurredConstraintViolation
429Rate limit of the API key exceeded (see Retry-After)

GET /api/v1/surveys/{id}

Get a survey with its structure (scope surveys:read)

Get a survey with its structure (scope surveys:read)

ParameterOrtPflichtBeschreibung
idpathjaV1Survey identifier
StatusBedeutungSchema
200V1Survey resourceV1Survey
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
404Not foundError
429Rate limit of the API key exceeded (see Retry-After)

PATCH /api/v1/surveys/{id}

Change title or description (scope surveys:write)

Merge patch (`application/merge-patch+json`): omitted fields stay unchanged. Changes the draft; respondents see them after the next publish. Archived surveys: 409.

ParameterOrtPflichtBeschreibung
idpathjaV1Survey identifier

Request-Body (V1Survey.V1SurveyUpdateInput.jsonMergePatch):

FeldTypBeschreibung
titlestring | null
descriptionstring | null
StatusBedeutungSchema
200V1Survey resource updatedV1Survey
400Invalid inputError
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
404Not foundError
422An error occurredConstraintViolation
429Rate limit of the API key exceeded (see Retry-After)

POST /api/v1/surveys/{id}/close

Close a live or scheduled survey (scope surveys:write; 409 from other statuses)

Close a live or scheduled survey (scope surveys:write; 409 from other statuses)

ParameterOrtPflichtBeschreibung
idpathjaV1Survey identifier
StatusBedeutungSchema
200V1Survey resource createdV1Survey
400Invalid inputError
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
422An error occurredConstraintViolation
429Rate limit of the API key exceeded (see Retry-After)

POST /api/v1/surveys/{id}/publish

Publish the draft as a new version (scope surveys:write)

The status becomes `scheduled` if the start lies in the future, otherwise `live`. 409 for archived surveys, 422 if the draft is not publishable.

ParameterOrtPflichtBeschreibung
idpathjaV1Survey identifier
StatusBedeutungSchema
200V1Survey resource createdV1Survey
400Invalid inputError
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
422An error occurredConstraintViolation
429Rate limit of the API key exceeded (see Retry-After)

Responses

GET /api/v1/responses/{id}

Get a response with all answers (scope responses:read)

Get a response with all answers (scope responses:read)

ParameterOrtPflichtBeschreibung
idpathjaV1Response identifier
StatusBedeutungSchema
200V1Response resourceV1Response
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
404Not foundError
429Rate limit of the API key exceeded (see Retry-After)

DELETE /api/v1/responses/{id}

Delete a response permanently (scope responses:write)

For example for data subject requests. Removes the response with its answers; aggregates are recomputed. Audit-logged (`response.deleted`).

ParameterOrtPflichtBeschreibung
idpathjaV1Response identifier
StatusBedeutungSchema
204V1Response resource deleted
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
404Not foundError
429Rate limit of the API key exceeded (see Retry-After)

GET /api/v1/surveys/{surveyId}/responses

List the responses of a survey (scope responses:read)

Newest first (by completion, unfinished responses by start). Range: `from`/`to` (default: since the survey was created). Excluded responses only with `includeExcluded=true`. Pagination by cursor: pass `nextCursor` as `cursor` for the next page; it stays stable while new responses arrive. `answers` maps question keys to display values.

ParameterOrtPflichtBeschreibung
statusqueryneincompleted (default), started (not completed) or all
fromqueryneinStart: local date `YYYY-MM-DD` (midnight in `timezone`) or ISO 8601 date-time with offset
toqueryneinEnd: local date `YYYY-MM-DD` (inclusive) or ISO 8601 date-time with offset (exclusive)
timezonequeryneinIANA timezone of the dates (default UTC)
includeExcludedqueryneinAlso list excluded (flagged) responses
limitqueryneinPage size
cursorquerynein`nextCursor` of the previous page
surveyIdpathjaV1Response identifier
StatusBedeutungSchema
200V1Response resourceV1Response.V1ResponsePage
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
404Not foundError
429Rate limit of the API key exceeded (see Retry-After)

Analytics

GET /api/v1/surveys/{id}/analytics

Key figures and results per question (scope analytics:read)

Completed, not excluded responses in the range (default: the last 30 days including today). Same numbers as the dashboard.

ParameterOrtPflichtBeschreibung
fromqueryneinStart: local date `YYYY-MM-DD` (midnight in `timezone`) or ISO 8601 date-time with offset
toqueryneinEnd: local date `YYYY-MM-DD` (inclusive) or ISO 8601 date-time with offset (exclusive)
timezonequeryneinIANA timezone of the dates (default UTC)
idpathjaV1SurveyAnalytics identifier
StatusBedeutungSchema
200V1SurveyAnalytics resourceV1SurveyAnalytics
401Missing, invalid, expired or revoked API key
403The API key lacks the required scope, or X-Organization-Id names another organization
404Not foundError
429Rate limit of the API key exceeded (see Retry-After)

Schemas ​

V1Response

FeldTypBeschreibung
idstring (uuid)
surveyIdstring (uuid)
statusstring (in_progress, completed)
startedAtstring (date-time)
completedAtstring | null (date-time)
durationMsinteger | null
channelstringHow the response was collected: script, react, vue, angular, angularjs, iframe, embed, link or api
embedIdstring | null (uuid)
deviceTypestring | null
browserFamilystring | null
osFamilystring | null
countrystring | nullISO 3166-1 alpha-2
localestring | null
referrerHoststring | null
utmobject
metaobject
identifiedbooleanStarted with a verified identity token
versionNumberinteger | nullSurvey version the respondent answered
excludedbooleanExcluded from analytics and results (spam, test, …)
answersarrayEvery question of the response's survey version in order, answered or not.

V1Response.V1ResponsePage

FeldTypBeschreibung
itemsarray
totalItemsintegerNumber of responses matching the filter (all pages)
nextCursorstring | nullCursor of the next page; null on the last page

V1Survey

FeldTypBeschreibung
idstring (uuid)
publicIdstring
typestring (poll, survey)
titlestring
descriptionstring | null
statusstring (draft, scheduled, live, closed, archived)
questionCountinteger
publishedVersioninteger | null
publishedAtstring | null (date-time)
hasUnpublishedChangesboolean
createdAtstring (date-time)
updatedAtstring (date-time)
pagesarray

V1Survey.V1SurveyPage

FeldTypBeschreibung
itemsarray
pageinteger
itemsPerPageinteger
totalItemsintegerNumber of surveys matching the filter (all pages)

V1SurveyAnalytics

FeldTypBeschreibung
surveyIdstring (uuid)
metaobjectWhere the numbers come from and the resolved range (ISO 8601 in the filter timezone, `to` exclusive).
overviewobject
totalResponsesintegerCompleted responses counted in the question results
questionsarray