PostHog surveys API

The surveys API from PostHog — 14 operation(s) for surveys.

OpenAPI Specification

posthog-surveys-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: PostHog actions surveys API
  version: 1.0.0
  description: ''
tags:
- name: surveys
paths:
  /api/projects/{project_id}/surveys/:
    get:
      operationId: surveys_list
      parameters:
      - in: query
        name: archived
        schema:
          type: boolean
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - $ref: '#/components/parameters/ProjectIdPath'
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSurveyList'
          description: ''
      x-explicit-tags:
      - surveys
    post:
      operationId: surveys_create
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnlySchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnlySchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnlySchema'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          description: ''
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/:
    get:
      operationId: surveys_retrieve
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Survey'
          description: ''
      x-explicit-tags:
      - surveys
    put:
      operationId: surveys_update
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Survey'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Survey'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Survey'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Survey'
          description: ''
      x-explicit-tags:
      - surveys
    patch:
      operationId: surveys_partial_update
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSurveySerializerCreateUpdateOnlySchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSurveySerializerCreateUpdateOnlySchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSurveySerializerCreateUpdateOnlySchema'
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          description: ''
      x-explicit-tags:
      - surveys
    delete:
      operationId: surveys_destroy
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '204':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/activity/:
    get:
      operationId: surveys_activity_retrieve
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - activity_log:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/archived-response-uuids/:
    get:
      operationId: surveys_archived_response_uuids_retrieve
      description: 'Get list of archived response UUIDs for HogQL filtering.


        Returns list of UUIDs that the frontend can use to filter out archived responses

        in HogQL queries.'
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/duplicate_to_projects/:
    post:
      operationId: surveys_duplicate_to_projects_create
      description: 'Duplicate a survey to multiple projects in a single transaction.


        Accepts a list of target team IDs and creates a copy of the survey in each project.

        Uses an all-or-nothing approach - if any duplication fails, all changes are rolled back.'
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/generate_translations/:
    post:
      operationId: surveys_generate_translations_create
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateSurveyTranslationsRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GenerateSurveyTranslationsRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GenerateSurveyTranslationsRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateSurveyTranslationsResponse'
          description: ''
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/responses/{response_uuid}/archive/:
    post:
      operationId: surveys_responses_archive_create
      description: Archive a single survey response.
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: response_uuid
        schema:
          type: string
          pattern: ^[^/]+$
        required: true
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/responses/{response_uuid}/unarchive/:
    post:
      operationId: surveys_responses_unarchive_create
      description: Unarchive a single survey response.
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: response_uuid
        schema:
          type: string
          pattern: ^[^/]+$
        required: true
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:write
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/stats/:
    get:
      operationId: surveys_stats_retrieve
      description: "Get survey response statistics for a specific survey.\n\nArgs:\n    date_from: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)\n    date_to: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)\n    exclude_archived: Optional boolean to exclude archived responses (default: false, includes archived)\n\nReturns:\n    Survey statistics including event counts, unique respondents, and conversion rates"
      parameters:
      - in: query
        name: date_from
        schema:
          type: string
          format: date-time
        description: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)
      - in: query
        name: date_to
        schema:
          type: string
          format: date-time
        description: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SurveyStatsResponse'
          description: ''
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/summarize_responses/:
    post:
      operationId: surveys_summarize_responses_create
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/{id}/summary_headline/:
    post:
      operationId: surveys_summary_headline_create
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this survey.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SurveySerializerCreateUpdateOnly'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/activity/:
    get:
      operationId: surveys_all_activity_retrieve
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - activity_log:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/responses_count/:
    get:
      operationId: surveys_responses_count_retrieve
      description: "Get response counts for all surveys.\n\nArgs:\n    exclude_archived: Optional boolean to exclude archived responses (default: false, includes archived)\n    survey_ids: Optional comma-separated list of survey IDs to filter by\n\nReturns:\n    Dictionary mapping survey IDs to response counts"
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - surveys
  /api/projects/{project_id}/surveys/stats/:
    get:
      operationId: surveys_global_stats_retrieve
      description: "Get aggregated response statistics across all surveys.\n\nArgs:\n    date_from: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)\n    date_to: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)\n\nReturns:\n    Aggregated statistics across all surveys including total counts and rates"
      parameters:
      - in: query
        name: date_from
        schema:
          type: string
          format: date-time
        description: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)
      - in: query
        name: date_to
        schema:
          type: string
          format: date-time
        description: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - surveys
      security:
      - PersonalAPIKeyAuth:
        - survey:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SurveyGlobalStatsResponse'
          description: ''
      x-explicit-tags:
      - surveys
components:
  schemas:
    FeatureFlagFilterPropertyMultiContainsSchemaOperatorEnum:
      enum:
      - icontains_multi
      - not_icontains_multi
      type: string
      description: '* `icontains_multi` - icontains_multi

        * `not_icontains_multi` - not_icontains_multi'
    FeatureFlagFilterPropertySemverSchema:
      type: object
      properties:
        key:
          type: string
          description: Property key used in this feature flag condition.
        type:
          allOf:
          - $ref: '#/components/schemas/PropertyGroupTypeEnum'
          description: 'Property filter type. Common values are ''person'' and ''cohort''.


            * `cohort` - cohort

            * `person` - person

            * `group` - group'
        cohort_name:
          type: string
          nullable: true
          description: Resolved cohort name for cohort-type filters.
        group_type_index:
          type: integer
          nullable: true
          description: Group type index when using group-based filters.
        operator:
          allOf:
          - $ref: '#/components/schemas/FeatureFlagFilterPropertySemverSchemaOperatorEnum'
          description: 'Semantic version comparison operator.


            * `semver_gt` - semver_gt

            * `semver_gte` - semver_gte

            * `semver_lt` - semver_lt

            * `semver_lte` - semver_lte

            * `semver_eq` - semver_eq

            * `semver_neq` - semver_neq

            * `semver_tilde` - semver_tilde

            * `semver_caret` - semver_caret

            * `semver_wildcard` - semver_wildcard'
        value:
          type: string
          description: Semantic version string.
      required:
      - key
      - operator
      - value
    SurveyResponseBasedBranching:
      type: object
      properties:
        type:
          allOf:
          - $ref: '#/components/schemas/SurveyResponseBasedBranchingTypeEnum'
          description: 'Branch based on the selected or entered response.


            * `response_based` - response_based'
        responseValues:
          type: object
          additionalProperties:
            oneOf:
            - type: integer
              minimum: 0
            - type: string
              enum:
              - end
          description: Response-based branching map. Values can be a question index or 'end'.
      required:
      - responseValues
      - type
    SurveyResponseBasedBranchingTypeEnum:
      enum:
      - response_based
      type: string
      description: '* `response_based` - response_based'
    FeatureFlagFilterPropertyCohortInSchemaOperatorEnum:
      enum:
      - in
      - not_in
      type: string
      description: '* `in` - in

        * `not_in` - not_in'
    SurveySerializerCreateUpdateOnlySchema:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Survey name.
          maxLength: 400
          minLength: 1
        description:
          type: string
          description: Survey description.
        type:
          allOf:
          - $ref: '#/components/schemas/SurveyType'
          description: 'Survey type.


            * `popover` - popover

            * `widget` - widget

            * `external_survey` - external survey

            * `api` - api'
        schedule:
          nullable: true
          description: 'Survey scheduling behavior: ''once'' = show once per user (default), ''recurring'' = repeat based on iteration_count and iteration_frequency_days settings, ''always'' = show every time conditions are met (mainly for widget surveys)


            * `once` - once

            * `recurring` - recurring

            * `always` - always'
          oneOf:
          - $ref: '#/components/schemas/ScheduleEnum'
          - $ref: '#/components/schemas/NullEnum'
        linked_flag:
          allOf:
          - $ref: '#/components/schemas/MinimalFeatureFlag'
          readOnly: true
        linked_flag_id:
          type: integer
          writeOnly: true
          nullable: true
          description: The feature flag linked to this survey.
        linked_insight_id:
          type: integer
          writeOnly: true
          nullable: true
        targeting_flag_id:
          type: integer
          writeOnly: true
          description: An existing targeting flag to use for this survey.
        targeting_flag:
          allOf:
          - $ref: '#/components/schemas/MinimalFeatureFlag'
          readOnly: true
        internal_targeting_flag:
          allOf:
          - $ref: '#/components/schemas/MinimalFeatureFlag'
          readOnly: true
        targeting_flag_filters:
          allOf:
          - $ref: '#/components/schemas/FeatureFlagFiltersSchema'
          writeOnly: true
          nullable: true
          description: 'Target specific users based on their properties. Example: {groups: [{properties: [{key: ''email'', value: [''@company.com''], operator: ''icontains''}], rollout_percentage: 100}]}'
        remove_targeting_flag:
          type: boolean
          writeOnly: true
          nullable: true
          description: Set to true to completely remove all targeting filters from the survey, making it visible to all users (subject to other display conditions like URL matching).
        questions:
          type: array
          items:
            $ref: '#/components/schemas/SurveyQuestionInputSchema'
          nullable: true
          description: "\n        The `array` of questions included in the survey. Each question must conform to one of the defined question types: Basic, Link, Rating, or Multiple Choice.\n\n        Basic (open-ended question)\n        - `id`: The question ID\n        - `type`: `open`\n        - `question`: The text of the question.\n        - `description`: Optional description of the question.\n        - `descriptionContentType`: Content type of the description (`html` or `text`).\n        - `optional`: Whether the question is optional (`boolean`).\n        - `buttonText`: Text displayed on the submit button.\n        - `branching`: Branching logic for the question. See branching types below for details.\n\n        Link (a question with a link)\n        - `id`: The question ID\n        - `type`: `link`\n        - `question`: The text of the question.\n        - `description`: Optional description of the question.\n        - `descriptionContentType`: Content type of the description (`html` or `text`).\n        - `optional`: Whether the question is optional (`boolean`).\n        - `buttonText`: Text displayed on the submit button.\n        - `link`: The URL associated with the question.\n        - `branching`: Branching logic for the question. See branching types below for details.\n\n        Rating (a question with a rating scale)\n        - `id`: The question ID\n        - `type`: `rating`\n        - `question`: The text of the question.\n        - `description`: Optional description of the question.\n        - `descriptionContentType`: Content type of the description (`html` or `text`).\n        - `optional`: Whether the question is optional (`boolean`).\n        - `buttonText`: Text displayed on the submit button.\n        - `display`: Display style of the rating (`number` or `emoji`).\n        - `scale`: The scale of the rating (`number`).\n        - `lowerBoundLabel`: Label for the lower bound of the scale.\n        - `upperBoundLabel`: Label for the upper bound of the scale.\n        - `isNpsQuestion`: Whether the question is an NPS rating.\n        - `branching`: Branching logic for the question. See branching types below for details.\n\n        Multiple choice\n        - `id`: The question ID\n        - `type`: `single_choice` or `multiple_choice`\n        - `question`: The text of the question.\n        - `description`: Optional description of the question.\n        - `descriptionContentType`: Content type of the description (`html` or `text`).\n        - `optional`: Whether the question is optional (`boolean`).\n        - `buttonText`: Text displayed on the submit button.\n        - `choices`: An array of choices for the question.\n        - `shuffleOptions`: Whether to shuffle the order of the choices (`boolean`).\n        - `hasOpenChoice`: Whether the question allows an open-ended response (`boolean`).\n        - `branching`: Branching logic for the question. See branching types below for details.\n\n        Branching logic can be one of the following types:\n\n        Next question: Proceeds to the next question\n        ```json\n        {\n            \"type\": \"next_question\"\n        }\n        ```\n\n        End: Ends the survey, optionally displaying a confirmation message.\n        ```json\n        {\n            \"type\": \"end\"\n        }\n        ```\n\n        Response-based: Branches based on the response values. Available for the `rating` and `single_choice` question types.\n        ```json\n        {\n            \"type\": \"response_based\",\n            \"responseValues\": {\n                \"responseKey\": \"value\"\n            }\n        }\n        ```\n\n        Specific question: Proceeds to a specific question by index.\n        ```json\n        {\n            \"type\": \"specific_question\",\n            \"index\": 2\n        }\n        ```\n\n        Translations: Each question can include inline translations.\n        - `translations`: Object mapping language codes to translated fields.\n        - Language codes: Any string - allows customers to use their own language keys (e.g., \"es\", \"es-MX\", \"english\", \"french\")\n        - Translatable fields: `question`, `description`, `buttonText`, `choices`, `lowerBoundLabel`, `upperBoundLabel`, `link`\n\n        Example with translations:\n        ```json\n        {\n            \"id\": \"uuid\",\n            \"type\": \"rating\",\n            \"question\": \"How satisfied are you?\",\n            \"lowerBoundLabel\": \"Not satisfied\",\n            \"upperBoundLabel\": \"Very satisfied\",\n            \"translations\": {\n                \"es\": {\n                    \"question\": \"¿Qué tan satisfecho estás?\",\n                    \"lowerBoundLabel\": \"No satisfecho\",\n                    \"upperBoundLabel\": \"Muy satisfecho\"\n                },\n                \"fr\": {\n                    \"question\": \"Dans quelle mesure êtes-vous satisfait?\"\n                }\n            }\n        }\n        ```\n        "
        conditions:
          allOf:
          - $ref: '#/components/schemas/SurveyConditionsSchema'
          nullable: true
          description: Display and targeting conditions for the survey.
        appearance:
          allOf:
          - $ref: '#/components/schemas/SurveyAppearanceSchema'
          nullable: true
          description: Survey appearance customization.
        created_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          allOf:
          - $ref: '#/components/schemas/UserBasic'
          readOnly: true
        start_date:
          type: string
          format: date-time
          nullable: true
          description: Setting this will launch the survey immediately. Don't add a start_date unless explicitly requested to do so.
        end_date:
          type: string
          format: date-time
          nullable: true
          description: When the survey stopped being shown to users. Setting this will complete the survey.
        archived:
          type: boolean
          description: Archive state for the survey.
        responses_limit:
          type: integer
          nullable: true
          description: The maximum number of responses before automatically stopping the survey.
        iteration_count:
          type: integer
          maximum: 500
          minimum: 1
          nullable: true
          description: For a recurring schedule, this field specifies the number of times the survey should be shown to the user. Use 1 for 'once every X days', higher numbers for multiple repetitions. Works together with iteration_frequency_days to determine the overall survey schedule.
        iteration_frequency_days:
          type: integer
          maximum: 365
          minimum: 1
          nullable: true
          description: For a recurring schedule, this field specifies the interval in days between each survey instance shown to the user, used alongside iteration_count for precise scheduling.
        iteration_start_dates:
          type: array
          items:
            type: string
            format: date-time
            nullable: true
          nullable: true
        current_iteration:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        current_iteration_start_date:
          type: string
          format: date-time
          nullable: true
        response_sampling_start_date:
          type: string
          format: date-time
          nullable: true
        response_sampling_interval_type:
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/ResponseSamplingIntervalTypeEnum'
          - $ref: '#/components/schemas/BlankEnum'
          - $ref: '#/components/schemas/NullEnum'
        response_sampling_interval:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        response_sampling_limit:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        response_sampling_daily_limits:
          nullable: true
        enable_partial_responses:
          type: boolean
          nullable: true
          description: When at least one question is answered, the response is stored (true). The response is stored when all questions are answered (false).
        enable_iframe_embedding:
          type: boolean
          nullable: true
        translations:
          nullable: true
        _create_in_folder:
          type: string
          writeOnly: true
          title: ' create in folder'
        form_content:
          nullable: true
      required:
      - created_at
      - created_by
      - id
      - internal_targeting_flag
      - linked_flag
      - name
      - targeting_flag
      - type
    RoleAtOrganizationEnum:
      enum:
      - engineering
      - data
      - product
      - founder
      - leadership
      - marketing
      - sales
      - other
      type: string
      description: '* `engineering` - Engineering

        * `data` - Data

        * `product` - Product Management

        * `founder` - Founder

        * `leadership` - Leadership

        * `marketing` - Marketing

        * `sales` - Sales / Success

        * `other` - Other'
    SurveyStatsResponse:
      type: object
      properties:
        survey_id:
          type: string
          description: The survey ID these stats belong to.
        start_date:
          type: string
          format: date-time
          nullable: true
          description: When the survey started collecting responses.
        end_date

# --- truncated at 32 KB (98 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/posthog/refs/heads/main/openapi/posthog-surveys-api-openapi.yml