> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview the Pendo survey job

> Reads the NPS responses of the chosen surveys for the last `days` days and shows how a run would match them: the newest rows, how many responses have no email, how many find a Statisfy account by the chosen match, and how many are people Statisfy knows. It reads at most 5 guides and 5 Sentiment surveys, and lists the others as skipped. It stops after 45 seconds and lists what it did not read as skipped or failed. When `account_id_field` is left out, it uses the saved one, as a run does. The settings are not saved. A 409 means Pendo is not connected, or Pendo rejected the key: an admin fixes the connection in Statisfy's app. A 422 means Pendo refused the call (a wrong region comes with its own message). A 404 means Pendo did not find the requested item. A 502 means Pendo did not answer or is rate limited: try again in a minute. Needs integrations:write: the rows hold emails and comments.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/pendo/surveys/preview
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/integrations/pendo/surveys/preview:
    post:
      tags:
        - integrations
      summary: Preview the Pendo survey job
      description: >-
        Reads the NPS responses of the chosen surveys for the last `days` days
        and shows how a run would match them: the newest rows, how many
        responses have no email, how many find a Statisfy account by the chosen
        match, and how many are people Statisfy knows. It reads at most 5 guides
        and 5 Sentiment surveys, and lists the others as skipped. It stops after
        45 seconds and lists what it did not read as skipped or failed. When
        `account_id_field` is left out, it uses the saved one, as a run does.
        The settings are not saved. A 409 means Pendo is not connected, or Pendo
        rejected the key: an admin fixes the connection in Statisfy's app. A 422
        means Pendo refused the call (a wrong region comes with its own
        message). A 404 means Pendo did not find the requested item. A 502 means
        Pendo did not answer or is rate limited: try again in a minute. Needs
        integrations:write: the rows hold emails and comments.
      operationId: integrations_pendo_preview_surveys
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                days:
                  default: 7
                  description: How many days back from now to read
                  maximum: 30
                  minimum: 1
                  title: Days
                  type: integer
                surveys:
                  $ref: '#/components/schemas/PendoSurveySettings'
                  description: The settings to try. They are not saved
              required:
                - surveys
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendoSurveyPreview'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    PendoSurveySettings:
      additionalProperties: false
      description: The settings of the NPS survey job.
      properties:
        account_id_field:
          anyOf:
            - maxLength: 512
              type: string
            - type: 'null'
          default: null
          description: >-
            The Pendo account field that finds the account of a response, for
            example custom.crm_id. An empty text means no field: the email of
            the person finds the account. null means not chosen: the job uses
            the config's account_id_field
          title: Account Id Field
        account_match:
          anyOf:
            - maxLength: 512
              type: string
            - type: 'null'
          default: null
          description: >-
            The Statisfy account field that the Pendo value is matched to:
            crm_account_id, domain, name, or the key of a text custom field of
            accounts. null means crm_account_id
          title: Account Match
        create_missing_people:
          default: true
          description: >-
            False: a response from a person who is not in Statisfy yet is
            skipped
          title: Create Missing People
          type: boolean
        mode:
          default: all_guides
          description: >-
            all_guides reads every NPS guide. selected reads only
            `selected_guides`. Both modes also read `sentiment_survey_ids`
          enum:
            - all_guides
            - selected
          title: Mode
          type: string
        selected_guides:
          description: >-
            selected mode: the NPS guide IDs to read. Take them from GET
            /v1/integrations/pendo/surveys: only their format is checked here
            (letters, digits, - and _), and a guide that does not exist fails at
            each run
          items:
            maxLength: 200
            minLength: 1
            pattern: ^[A-Za-z0-9_-]+$
            type: string
          maxItems: 50
          title: Selected Guides
          type: array
        sentiment_survey_ids:
          description: >-
            Sentiment survey IDs to read, in both modes. Pendo cannot list them,
            so the admin gives each ID. Check each one with GET
            /v1/integrations/pendo/surveys/sentiment/{survey_id} first: only the
            format is checked here, and a wrong ID fails at each run. An empty
            list reads no Sentiment survey
          items:
            maxLength: 200
            minLength: 1
            pattern: ^[A-Za-z0-9_-]+$
            type: string
          maxItems: 50
          title: Sentiment Survey Ids
          type: array
      title: PendoSurveySettings
      type: object
    PendoSurveyPreview:
      properties:
        failed_surveys:
          description: One entry per survey that could not be read
          items:
            type: string
          title: Failed Surveys
          type: array
        known_people:
          description: Responses read from a person who is already in Statisfy
          title: Known People
          type: integer
        matched_by_crm_id:
          description: >-
            Responses read whose Pendo account value finds a Statisfy account,
            by the chosen match
          title: Matched By Crm Id
          type: integer
        rows:
          description: The newest responses, at most 20
          items:
            $ref: '#/components/schemas/PendoSurveyPreviewRow'
          title: Rows
          type: array
        skipped_guides:
          description: >-
            Guides the preview did not read: it reads at most 5, and none after
            its time limit. A run of the job reads them all
          items:
            $ref: '#/components/schemas/PendoSkippedGuide'
          title: Skipped Guides
          type: array
        skipped_sentiment_survey_ids:
          description: >-
            Sentiment survey IDs the preview did not read to the end: it reads
            at most 5, none after its time limit, and a survey the time limit
            cut between two pages is here too (its responses read so far are
            counted). A run of the job reads them all
          items:
            type: string
          title: Skipped Sentiment Survey Ids
          type: array
        total_responses:
          description: All the responses that were read
          title: Total Responses
          type: integer
        without_email:
          description: Responses with no email. A run cannot find a person for them
          title: Without Email
          type: integer
      required:
        - rows
        - total_responses
        - without_email
        - matched_by_crm_id
        - known_people
        - failed_surveys
        - skipped_guides
        - skipped_sentiment_survey_ids
      title: PendoSurveyPreview
      type: object
    PendoSurveyPreviewRow:
      properties:
        account_key:
          anyOf:
            - type: string
            - type: 'null'
          description: The Pendo account value that finds the account
          title: Account Key
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        email:
          anyOf:
            - type: string
            - type: 'null'
          description: The email of the person. Personal data
          title: Email
        rating:
          anyOf:
            - type: integer
            - type: 'null'
          description: The NPS score, 0 to 10
          title: Rating
        response_id:
          title: Response Id
          type: string
        submitted_at_ms:
          description: When the person answered, in milliseconds since 1970
          title: Submitted At Ms
          type: integer
        survey_kind:
          description: 'guide: an NPS guide; sentiment: a Sentiment survey'
          enum:
            - guide
            - sentiment
          title: Survey Kind
          type: string
        survey_name:
          title: Survey Name
          type: string
      required:
        - response_id
        - survey_kind
        - survey_name
        - submitted_at_ms
      title: PendoSurveyPreviewRow
      type: object
    PendoSkippedGuide:
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
      required:
        - id
        - name
      title: PendoSkippedGuide
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.