Skip to main content

Get Insight

Returns aggregated response data for a specific funnel question or survey element.

GET /v1/funnels/{funnelId}/metrics/insights/{insightId}

Authentication

Requires the x-perspective-api-key header. See Authentication for details.

Path parameters

NameTypeRequiredDescription
funnelIdstringYesThe ID of the funnel to query.
insightIdstringYesThe ID of the question or survey element, as shown in the funnel builder (e.g. question_1234).

Query parameters

NameTypeRequiredDescription
fromstring (ISO 8601)YesStart of the metrics period, e.g. 2025-01-01T00:00:00.000Z. Must be before to.
tostring (ISO 8601)YesEnd of the metrics period, e.g. 2025-01-31T00:00:00.000Z.
offsetstringNoTimezone offset in minutes, e.g. -120 for UTC−2. Accepts an optional leading + or -.

Example request

curl "https://api.perspective.co/v1/funnels/fnl_abc123/metrics/insights/question_1234?from=2025-01-01T00:00:00.000Z&to=2025-01-31T00:00:00.000Z" \
-H "x-perspective-api-key: $PERSPECTIVE_API_KEY"

Response

Returns { data: InsightData }.

InsightData object

FieldTypeDescription
titlestringThe question text for this insight.
answersobjectMap of answer text to response count. Each key is an answer option; the value is how many respondents chose it.
groupedAnswersobjectPresent only for multiple-choice questions. Keys are semicolon-separated answer combinations (e.g. "Option A; Option B"); values are the count of respondents who selected that exact combination.

Example response

{
"data": {
"title": "What is your Community goal? Answer the question to find the right course for you and receive optimal support.",
"answers": {
"Secure competitive advantage": 3,
"Receive support": 1,
"Gain loyal fans": 1
},
"groupedAnswers": {
"Secure competitive advantage; Receive support": 4,
"Receive support; Gain loyal fans": 2
}
}
}

Errors

See Errors for the full list of status codes and handling guidance.

StatusMeaning
400Missing or invalid parameters, or the requested insight was not found for this funnel.
401Missing or invalid API key.
403Your API key does not have metrics:read permission.
500Internal server error.