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

> ## Agent Instructions
> Usertick runs surveys on websites, by link, by QR code and by email, and collects every response in one inbox with reports, dashboards and workflows. The REST API lives at https://app.usertick.com/api/public/v1 and uses Bearer API keys or OAuth access tokens; the JavaScript SDK is the @usertick/snippet package on npm.

# Copy a survey from a copy link

> Copies the survey a copy link shares into the organization as a new draft, as Copy in Usertick does: its questions, logic, languages, theme and texts, with its pictures and videos copied into the organization's library. Send the link's address (url) or its token. Nothing goes live: a person publishes the copy in Usertick (editorUrl). It counts as a new survey for the plan's limits, which refuse it rather than cut it, and for the 200 creates a day per credential that POST /surveys counts (429 PUB-008-008). A link that is off, one Usertick turned off, an unknown token and an address that is not on Usertick's site all answer 404 SRV-014-001, so a caller learns nothing about why. Answers 201 with the draft and its address in Location.

Scopes: surveys:draft, surveys:read.



## OpenAPI

````yaml api-reference/openapi.json POST /survey-copies
openapi: 3.1.0
info:
  title: Usertick Public API
  version: 1.0.0
  description: >-
    The Usertick REST API v1: responses, surveys, metrics, contacts, email sends
    and webhook subscriptions of one organization.


    **Authentication.** Send an API key (Settings, Developers, API keys;
    utk_...) or an app's OAuth access token (uto_...) as Authorization: Bearer.
    X-Api-Key works for clients that cannot set Authorization. Each endpoint
    lists the scopes it needs. API keys work on Pro plans and up, and apps such
    as Zapier on every plan. AI assistants reach the API only through the
    Usertick MCP server (Starter and up), never with their token directly.


    **Format.** Plain JSON resources; times are RFC 3339 in UTC with
    milliseconds (2026-09-30T10:00:00.000Z). Lists are { data, nextCursor }:
    limit is 1 to 100 (default 25, out of range is 400), and nextCursor goes
    back as cursor until it is null. A page starts strictly after the last row
    of the page before, so a row deleted or renamed in between never ends a list
    early.


    **Errors.** Every error is { statusCode, success: false, code, message, data
    }, plus errors: [{ field, code, message }] for invalid fields. Switch on
    code (x-error-codes lists them all); messages may change. A path with no
    route answers 404 GEN-000-404, a method the route doesn't take 405
    GEN-000-405 and a body that is not JSON (multipart/form-data on a file
    upload) 415 GEN-000-415, in the same envelope.


    **Rate limits.** The plan sets the requests a minute, as token buckets: 300
    per credential and 1,500 per organization on Business, 120 and 600 on the
    other plans, and an Enterprise plan may set its own. GET /me returns the
    ones that apply. An answer to an authenticated request has
    X-RateLimit-Limit, -Remaining and -Reset (seconds until the budget is full)
    for the credential, and X-RateLimit-Org-* for the organization, except a 429
    over the credential's budget, which has the credential's only, and
    X-RateLimit-Window: 60s. Over a budget is 429 with Retry-After, the seconds
    the bucket takes to refill one request. A 401 carries no X-RateLimit
    headers, and neither does a 429 GEN-429-001 from the per-address limit
    (3,000 requests a minute per client address, checked before the credential).
    Calls from the Usertick MCP server skip the per-address limit, since every
    assistant arrives from its addresses; the per-credential and
    per-organization budgets still apply to them.


    **Idempotency.** Every POST, and the PATCH of a survey, dashboard or
    workflow draft or of a survey theme, takes an Idempotency-Key header: the
    same key and request within 24 hours get the first answer again. A refusal
    that depends on state (a 403, a 409 or a 429) and a server error are not
    kept, so the same request with the key runs again.


    **Survey drafts.** With surveys:draft an assistant or a script creates
    surveys as drafts, copies any survey into a draft, and edits a draft or the
    unpublished changes of a live or paused survey; a person publishes them in
    Usertick. With surveys:archive it archives surveys and restores archived
    ones as drafts.


    **Themes, folders and pictures.** With themes:write a script creates survey
    themes and edits those no live or paused survey uses; with surveys:organize
    it creates and renames survey folders, files surveys under them and moves
    draft surveys between sites; with media:write it uploads pictures to the
    media library. None of it changes what visitors see.


    **Contacts and email.** With contacts:read and contacts:write a script
    manages contacts, lists and their members, and erases a contact with every
    response of the person (POST /contacts/{contactId}/erase, with
    responses:delete). With email:read it reads the survey email sends; sending
    stays in Usertick.


    **Dashboards and workflows.** With dashboards:draft an assistant or a script
    creates and copies dashboards as drafts and edits their drafts; with
    workflows:draft it creates and copies workflows switched off and edits their
    drafts. A person publishes either one in Usertick. dashboards:read and
    workflows:read list and read them, and integrations:read lists what a
    workflow step can pick of a connected tool. With dashboards:share an app or
    an AI assistant shares a board its member owns with people in the
    organization, never outside it.


    **Exports.** With exports:create (and responses:read) a script starts CSV or
    Excel exports of a survey's Results or of a dashboard, the files the Export
    menu makes, and downloads them for 24 hours. Each file counts as one of the
    plan's exports a month.


    **Support tickets.** With support:read and support:write an app or an AI
    assistant opens support tickets for the member it signed in as, lists that
    member's tickets and replies on them, with files as on the Help page: each
    file is uploaded first, or copied from the media library with surveys:read,
    and named in the message, and every file of a thread downloads through a
    link that works for five minutes. A ticket belongs to a person, so an API
    key can't carry these scopes. Support tickets come with the paid plans.


    **Versioning.** Within /v1 changes are additive only: new endpoints, new
    optional parameters, new fields (ignore fields you do not know). Anything
    that will go away is announced at least six months ahead with Deprecation
    and Sunset headers on its answers.


    **Webhooks.** Every delivery is { id, type, createdAt, data }, signed per
    Standard Webhooks (see webhooks). data is the Response resource, with change
    on response.status_changed and response.classification_corrected; on
    theme.spiking it is the spike.


    Every answer carries X-Request-Id.
  contact:
    name: Usertick support
    url: https://usertick.com/support
servers:
  - url: https://app.usertick.com/api/public/v1
    description: Production
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Account
  - name: Responses
  - name: Surveys
  - name: Metrics
  - name: Exports
  - name: Contacts
  - name: Email
  - name: Dashboards
  - name: Workflows
  - name: Support
  - name: Webhooks
paths:
  /survey-copies:
    post:
      tags:
        - Surveys
      summary: Copy a survey from a copy link as a draft
      description: >-
        Copies the survey a copy link shares into the organization as a new
        draft, as Copy in Usertick does: its questions, logic, languages, theme
        and texts, with its pictures and videos copied into the organization's
        library. Send the link's address (url) or its token. Nothing goes live:
        a person publishes the copy in Usertick (editorUrl). It counts as a new
        survey for the plan's limits, which refuse it rather than cut it, and
        for the 200 creates a day per credential that POST /surveys counts (429
        PUB-008-008). A link that is off, one Usertick turned off, an unknown
        token and an address that is not on Usertick's site all answer 404
        SRV-014-001, so a caller learns nothing about why. Answers 201 with the
        draft and its address in Location.


        Scopes: surveys:draft, surveys:read.
      operationId: copySurveyFromLink
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveyCopyBody'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
            X-RateLimit-Org-Limit:
              $ref: '#/components/headers/XRateLimitOrgLimit'
            X-RateLimit-Org-Remaining:
              $ref: '#/components/headers/XRateLimitOrgRemaining'
            X-RateLimit-Org-Reset:
              $ref: '#/components/headers/XRateLimitOrgReset'
            X-RateLimit-Window:
              $ref: '#/components/headers/XRateLimitWindow'
            Location:
              $ref: '#/components/headers/Location'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SurveyDraft'
        '400':
          description: >-
            The request isn't valid. Codes: PUB-001-004, PUB-001-006,
            PUB-008-001, GEN-000-003, PUB-002-001.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                PUB-001-004:
                  $ref: '#/components/examples/PUB-001-004'
                PUB-001-006:
                  $ref: '#/components/examples/PUB-001-006'
                PUB-008-001:
                  $ref: '#/components/examples/PUB-008-001'
                GEN-000-003:
                  $ref: '#/components/examples/GEN-000-003'
                PUB-002-001:
                  $ref: '#/components/examples/PUB-002-001'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The request was refused. Codes: APK-004-004, APK-004-005,
            APK-004-008, APK-004-009, AUTHZ-001-002, PLN-001-002, PLN-001-003,
            PLN-001-015, SRV-001-027, CMP-007-001.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                APK-004-004:
                  $ref: '#/components/examples/APK-004-004'
                APK-004-005:
                  $ref: '#/components/examples/APK-004-005'
                APK-004-008:
                  $ref: '#/components/examples/APK-004-008'
                APK-004-009:
                  $ref: '#/components/examples/APK-004-009'
                AUTHZ-001-002:
                  $ref: '#/components/examples/AUTHZ-001-002'
                PLN-001-002:
                  $ref: '#/components/examples/PLN-001-002'
                PLN-001-003:
                  $ref: '#/components/examples/PLN-001-003'
                PLN-001-015:
                  $ref: '#/components/examples/PLN-001-015'
                SRV-001-027:
                  $ref: '#/components/examples/SRV-001-027'
                CMP-007-001:
                  $ref: '#/components/examples/CMP-007-001'
        '404':
          description: 'The resource couldn''t be found. Codes: SRV-014-001.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                SRV-014-001:
                  $ref: '#/components/examples/SRV-014-001'
        '409':
          description: >-
            The request conflicts with the current state. Codes: PUB-002-002,
            PUB-002-003.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                PUB-002-002:
                  $ref: '#/components/examples/PUB-002-002'
                PUB-002-003:
                  $ref: '#/components/examples/PUB-002-003'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          description: >-
            Over a budget. Codes: APK-004-003, APK-004-006, GEN-429-001,
            PUB-008-008.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                APK-004-003:
                  $ref: '#/components/examples/APK-004-003'
                APK-004-006:
                  $ref: '#/components/examples/APK-004-006'
                GEN-429-001:
                  $ref: '#/components/examples/GEN-429-001'
                PUB-008-008:
                  $ref: '#/components/examples/PUB-008-008'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >-
        Any 1 to 255 printable ASCII characters, without a space at either end.
        The answer to the first request with a key is kept for 24 hours per
        credential: the same request again gets it back (Idempotent-Replayed:
        true), another request with the key is 409 PUB-002-002, and while the
        first still runs 409 PUB-002-003. A server error is not kept, and a
        request that never answered frees its key after 2 minutes: a retry with
        the key then runs again.
      required: false
      schema:
        type: string
        maxLength: 255
  schemas:
    SurveyCopyBody:
      type: object
      properties:
        url:
          type: string
          description: >-
            An address of a copy link on Usertick's site, with or without a
            language in the path, such as
            https://usertick.com/try/kX9pQ2mLw4nT8vRz5aBc7dEf or
            https://usertick.com/de/try/kX9pQ2mLw4nT8vRz5aBc7dEf. Any other
            address is 404 SRV-014-001.
          format: uri
          maxLength: 2048
        token:
          type: string
          description: The last part of the address, instead of url.
          minLength: 1
          maxLength: 64
      required: []
      description: >-
        Send url or token, one of them and nothing else (400 PUB-008-001 for
        another field, 400 PUB-001-004 for both or neither).
      additionalProperties: false
      examples:
        - url: https://usertick.com/try/kX9pQ2mLw4nT8vRz5aBc7dEf
    SurveyDraft:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          enum:
            - draft
            - active
            - paused
            - archived
        channel:
          type: string
          enum:
            - website
            - link
            - email
        site:
          oneOf:
            - $ref: '#/components/schemas/SiteRef'
            - type: 'null'
        draftVersion:
          type: integer
          description: Send it back as expectedDraftVersion.
        editable:
          type: boolean
          description: >-
            True for a draft, a live and a paused survey; an archived one
            changes once a person restores it.
        hasUnpublishedChanges:
          type: boolean
          description: >-
            True when the survey is live or paused and this is its unpublished
            changes: visitors see the published version until a person
            publishes.
        editorUrl:
          type: string
          description: >-
            The survey in the Usertick editor, where a person publishes it. Give
            it to the person.
          format: uri
        defaultLanguage:
          type: string
        languages:
          type: array
          items:
            type: string
        displayMode:
          type: string
          enum:
            - steps
            - all
            - chat
        position:
          type: string
        texts:
          type: object
          additionalProperties:
            description: >-
              A string in the survey's default language, or a map of language to
              text (languages the survey has). On an edit a string replaces the
              field and its translations; a map sets those languages and keeps
              the others, null removing one.
            oneOf:
              - type: string
              - type: object
                additionalProperties:
                  type:
                    - string
                    - 'null'
        theme:
          type: object
          properties:
            style:
              type:
                - string
                - 'null'
              enum:
                - classic
                - mono
                - editorial
                - studio
                - soft
                - aurora
                - midnight
                - sage
                - terminal
                - null
            themeId:
              type:
                - string
                - 'null'
              format: uuid
          required:
            - style
            - themeId
          description: Both null for a look a person changed by hand.
          additionalProperties: false
        display:
          type: object
          description: >-
            How the survey shows, with the defaults filled in; the website
            widget's settings on a website survey only.
        chat:
          type: object
          properties:
            replies:
              type: boolean
            avatar:
              type: string
              enum:
                - theme
                - image
                - none
            avatarUrl:
              type:
                - string
                - 'null'
            name:
              type:
                - string
                - 'null'
            showName:
              type: boolean
          required:
            - replies
            - avatar
            - avatarUrl
            - name
            - showName
          additionalProperties: false
        page:
          oneOf:
            - type: object
              description: The hosted page's template, with the defaults filled in.
            - type: 'null'
          description: Null on a website survey.
        settings:
          type: object
          description: >-
            redirectUrl, anonymous, hideWithoutStorage (website), responseLimit,
            showClosingNote (link, email), showBadge and timer.
        email:
          oneOf:
            - type: object
              properties:
                subject:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                preheader:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                greeting:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                footer:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
              required:
                - subject
                - preheader
                - greeting
                - footer
              additionalProperties: false
            - type: 'null'
          description: Null on another channel.
        targeting:
          $ref: '#/components/schemas/DraftTargeting'
        variants:
          type: array
          items:
            $ref: '#/components/schemas/DraftVariant'
        endings:
          type: array
          items:
            $ref: '#/components/schemas/EndingInput'
          description: >-
            The endings in order, in the input's shape. A survey that never had
            endings reads as one, e_default, made of its success texts and its
            redirect.
        questions:
          type: array
          items:
            $ref: '#/components/schemas/DraftQuestion'
        publishChecks:
          type: array
          items:
            $ref: '#/components/schemas/PublishCheck'
          description: >-
            What publishing would refuse now: a report for the person who
            publishes. Nothing here blocks saving a draft.
        createdAt:
          type: string
          format: date-time
          examples:
            - '2026-09-30T10:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          examples:
            - '2026-09-30T10:00:00.000Z'
        aiGenerated:
          type: boolean
          description: >-
            True when Usertick AI wrote text in the survey's own fields; each
            question has its own. Read only.
        aiGeneratedAt:
          type:
            - string
            - 'null'
          description: >-
            When text Usertick AI wrote was first stored here; null when people
            wrote all of it.
          format: date-time
          examples:
            - '2026-09-30T10:00:00.000Z'
      required:
        - id
        - name
        - status
        - channel
        - site
        - draftVersion
        - editable
        - hasUnpublishedChanges
        - editorUrl
        - defaultLanguage
        - languages
        - displayMode
        - position
        - texts
        - theme
        - display
        - chat
        - page
        - settings
        - email
        - targeting
        - variants
        - endings
        - questions
        - publishChecks
        - createdAt
        - updatedAt
        - aiGenerated
        - aiGeneratedAt
      additionalProperties: false
      examples:
        - id: 11111111-1111-4111-8111-111111111111
          name: Checkout NPS
          status: draft
          channel: website
          site:
            id: 22222222-2222-4222-8222-222222222222
            domain: shop.example.com
          draftVersion: 1
          editable: true
          hasUnpublishedChanges: false
          editorUrl: >-
            https://app.usertick.com/surveys?edit=11111111-1111-4111-8111-111111111111&org=3c9e4e1a-5b7d-4f20-9a61-0c2d8e4f6a10
          defaultLanguage: en
          languages:
            - en
          displayMode: steps
          position: bottom-right
          texts: {}
          theme:
            style: classic
            themeId: null
          display:
            type: popup
            launcherSide: right
            launcherStyle: icon
            launcherIcon: chat
            showClose: true
            closePosition: right
            minimizable: false
            minimizePosition: right
            startMinimizedDesktop: false
            startMinimizedMobile: false
            showHeader: true
            showProgress: true
            showNavigation: true
            autoAdvance: true
            showLanguagePicker: true
            showSchemeToggle: false
          chat:
            replies: true
            avatar: theme
            avatarUrl: null
            name: null
            showName: false
          page: null
          settings:
            redirectUrl: null
            anonymous: false
            hideWithoutStorage: true
            responseLimit: null
            showBadge: true
            timer: null
          email: null
          targeting:
            pages: null
            trigger:
              mode: any
              conditions:
                - type: delay
                  seconds: 5
            devices:
              - desktop
              - tablet
              - mobile
            frequency:
              type: until_response
              cooldownDays: 30
              maxDisplays: 0
              afterDismissDays: 0
              afterSubmission: never
              dismissBackoff: false
            audience: null
            extraSettings: false
          variants: []
          questions:
            - id: a0000000-0000-4000-8000-000000000005
              ref: q1
              type: nps
              text: How likely are you to recommend Usertick?
              required: true
              lowLabel: Not likely
              highLabel: Very likely
              logic: []
              aiGenerated: false
              aiGeneratedAt: null
          publishChecks: []
          createdAt: '2026-11-03T10:00:00.000Z'
          updatedAt: '2026-11-03T10:00:00.000Z'
          aiGenerated: false
          aiGeneratedAt: null
    Error:
      type: object
      properties:
        statusCode:
          type: integer
          description: The HTTP status, again.
        success:
          type: boolean
          description: Always false.
        code:
          type: string
          description: >-
            What went wrong, stable across versions (see x-error-codes). For
            invalid fields, the first field's code.
          examples:
            - PUB-001-001
        message:
          type:
            - string
            - 'null'
          description: The code's message in English (US); null for a code without one.
        data:
          description: Extra context for some errors; null otherwise.
        kind:
          type: string
          description: >-
            plan when the organization's plan refuses the request; left out
            otherwise.
          enum:
            - plan
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          description: >-
            Every invalid field, in the order of the request's parameters. Only
            on a 400 about fields.
      required:
        - statusCode
        - success
        - code
        - message
        - data
      description: >-
        Every error answer. Success answers are the plain resource or list
        instead.
      additionalProperties: false
      examples:
        - statusCode: 400
          success: false
          code: PUB-001-001
          message: The limit must be between 1 and 100.
          data: null
          errors:
            - field: limit
              code: PUB-001-001
              message: The limit must be between 1 and 100.
            - field: sort
              code: PUB-001-005
              message: The sort order must be asc or desc.
    SiteRef:
      type: object
      properties:
        id:
          type: string
          format: uuid
        domain:
          type: string
      required:
        - id
        - domain
      additionalProperties: false
    DraftTargeting:
      type: object
      properties:
        pages:
          oneOf:
            - type: object
              properties:
                target:
                  type: string
                  enum:
                    - path
                    - url
                include:
                  type: array
                  items:
                    $ref: '#/components/schemas/DraftPageRule'
                exclude:
                  type: array
                  items:
                    $ref: '#/components/schemas/DraftPageRule'
              required:
                - target
                - include
                - exclude
              additionalProperties: false
            - type: 'null'
          description: Null for every page.
        trigger:
          oneOf:
            - $ref: '#/components/schemas/DraftTrigger'
            - type: 'null'
          description: The full trigger; null for none.
        devices:
          type: array
          items:
            type: string
            enum:
              - desktop
              - tablet
              - mobile
        frequency:
          type: object
          properties:
            type:
              type: string
              enum:
                - once
                - until_response
                - each_page
                - cooldown
                - always
            cooldownDays:
              type: integer
            maxDisplays:
              type: integer
            afterDismissDays:
              type: integer
            afterSubmission:
              type: string
              enum:
                - never
                - always
                - cooldown
            dismissBackoff:
              type: boolean
          required:
            - type
            - cooldownDays
            - maxDisplays
            - afterDismissDays
            - afterSubmission
            - dismissBackoff
          additionalProperties: false
        audience:
          oneOf:
            - $ref: '#/components/schemas/DraftAudience'
            - type: 'null'
          description: Null without audience gates.
        extraSettings:
          type: boolean
          description: >-
            The survey holds targeting this shape doesn't show (a trigger type
            the editor no longer writes, an unknown key); an edit keeps it
            unless it sets that part.
      required:
        - pages
        - trigger
        - devices
        - frequency
        - audience
        - extraSettings
      additionalProperties: false
    DraftVariant:
      type: object
      properties:
        id:
          type: string
          description: A variant the survey has, to keep it.
        name:
          type: string
          minLength: 1
          maxLength: 60
        match:
          type: string
          enum:
            - all
            - any
        conditions:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - country
                  - device
                  - random
                  - url
                  - trait
              op:
                type: string
              values:
                type: array
                items:
                  type: string
                maxItems: 250
              percent:
                type: integer
                minimum: 1
                maximum: 100
              target:
                type: string
                enum:
                  - path
                  - url
                  - address
              key:
                type: string
                maxLength: 64
              value:
                type:
                  - string
                  - number
                  - boolean
            required:
              - type
            additionalProperties: false
          description: url and trait on a website survey only.
          minItems: 1
          maxItems: 5
        style:
          type: string
          enum:
            - classic
            - mono
            - editorial
            - studio
            - soft
            - aurora
            - midnight
            - sage
            - terminal
        texts:
          type: object
          additionalProperties:
            description: >-
              A string in the survey's default language, or a map of language to
              text (languages the survey has). On an edit a string replaces the
              field and its translations; a map sets those languages and keeps
              the others, null removing one.
            oneOf:
              - type: string
              - type: object
                additionalProperties:
                  type:
                    - string
                    - 'null'
        settings:
          type: object
          description: >-
            Display settings in the editor's names (GET /surveys/capabilities,
            variants.settingKeys).
        questions:
          type: array
          items:
            type: object
            properties:
              questionId:
                type: string
              hidden:
                type: boolean
              text:
                description: >-
                  A string in the survey's default language, or a map of
                  language to text (languages the survey has). On an edit a
                  string replaces the field and its translations; a map sets
                  those languages and keeps the others, null removing one.
                oneOf:
                  - type: string
                  - type: object
                    additionalProperties:
                      type:
                        - string
                        - 'null'
              options:
                type: array
                items:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                maxItems: 250
            required:
              - questionId
            additionalProperties: false
          maxItems: 200
        endings:
          type:
            - array
            - 'null'
          description: >-
            What this variant does with the survey's endings, by ending id:
            hidden (the variant doesn't show it) or patch (fields it shows
            instead). At most 20 entries (a list over 20 is 400 SRV-001-035 on
            create and SRV-002-035 on edit; an entry with a key this shape
            doesn't take is 400 PUB-008-001, an entry with an invalid or
            repeated id, with hidden other than true, or for an ending only some
            variants show is 400 PUB-001-004, and an id the survey doesn't have
            is 400 PUB-008-012). A variant sent without endings keeps its stored
            ones.
          items:
            oneOf:
              - type: object
                properties:
                  id:
                    type: string
                    description: >-
                      An ending of the survey, by id. On a survey that never had
                      endings, e_default names its thank-you screen: the success
                      texts and the redirect.
                    pattern: ^e_[a-z0-9]{1,32}$
                  hidden:
                    type: boolean
                    enum:
                      - true
                required:
                  - id
                  - hidden
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    description: >-
                      An ending of the survey, by id. On a survey that never had
                      endings, e_default names its thank-you screen: the success
                      texts and the redirect.
                    pattern: ^e_[a-z0-9]{1,32}$
                  patch:
                    type: object
                    properties:
                      title:
                        description: >-
                          The heading, at most 500 characters in every language.
                          A string in the survey's default language, or a map of
                          language to text (languages the survey has). On an
                          edit a string replaces the field and its translations;
                          a map sets those languages and keeps the others, null
                          removing one.
                        oneOf:
                          - type: string
                          - type: object
                            additionalProperties:
                              type:
                                - string
                                - 'null'
                          - type: 'null'
                      message:
                        description: >-
                          The text under the heading, at most 3,000 characters
                          in every language.
                        oneOf:
                          - type: string
                          - type: object
                            additionalProperties:
                              type:
                                - string
                                - 'null'
                          - type: 'null'
                      icon:
                        type:
                          - string
                          - 'null'
                        description: One emoji.
                        maxLength: 16
                      iconImage:
                        type:
                          - string
                          - 'null'
                        description: >-
                          The address of a file in the organization's media
                          library; null or empty removes it.
                        maxLength: 2048
                      iconImageSize:
                        type:
                          - integer
                          - 'null'
                        description: The picture's size in pixels (64 when left out).
                        minimum: 16
                        maximum: 160
                      buttonText:
                        description: >-
                          The button's words, at most 100 characters in every
                          language. A button takes both buttonText and
                          buttonUrl.
                        oneOf:
                          - type: string
                          - type: object
                            additionalProperties:
                              type:
                                - string
                                - 'null'
                          - type: 'null'
                      buttonUrl:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Where the button goes, at most 2,048 characters.
                          Publishing needs an address that starts with https://;
                          saving a draft doesn't check it.
                        maxLength: 2048
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A code shown to the respondent, such as a discount
                          code, at most 64 characters.
                        maxLength: 64
                      redirectUrl:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Where the respondent is sent 2.5 seconds after the
                          ending shows, at most 2,048 characters. Publishing
                          needs an address that starts with https://; saving a
                          draft doesn't check it. It can't go with a button or a
                          code (400 PUB-008-013).
                        maxLength: 2048
                    required: []
                    description: >-
                      The fields this variant shows instead of the ending's own.
                      A patch holds only the fields it sends: a field sent as
                      null is left out of it, so the ending's own shows. To stop
                      changing a field, leave it out or send null.
                    additionalProperties: false
                required:
                  - id
                  - patch
                additionalProperties: false
          maxItems: 20
      required:
        - id
        - name
        - conditions
      description: >-
        A variant in the input's shape with its id; its questions by id. endings
        lists each ending entry it holds.
      additionalProperties: false
    EndingInput:
      type: object
      properties:
        id:
          type: string
          description: >-
            The ending's id. Keep the id of an ending the survey has to change
            it; a new id adds one. e_default names the thank-you of a survey
            that never had endings.
          pattern: ^e_[a-z0-9]{1,32}$
        title:
          description: >-
            The heading, at most 500 characters in every language. A string in
            the survey's default language, or a map of language to text
            (languages the survey has). On an edit a string replaces the field
            and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        message:
          description: >-
            The text under the heading, at most 3,000 characters in every
            language.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        icon:
          type:
            - string
            - 'null'
          description: One emoji.
          maxLength: 16
        iconImage:
          type:
            - string
            - 'null'
          description: >-
            The address of a file in the organization's media library; null or
            empty removes it.
          maxLength: 2048
        iconImageSize:
          type:
            - integer
            - 'null'
          description: The picture's size in pixels (64 when left out).
          minimum: 16
          maximum: 160
        buttonText:
          description: >-
            The button's words, at most 100 characters in every language. A
            button takes both buttonText and buttonUrl.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        buttonUrl:
          type:
            - string
            - 'null'
          description: >-
            Where the button goes, at most 2,048 characters. Publishing needs an
            address that starts with https://; saving a draft doesn't check it.
          maxLength: 2048
        code:
          type:
            - string
            - 'null'
          description: >-
            A code shown to the respondent, such as a discount code, at most 64
            characters.
          maxLength: 64
        redirectUrl:
          type:
            - string
            - 'null'
          description: >-
            Where the respondent is sent 2.5 seconds after the ending shows, at
            most 2,048 characters. Publishing needs an address that starts with
            https://; saving a draft doesn't check it. It can't go with a button
            or a code (400 PUB-008-013).
          maxLength: 2048
        onlyIn:
          type:
            - array
            - 'null'
          description: >-
            The variants, by name or id, that show the ending; null or [] for
            every variant. The first ending without onlyIn is the default.
          items:
            type: string
            maxLength: 60
          maxItems: 8
      required:
        - id
      description: >-
        One ending: a screen a respondent finishes on. An ending sent with an id
        the survey has keeps each field it leaves out; send null or an empty
        string to clear one. A redirect sent in an entry clears that ending's
        button and code, and a button or code clears its redirect. Endings left
        out of the list are removed.
      additionalProperties: false
    DraftQuestion:
      type: object
      properties:
        id:
          type: string
          description: The question id.
        ref:
          type: string
          description: 'On a question this request added: your ref.'
        type:
          type: string
          description: >-
            Every editor type; file upload, screenshot and signature count
            toward the plan's file questions and are checked at publish. A type
            never changes (400 PUB-008-006).
          enum:
            - welcome
            - nps
            - rating
            - ces
            - emoji
            - boolean
            - multiple_choice
            - dropdown
            - ranking
            - slider
            - text
            - contact
            - date
            - file_upload
            - screenshot
            - signature
            - matrix
            - number
            - big_scale
            - ruler
            - dial
            - this_or_that
            - allocation
            - consent
            - cta
        text:
          description: >-
            The question (a message screen's heading). Required on a create. A
            string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
        description:
          description: Words under the question.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        required:
          type: boolean
          description: >-
            The editor's default for the type when left out (requiredByDefault).
            A message screen and a call to action can't be required.
        title:
          description: 'welcome: the heading.'
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        body:
          description: 'welcome, cta: one paragraph.'
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        buttonText:
          description: welcome, cta.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        buttonUrl:
          type:
            - string
            - 'null'
          description: 'cta: the link (https); publishing needs one.'
          maxLength: 2048
        options:
          type: array
          items:
            description: >-
              The answer's words, or an object with its words as text and its
              own reply (multiple_choice, dropdown), emoji and picture.
            oneOf:
              - type: string
              - type: object
                properties:
                  text:
                    description: >-
                      A string in the survey's default language, or a map of
                      language to text (languages the survey has). On an edit a
                      string replaces the field and its translations; a map sets
                      those languages and keeps the others, null removing one.
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties:
                          type:
                            - string
                            - 'null'
                  reply:
                    description: >-
                      A string in the survey's default language, or a map of
                      language to text (languages the survey has). On an edit a
                      string replaces the field and its translations; a map sets
                      those languages and keeps the others, null removing one.
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties:
                          type:
                            - string
                            - 'null'
                      - type: 'null'
                  emoji:
                    type:
                      - string
                      - 'null'
                    maxLength: 16
                  image:
                    type:
                      - string
                      - 'null'
                    description: >-
                      The address of a file in the organization's media library;
                      null or empty removes it.
                    maxLength: 2048
                required:
                  - text
                additionalProperties: false
              - type: object
                additionalProperties:
                  type:
                    - string
                    - 'null'
          description: >-
            multiple_choice, dropdown, ranking, allocation. Replaces the list;
            an option whose words stay keeps its value.
          maxItems: 250
        multiple:
          type: boolean
          description: 'multiple_choice, dropdown, matrix: more than one answer.'
        allowOther:
          type: boolean
          description: 'multiple_choice, dropdown: an Other answer.'
        faces:
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  emoji:
                    type: string
                    maxLength: 16
                  label:
                    description: >-
                      A string in the survey's default language, or a map of
                      language to text (languages the survey has). On an edit a
                      string replaces the field and its translations; a map sets
                      those languages and keeps the others, null removing one.
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties:
                          type:
                            - string
                            - 'null'
                      - type: 'null'
                  reply:
                    description: >-
                      The reply after this face is picked (at most 200
                      characters).
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties:
                          type:
                            - string
                            - 'null'
                      - type: 'null'
                required:
                  - emoji
                additionalProperties: false
              maxItems: 7
            - type: 'null'
          description: >-
            emoji, dial: worst to best. On a dial without lowLabel and highLabel
            the first and last faces' words are the ends; an emoji scale shows
            no ends.
        rows:
          description: >-
            matrix: the statements (at most 50); text: the answer box's height
            in lines, 1 to 12.
          oneOf:
            - type: array
              items:
                description: >-
                  A string in the survey's default language, or a map of
                  language to text (languages the survey has). On an edit a
                  string replaces the field and its translations; a map sets
                  those languages and keeps the others, null removing one.
                oneOf:
                  - type: string
                  - type: object
                    additionalProperties:
                      type:
                        - string
                        - 'null'
              maxItems: 50
            - type: integer
              minimum: 1
              maximum: 12
            - type: 'null'
        columns:
          type: array
          items:
            description: >-
              A string in the survey's default language, or a map of language to
              text (languages the survey has). On an edit a string replaces the
              field and its translations; a map sets those languages and keeps
              the others, null removing one.
            oneOf:
              - type: string
              - type: object
                additionalProperties:
                  type:
                    - string
                    - 'null'
          description: 'matrix: the answers.'
          maxItems: 20
        pairs:
          type: array
          items:
            type: object
            properties:
              a:
                description: >-
                  A string in the survey's default language, or a map of
                  language to text (languages the survey has). On an edit a
                  string replaces the field and its translations; a map sets
                  those languages and keeps the others, null removing one.
                oneOf:
                  - type: string
                  - type: object
                    additionalProperties:
                      type:
                        - string
                        - 'null'
              b:
                description: >-
                  A string in the survey's default language, or a map of
                  language to text (languages the survey has). On an edit a
                  string replaces the field and its translations; a map sets
                  those languages and keeps the others, null removing one.
                oneOf:
                  - type: string
                  - type: object
                    additionalProperties:
                      type:
                        - string
                        - 'null'
            required:
              - a
              - b
            additionalProperties: false
          description: this_or_that.
          maxItems: 50
        points:
          type:
            - integer
            - 'null'
          description: 'rating: how many points (2 to 10, default 5).'
          minimum: 2
          maximum: 10
        min:
          type:
            - number
            - 'null'
          description: slider, big_scale, ruler, number.
        max:
          type:
            - number
            - 'null'
          description: slider, big_scale, ruler, number.
        step:
          type:
            - number
            - 'null'
          description: slider, ruler, number; allocation 1 to 100.
        lowLabel:
          description: 'The low end: nps, rating, ces, dial, slider, big_scale, ruler.'
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        highLabel:
          description: The high end.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        placeholder:
          description: text, number, dropdown, date.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        dateMode:
          type: string
          description: date.
          enum:
            - date
            - datetime-local
            - time
        contactFields:
          type: array
          items:
            type: string
            enum:
              - name
              - email
              - phone
              - company
              - message
          description: >-
            contact (default name and email). Required through the email field,
            else the first.
          maxItems: 5
        yesLabel:
          description: boolean.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        noLabel:
          description: boolean.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        checkboxLabel:
          description: 'consent: the words beside the box.'
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        replies:
          oneOf:
            - type: object
              properties:
                low:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                mid:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                high:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                'yes':
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                'no':
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
                answered:
                  description: >-
                    A string in the survey's default language, or a map of
                    language to text (languages the survey has). On an edit a
                    string replaces the field and its translations; a map sets
                    those languages and keeps the others, null removing one.
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                    - type: 'null'
              required: []
              additionalProperties: false
            - type: 'null'
          description: >-
            The reply after an answer in steps and chat mode, at most 200
            characters each: low, mid and high for nps, rating, ces, emoji, dial
            and big_scale; yes and no for boolean; answered for any other
            answer. Not on welcome or cta.
        timer:
          oneOf:
            - type: object
              properties:
                seconds:
                  type: integer
                  minimum: 5
                  maximum: 600
                action:
                  type: string
                  enum:
                    - next
                    - submit
                allowBack:
                  type: boolean
              required:
                - seconds
              additionalProperties: false
            - type: 'null'
          description: >-
            A countdown for the question, not on welcome; checked against the
            plan at publish.
        page:
          type:
            - string
            - 'null'
          description: 'steps: neighboring questions with the same page share one screen.'
          minLength: 1
          maxLength: 32
        onlyIn:
          type:
            - array
            - 'null'
          description: >-
            The variants, by name or id, that show the question; null or [] for
            every variant.
          items:
            type: string
            maxLength: 60
          maxItems: 8
        image:
          type:
            - string
            - 'null'
          description: >-
            The address of a file in the organization's media library; null or
            empty removes it.
          maxLength: 2048
        imageAlt:
          description: >-
            A string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        video:
          type:
            - string
            - 'null'
          description: >-
            The address of a file in the organization's media library; null or
            empty removes it.
          maxLength: 2048
        videoPoster:
          type:
            - string
            - 'null'
          description: >-
            The address of a file in the organization's media library; null or
            empty removes it.
          maxLength: 2048
        imagePosition:
          type:
            - string
            - 'null'
          enum:
            - above
            - below
            - null
        imageSize:
          type:
            - integer
            - 'null'
          description: Percent of the card.
          minimum: 5
          maximum: 100
        imageAlign:
          type:
            - string
            - 'null'
          enum:
            - left
            - center
            - right
            - null
        icon:
          type:
            - string
            - 'null'
          description: 'welcome: the emoji.'
          maxLength: 16
        iconImage:
          type:
            - string
            - 'null'
          description: >-
            The address of a file in the organization's media library; null or
            empty removes it.
          maxLength: 2048
        iconImageSize:
          type:
            - integer
            - 'null'
          description: 'welcome: pixels.'
          minimum: 16
          maximum: 160
        showScoreFeedback:
          type:
            - boolean
            - 'null'
          description: nps.
        shape:
          type:
            - string
            - 'null'
          description: rating.
          enum:
            - star
            - heart
            - thumb
            - number
            - null
        default:
          type:
            - number
            - 'null'
          description: slider.
        range:
          type:
            - boolean
            - 'null'
          description: 'slider: two handles.'
        prefix:
          description: number, at most 20 characters.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        suffix:
          description: slider, number, at most 20 characters.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        unit:
          description: ruler, allocation, at most 20 characters.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        majorEvery:
          type:
            - integer
            - 'null'
          description: ruler.
          minimum: 1
          maximum: 1000000
        overflow:
          type:
            - boolean
            - 'null'
          description: ruler.
        total:
          type:
            - integer
            - 'null'
          description: allocation.
          minimum: 10
          maximum: 1000
        minPerOption:
          type:
            - integer
            - 'null'
          description: allocation.
          minimum: 0
          maximum: 1000
        maxPerOption:
          type:
            - integer
            - 'null'
          description: allocation.
          minimum: 0
          maximum: 1000
        yesEmoji:
          type:
            - string
            - 'null'
          description: boolean.
          maxLength: 16
        noEmoji:
          type:
            - string
            - 'null'
          description: boolean.
          maxLength: 16
        yesImage:
          type:
            - string
            - 'null'
          description: >-
            The address of a file in the organization's media library; null or
            empty removes it.
          maxLength: 2048
        noImage:
          type:
            - string
            - 'null'
          description: >-
            The address of a file in the organization's media library; null or
            empty removes it.
          maxLength: 2048
        otherLabel:
          description: multiple_choice, dropdown.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        randomize:
          type:
            - boolean
            - 'null'
          description: multiple_choice, ranking.
        minSelections:
          type:
            - integer
            - 'null'
          description: multiple_choice, dropdown.
          minimum: 0
          maximum: 250
        maxSelections:
          type:
            - integer
            - 'null'
          description: multiple_choice, dropdown.
          minimum: 0
          maximum: 250
        rankLimit:
          type:
            - integer
            - 'null'
          description: 'ranking: the top N.'
          minimum: 1
          maximum: 250
        minLength:
          type:
            - integer
            - 'null'
          description: text.
          minimum: 0
          maximum: 10000
        maxLength:
          type:
            - integer
            - 'null'
          description: text.
          minimum: 1
          maximum: 10000
        enableFileUpload:
          type:
            - boolean
            - 'null'
          description: 'text: an attach button (a file question for the plan).'
        enableScreenshot:
          type:
            - boolean
            - 'null'
          description: 'text: a screenshot button (a file question for the plan).'
        fileMaxSizeMb:
          type:
            - integer
            - 'null'
          description: text.
          minimum: 1
          maximum: 10
        fileAccept:
          type:
            - string
            - 'null'
          description: text.
          maxLength: 200
        fileButtonText:
          description: >-
            A string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        screenshotButtonText:
          description: >-
            A string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        fieldLabels:
          type:
            - object
            - 'null'
          description: 'contact: labels by field.'
          additionalProperties:
            description: >-
              A string in the survey's default language, or a map of language to
              text (languages the survey has). On an edit a string replaces the
              field and its translations; a map sets those languages and keeps
              the others, null removing one.
            oneOf:
              - type: string
              - type: object
                additionalProperties:
                  type:
                    - string
                    - 'null'
              - type: 'null'
        fieldPlaceholders:
          type:
            - object
            - 'null'
          description: 'contact: placeholders by field.'
          additionalProperties:
            description: >-
              A string in the survey's default language, or a map of language to
              text (languages the survey has). On an edit a string replaces the
              field and its translations; a map sets those languages and keeps
              the others, null removing one.
            oneOf:
              - type: string
              - type: object
                additionalProperties:
                  type:
                    - string
                    - 'null'
              - type: 'null'
        minDate:
          type:
            - string
            - 'null'
          description: >-
            date: YYYY-MM-DD (THH:mm, or HH:mm for a time) or today, today+N,
            today-N.
          maxLength: 40
        maxDate:
          type:
            - string
            - 'null'
          description: date.
          maxLength: 40
        accept:
          type:
            - string
            - 'null'
          description: file_upload.
          maxLength: 200
        maxSizeMb:
          type:
            - integer
            - 'null'
          description: file_upload.
          minimum: 1
          maximum: 10
        maxFiles:
          type:
            - integer
            - 'null'
          description: file_upload.
          minimum: 1
          maximum: 5
        dragText:
          description: >-
            A string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        canvasHeight:
          type:
            - integer
            - 'null'
          description: signature.
          minimum: 80
          maximum: 400
        penColor:
          type:
            - string
            - 'null'
          description: 'signature: theme or a hex color.'
          maxLength: 32
        penWidth:
          type:
            - number
            - 'null'
          description: signature.
          minimum: 0.5
          maximum: 6
        clearButtonText:
          description: >-
            A string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        randomizeRows:
          type:
            - boolean
            - 'null'
          description: matrix.
        allowNa:
          type:
            - boolean
            - 'null'
          description: matrix.
        naLabel:
          description: >-
            A string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        dismissText:
          description: >-
            A string in the survey's default language, or a map of language to
            text (languages the survey has). On an edit a string replaces the
            field and its translations; a map sets those languages and keeps the
            others, null removing one.
          oneOf:
            - type: string
            - type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
            - type: 'null'
        logic:
          type: array
          items:
            type: object
            properties:
              op:
                type: string
                enum:
                  - equals
                  - not_equals
                  - contains
                  - not_contains
                  - gt
                  - gte
                  - lt
                  - lte
                  - answered
                  - not_answered
              answer:
                type:
                  - string
                  - number
                  - boolean
              then:
                oneOf:
                  - type: string
                    enum:
                      - end
                  - type: object
                    properties:
                      goto:
                        type: string
                        description: A question id.
                    required:
                      - goto
                    additionalProperties: false
                  - type: object
                    properties:
                      ending:
                        type: string
                        description: >-
                          An ending of the survey, by id. On a survey that never
                          had endings, e_default names its thank-you screen: the
                          success texts and the redirect.
                        pattern: ^e_[a-z0-9]{1,32}$
                    required:
                      - ending
                    additionalProperties: false
                  - type: 'null'
                description: >-
                  Null for a rule with no destination yet (publishing asks for
                  one).
            required:
              - op
              - then
            additionalProperties: false
          description: Not on a message screen.
        fallback:
          oneOf:
            - type: string
              enum:
                - end
            - type: object
              properties:
                goto:
                  type: string
                  description: A question id.
              required:
                - goto
              additionalProperties: false
            - type: object
              properties:
                ending:
                  type: string
                  description: >-
                    An ending of the survey, by id. On a survey that never had
                    endings, e_default names its thank-you screen: the success
                    texts and the redirect.
                  pattern: ^e_[a-z0-9]{1,32}$
              required:
                - ending
              additionalProperties: false
            - type: 'null'
          description: >-
            Where the question goes when no rule matches. Null when it has none
            and goes on to the next question. Every question but a message
            screen carries it.
        extraSettings:
          type: boolean
          description: >-
            Only when true: the question holds settings this shape doesn't show
            (retired options, a picture beside a matrix row); an edit keeps
            them.
        aiGenerated:
          type: boolean
          description: >-
            True when Usertick AI wrote text in this question, in any of its
            languages: a draft from Create with AI, a generated or suggested
            question, suggested options or labels, a rewrite or a translation.
            The mark records where the text came from, so it stays true after a
            person edits the text. Read only: an edit never sends it.
        aiGeneratedAt:
          type:
            - string
            - 'null'
          description: >-
            When text Usertick AI wrote was first stored here; null when people
            wrote all of it.
          format: date-time
          examples:
            - '2026-09-30T10:00:00.000Z'
      required:
        - id
        - type
        - text
        - required
        - aiGenerated
        - aiGeneratedAt
      description: >-
        A question in the typed shape: the common fields and the type's own that
        it holds.
      additionalProperties: false
    PublishCheck:
      type: object
      properties:
        code:
          type: string
          description: The code publishing answers with.
        message:
          type:
            - string
            - 'null'
      required:
        - code
        - message
      additionalProperties: false
    FieldError:
      type: object
      properties:
        field:
          type: string
          description: >-
            The query parameter, or the body property (camelCase, dotted when
            nested).
        code:
          type: string
        message:
          type:
            - string
            - 'null'
      required:
        - field
        - code
        - message
      additionalProperties: false
    DraftPageRule:
      type: object
      properties:
        op:
          type: string
          enum:
            - contains
            - equals
            - starts_with
            - ends_with
            - regex
        value:
          type: string
        target:
          type: string
          enum:
            - path
            - url
      required:
        - op
        - value
      additionalProperties: false
    DraftTrigger:
      type: object
      properties:
        mode:
          type: string
          description: any (default) or all of the conditions.
          enum:
            - any
            - all
        delaySeconds:
          type: integer
          description: Wait once the conditions are met, 0 to 60.
        dontInterrupt:
          type: boolean
          description: Then hold the open while the visitor is busy.
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/DraftTriggerCondition'
          description: One condition of each type at most.
          minItems: 1
          maxItems: 22
      required:
        - conditions
      description: The full trigger, as the editor's Trigger step builds it.
      additionalProperties: false
    DraftAudience:
      type: object
      properties:
        visitor:
          oneOf:
            - type: object
              properties:
                mode:
                  type: string
                  enum:
                    - new
                    - returning
                minVisits:
                  type: integer
                  minimum: 2
                  maximum: 1000
              required:
                - mode
              additionalProperties: false
            - type: 'null'
        samplePct:
          type:
            - integer
            - 'null'
          description: The share of visitors.
          minimum: 1
          maximum: 99
        auth:
          type:
            - string
            - 'null'
          enum:
            - identified
            - anonymous
            - null
        traits:
          oneOf:
            - type: object
              properties:
                mode:
                  type: string
                  enum:
                    - any
                    - all
                rules:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        minLength: 1
                        maxLength: 64
                      op:
                        type: string
                        enum:
                          - eq
                          - neq
                          - contains
                          - not_contains
                          - starts_with
                          - ends_with
                          - gt
                          - gte
                          - lt
                          - lte
                          - set
                          - not_set
                      value:
                        type:
                          - string
                          - number
                          - boolean
                    required:
                      - key
                      - op
                    additionalProperties: false
                  maxItems: 50
              required:
                - rules
              additionalProperties: false
            - type: 'null'
        query:
          type:
            - array
            - 'null'
          description: URL parameters, any row.
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                maxLength: 100
              value:
                type: string
                maxLength: 500
            required:
              - key
            additionalProperties: false
          maxItems: 50
        referrer:
          type:
            - string
            - 'null'
          description: A regular expression the referrer matches.
          maxLength: 500
        surveys:
          type:
            - array
            - 'null'
          description: Earlier surveys in this browser, every row.
          items:
            type: object
            properties:
              surveyId:
                type: string
                format: uuid
              state:
                type: string
                enum:
                  - not_seen
                  - seen
                  - responded
                  - not_responded
                  - dismissed
              withinDays:
                type: integer
                minimum: 1
                maximum: 3650
            required:
              - surveyId
              - state
            additionalProperties: false
          maxItems: 20
        schedule:
          oneOf:
            - type: object
              properties:
                from:
                  type: string
                  maxLength: 40
                to:
                  type: string
                  maxLength: 40
                days:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    maximum: 6
                  maxItems: 7
                hourFrom:
                  type: integer
                  minimum: 0
                  maximum: 23
                hourTo:
                  type: integer
                  minimum: 0
                  maximum: 24
              required: []
              additionalProperties: false
            - type: 'null'
        country:
          oneOf:
            - type: object
              properties:
                op:
                  type: string
                  enum:
                    - in
                    - not_in
                values:
                  type: array
                  items:
                    type: string
                    minLength: 2
                    maxLength: 2
                  minItems: 1
                  maxItems: 250
              required:
                - op
                - values
              additionalProperties: false
            - type: 'null'
      required: []
      description: The audience gates, as the editor stores them.
      additionalProperties: false
    DraftTriggerCondition:
      type: object
      properties:
        type:
          type: string
          enum:
            - load
            - delay
            - scroll
            - exit_intent
            - time_on_site
            - idle
            - pages_viewed
            - element_click
            - element_visible
            - element_hover
            - form_submit
            - form_abandon
            - text_copy
            - finished_reading
            - custom_event
            - video_watched
            - rage_click
            - js_error
            - frustration
            - engaged
            - hesitation
            - cant_find
        seconds:
          type: integer
          description: >-
            delay 0 to 60 (default 10), idle 5 to 300 (default 30), time_on_site
            10 to 1800 (default 60).
        percent:
          type: integer
          description: 'scroll (default 50), video_watched (default 90): 10 to 100.'
        count:
          type: integer
          description: 'pages_viewed: 1 to 50 (default 3).'
        selector:
          type: string
          description: >-
            A CSS selector: required for element_click, element_visible and
            element_hover; empty means any for form_submit, form_abandon,
            text_copy, finished_reading and video_watched.
          maxLength: 500
        dwellMs:
          type: integer
          description: 'element_hover: 200 to 3000 (default 600).'
        event:
          type: string
          description: 'custom_event: the event name.'
          minLength: 1
          maxLength: 500
        times:
          type: integer
          description: 'custom_event: opens on this matching call, 1 to 100.'
        where:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                maxLength: 64
              op:
                type: string
                enum:
                  - eq
                  - neq
                  - contains
                  - not_contains
                  - starts_with
                  - ends_with
                  - gt
                  - gte
                  - lt
                  - lte
                  - set
                  - not_set
              value:
                type:
                  - string
                  - number
                  - boolean
            required:
              - key
              - op
            additionalProperties: false
          description: 'custom_event: rules on the event''s properties.'
          maxItems: 50
        clicks:
          type: integer
          description: 'rage_click: 2 to 20.'
        windowMs:
          type: integer
          description: 'rage_click: 100 to 10000.'
        radius:
          type: integer
          description: 'rage_click: 1 to 500.'
        level:
          type: string
          description: frustration, engaged (default medium).
          enum:
            - low
            - medium
            - high
        devices:
          type: array
          items:
            type: string
            enum:
              - desktop
              - tablet
              - mobile
          description: Only on these devices.
          minItems: 1
      required:
        - type
      description: >-
        One trigger condition: its type and the settings the type takes (GET
        /surveys/capabilities); any other field is 400 PUB-008-001.
      additionalProperties: false
  headers:
    XRequestId:
      description: >-
        This answer's id (req_ and 32 hex characters), also in the logs. Quote
        it to support.
      schema:
        type: string
    XRateLimitLimit:
      description: The credential's requests per minute.
      schema:
        type: integer
    XRateLimitRemaining:
      description: What is left of it now.
      schema:
        type: integer
    XRateLimitReset:
      description: >-
        Seconds until the credential's budget is full again (the bucket refills
        continuously).
      schema:
        type: integer
    XRateLimitOrgLimit:
      description: Every credential of the organization together, per minute.
      schema:
        type: integer
    XRateLimitOrgRemaining:
      description: What is left of the organization's budget.
      schema:
        type: integer
    XRateLimitOrgReset:
      description: Seconds until the organization's budget is full again.
      schema:
        type: integer
    XRateLimitWindow:
      description: >-
        The window both budgets count over: 60s, since they are requests per
        minute.
      schema:
        type: string
    Location:
      description: The job to follow.
      schema:
        type: string
    IdempotentReplayed:
      description: >-
        true when this is the kept answer of an earlier request with the same
        Idempotency-Key.
      schema:
        type: string
    RetryAfter:
      description: >-
        Seconds to wait before trying again. On a 429 over a budget, the time
        the bucket takes to refill one request (1 second at 120 or 300 a
        minute); X-RateLimit-Reset says when the whole budget is back.
      schema:
        type: integer
  examples:
    PUB-001-004:
      summary: This value isn't valid.
      value:
        statusCode: 400
        success: false
        code: PUB-001-004
        message: This value isn't valid.
        data: null
    PUB-001-006:
      summary: Send a JSON body that this endpoint accepts.
      value:
        statusCode: 400
        success: false
        code: PUB-001-006
        message: Send a JSON body that this endpoint accepts.
        data: null
    PUB-008-001:
      summary: >-
        This field isn't taken here. GET /surveys/capabilities lists the fields
        each question type takes, and the operations list theirs.
      value:
        statusCode: 400
        success: false
        code: PUB-008-001
        message: >-
          This field isn't taken here. GET /surveys/capabilities lists the
          fields each question type takes, and the operations list theirs.
        data: null
    GEN-000-003:
      summary: Some fields aren't valid. Check them and try again.
      value:
        statusCode: 400
        success: false
        code: GEN-000-003
        message: Some fields aren't valid. Check them and try again.
        data: null
    PUB-002-001:
      summary: >-
        Send an Idempotency-Key of 1 to 255 printable ASCII characters, without
        a space at either end.
      value:
        statusCode: 400
        success: false
        code: PUB-002-001
        message: >-
          Send an Idempotency-Key of 1 to 255 printable ASCII characters,
          without a space at either end.
        data: null
    APK-004-004:
      summary: >-
        This API key or app doesn't have permission for this request. Grant it
        the required scope.
      value:
        statusCode: 403
        success: false
        code: APK-004-004
        message: >-
          This API key or app doesn't have permission for this request. Grant it
          the required scope.
        data: null
    APK-004-005:
      summary: >-
        Your plan doesn't include API keys. To use them, upgrade to Pro or
        higher.
      value:
        statusCode: 403
        success: false
        code: APK-004-005
        message: >-
          Your plan doesn't include API keys. To use them, upgrade to Pro or
          higher.
        data: null
    APK-004-008:
      summary: >-
        This organization's plan doesn't include apps that use the API, such as
        Zapier. To use them, contact Usertick sales to change the plan.
      value:
        statusCode: 403
        success: false
        code: APK-004-008
        message: >-
          This organization's plan doesn't include apps that use the API, such
          as Zapier. To use them, contact Usertick sales to change the plan.
        data: null
    APK-004-009:
      summary: >-
        This organization's plan doesn't include the MCP server. To use an AI
        assistant with Usertick, upgrade to Starter or higher.
      value:
        statusCode: 403
        success: false
        code: APK-004-009
        message: >-
          This organization's plan doesn't include the MCP server. To use an AI
          assistant with Usertick, upgrade to Starter or higher.
        data: null
    AUTHZ-001-002:
      summary: Your role doesn't have the required permission.
      value:
        statusCode: 403
        success: false
        code: AUTHZ-001-002
        message: Your role doesn't have the required permission.
        data: null
    PLN-001-002:
      summary: >-
        The organization has as many surveys as its plan allows, archived ones
        not counted. To add or restore one, archive a survey or upgrade the
        plan.
      value:
        statusCode: 403
        success: false
        code: PLN-001-002
        message: >-
          The organization has as many surveys as its plan allows, archived ones
          not counted. To add or restore one, archive a survey or upgrade the
          plan.
        data: null
    PLN-001-003:
      summary: >-
        This survey has more questions than your plan allows. To save or publish
        it, remove questions or upgrade your plan.
      value:
        statusCode: 403
        success: false
        code: PLN-001-003
        message: >-
          This survey has more questions than your plan allows. To save or
          publish it, remove questions or upgrade your plan.
        data: null
    PLN-001-015:
      summary: >-
        This survey has more questions that collect a file, a screenshot or a
        signature than your plan allows. To save or publish it, remove one or
        upgrade to Starter, which has no such limit.
      value:
        statusCode: 403
        success: false
        code: PLN-001-015
        message: >-
          This survey has more questions that collect a file, a screenshot or a
          signature than your plan allows. To save or publish it, remove one or
          upgrade to Starter, which has no such limit.
        data: null
    SRV-001-027:
      summary: >-
        This survey has more languages than your plan includes. To create it,
        remove languages or upgrade your plan.
      value:
        statusCode: 403
        success: false
        code: SRV-001-027
        message: >-
          This survey has more languages than your plan includes. To create it,
          remove languages or upgrade your plan.
        data: null
    CMP-007-001:
      summary: This organization is deactivated, so the survey wasn't created.
      value:
        statusCode: 403
        success: false
        code: CMP-007-001
        message: This organization is deactivated, so the survey wasn't created.
        data: null
    SRV-014-001:
      summary: The survey couldn't be found.
      value:
        statusCode: 404
        success: false
        code: SRV-014-001
        message: The survey couldn't be found.
        data: null
    PUB-002-002:
      summary: >-
        This Idempotency-Key was used with a different request. Use a new key
        for a new request.
      value:
        statusCode: 409
        success: false
        code: PUB-002-002
        message: >-
          This Idempotency-Key was used with a different request. Use a new key
          for a new request.
        data: null
    PUB-002-003:
      summary: >-
        A request with this Idempotency-Key is still running. Try again in a
        moment.
      value:
        statusCode: 409
        success: false
        code: PUB-002-003
        message: >-
          A request with this Idempotency-Key is still running. Try again in a
          moment.
        data: null
    APK-004-003:
      summary: This API key or app sent too many requests. Wait a minute and try again.
      value:
        statusCode: 429
        success: false
        code: APK-004-003
        message: >-
          This API key or app sent too many requests. Wait a minute and try
          again.
        data: null
    APK-004-006:
      summary: >-
        Your organization sent too many API requests. Wait a minute and try
        again.
      value:
        statusCode: 429
        success: false
        code: APK-004-006
        message: >-
          Your organization sent too many API requests. Wait a minute and try
          again.
        data: null
    GEN-429-001:
      summary: Too many requests were sent. Wait a minute and try again.
      value:
        statusCode: 429
        success: false
        code: GEN-429-001
        message: Too many requests were sent. Wait a minute and try again.
        data: null
    PUB-008-008:
      summary: >-
        This credential created as many surveys today as the API allows, 200 a
        day. Try again after the time in Retry-After.
      value:
        statusCode: 429
        success: false
        code: PUB-008-008
        message: >-
          This credential created as many surveys today as the API allows, 200 a
          day. Try again after the time in Retry-After.
        data: null
    APK-004-001:
      summary: Send an API key or an access token in the Authorization header.
      value:
        statusCode: 401
        success: false
        code: APK-004-001
        message: Send an API key or an access token in the Authorization header.
        data: null
    APK-004-002:
      summary: >-
        The API key or access token is invalid, expired or revoked. Connect
        again with a valid one.
      value:
        statusCode: 401
        success: false
        code: APK-004-002
        message: >-
          The API key or access token is invalid, expired or revoked. Connect
          again with a valid one.
        data: null
    APK-004-007:
      summary: >-
        This credential is for another server. The MCP server takes only the
        access tokens an assistant gets when it signs in, and the REST API takes
        API keys and app tokens.
      value:
        statusCode: 401
        success: false
        code: APK-004-007
        message: >-
          This credential is for another server. The MCP server takes only the
          access tokens an assistant gets when it signs in, and the REST API
          takes API keys and app tokens.
        data: null
    GEN-000-413:
      summary: The request is too large. Send less data or a smaller file.
      value:
        statusCode: 413
        success: false
        code: GEN-000-413
        message: The request is too large. Send less data or a smaller file.
        data: null
    GEN-000-415:
      summary: >-
        The request body isn't JSON. Send it with Content-Type:
        application/json.
      value:
        statusCode: 415
        success: false
        code: GEN-000-415
        message: >-
          The request body isn't JSON. Send it with Content-Type:
          application/json.
        data: null
  responses:
    Unauthorized:
      description: >-
        No credential, one that is invalid, expired or revoked, or a token an AI
        assistant got for the MCP server. Codes: APK-004-001, APK-004-002,
        APK-004-007.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            APK-004-001:
              $ref: '#/components/examples/APK-004-001'
            APK-004-002:
              $ref: '#/components/examples/APK-004-002'
            APK-004-007:
              $ref: '#/components/examples/APK-004-007'
    PayloadTooLarge:
      description: 'The body is over 64 KB. Codes: GEN-000-413.'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            GEN-000-413:
              $ref: '#/components/examples/GEN-000-413'
    UnsupportedMediaType:
      description: >-
        The body is not JSON: send it with Content-Type: application/json.
        Codes: GEN-000-415.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            GEN-000-415:
              $ref: '#/components/examples/GEN-000-415'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An API key (utk_live_...) or an app's OAuth access token (uto_...).
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: The API key, for clients that cannot send Authorization.

````

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