surveys

Mixin for ViewSets to handle approval-gate exceptions raised from decorated serializers.

Intercepts ApprovalRequired (409) and PolicyConflict (400) raised by the @approval_gate decorator on serializer methods and converts them into the same responses the viewset path produces (see decorators._result_to_response), so both paths share one contract.

get/api/projects/{project_id}/surveys/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/surveys/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

archivedboolean
created_bynumber

Filter surveys by the ID of the user who created them.

idsstring[]

Multiple values may be separated by commas.

limitinteger

Number of results to return per page.

offsetinteger

The initial index from which to return the results.

searchstring

Match against survey name and description. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram — typos, prefix-as-you-type) matches instead. Each result's search_match_type is exact or similar.

status'complete' | 'draft' | 'running'

Filter surveys by their current status.

  • draft - Draft
  • running - Running
  • complete - Complete
type'api' | 'external_survey' | 'popover' | 'widget'
  • popover - popover
  • widget - widget
  • external_survey - external survey
  • api - api

Response

countinteger required
nextstring uri nullable
previousstring uri nullable

Example response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100"
}

Changes

No recorded changes to this operation across all 1 revision of this API.