> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/api-reference/surveys.md).

# Surveys

## Get all surveys

> Returns all surveys for the organization.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetSurveysResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSurveysResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetSurveysResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/Survey"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"Survey":{"properties":{"id":{"description":"The unique identifier of the survey.","type":"string"},"name":{"description":"The name of the survey.","type":"string"},"type":{"description":"The type of the survey.\n\nKnown values: `nps`, `csat`, `custom`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"When the survey was last updated (RFC3339 format).","format":"date-time","type":"string"}},"required":["id","name","type","updated_at"],"title":"Survey represents a survey in the API response.","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"}}},"paths":{"/surveys":{"get":{"description":"Returns all surveys for the organization.\n\n**Rate limit:** 300 requests per minute","operationId":"GetSurveys","responses":{"200":{"$ref":"#/components/responses/GetSurveysResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get all surveys","tags":["surveys"]}}}}
```

## Get a survey by its ID

> Returns a single survey by ID.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetSurveyResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSurveyResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetSurveyResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Survey"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"Survey":{"properties":{"id":{"description":"The unique identifier of the survey.","type":"string"},"name":{"description":"The name of the survey.","type":"string"},"type":{"description":"The type of the survey.\n\nKnown values: `nps`, `csat`, `custom`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"When the survey was last updated (RFC3339 format).","format":"date-time","type":"string"}},"required":["id","name","type","updated_at"],"title":"Survey represents a survey in the API response.","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"}}},"paths":{"/surveys/{id}":{"get":{"description":"Returns a single survey by ID.\n\n**Rate limit:** 300 requests per minute","operationId":"GetSurvey","parameters":[{"description":"The ID of the survey.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/GetSurveyResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get a survey by its ID","tags":["surveys"]}}}}
```

## Get survey responses for a survey

> Returns paginated survey responses visible to the caller, optionally filtered by time range, account, or contact.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetSurveyResponsesResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSurveyResponsesResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetSurveyResponsesResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/SurveyResponse"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"SurveyResponse":{"properties":{"account_id":{"description":"The ID of the account associated with the response.","type":"string"},"answers":{"description":"The answers submitted in this response.","items":{"$ref":"#/components/schemas/SurveyResponseAnswer"},"nullable":true,"type":"array"},"contact_id":{"description":"The ID of the contact who submitted the response.","type":"string"},"excluded_at":{"description":"When the response was excluded from analytics.","format":"date-time","type":"string"},"id":{"description":"The unique identifier of the survey response.","type":"string"},"issue_id":{"description":"The ID of the issue associated with this response, when applicable.","type":"string"},"submitted_at":{"description":"When the response was submitted.","format":"date-time","type":"string"},"survey_id":{"description":"The ID of the survey template associated with this response.","type":"string"},"survey_instance_id":{"description":"The ID of the individual survey delivery that produced this response.","type":"string"},"survey_type":{"description":"The type of survey associated with this response.\n\nKnown values: `nps`, `csat`, `custom`. This list is not exhaustive.","type":"string"}},"required":["id","survey_instance_id","survey_type"],"title":"SurveyResponse represents a survey response in the API.","type":"object"},"SurveyResponseAnswer":{"properties":{"prompt":{"description":"The prompt/question that was answered.","type":"string"},"question_id":{"description":"The ID of the survey question, when applicable.","type":"string"},"question_type":{"description":"The type of question (score or comment).","type":"string"},"value":{"description":"The value of the answer.","type":"string"}},"required":["prompt","question_type","value"],"title":"SurveyResponseAnswer represents an answer in a survey response.","type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"}}},"paths":{"/surveys/{id}/responses":{"get":{"description":"Returns paginated survey responses visible to the caller, optionally filtered by time range, account, or contact.\n\n**Rate limit:** 300 requests per minute","operationId":"GetSurveyResponses","parameters":[{"description":"The ID of the survey.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Filter responses submitted after this time (RFC3339 format).","in":"query","name":"submitted_after","schema":{"format":"date-time","type":"string"}},{"description":"Filter responses submitted before this time (RFC3339 format).","in":"query","name":"submitted_before","schema":{"format":"date-time","type":"string"}},{"description":"Filter responses by account ID. Required with contact_id when the caller has scoped account or contact access.","in":"query","name":"account_id","schema":{"type":"string"}},{"description":"Filter responses by contact ID. Required with account_id when the caller has scoped account or contact access.","in":"query","name":"contact_id","schema":{"type":"string"}},{"description":"The cursor for pagination.","in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The number of responses to fetch. Defaults to 100. Must be greater than 0 and less than 1000.","in":"query","name":"limit","schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"$ref":"#/components/responses/GetSurveyResponsesResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get survey responses for a survey","tags":["surveys"]}}}}
```

## Search for surveys by a given filter

> Filterable fields and their allowed operators:\
> \
> &#x20;Field | Allowed operators |\
> &#x20;\--- | --- |\
> &#x20;\`updated\_at\` | \`time\_is\_after\`, \`time\_is\_before\`, \`time\_range\` |\
> \
> Timestamp values use RFC3339 format.\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"SearchSurveysRequest":{"properties":{"filter":{"$ref":"#/components/schemas/Filter"},"limit":{"description":"The number of surveys to fetch. Defaults to 100. Must be between 1 and 1000.","format":"int64","type":"integer"}},"type":"object"},"Filter":{"properties":{"field":{"description":"The field for this filter.  For allowed fields, see the documentation for\nthe specific endpoint you are using.\nFor non-compound filters (any operators other than \"and\" or \"or\"),\nfield must be set, along with either value or values, depending on the operator.","type":"string"},"operator":{"description":"The operator for this filter.","enum":["equals","not_equals","contains","does_not_contain","in","not_in","and","or","time_is_after","time_is_before","time_range","string_contains","string_does_not_contain","is_set","is_unset","greater_than","less_than","greater_than_or_equals","less_than_or_equals","includes_all_of","starts_with","ends_with"],"type":"string"},"subfilters":{"description":"Sub-filters for this filter.  Valid only when operator is \"and\" or \"or\".\nThe maximum allowed depth for a tree of filters is 3, counting the top-level filter.","items":{"$ref":"#/components/schemas/Filter"},"type":"array"},"value":{"description":"The value for this filter. Used by single-valued operators: \"equals\", \"not_equals\",\n\"contains\", \"does_not_contain\", \"string_contains\", \"string_does_not_contain\",\n\"starts_with\", \"ends_with\", \"time_is_after\", \"time_is_before\", \"greater_than\",\n\"less_than\", \"greater_than_or_equals\", and \"less_than_or_equals\".","type":"string"},"values":{"description":"The values for this filter. Used by multi-valued operators: \"in\", \"not_in\", and\n\"includes_all_of\". For \"time_range\", set to [start, end].","items":{"type":"string"},"type":"array"}},"required":["operator"],"type":"object"},"SearchSurveysResponseBody":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Survey"},"type":"array"},"request_id":{"type":"string"}},"required":["data","request_id"],"type":"object"},"Survey":{"properties":{"id":{"description":"The unique identifier of the survey.","type":"string"},"name":{"description":"The name of the survey.","type":"string"},"type":{"description":"The type of the survey.\n\nKnown values: `nps`, `csat`, `custom`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"When the survey was last updated (RFC3339 format).","format":"date-time","type":"string"}},"required":["id","name","type","updated_at"],"title":"Survey represents a survey in the API response.","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"}},"responses":{"SearchSurveysResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchSurveysResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/surveys/search":{"post":{"description":"Filterable fields and their allowed operators:\n\n Field | Allowed operators |\n --- | --- |\n `updated_at` | `time_is_after`, `time_is_before`, `time_range` |\n\nTimestamp values use RFC3339 format.\n\n**Rate limit:** 120 requests per minute","operationId":"SearchSurveys","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchSurveysRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/SearchSurveysResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Search for surveys by a given filter","tags":["surveys"]}}}}
```

## Get survey responses for an issue

> Returns paginated CSAT and custom survey responses associated with an issue.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetIssueSurveyResponsesResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetIssueSurveyResponsesResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetIssueSurveyResponsesResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/SurveyResponse"},"type":"array"},"issue_id":{"description":"The canonical issue ID.","type":"string"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","issue_id","request_id"],"type":"object"},"SurveyResponse":{"properties":{"account_id":{"description":"The ID of the account associated with the response.","type":"string"},"answers":{"description":"The answers submitted in this response.","items":{"$ref":"#/components/schemas/SurveyResponseAnswer"},"nullable":true,"type":"array"},"contact_id":{"description":"The ID of the contact who submitted the response.","type":"string"},"excluded_at":{"description":"When the response was excluded from analytics.","format":"date-time","type":"string"},"id":{"description":"The unique identifier of the survey response.","type":"string"},"issue_id":{"description":"The ID of the issue associated with this response, when applicable.","type":"string"},"submitted_at":{"description":"When the response was submitted.","format":"date-time","type":"string"},"survey_id":{"description":"The ID of the survey template associated with this response.","type":"string"},"survey_instance_id":{"description":"The ID of the individual survey delivery that produced this response.","type":"string"},"survey_type":{"description":"The type of survey associated with this response.\n\nKnown values: `nps`, `csat`, `custom`. This list is not exhaustive.","type":"string"}},"required":["id","survey_instance_id","survey_type"],"title":"SurveyResponse represents a survey response in the API.","type":"object"},"SurveyResponseAnswer":{"properties":{"prompt":{"description":"The prompt/question that was answered.","type":"string"},"question_id":{"description":"The ID of the survey question, when applicable.","type":"string"},"question_type":{"description":"The type of question (score or comment).","type":"string"},"value":{"description":"The value of the answer.","type":"string"}},"required":["prompt","question_type","value"],"title":"SurveyResponseAnswer represents an answer in a survey response.","type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"}}},"paths":{"/issues/{id}/survey-responses":{"get":{"description":"Returns paginated CSAT and custom survey responses associated with an issue.\n\n**Rate limit:** 300 requests per minute","operationId":"GetIssueSurveyResponses","parameters":[{"description":"The ID or number of the issue.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Filter responses by survey template ID.","in":"query","name":"survey_id","schema":{"type":"string"}},{"description":"Filter responses submitted after this time (RFC3339 format).","in":"query","name":"submitted_after","schema":{"format":"date-time","type":"string"}},{"description":"Filter responses submitted before this time (RFC3339 format).","in":"query","name":"submitted_before","schema":{"format":"date-time","type":"string"}},{"description":"The cursor for pagination.","in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The number of responses to fetch. Defaults to 100. Must be greater than 0 and less than 1000.","in":"query","name":"limit","schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"$ref":"#/components/responses/GetIssueSurveyResponsesResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get survey responses for an issue","tags":["surveys"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.usepylon.com/pylon-docs/developer/api/api-reference/surveys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
