openapi: 3.0.3
info:
  title: Poltio API (Platform) Documentation
  description: Poltio Platform API Calls
  contact:
    email: dev@poltio.com
  version: 10.4.0
servers:
  - url: https://api.poltio.com/
tags:
  - name: Auth
    description: Login, signup and verification related calls
  - name: Content
    description: Core object for all content types.
  - name: Lead
    description: Small interactions you can trigger via vote, start or result actions that you can use to get information from your users or display them some information like videos, coupon codes etc...
  - name: PixelCode
    description: Desc
  - name: Question
    description: Question model is the single sequence in the content. Can have multiple types like free text, multi punch etc...
  - name: Answer
    description: Answers are pre defined selectable options for Question model.
  - name: Result
    description: Results are what your users will see after they finish playing a session. Can be calculated by searching, max/min right answers, calculating a numeric score or at random.
  - name: Vote
    description: Votes are either users selecting a pre defined answer or entering their own custom
  - name: Theme
    description: Customize the look and feel of your widgets to match your branding
  - name: Stats
    description: Stats for your account or your content
  - name: Dashboard
    description: Data needed to populate an account dashboard includes active content and metrics
  - name: SheetHook
    description: Connect your content with a Google Sheet to get real time data
  - name: Webhook
    description: Get answers/votes/leads from your contents real time in JSON format.
  - name: Report
    description: Request downloadble reports for your account or your contents.
  - name: Subscription
    description: Subscription related actions
  - name: Settings
    description: Update your profile settings or password.
  - name: Token
    description: Manage your tokens and issue new tokens
  - name: DataSource
    description: DataSource connects your external product/service store with poltio results for recommendation
  - name: DataSourceContent
    description: Manage your DataSourceContent bridge connections and their searchable field definitions
  - name: Widget
    description: Dynamic Widgets allows you to display different content without changing the SDK/iFrame code in your page depending on the URL of the page.
  - name: Domain
    description: You can manage your custom domains
  - name: ClientKey
    description: Manage SDK client keys for your organization
paths:
  /platform/auth/login:
    post:
      summary: First step of the login flow. If the account has 2fa enabled, this will provide a temporary token. If 2fa is disabled, this will provide a regular API token.
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/Login'
      responses:
        "200":
          $ref: '#/components/responses/Login'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/two-factor/verify:
    post:
      summary: Second step of the login flow for accounts that enabled 2fa for their account.
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/LoginTFAVerify'
      responses:
        "200":
          $ref: '#/components/responses/Loggedin'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          description: Verification failed with the TOTP, ask user to verify and reenter the TOTP
        "410":
          description: Can happen if you wait too long for the login or used expired TOTP. Should display an error and redirect to 1step of the login flow.
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/two-factor/verify-recovery:
    post:
      summary: Second step of the login flow for 2fa enabled accounts but instead of TOTP this call requires a valid recovery code to bypass 2fa
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/LoginTFAVerify'
      responses:
        "200":
          $ref: '#/components/responses/Loggedin'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          description: Verification failed with the TOTP, ask user to verify and reenter the TOTP
        "410":
          description: Can happen if you wait too long for the login or used expired TOTP. Should display an error and redirect to 1step of the login flow.
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/login-with-email:
    post:
      summary: This method generates a 1 use login url with signature if the user wants to generate a token without password and 2fa flows
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/LoginWithEmail'
      responses:
        "200":
          description: Check your email
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/login-with-email-token:
    post:
      summary: second step of magic link auth, this call validates and login the user
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/LoginWithEmailToken'
      responses:
        "200":
          $ref: '#/components/responses/Loggedin'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/register:
    post:
      summary: Register a new account
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/Register'
      responses:
        "200":
          $ref: '#/components/responses/Register'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/password/forget:
    post:
      summary: Start the password recovery flow
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/PasswordForget'
      responses:
        "200":
          description: Password reset email sent
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/password/reset:
    post:
      summary: Complete the password recovery flow and reset your password
      tags:
        - Auth
      requestBody:
        $ref: '#/components/requestBodies/PasswordReset'
      responses:
        "200":
          description: Password changed
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/verify/{token}:
    get:
      summary: Verify the email address
      tags:
        - Auth
      parameters:
        - name: token
          in: path
          description: Verify Token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Account Verified
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/auth/logout:
    post:
      summary: Expire the currently used active token
      security:
        - publisherAuth: []
      tags:
        - Auth
      responses:
        "204":
          description: Successfully revoked the active token
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/account/profile:
    get:
      summary: Get the authenticated user's profile information
      description: Returns details for the authenticated user, including organizations and two-factor authentication status.
      tags:
        - Auth
      security:
        - publisherAuth: []
      responses:
        "200":
          description: User profile retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/User'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content:
    post:
      tags:
        - Content
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/BaseContent'
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content pagination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseContent'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
    get:
      tags:
        - Content
      summary: Get the users content in paginated and new format.
      security:
        - publisherAuth: []
      parameters:
        - name: page
          in: query
          description: Defines the page number for the results for paginated responses
          required: false
          schema:
            type: integer
        - name: per_page
          in: query
          description: How many data you want per page.
          required: false
          schema:
            type: integer
            default: 12
        - name: order
          in: query
          description: Selects the field you want to order.
          required: false
          schema:
            type: string
            default: created_at
            enum:
              - created_at
              - end_date
              - updated_at
              - id
              - vote_count
              - voter_count
              - type
        - name: sort
          in: query
          description: Selects the order you want to sort.
          required: false
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
        - name: type
          in: query
          required: false
          description: If you want to filter out one or more specific types, you can use this.
          schema:
            type: array
            items:
              type: string
              enum:
                - poll
                - set
                - test
                - quiz
                - this-that
                - would-you-rather
        - name: q
          in: query
          description: If you want to filter/search by title and desc fields, you can use this param.
          required: false
          schema:
            type: string
            default: lorem ipsum
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/ContentPagedResponse'
        "401":
          description: You need a valid token to see this response
        "500":
          description: Tech error. Please try again later.
  /platform/content/drafts:
    get:
      tags:
        - Content
      summary: Get unpublished contets as paginated
      security:
        - publisherAuth: []
      parameters:
        - name: page
          in: query
          description: Defines the page number for the results for paginated responses
          required: false
          schema:
            type: integer
        - name: per_page
          in: query
          description: How many data you want per page.
          required: false
          schema:
            type: integer
            default: 12
        - name: order
          in: query
          description: Selects the field you want to order.
          required: false
          schema:
            type: string
            default: created_at
            enum:
              - created_at
              - end_date
              - updated_at
              - id
              - vote_count
              - voter_count
              - type
        - name: sort
          in: query
          description: Selects the order you want to sort.
          required: false
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
        - name: type
          in: query
          required: false
          description: If you want to filter out one or more specific types, you can use this.
          schema:
            type: array
            items:
              type: string
              enum:
                - poll
                - set
                - test
                - quiz
                - this-that
                - would-you-rather
        - name: q
          in: query
          description: If you want to filter/search by title and desc fields, you can use this param.
          required: false
          schema:
            type: string
            default: lorem ipsum
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/ContentPagedResponse'
        "401":
          description: You need a valid token to see this response
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}:
    get:
      tags:
        - Content
      summary: Get a single content with metrics that user owned.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content pagination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentWithMetrics'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    put:
      tags:
        - Content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/BaseContent'
      responses:
        "200":
          description: Content pagination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseContent'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content removed.
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/publish:
    get:
      tags:
        - Content
      summary: Update the content Published status.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content is updated as Published
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/duplicate:
    get:
      tags:
        - Content
      summary: Duplicates a content you own to your account.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content is duplicated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseContent'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/results:
    get:
      tags:
        - Content
      summary: Get paginated results for the content.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: page
          in: query
          description: Defines the page number for the results for paginated responses
          required: false
          schema:
            type: integer
        - name: per_page
          in: query
          description: How many data you want per page, can be between 1 and 100.
          required: false
          schema:
            type: integer
            default: 12
        - name: order_by
          in: query
          description: If you want to order the results based on a specific column
          required: false
          schema:
            type: string
            default: position
            enum:
              - position
              - id
              - click_count
              - counter
        - name: order_dir
          in: query
          description: Order direction
          required: false
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
      responses:
        "200":
          $ref: '#/components/responses/ContentResultsPagedResponse'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/sessions:
    get:
      tags:
        - Content
      summary: Get paginated sessions for the content.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: page
          in: query
          description: Defines the page number for the results for paginated responses
          required: false
          schema:
            type: integer
        - name: per_page
          in: query
          description: How many data you want per page.
          required: false
          schema:
            type: integer
            default: 12
      responses:
        "200":
          $ref: '#/components/responses/ContentSessionsPagedResponse'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/lead:
    put:
      tags:
        - Lead
      summary: Save or Update a lead for a Content Cover screen
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/AttachLead'
      responses:
        "200":
          description: Lead saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - Lead
      summary: Removes a lead from a cover object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Lead removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/pixel-code:
    put:
      tags:
        - PixelCode
      summary: Save or Update a PixelCode for a Content Cover screen
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/AttachPixelCode'
      responses:
        "200":
          description: Lead saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - PixelCode
      summary: Removes a PixelCode from a cover object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Lead removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/edit:
    get:
      tags:
        - Content
      summary: Get a single content for edit
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content pagination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Content'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/calculator-test:
    post:
      tags:
        - Calculator Test
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/CalculatorTest'
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content pagination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseContent'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/question:
    post:
      tags:
        - Question
      summary: Add a new question to a content during creation
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/Question'
      responses:
        "200":
          description: Question added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Question'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/question/{question_id}:
    put:
      tags:
        - Question
      summary: Update question object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: Unique Identifier for the Question object
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/Question'
      responses:
        "200":
          description: Question updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Question'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Question
      summary: Delete a question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: Unique Identifier for the Question object
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Question removed
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/question/{question_id}/lead:
    put:
      tags:
        - Lead
      summary: Save or Update a lead for all the answers of a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AttachLead'
      responses:
        "200":
          description: Lead saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - Lead
      summary: Removes a lead from all the answers of a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Lead removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{question_id}/pixel-code:
    put:
      tags:
        - PixelCode
      summary: Save or Update a pixel code for all the answers of a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AttachPixelCode'
      responses:
        "200":
          description: PixelCode saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - PixelCode
      summary: Removes a lead from all the answers of a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: PixelCode removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{question_id}/conditions/add:
    post:
      tags:
        - Content
      summary: Add a single answer as a question condition
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/questionIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/AddCondition'
      responses:
        "200":
          description: Conditions updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  conditions:
                    type: array
                    items:
                      type: integer
                      description: Answer IDs for the active condition
        "400":
          description: Answers Question and Target Question are not in the same content
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exist
        "409":
          description: Answer id already exists as a condition
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{question_id}/conditions/remove:
    post:
      tags:
        - Content
      summary: Remove a single answer as a question condition
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/questionIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/RemoveCondition'
      responses:
        "200":
          description: Conditions updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  conditions:
                    type: array
                    items:
                      type: integer
                      description: Answer IDs for the active condition
        "400":
          description: Answers Question and Target Question are not in the same content
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exist
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{question_id}/conditions:
    delete:
      tags:
        - Content
      summary: Clears existing conditions from question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/questionIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Conditions updated
        "400":
          description: Answers Question and Target Question are not in the same content
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exist
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{source_id}/answer/clone/{target_id}:
    get:
      tags:
        - Answer
      summary: Clones answers from the Source to Target question and removes existing answers from Target
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: source_id
          in: path
          description: ID for the question you want to use as the source
          required: true
          schema:
            type: integer
        - name: target_id
          in: path
          description: ID for the question you want to use as the target. All existing answers of this question will be replaced by the source
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Answer added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuestionAnswers'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/question/{question_id}/answer:
    post:
      tags:
        - Answer
      summary: Add a new answer to a question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/Answer'
      responses:
        "200":
          description: Answer added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Answer'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/question/{question_id}/answer/multi:
    post:
      tags:
        - Answer
      summary: Adds multiple answers in one go.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/questionIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/MultiAnswer'
      responses:
        "200":
          description: Answer added
          content:
            application/json:
              schema:
                type: object
                properties:
                  answers:
                    type: array
                    items:
                      $ref: '#/components/schemas/Answer'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/question/{question_id}/answer/{answer_id}:
    put:
      tags:
        - Answer
      summary: Update an existing answer object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: Unique identifier for the Question object
          required: true
          schema:
            type: integer
        - name: answer_id
          in: path
          description: ID for the answer
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/Answer'
      responses:
        "200":
          description: Answer updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Answer'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Answer
      summary: Remove an existing answer object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: Unique identifier for the Question object
          required: true
          schema:
            type: integer
        - name: answer_id
          in: path
          description: ID for the answer
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Answer removed
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/question/{question_id}/answer/{answer_id}/lead:
    put:
      tags:
        - Lead
      summary: Save or Update a lead for a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
        - name: answer_id
          in: path
          description: ID for the answer
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AttachLead'
      responses:
        "200":
          description: Lead saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - Lead
      summary: Removes a lead from a cover object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
        - name: answer_id
          in: path
          description: ID for the answer
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Lead removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{question_id}/answer/{answer_id}/results:
    put:
      tags:
        - Answer
      summary: Update a points for Result - Answer relations
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
        - name: answer_id
          in: path
          description: ID for the answer
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AnswerResultPoint'
      responses:
        "200":
          description: Point updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Answer'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{question_id}/answer/{answer_id}/pixel-code:
    put:
      tags:
        - PixelCode
      summary: Save or Update a pixel code for a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
        - name: answer_id
          in: path
          description: ID for the answer
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AttachPixelCode'
      responses:
        "200":
          description: PixelCode saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - PixelCode
      summary: Removes a lead from a cover object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
        - name: answer_id
          in: path
          description: ID for the answer
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: PixelCode removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/order/questions:
    get:
      tags:
        - Question
      summary: Get the current order for the Question(s) in the content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Current question ids with their positions in the content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuestionPositions'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    put:
      tags:
        - Question
      summary: Update positions of the Questions in the content.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/QuestionPositions'
      responses:
        "200":
          description: Current question ids with their positions in the content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuestionPositions'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/order/answers/{question_id}:
    get:
      tags:
        - Answer
      summary: Get the current order for the Answers(s) in the Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: Unique ID for the Question
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Current answer ids with their positions in the question
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswerPositions'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    put:
      tags:
        - Answer
      summary: Update positions of the Answers in the question.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: Unique ID for the Question
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AnswerPositions'
      responses:
        "200":
          description: Current answer ids with their positions in the question
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswerPositions'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/result:
    post:
      tags:
        - Result
      summary: Add a new result to a content during creation
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/Result'
      responses:
        "200":
          description: result added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/result/{result_id}:
    put:
      tags:
        - Result
      summary: Modify an existing result object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/Result'
      responses:
        "200":
          description: result modified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Result
      summary: Remove an existing result object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: result deleted
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/result/{result_id}/lead:
    put:
      tags:
        - Lead
      summary: Save or Update a lead for a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AttachLead'
      responses:
        "200":
          description: Lead saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - Lead
      summary: Removes a lead from a cover object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Lead removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/result/{result_id}/pixel-code:
    put:
      tags:
        - PixelCode
      summary: Save or Update a pixel code for a Question
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AttachPixelCode'
      responses:
        "200":
          description: PixelCode saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - PixelCode
      summary: Removes a pixel code from a cover object
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: PixelCode removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/result/{result_id}/click-pixel-code:
    put:
      tags:
        - PixelCode
      summary: Save or Update a pixel code for a Result For Click Action
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AttachPixelCode'
      responses:
        "200":
          description: PixelCode saved.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - PixelCode
      summary: Removes a pixel code from a result object for click trigger
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: result_id
          in: path
          description: ID for the result
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: PixelCode removed from content.
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/question/{question_id}/inputs:
    get:
      tags:
        - Vote
      summary: Get the free type answers for a question you own.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - name: question_id
          in: path
          description: ID for the question you want to add the new answer to
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - name: order
          in: query
          description: Selects the field you want to order.
          required: false
          schema:
            type: string
            default: created_at
            enum:
              - created_at
              - voter_id
              - id
        - name: sort
          in: query
          description: Selects the order you want to sort.
          required: false
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
      responses:
        "200":
          $ref: '#/components/responses/VoterInputsPagedResponse'
        "400":
          description: This question does not have any free type answers
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/theme:
    post:
      tags:
        - Theme
      summary: Create a new theme
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Theme'
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Theme saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    get:
      tags:
        - Theme
      summary: Get a list of your themes
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/ThemePagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/theme/{theme_id}:
    parameters:
      - $ref: '#/components/parameters/themeIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - Theme
      summary: Get your theme
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Theme
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    delete:
      tags:
        - Theme
      summary: Delete an existing theme
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Theme saved.
        "400":
          description: Theme is in use and cant be deleted
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
    put:
      tags:
        - Theme
      summary: Update existing theme
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Theme'
      responses:
        "200":
          description: Theme saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You don't own this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/theme/default:
    get:
      tags:
        - Theme
      summary: Get default theme values
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Default theme values
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/dashboard:
    get:
      tags:
        - Dashboard
      summary: Get user generic metrics to build up a dashboard
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: User Dashboard Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dashboard'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/dashboard/summary:
    get:
      tags:
        - Dashboard
      summary: Get most recent active content stat summary for dashboard
      parameters:
        - $ref: '#/components/parameters/startDateParam'
        - $ref: '#/components/parameters/endDateParam'
        - $ref: '#/components/parameters/deviceTypeParam'
        - $ref: '#/components/parameters/takeParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Content Stats for the Account Summary section on Dashboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountSummaryResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/dashboard/metrics/{period}:
    post:
      tags:
        - Dashboard
        - Stats
      summary: Get Metrics for a dashboard
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/periodPathParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/MetricsRequest'
      responses:
        "200":
          $ref: '#/components/responses/MetricsResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/upload:
    post:
      tags:
        - Content
      summary: Upload image files for creating content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - ext
                - f
              properties:
                f:
                  type: string
                  description: base64 encoded image file
                ext:
                  type: string
                  description: 'File extension without the . (ex: png)'
                bucket:
                  type: string
                  description: A directory name for uploading the file. Like questions or tests or answers
        required: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  file:
                    type: string
                    description: uploaded file object
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/templates:
    get:
      tags:
        - Content
      summary: Get content templates
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/ContentPagedResponse'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You are not allowed to view this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/templates/{public_id}:
    get:
      tags:
        - Content
      summary: Get template content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Template data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentWithMetrics'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You are not allowed to view this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/templates/{public_id}/use:
    get:
      tags:
        - Content
      summary: Use template content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Template data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentWithMetrics'
        "401":
          description: You need a valid token to see this response
        "403":
          description: You are not allowed to view this content
        "404":
          description: Content with the given public id does not exists
        "500":
          description: Tech error. Please try again later.
  /platform/content/{public_id}/sources:
    get:
      tags:
        - Content
        - Stats
      summary: Get vote sources report for content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/VoteSourcesPagedResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/sankey:
    get:
      tags:
        - Content
        - Stats
      summary: Get Sankey Diagram for a Content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Sankey diagram for users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sankey'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          description: There are too many answers and result paths for us to generate a sensible graph
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/sankey/users/{from_id}/{to_id}:
    get:
      tags:
        - Content
        - Stats
      summary: Get Sankey Diagram for a Content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/fromIdParam'
        - $ref: '#/components/parameters/toIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Sankey diagram for users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SankeyUserPagedResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/voters:
    get:
      tags:
        - Content
        - Stats
      summary: Get paginated list of voters call
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/downloadReportParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content voters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VotersPagedResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/searchable-fields:
    get:
      tags:
        - Content
        - DataSource
      summary: Get all searchable fields for a searchable content.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Content voters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchableFieldsResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/metrics/{period}:
    post:
      tags:
        - Content
        - Stats
      summary: Get Metrics for a content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/periodPathParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/MetricsRequest'
      responses:
        "200":
          $ref: '#/components/responses/MetricsResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/hooks/sheet:
    get:
      tags:
        - SheetHook
      summary: List your existing sheet hooks in paginated format.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/publicIdQSParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/SheetHooksPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - SheetHook
      summary: Create a new sheet hook.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/SheetHook'
      responses:
        "200":
          description: SheetHook Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SheetHook'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/hooks/sheet/{hook_id}:
    parameters:
      - $ref: '#/components/parameters/hookIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - SheetHook
      summary: Get details of the hook.
      security:
        - publisherAuth: []
      responses:
        "200":
          description: SheetHook View
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SheetHook'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    put:
      tags:
        - SheetHook
      summary: Update an existing Hook.
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/SheetHook'
      responses:
        "200":
          description: SheetHook Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SheetHook'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - SheetHook
      summary: Delete an existing hook.
      security:
        - publisherAuth: []
      responses:
        "200":
          description: SheetHook Deleted
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/hooks/sheet/{hook_id}/logs:
    get:
      tags:
        - SheetHook
      summary: Get logs for the Sheethook
      parameters:
        - $ref: '#/components/parameters/hookIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/SheetHookLogsPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/hooks/web:
    get:
      tags:
        - Webhook
      summary: List your existing web hooks in paginated format.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/publicIdQSParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/WebhookPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Webhook
      summary: Create a new web hook.
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Webhook'
      responses:
        "200":
          description: Webhook Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        "400":
          description: 'Bad request, you are trying to add more than 2 account wide hooks. '
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/BadRequest'
        "500":
          $ref: '#/components/responses/Error'
  /platform/hooks/web/{hook_id}:
    parameters:
      - $ref: '#/components/parameters/hookIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - Webhook
      summary: Get details of the hook.
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Webhook View
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        "400":
          description: 'Bad request, you are trying to add more than 2 account wide hooks. '
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/BadRequest'
        "500":
          $ref: '#/components/responses/Error'
    put:
      tags:
        - Webhook
      summary: Update an existing Hook.
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Webhook'
      responses:
        "200":
          description: Webhook Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Webhook
      summary: Delete an existing hook.
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Webhook Deleted
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/hooks/web/{hook_id}/logs:
    get:
      tags:
        - Webhook
      summary: Get logs for the Sheethook
      parameters:
        - $ref: '#/components/parameters/hookIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/WebhookLogsPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/reports:
    get:
      tags:
        - Report
      summary: Get report requests in paginated manner
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/ReportRequestsPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Report
      summary: Request a new Report
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/ReportRequest'
      responses:
        "200":
          description: Report requested
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/subscription/tiers:
    get:
      tags:
        - Subscription
      summary: Get active subscriptions
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: A new incomplete subscription created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tier'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          description: You can't create a new subscription with an active subscription
        "500":
          $ref: '#/components/responses/Error'
  /platform/subscription/{tier_id}:
    post:
      tags:
        - Subscription
      summary: Create a new subscription
      parameters:
        - $ref: '#/components/parameters/tierIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/SubscriptionRequest'
      responses:
        "200":
          description: A new incomplete subscription created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncompleteSubscription'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          description: You can't create a new subscription with an active subscription
        "500":
          $ref: '#/components/responses/Error'
  /platform/leads:
    get:
      tags:
        - Lead
      summary: Get your lead campaigns in paginated order
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/LeadsPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Lead
      summary: Create a new Lead Campaign
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/LeadRequest'
      responses:
        "200":
          description: Lead created
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/leads/{lead_id}:
    parameters:
      - $ref: '#/components/parameters/leadIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - Lead
      summary: Get a single lead
      security:
        - publisherAuth: []
      responses:
        "200":
          description: lead
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    put:
      tags:
        - Lead
      summary: Update a lead campaign
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/LeadRequest'
      responses:
        "200":
          description: lead
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Lead
      summary: Delete a lead campaign
      security:
        - publisherAuth: []
      responses:
        "200":
          description: lead deleeted
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/leads/{lead_id}/inputs:
    get:
      tags:
        - Lead
      summary: get user inputs in paginated response
      parameters:
        - $ref: '#/components/parameters/leadIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/LeadInputsPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/leads/{lead_id}/logs:
    get:
      tags:
        - Lead
      summary: get lead logs in paginated response
      parameters:
        - $ref: '#/components/parameters/leadIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/LeadLogsPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/leads/{lead_id}/codes:
    parameters:
      - $ref: '#/components/parameters/leadIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - Lead
      summary: get lead codes in paginated response
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/LeadCodesPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Lead
      summary: add one or more lead codes.
      requestBody:
        $ref: '#/components/requestBodies/MultiLeadCode'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Code added to the lead.
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Lead
      summary: remove ALL added lead codes from your lead.
      security:
        - publisherAuth: []
      responses:
        "200":
          description: ALL codes removed from the lead.
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/leads/{lead_id}/codes/{lead_coupon_code_id}:
    parameters:
      - $ref: '#/components/parameters/leadIdParam'
      - $ref: '#/components/parameters/leadCouponCodeId'
      - $ref: '#/components/parameters/organizationIdHeader'
    put:
      tags:
        - Lead
      summary: Update a single coupon code
      requestBody:
        $ref: '#/components/requestBodies/LeadCodeRequest'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Code updated
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Lead
      summary: deletes single coopn code from the lead
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Code deleted
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings:
    put:
      tags:
        - Settings
      summary: Update your username, email or photo.
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/SettingsRequest'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Updated
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/password:
    put:
      tags:
        - Settings
      summary: Update your password.
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/PasswordRequest'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Updated
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/resend-verification:
    post:
      tags:
        - Settings
      summary: Resend your verification email
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Verification email has been sent.
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/accept-terms:
    post:
      tags:
        - Settings
      summary: Accept terms and conditions call
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Terms and conditions has been accepted
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/two-factor/setup:
    post:
      tags:
        - Settings
      summary: Setup Two Factor Auth for your account
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Created a temporary secret.
          content:
            application/json:
              schema:
                type: object
                properties:
                  qr:
                    type: string
                    description: base64 encoded QR code image. you can use it img src
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/two-factor/verify:
    post:
      tags:
        - Settings
      summary: Verify 2fa setup for the account with a TOTP verification code
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/TFAVerify'
      responses:
        "200":
          description: Created a temporary secret.
          content:
            application/json:
              schema:
                type: object
                properties:
                  recovery_codes:
                    type: array
                    description: Recovery codes for the 2fa setup
                    items:
                      type: string
                      example: 1234asdasdasd
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          description: Verification failed, TOTP code is invalid.
        "410":
          description: Request is expired, give an error to the user and redirect them to the setup step.
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/two-factor/disable:
    post:
      tags:
        - Settings
      summary: Disable the 2fa setup for the account, requires TOTP verification
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/TFAVerify'
      responses:
        "200":
          description: Disabled 2fa setup from the account
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          description: Verification failed, TOTP code is invalid.
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/two-factor/reset-recovery-codes:
    post:
      tags:
        - Settings
      summary: Resets and regenrates recovery codes for an account, requires TOTP verification
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/TFAVerify'
      responses:
        "200":
          description: Removed existing recovery codes and regenerated again
          content:
            application/json:
              schema:
                type: object
                properties:
                  recovery_codes:
                    type: array
                    description: Recovery codes for the 2fa setup
                    items:
                      type: string
                      example: 1234asdasdasd
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          description: Verification failed, TOTP code is invalid.
        "500":
          $ref: '#/components/responses/Error'
  /platform/data-sources:
    get:
      tags:
        - DataSource
      summary: Get a list of your data sources
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: List of data sources
        "401":
          $ref: '#/components/responses/Unauthorized'
    post:
      tags:
        - DataSource
      summary: Create a new data source (supports CSV upload or URL)
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "201":
          description: Data source created and analysis job dispatched
        "422":
          $ref: '#/components/responses/BadRequest'
  /platform/data-sources/{data_source_id}:
    get:
      tags:
        - DataSource
      summary: Get details of a data source
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Data source details
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    allOf:
                      - $ref: '#/components/schemas/DataSource'
                      - type: object
                        properties:
                          elements:
                            type: array
                            items:
                              type: object
                          notes:
                            type: array
                            items:
                              $ref: '#/components/schemas/DataSourceNote'
                          analysis_status:
                            type: string
                            example: completed
                          analysis:
                            $ref: '#/components/schemas/DataSourceFormatAnalysis'
        "404":
          $ref: '#/components/responses/NotFound'
    put:
      tags:
        - DataSource
      summary: Update a data source
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Data source updated
    delete:
      tags:
        - DataSource
      summary: Delete a data source
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Data source deleted
  /platform/data-sources/{data_source_id}/format:
    get:
      tags:
        - DataSource
      summary: Get payload format analysis with sample values (triggers background job if missing)
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Analysis format ready
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: completed
                  data:
                    $ref: '#/components/schemas/DataSourceFormatAnalysis'
        "202":
          description: Analysis in progress, try again in 2 minutes
  /platform/data-sources/{data_source_id}/refresh-format:
    post:
      tags:
        - DataSource
      summary: Recreate / renew the field examples and format analysis in cache
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "202":
          description: Format refresh initiated in background
  /platform/data-sources/{data_source_id}/mark-ready:
    post:
      tags:
        - DataSource
      summary: Mark data source as ready and trigger background import
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Data source marked as ready and import job queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    $ref: '#/components/schemas/DataSource'
        "400":
          description: Data source import is already pending or in progress
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  msg:
                    type: string
                    example: Data source import is already pending or in progress
        "422":
          description: Data source is missing required elements
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  msg:
                    type: string
                    example: 'Data source is missing required elements: id, name, image, url'
                  missing_elements:
                    type: array
                    items:
                      type: string
                    example:
                      - id
                      - name
                      - image
                      - url
  /platform/data-sources/{data_source_id}/items:
    get:
      tags:
        - DataSource
      summary: List items for a data source with extracted element values
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: List of items with values
  /platform/data-sources/{data_source_id}/elements:
    get:
      tags:
        - DataSource
      summary: List element mappings for a data source
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: List of elements
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DataSourceItemElement'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - DataSource
      summary: Create a new element mapping
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSourceItemElementRequest'
      responses:
        "200":
          description: Element mapping created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceItemElement'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/data-sources/{data_source_id}/elements/{element_id}:
    put:
      tags:
        - DataSource
      summary: Update an element mapping
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/dataSourceElementId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSourceItemElementRequest'
      responses:
        "200":
          description: Element mapping updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceItemElement'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - DataSource
      summary: Delete an element mapping
      parameters:
        - $ref: '#/components/parameters/dataSourceId'
        - $ref: '#/components/parameters/dataSourceElementId'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Element mapping deleted successfully
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/dsc:
    get:
      tags:
        - DataSourceContent
      summary: Get list of DataSourceContents
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: A paginated list of DataSourceContent objects
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DataSourceContent'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - DataSourceContent
      summary: Create a new DataSourceContent connection
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      requestBody:
        $ref: '#/components/requestBodies/DataSourceContentRequest'
      responses:
        "200":
          description: DataSourceContent connection successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/dsc/{dataSourceContent}:
    parameters:
      - $ref: '#/components/parameters/dataSourceContentId'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - DataSourceContent
      summary: Get details of a DataSourceContent connection with its content and fields
      security:
        - publisherAuth: []
      responses:
        "200":
          description: DataSourceContent retrieved successfully with content and fields
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/DataSourceContent'
                  - type: object
                    properties:
                      content:
                        $ref: '#/components/schemas/Content'
                      fields:
                        type: array
                        items:
                          $ref: '#/components/schemas/DataSourceContentField'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    put:
      tags:
        - DataSourceContent
      summary: Update an existing DataSourceContent connection
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/DataSourceContentRequest'
      responses:
        "200":
          description: DataSourceContent updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - DataSourceContent
      summary: Delete a DataSourceContent connection
      security:
        - publisherAuth: []
      responses:
        "200":
          description: DataSourceContent connection successfully removed
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/dsc/{dataSourceContent}/fields:
    parameters:
      - $ref: '#/components/parameters/dataSourceContentId'
      - $ref: '#/components/parameters/organizationIdHeader'
    post:
      tags:
        - DataSourceContent
      summary: Add or update a searchable field definition on DataSourceContent
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/DataSourceContentFieldRequest'
      responses:
        "200":
          description: Searchable field defined successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceContentField'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/dsc/{dataSourceContent}/fields/{dataSourceContentField}:
    parameters:
      - $ref: '#/components/parameters/dataSourceContentId'
      - $ref: '#/components/parameters/dataSourceContentFieldId'
      - $ref: '#/components/parameters/organizationIdHeader'
    put:
      tags:
        - DataSourceContent
      summary: Update a searchable field definition on DataSourceContent
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/DataSourceContentFieldRequest'
      responses:
        "200":
          description: Searchable field updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceContentField'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - DataSourceContent
      summary: Delete a searchable field definition from DataSourceContent
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Searchable field definition removed successfully
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/pixel-codes:
    get:
      tags:
        - PixelCode
      summary: Get your pixel codes in paginated order
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/PixelCodesPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - PixelCode
      summary: Create a new PixelCode
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/PixelCodeRequest'
      responses:
        "200":
          description: PixelCode created
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/pixel-codes/{pixel_code_id}:
    parameters:
      - $ref: '#/components/parameters/pixelCodeId'
      - $ref: '#/components/parameters/organizationIdHeader'
    put:
      tags:
        - PixelCode
      summary: Update a PixelCode
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/PixelCodeRequest'
      responses:
        "200":
          description: Pixel Code updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixelCode'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - PixelCode
      summary: Delete a pixel code
      security:
        - publisherAuth: []
      responses:
        "200":
          description: pixel code deleeted
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/tokens:
    get:
      tags:
        - Token
      summary: Get your tokens in paginated order
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/TokensPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Token
      summary: Issue new token
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/CreateTokenRequest'
      responses:
        "200":
          description: Token created
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    example: XXXX
                    description: 'Full token string '
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/tokens/{token_id}:
    delete:
      tags:
        - Token
      summary: Revokes given token
      parameters:
        - $ref: '#/components/parameters/oauthTokenIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Token revoked
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/client-keys:
    get:
      tags:
        - ClientKey
      summary: List all client keys for the organization
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: List of client keys
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ClientKey'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - ClientKey
      summary: Create a new SDK client key
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  example: Web App Key
                is_production:
                  type: boolean
                  default: true
                  example: true
      responses:
        "200":
          description: Client key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientKey'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/client-keys/{clientKey}/revoke:
    post:
      tags:
        - ClientKey
      summary: Revoke a client key
      parameters:
        - in: path
          name: clientKey
          required: true
          description: Client key ID
          schema:
            type: integer
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Client key revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientKey'
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/client-keys/{clientKey}:
    delete:
      tags:
        - ClientKey
      summary: Delete a revoked client key (only allowed 30 days after revocation)
      parameters:
        - in: path
          name: clientKey
          required: true
          description: Client key ID
          schema:
            type: integer
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Client key deleted successfully
        "400":
          $ref: '#/components/responses/ValidationError'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/data-sources/upload:
    post:
      tags:
        - DataSource
      summary: Upload a json, xml, csv or text file to use as a datasource.
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: string
              description: Your file in compatible format (txt, json, xml, csv)
              format: binary
        required: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                  hashName:
                    type: string
                    description: Uploaded file name for reference
                  jobId:
                    type: integer
                    description: Uploaded file id for reference.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "422":
          $ref: '#/components/responses/BadRequest'
        "500":
          $ref: '#/components/responses/Error'
  /platform/widgets:
    get:
      tags:
        - Widget
      summary: List your existing dynamic widgets
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/publicIdQSParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/DynamicWidgetsPagedResponse'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Widget
      summary: Create a new dynamic widget
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/DynamicWidget'
      responses:
        "200":
          description: Widget Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DynamicWidget'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
  /platform/widgets/{widget_id}:
    parameters:
      - $ref: '#/components/parameters/widgetIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - Widget
      summary: Get a single Dynamic Widget
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Dynamic Widget
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DynamicWidget'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    put:
      tags:
        - Widget
      summary: Update an existing Dynamic Widget.
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/DynamicWidget'
      responses:
        "200":
          description: Dynamic Widget Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DynamicWidget'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Widget
      summary: Delete an existing dynamic widget.
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Widget Deleted
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/domains:
    get:
      tags:
        - Domain
      summary: List your existing custom domains
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/Domains'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Domain
      summary: Create a new domain
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Domain'
      responses:
        "200":
          description: Domain Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domain'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
  /platform/domains/{domain_id}:
    parameters:
      - $ref: '#/components/parameters/domainIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    put:
      tags:
        - Domain
      summary: Update an existing Domain.
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Domain'
      responses:
        "200":
          description: Domain Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domain'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Domain
      summary: Delete an existing domain
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/Domains'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/account-domains:
    get:
      tags:
        - Domain
      summary: List allowed account domains
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: A list of allowed account domains.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountDomain'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Domain
      summary: Add a new allowed account domain
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - domain
              properties:
                domain:
                  type: string
                  description: The domain name to add (e.g. example.com)
      responses:
        "200":
          description: Account domain created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountDomain'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /platform/account-domains/{account_domain_id}:
    parameters:
      - name: account_domain_id
        in: path
        required: true
        schema:
          type: integer
      - $ref: '#/components/parameters/organizationIdHeader'
    delete:
      tags:
        - Domain
      summary: Delete an existing allowed account domain
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Account domain deleted, returns remaining domains.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountDomain'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/account-domains/{account_domain_id}/verify:
    parameters:
      - name: account_domain_id
        in: path
        required: true
        schema:
          type: integer
      - $ref: '#/components/parameters/organizationIdHeader'
    post:
      tags:
        - Domain
      summary: Verify an allowed account domain
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Domain successfully verified.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountDomain'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "422":
          description: Verification failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      verification_token:
                        type: string
                      instructions:
                        type: object
                        properties:
                          snippet:
                            type: string
                          dns:
                            type: string
        "500":
          $ref: '#/components/responses/Error'
  /platform/search/playground:
    post:
      tags:
        - Search
        - Content
      summary: Simple endpoint to test search results for given query or filter
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/SearchPlayground'
      responses:
        "200":
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResult'
        "400":
          description: You have a syntax issue in your query or filter.
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "423":
          description: Given content is not search ready yet.
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/session/urls:
    get:
      tags:
        - Content
        - Stats
        - Session
      summary: Get the session urls groupped by url and session counts
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/perPageParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          $ref: '#/components/responses/SessionUrlsPagedResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/content/{public_id}/conditions:
    get:
      tags:
        - Content
        - Question
      summary: Get a list of questions in your content with conditions attached.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/publicIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: A list of your questions in the content with additional conditions attached as answer and question.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QuestionWithCondition'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/conversion:
    get:
      tags:
        - Settings
      summary: List the conversion success urls you defined
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/ConversionSettings'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/Error'
    post:
      tags:
        - Settings
      summary: Define a new url for conversion tracking
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/ConversionSetting'
      responses:
        "200":
          description: url saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionSetting'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
  /platform/snippet/check-page:
    post:
      tags:
        - Snippet
      summary: Checks if a specific page url has snippet requests in the last 48 hours.
      description: This page will return 200 if the given page url has snippet requests, 403 if the given url is not valid according to the account domains and 404 if there was no request to the given url in the last 48 hours
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/CheckSnippetPage'
      responses:
        "200":
          description: Given url has snippet active and getting requests
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
  /platform/settings/conversion/{conversion_setting_id}:
    parameters:
      - $ref: '#/components/parameters/conversionSettingIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    put:
      tags:
        - Settings
      summary: Update an existing conversion url.
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/ConversionSetting'
      responses:
        "200":
          description: Setting Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionSetting'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Settings
      summary: Delete an existing conversion url
      security:
        - publisherAuth: []
      responses:
        "200":
          $ref: '#/components/responses/ConversionSettings'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/trigger-demo:
    post:
      tags:
        - TriggerDemo
      summary: Request a Trigger Demo Background image
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/TriggerDemoRequest'
      responses:
        "200":
          description: Trigger Demo BG Request Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerDemo'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
  /platform/conversion/time-stats:
    get:
      tags:
        - Conversion
      summary: Get conversion Time Stats metrics either for your whole account or a content
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/contentIdQSParam'
        - $ref: '#/components/parameters/startDateParam'
        - $ref: '#/components/parameters/organizationIdHeader'
        - $ref: '#/components/parameters/endDateParam'
        - $ref: '#/components/parameters/deviceTypeParam'
      responses:
        "200":
          description: Conversion Time Stats
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConversionTimeStats'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
  /platform/link-shorten:
    post:
      tags:
        - Link Shortner
      summary: Creates a polt.io shortlink from any given long url
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/ShortLink'
      responses:
        "200":
          description: Short link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShortLink'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/Conflict'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations:
    get:
      tags:
        - Organization
      summary: Get a list of organization the current user is a part of.
      security:
        - publisherAuth: []
      parameters:
        - $ref: '#/components/parameters/organizationIdHeader'
      responses:
        "200":
          description: Organizations with the role of the current user
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrganizationWithRole'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}:
    parameters:
      - $ref: '#/components/parameters/organizationIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      tags:
        - Organization
      summary: Get organization and it's current user list
      security:
        - publisherAuth: []
      responses:
        "200":
          description: User with roles
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization:
                    $ref: '#/components/schemas/Organization'
                  users:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  invites:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrganizationInvite'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
    put:
      tags:
        - Organization
      summary: Update organization name
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Organization'
      responses:
        "200":
          description: User with roles
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrganizationWithRole'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/invite:
    parameters:
      - $ref: '#/components/parameters/organizationIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    post:
      tags:
        - Organization
      summary: invite new members to your organization
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/OrganizationInvite'
      responses:
        "200":
          description: User with roles
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/join/{token}:
    get:
      tags:
        - Organization
      summary: Join a organization after login with a invite token
      parameters:
        - $ref: '#/components/parameters/organizationIdParam'
        - $ref: '#/components/parameters/organizationInviteTokenParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: User with roles
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/leave:
    get:
      tags:
        - Organization
      summary: Leave an organization that  you are a part of but not the owner of
      parameters:
        - $ref: '#/components/parameters/organizationIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Left the organization
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/cancel-invite/{email}:
    delete:
      tags:
        - Organization
      summary: Remove a pending invite from organization
      parameters:
        - $ref: '#/components/parameters/organizationIdParam'
        - $ref: '#/components/parameters/emailParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: Invite removed
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/remove-member/{id}:
    delete:
      tags:
        - Organization
      summary: Remove a user from an organization
      parameters:
        - $ref: '#/components/parameters/organizationIdParam'
        - $ref: '#/components/parameters/userIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      responses:
        "200":
          description: member removed
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/update-member:
    post:
      tags:
        - Organization
      summary: Updates role for a given member in an organization
      parameters:
        - $ref: '#/components/parameters/organizationIdParam'
        - $ref: '#/components/parameters/organizationIdHeader'
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/OrganizationUpdateMember'
      responses:
        "200":
          description: member role updated
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/ip-rules:
    parameters:
      - $ref: '#/components/parameters/organizationIdParam'
      - $ref: '#/components/parameters/organizationIdHeader'
    get:
      summary: List all IP Rules for an organization
      tags:
        - Organization
      security:
        - publisherAuth: []
      responses:
        "200":
          description: list of ip rules
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/IpRule'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    post:
      summary: Create a new IP Rule
      tags:
        - Organization
      security:
        - publisherAuth: []
      requestBody:
        $ref: '#/components/requestBodies/IpRuleRequest'
      responses:
        "200":
          description: IP Rule created
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
  /platform/organizations/{organization_id}/ip-rules/{ip_rule}:
    parameters:
      - $ref: '#/components/parameters/organizationIdParam'
      - $ref: '#/components/parameters/ipRuleId'
      - $ref: '#/components/parameters/organizationIdHeader'
    put:
      summary: Update an existing IP Rule
      tags:
        - Organization
      requestBody:
        $ref: '#/components/requestBodies/IpRuleRequest'
      responses:
        "200":
          description: Ip rule updated
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
    delete:
      summary: Delete an IP Rule
      tags:
        - Organization
      responses:
        "200":
          description: Ip rule removed
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/Error'
          ## end of paths
components:
  parameters:
    pageParam:
      in: query
      name: page
      description: Defines the page number for the results for paginated responses
      required: false
      schema:
        type: integer
    perPageParam:
      in: query
      name: per_page
      description: How many data you want per page.
      required: false
      schema:
        type: integer
        default: 12
    downloadReportParam:
      in: query
      name: download
      description: Indicates that you want requested report as a file in your email
      required: false
      schema:
        type: boolean
        default: true
    periodParam:
      in: query
      name: period
      description: The period of metrics you want to group by.
      required: true
      schema:
        type: string
        enum:
          - day
          - week
          - month
          - year
    metricsParam:
      in: query
      name: metrics
      description: The desired metrics in comma separeted form.
      required: true
      schema:
        type: string
        enum:
          - view
          - vote
          - voter
          - start
          - finish
          - undo
          - result_view
          - result_view_unique
          - result_click
          - result_click_secondary
          - result_click_compare
          - result_click_compare_pdp
          - result_click_compare_submit
          - result_click_unique
          - result_swipe
          - conversion
          - cta_view
          - result_click_share
          - result_click_start_over
    dirParam:
      in: query
      name: dir
      description: Direction for the order of the stat records
      schema:
        type: string
        default: asc
        enum:
          - asc
          - desc
    countParam:
      in: query
      name: count
      description: How many months/days/weeks etc.. do you want to go back
      schema:
        type: integer
        default: 10
    themeIdParam:
      in: path
      name: theme_id
      description: Unique identifier for the Theme
      required: true
      schema:
        type: integer
    publicIdParam:
      in: path
      name: public_id
      description: Unique identifier for the Content
      required: true
      schema:
        type: string
    questionIdParam:
      in: path
      name: question_id
      description: Unique identifier for the Question
      required: true
      schema:
        type: integer
    leadIdParam:
      in: path
      name: lead_id
      description: Unique identifier for the Lead Campaign
      required: true
      schema:
        type: string
    leadCouponCodeId:
      in: path
      name: lead_coupon_code_id
      description: Unique identifier for the Lead Coupon Code
      required: true
      schema:
        type: string
    fromIdParam:
      in: path
      name: from_id
      required: true
      schema:
        type: string
    toIdParam:
      in: path
      name: to_id
      required: true
      schema:
        type: string
    takeParam:
      in: query
      name: take
      schema:
        type: integer
        default: 10
    startDateParam:
      in: query
      name: start
      schema:
        type: string
        format: date
        example: "2022-01-01"
    endDateParam:
      in: query
      name: end
      schema:
        type: string
        format: date
        example: "2022-01-01"
    hookIdParam:
      in: path
      required: true
      name: hook_id
      schema:
        type: integer
        example: 1
    contentIdParam:
      in: query
      name: content_id
      schema:
        type: integer
        example: 1
    publicIdQSParam:
      in: query
      name: public_id
      schema:
        type: string
        example: XXX-YYY-ZZZ
    tierIdParam:
      in: path
      name: tier_id
      required: true
      schema:
        type: integer
        example: 1
    dataSourceId:
      in: path
      name: data_source_id
      required: true
      schema:
        type: integer
        example: 1
    dataSourceElementId:
      in: path
      name: element_id
      required: true
      schema:
        type: integer
        example: 1
    dataSourceContentId:
      in: path
      name: dataSourceContent
      required: true
      schema:
        type: integer
        example: 1
    dataSourceContentFieldId:
      in: path
      name: dataSourceContentField
      required: true
      schema:
        type: integer
        example: 1
    pixelCodeId:
      in: path
      name: pixel_code_id
      required: true
      schema:
        type: integer
        example: 1
    periodPathParam:
      in: path
      name: period
      description: The period of metrics you want to group by.
      required: true
      schema:
        type: string
        enum:
          - day
          - week
          - month
          - year
    deviceTypeParam:
      in: query
      name: device_type
      schema:
        type: string
        nullable: true
        enum:
          - mobile
          - tablet
          - desktop
          - n/a
    oauthTokenIdParam:
      in: path
      name: token_id
      description: Unique identifier for the Oauth Token
      required: true
      schema:
        type: integer
    widgetIdParam:
      in: path
      required: true
      name: widget_id
      description: Unique identifier for the Dynamic Widget
      schema:
        type: integer
        example: 1
    domainIdParam:
      in: path
      required: true
      name: domain_id
      description: Unique identifier for the domain
      schema:
        type: integer
        example: 1
    conversionSettingIdParam:
      in: path
      required: true
      name: conversion_setting_id
      description: Unique identifier for the conversion setting url
      schema:
        type: integer
        example: 1
    contentIdQSParam:
      in: query
      name: content_id
      schema:
        type: integer
        example: 123
    organizationIdHeader:
      name: Organization-Id
      in: header
      description: The unique identifier of the active organization context.
      required: true
      schema:
        type: integer
      example: 42
    organizationIdParam:
      name: organization_id
      in: path
      description: The unique identifier of the active organization context.
      required: true
      schema:
        type: integer
      example: 42
    organizationInviteTokenParam:
      in: path
      name: token
      description: A unique and email bound invite token for an organization
      required: true
      schema:
        type: string
    emailParam:
      in: path
      name: email
      description: Email address
      required: true
      schema:
        type: string
    userIdParam:
      in: path
      name: id
      description: User id
      required: true
      schema:
        type: integer
    ipRuleId:
      name: ip_rule
      in: path
      required: true
      schema:
        type: integer
      description: The ID of the IP Rule
      ## end of params
  responses:
    Error:
      description: Generic error happened, please look into messages
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The route or content is not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: You have an invalid or expired token or not enough permission to access to this call.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: You dont have permission to access this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Forbidden'
    BadRequest:
      description: You dont have permission to access this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Gone:
      description: This content is no longer available
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: You have validation errors in your request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    Conflict:
      description: You are trying to save a record that already exists
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Loggedin:
      description: Logged in
      content:
        application/json:
          schema:
            type: object
            properties:
              token:
                type: string
                description: Bearer token for authonticating the requests
              user:
                $ref: '#/components/schemas/User'
    Login:
      description: First step of login successful, depending on users two factor auth settings, this call either returns a token and user information or a temporary token for two factor auth
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/Login'
              - $ref: '#/components/schemas/LoginFirstStepTwoFactor'
          examples:
            loginExample:
              summary: Logged in with out 2fa
              value:
                token: asdasdasda
                user:
                  id: 1
            loginFirstStepTwoFactorExample:
              summary: Login first step passed, please provide TOTP code
              value:
                two_factor_enabled: true
                temp_token: aasdadasda
    Register:
      description: Registed and logged in
      content:
        application/json:
          schema:
            type: object
            properties:
              token:
                type: string
                description: Bearer token for authonticating the requests
              user:
                $ref: '#/components/schemas/User'
    ContentMetricsResponse:
      description: Metrics
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ContentMetric'
    DashboardMetricsResponse:
      description: Metrics
      content:
        application/json:
          schema:
            type: array
            items:
              oneOf:
                - $ref: '#/components/schemas/MonthMetric'
                - $ref: '#/components/schemas/DayMetric'
                - $ref: '#/components/schemas/WeekMetric'
                - $ref: '#/components/schemas/YearMetric'
    MetricsResponse:
      description: Metrics
      content:
        application/json:
          schema:
            type: array
            items:
              type: array
              items:
                type: string
    TokensPagedResponse:
      description: Paginated oauth tokens.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OauthToken'
    Domains:
      description: A list of custom domains you defined.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/Domain'
    ConversionSettings:
      description: A list of conversion checkout success urls you defined
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ConversionSetting'
    DynamicWidgetsPagedResponse:
      description: A list of widget records
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DynamicWidget'
    SheetHooksPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SheetHook'
    SheetHookLogsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SheetHookLog'
    WebhookPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Webhook'
    WebhookLogsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebhookLog'
    ReportRequestsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ReportRequest'
    ContentPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Content'
    ContentResultsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContentResult'
    ContentSessionsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContentSession'
    VoterInputsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/VoterInput'
    LeadPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Lead'
    LeadInputsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeadInput'
    LeadLogsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeadLog'
    ThemePagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Theme'
    VoteSourcesPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/VoteSource'
    SessionUrlsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SessionUrl'
    LeadsPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Lead'
    PixelCodesPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PixelCode'
    LeadCodesPagedResponse:
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PagedResponse'
              - type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeadCode'
  ## end of responses

  ## beginning of schema
  schemas:
    ClientKey:
      type: object
      properties:
        id:
          type: integer
          example: 1
        organization_id:
          type: integer
          example: 10
        key:
          type: string
          example: pk_live_abc123...
        name:
          type: string
          example: Web App Key
        is_production:
          type: boolean
          example: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        last_used_at:
          type: string
          format: date-time
          nullable: true
        revoked_at:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        message:
          type: string
    Forbidden:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          description: unique code for the forbidden cause
        error:
          type: string
    ValidationError:
      type: object
      properties:
        msg:
          type: string
        errors:
          type: object
          description: This object will return each field and corresponding validation msg
    Question:
      type: object
      properties:
        id:
          type: integer
        user_id:
          type: integer
        title:
          type: string
        tag_id:
          type: integer
        vote_count:
          type: integer
        view_count:
          type: integer
          description: Total view count for the content, only accurate if the requester owns the content. Otherwise 0 will return
        session_vote_count:
          type: integer
          description: Indicates the total unique session based vote count. Counts 1 for each unique session for MP questions
        unique_voter:
          type: integer
          description: Unique voter count. Only available when the requester is also owner of the question.
        comment_count:
          type: integer
        sub_count:
          type: integer
        privacy:
          type: string
          enum:
            - public
            - private
        status:
          type: string
          enum:
            - draft
            - published
            - unpublished
        answer_type:
          type: string
          enum:
            - text
            - media
            - score
            - star_rating
            - yesno
            - free_text
            - free_number
            - autocomplete
            - wheel
            - mystery-box
            - scratch-card
            - slider
        created_at:
          type: string
        updated_at:
          type: string
        slug:
          type: string
        is_ended:
          type: integer
          description: calculates if the end_date is in the past on the server
        is_suggested:
          type: integer
        allow_multiple_answers:
          type: integer
          description: 'if 1 this question can allow multiple votes '
        max_multi_punch_answer:
          type: integer
          description: How many answers can a user vote for a multi punch question
        recommended_popular_answer:
          type: integer
          description: How many answers do you want to display on auto complete type answers
        link_html:
          type: string
        require_login:
          type: integer
          description: 'If 1, user needs to login before voting. '
        has_leads:
          type: integer
        mobile_only:
          type: integer
          description: If 1, this content must only be visible on mobile devices.
        answer_time_limit:
          type: integer
          description: N minutes for changing answers allowed
        hide_results:
          type: integer
          description: 'If 1, vote percentages wont be displayed after voting. '
        hide_counter:
          type: integer
          description: If 1, total number of people voted will not be displayed.
        auto_reports_enabled:
          type: integer
        post_type:
          type: string
          enum:
            - poll
            - test
            - quiz
        gives_feedback:
          type: integer
          description: 'If 1, after voting for this question, it will give some feedback. (ex: Right/Wrong answer.)'
        rotate_answers:
          type: integer
          description: 'If 1, while displaying answers, it should be in random order. '
        rotate_answers_last:
          type: integer
          description: 'If 1, while displaying answers, it should be in random order except the last answer '
        lang:
          type: string
        voted:
          type: integer
          description: 'indicates if the requester already voted for this question or not. '
        share_count_facebook:
          type: integer
        share_count_twitter:
          type: integer
        answers:
          type: array
          items:
            $ref: '#/components/schemas/Answer'
        voters:
          type: array
          items:
            $ref: '#/components/schemas/User'
        user:
          $ref: '#/components/schemas/User'
        display_ads:
          type: integer
          description: Decides whether to show ad_code on site.
        embed_ads:
          type: integer
          description: Decides whether to show ad_code on embeds
        embed_footer_url:
          type: string
          description: this will define the url for embed_footer_img
        play_once:
          type: integer
          description: If 1, same token can't get the voted/played content twice.
        play_once_strategy:
          type: string
          enum:
            - result
            - start
          default: result
          description: Defines which method should be used while deciding play once.
        play_once_msg:
          type: string
          description: Custom play once message.
        play_once_link:
          type: string
          description: Custom play once link.
        play_once_img:
          type: string
          description: Custom play once image.
        end_date_day:
          type: integer
          description: Remaining time in days to the end date. Only available to content owner in edit calls.
        end_date_hour:
          type: integer
          description: Remaining time in hours to the end date. Only available to content owner in edit calls.
        end_date_minute:
          type: integer
          description: Remaining time in minutes to the end date. Only available to content owner in edit calls.
        play_once_btn:
          type: string
          description: Custom play once button value
        cal_val_default:
          type: integer
          nullable: true
          description: Default calculator value for this question if no answer is voted
        is_searchable:
          type: boolean
        is_skippable:
          type: boolean
        is_connected:
          type: boolean
        autocomplete_help:
          nullable: true
          type: string
          description: Autocomplete answer type help text
        autocomplete_placeholder:
          nullable: true
          type: string
          description: Autocomplete answer type placeholder text.
        options:
          $ref: '#/components/schemas/QuestionOptions'
    QuestionOptions:
      type: object
      nullable: true
      properties:
        min_label:
          type: string
          nullable: true
          description: Custom minimum label for question.
          example: Min
        max_label:
          type: string
          nullable: true
          description: Custom maximum label for question.
          example: Max
    Answer:
      type: object
      properties:
        id:
          type: integer
        question_id:
          type: integer
        background:
          type: string
        alt:
          type: string
          nullable: true
          description: Alt tag for the background image
        vote_count:
          type: integer
        win_count:
          type: integer
        round_win_count:
          type: integer
        created_at:
          type: string
        updated_at:
          type: string
        triggers_lead:
          type: integer
        triggers_display:
          type: integer
        has_right_answer:
          type: integer
        is_right_answer:
          type: integer
        is_mutually_exclusive:
          type: integer
          description: Defines if the answer is mutually exclusive, meaning in a MP question, if this answer is selected, all other selected answers must be disregarded
        voted:
          type: integer
        is_clone:
          type: boolean
          description: Defines if an answer is clone of some other answer
        clone_source:
          nullable: true
          type: integer
          description: if this answer is a clone, this field refers to source answer id.
        cal_val:
          nullable: true
          type: integer
          description: Answer calculator set value
        max_vote:
          type: integer
          nullable: true
          default: 0
          description: If set, once the answer reaches this vote number, it will be disabled
        addon:
          type: string
          nullable: true
          description: Additional information thats gets shared with GTM and PixelCodes after user selects answer
        disabled_msg:
          type: string
          nullable: true
          description: If you want to customize the disabled state message for this answer
        content_results:
          type: array
          items:
            $ref: '#/components/schemas/ResultAnswer'
    ResultAnswer:
      allOf:
        - $ref: '#/components/schemas/Result'
        - type: object
          properties:
            pivot:
              type: object
              properties:
                answer_id:
                  type: integer
                content_result_id:
                  type: integer
                point:
                  type: integer
    QuestionAnswers:
      type: array
      items:
        $ref: '#/components/schemas/Answer'
    Result:
      type: object
      properties:
        id:
          type: integer
          example: 14271
        title:
          type: string
          example: Thank You!
        background:
          type: string
          nullable: true
          example: content/generic/1567532923.8938.jpg
        alt:
          type: string
          nullable: true
          description: Alt tag content for the background image.
        description:
          type: string
          example: Thank you for participating
        search:
          type: string
          nullable: true
        search2:
          type: string
          nullable: true
        url:
          type: string
          nullable: true
          example: https://www.poltio.com
        url_text:
          type: string
          nullable: true
          example: Click here for the best website ever
        luv:
          type: string
          nullable: true
          example: '&result=r1'
        is_default:
          type: integer
          enum:
            - 0
            - 1
          description: Defines if the result can be a catchall default result
    QuestionPositions:
      type: array
      items:
        $ref: '#/components/schemas/QuestionPosition'
    QuestionPosition:
      type: object
      properties:
        id:
          type: integer
          description: Unique ID for the question
          example: 1
        position:
          type: integer
          description: Position for the Question.
          example: 2
    AnswerPositions:
      type: array
      items:
        $ref: '#/components/schemas/AnswerPosition'
    AnswerPosition:
      type: object
      properties:
        id:
          type: integer
          description: Unique ID for the Answer
          example: 1
        position:
          type: integer
          description: Position for the Answer.
          example: 2
    User:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        email:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        photo:
          type: string
        level:
          type: integer
        is_verified:
          type: integer
          description: Need to be 1 in order to comment or create content.
        tc_accepted_at:
          type: string
          format: date-time
          nullable: true
          description: Defines if the user has accepted the terms and conditions
        has_two_factor:
          type: boolean
          description: Indicates whether 2FA is enabled for the account.
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/Organization'
    CustomDomain:
      type: object
      properties:
        id:
          type: integer
        domain:
          type: string
        is_verified:
          type: boolean
        is_active:
          type: boolean
        is_default:
          type: boolean
        status:
          type: string
          description: a human readable status of the domain, indicates if the custom domain is live or any of the auth stages
        verification_record:
          type: string
          nullable: true
          description: CNAME record used to verify the custom domain ownership.
    AccountDomain:
      type: object
      properties:
        id:
          type: integer
        domain:
          type: string
        verified_at:
          type: string
          format: datetime
          nullable: true
        verification_token:
          type: string
          nullable: true
        created_at:
          type: string
          format: datetime
        updated_at:
          type: string
          format: datetime
    ContentWithMetrics:
      type: object
      required:
        - content
        - metrics
      properties:
        content:
          $ref: '#/components/schemas/Content'
        metrics:
          type: object
    Content:
      type: object
      required:
        - public_id
        - type
        - original_id
        - title
        - background
        - alt
        - desc
        - created_at
        - updated_at
        - end_date
        - skip_start
        - skip_result
        - hide_counter
        - hide_results
        - display_repeat
        - lang
        - embed_footer_url
        - play_once
        - play_once_strategy
        - play_once_msg
        - play_once_img
        - play_once_btn
        - play_once_link
        - vote_count
        - voter_count
        - start_count
        - finish_count
        - view_count
        - is_ended
        - results
        - questions
        - user
      properties:
        public_id:
          type: string
          description: Unique ID for the content.
        type:
          type: string
          description: Defines the content type. Can be poll, set, quiz or test.
        original_id:
          type: integer
          description: Content type unique id for the Old format.
        title:
          type: string
          description: Content title.
        background:
          type: string
          description: Content main cover image path. Can be used with iproxy.
          nullable: true
        vertical_image:
          type: string
          description: Content main image vertical version for Wide Screen use
          nullable: true
        vertical_mobile_image:
          type: string
          description: Content main mobile image vertical version for Wide Screen use
          nullable: true
        alt:
          type: string
          nullable: true
          description: Alt tag content for the background image or vertical_image.
        desc:
          type: string
          description: Content description.
          nullable: true
        created_at:
          type: string
          format: datetime
          description: Content creation date.
        updated_at:
          type: string
          format: datetime
          description: Content last update date.
        end_Date:
          type: string
          format: datetime
          description: Content end date.
          nullable: true
        skip_start:
          type: boolean
          description: Indicates if the content should display a cover card.
        skip_result:
          type: boolean
          description: Indicates if the content should display a result card.
        hide_counter:
          type: boolean
          description: Indicicates if the content should hide vote counters.
        hide_results:
          type: boolean
          description: Indicates if the content should display vote percentages
        display_repeat:
          type: boolean
          description: Indicates if the content should display a Play Again button at the end.
        lang:
          type: string
          description: Content language.
        embed_footer_url:
          type: string
          description: If the embed_footer_img is set, this url should be linked to the img.
          nullable: true
        play_once:
          type: boolean
          description: Defines if the content is only available for vote/play once per user.
        play_once_strategy:
          type: string
          description: Indicates how the play once restrictions should be applied if enabled.
        play_once_msg:
          type: string
          nullable: true
          description: Defines a msg for play once errors.
        play_once_img:
          type: string
          description: Defines an image to show if the user sees a play once error screen
          nullable: true
        play_once_btn:
          type: string
          nullable: true
          description: Indiciates the button text for the play once error screen
        play_once_link:
          type: string
          nullable: true
          description: Indicates the button link for play once error screen
        vote_count:
          type: integer
          description: Vote count for the content
        voter_count:
          type: integer
          description: Unique voter count for the content
        start_count:
          type: integer
          description: Start count
        finish_count:
          type: integer
          description: Finish count
        view_count:
          type: integer
          description: View count
        is_ended:
          type: boolean
          description: Defines if the content has ended or not.
        results:
          type: array
          items:
            $ref: '#/components/schemas/ContentResult'
        questions:
          type: array
          items:
            $ref: '#/components/schemas/Question'
        user:
          $ref: '#/components/schemas/User'
    ContentResult:
      type: object
      required:
        - id
        - title
        - background
        - desc
        - url
        - url_text
        - youtube_id
        - lead_id
        - pixel_code_id
        - counter
        - luv
        - min_c
        - max_c
        - is_default
        - source_id
        - secondary_url
        - secondary_url_text
      properties:
        id:
          type: integer
        title:
          type: string
        background:
          type: string
          nullable: true
        alt:
          type: string
          nullable: true
        desc:
          type: string
          nullable: true
        url:
          type: string
          nullable: true
        url_text:
          type: string
          nullable: true
        youtube_id:
          type: string
          nullable: true
        lead_id:
          type: integer
          nullable: true
        pixel_code_id:
          type: integer
          nullable: true
        counter:
          type: integer
        luv:
          type: string
          nullable: true
        min_c:
          type: integer
          description: Min correct answer (or calculator score) to get this result
        max_c:
          type: integer
          description: Maximum correct answer or calculator score to get this result
        is_default:
          type: integer
          enum:
            - 0
            - 1
          description: Defines if the result can be a catchall default result
        secondary_url:
          type: string
          description: If you want to display a secondary action button in the result you can set any url with this field. If your content is connected with a DSC this field will be overwritten with DSC so use that field.
          nullable: true
        secondary_url_text:
          description: If you added a secondary_url field to your result, you can customize the button label with this field
          type: string
          nullable: true
        source_id:
          nullable: true
          type: string
          description: If you are creating a product finder manually and want to set a product id for the result you can use this field to customize the product id. This field will be used in GTM ecommerce events, conversion tracker and pixel codes. If your content is connected to a DSC, this field will be overwritten.
    ContentSession:
      type: object
      required:
        - voter_id
        - session_id
        - score
        - right_answer
        - play_time
        - started_at
        - finished_at
        - uuid
        - custom_id
        - url
      properties:
        voter_id:
          type: integer
          example: 176027111
        session_id:
          type: string
          example: 22a835ae-5703-45ff-a8b6-5e54a11ff6eb
        score:
          nullable: true
          type: integer
          example: 2
          description: If the content has some sort of score calculation, this will represent the calculated result
        right_answer:
          nullable: true
          type: integer
          example: 5
          description: If the content has right and wrong answers, this will represnt the number of correct choices in this session
        play_time:
          type: integer
          nullable: true
          example: 2400
          description: The time in miliseconds between start and finish
        started_at:
          type: string
          format: date-time
          example: "2023-02-16T09:18:53.000000Z"
          nullable: true
        finished_at:
          type: string
          format: date-time
          example: "2023-02-16T09:18:53.000000Z"
          nullable: true
        uuid:
          type: string
          nullable: true
          example: TESTUUID
          description: If the session has uuid in query string, this field will hold the uuid.
        custom_id:
          type: string
          nullable: true
          example: TestCustomId
          description: CustomID field can be used as an secondary UUID field that doesn't effect the auth flow.
        url:
          type: string
          nullable: true
          example: https://www.poltio.com
          description: The url of the session. If embedded and using poltio SDK, this url will be the parent page otherwise it will be the poltio widget url
    Sankey:
      type: object
      properties:
        columns:
          type: array
          items:
            $ref: '#/components/schemas/SankeyLine'
        rows:
          type: array
          items:
            $ref: '#/components/schemas/SankeyLine'
    SankeyLine:
      type: object
      properties:
        type:
          type: string
        label:
          type: string
    SankeyUser:
      type: object
      properties:
        user_id:
          type: integer
    Voter:
      type: object
      properties:
        VoteID:
          type: integer
          example: 403890883
        PoltioUserID:
          type: integer
          example: 132655691
        VoteDate:
          type: string
          example: "2022-09-01 15:46:03"
        PublisherSourceID:
          type: string
          nullable: true
        QuestionID:
          type: integer
          example: 206232
        QuestionTitle:
          type: string
          example: What is the best SaaS
        AnswerID:
          type: integer
          example: 175
        AnswerTitle:
          type: string
          example: Poltio
        VoteSource:
          type: string
          nullable: true
          example: https://www.poltio.com
    SearchableField:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          description: Name of the searchable or filterable field
          example: title
        type:
          type: string
          description: Type of the field.
          enum:
            - primary_search
            - secondary_search
            - filter_numeric
            - filter_string
    SearchableFieldsResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SearchableField'
    VotersPagedResponse:
      allOf:
        - $ref: '#/components/schemas/PagedResponse'
        - type: object
          required:
            - data
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/Voter'
    SankeyUserPagedResponse:
      allOf:
        - $ref: '#/components/schemas/PagedResponse'
        - type: object
          required:
            - data
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/SankeyUser'
    CalculatorTest:
      type: object
      required:
        - formula
        - vars
      properties:
        formula:
          type: string
          description: Your calculator formula
          example: (Q1 + Q2 + Q3)
        vars:
          type: array
          items:
            $ref: '#/components/schemas/CalculatorVar'
    CalculatorVar:
      type: object
      properties:
        Qx:
          type: string
          example: "2"
    Theme:
      type: object
      required:
        - id
        - name
        - primary_color
        - primary_color_selected
        - primary_text_color
        - primary_text_color_selected
        - secondary_color
        - secondary_background_color
        - footer_background_color
        - main_text_color
        - background_color
        - cover_background_color
        - cover_text_color
        - cover_desc_color
        - question_background_color
        - question_text_color
        - result_background_color
        - result_text_color
        - result_desc_color
        - mp_info_color
        - positive_color
        - negative_color
        - font_family
        - font_family_css
        - font_size_title
        - line_height_title
        - font_size_answer
        - line_height_answer
        - title_font_weight
        - button_font_weight
        - button_border_radius
        - answer_border_radius
        - textinput_border_radius
        - card_border_radius
        - footer_img
        - background_img
        - card_shadow
        - bar_thickness
        - question_load_time
        - gtm_id
        - gtm_dl
        - disc_msg
        - disc_display_option
        - card_title_alignment
        - percentage_color_unselected
        - percentage_color_selected
        - cover_font_size_title
        - cover_line_height_title
        - cover_font_size_description
        - cover_line_height_description
        - question_font_size_title
        - question_line_height_title
        - question_font_size_description
        - question_line_height_description
        - result_box_shadow
        - result_font_size_title
        - result_line_height_title
        - result_font_size_description
        - result_line_height_description
        - result_image_background
        - wide_image_background_color
        - anchor_color
        - anchor_hover_color
        - anchor_font_size
        - bullets_color
        - next_question_text_color
        - start_over_text_color
        - start_over_background_color
        - mobile_top_border_radius
        - content_background_color
      properties:
        id:
          type: integer
          description: Unique identifier for the theme
          example: 1
        name:
          type: string
          description: A string name for the theme for internal use
          example: My blue theme
        primary_color:
          type: string
          description: Primary font color
          example: rgba(0, 0, 0, 0.02)
        primary_color_selected:
          type: string
          description: Primary background color for action buttons and selected options outer shells
          example: rgb(0, 158, 235)
        primary_text_color:
          type: string
          description: Primary font color
          example: rgba(30, 61, 84, 1)
        primary_text_color_selected:
          type: string
          description: Text color for primary action buttons
          example: rgb(255, 255, 255)
        secondary_color:
          type: string
          description: Text color for unselected options
          example: rgba(30, 61, 84, 0.75)
        secondary_background_color:
          type: string
          description: Background color for non-selected options.
          example: rgb(221, 231, 235)
        footer_background_color:
          type: string
          description: Background color of Footer
          example: rgb(255, 255, 255)
        main_text_color:
          type: string
          description: Default font color for the page. All texts that doesn't have a specific field can be adjusted by this.
          example: rgb(30, 61, 84)
        background_color:
          type: string
          description: Default background color for the widget.
          example: rgb(240, 248, 255)
        background_repeat:
          type: string
          example: repeat
          description: 'Background repeat tag '
        background_size:
          type: string
          example: auto auto
          description: 'Background size tag '
        cover_background_color:
          type: string
          description: Background Color of Cover Card
          example: rgb(255, 255, 255)
        cover_text_color:
          type: string
          description: Font Color of Cover Card Title
          example: rgb(30, 61, 84)
        cover_desc_color:
          type: string
          description: Font Color of Cover Card Description Section
          example: rgb(131, 146, 166)
        question_background_color:
          type: string
          description: Background Color of Question Cards
          example: rgb(255, 255, 255)
        question_text_color:
          type: string
          description: Font Color of Question Cards
          example: rgb(30, 61, 84)
        result_background_color:
          type: string
          description: Background Color of Result Card
          example: rgb(255, 255, 255)
        result_text_color:
          type: string
          description: Font Color of Result Card
          example: rgb(30, 61, 84)
        result_desc_color:
          type: string
          description: Font Color of Result Card Description Section
          example: rgb(131, 146, 166)
        mp_info_color:
          type: string
          description: Font color of Multi Punch Info
          example: rgba(30, 61, 84, 0.7)
        positive_color:
          type: string
          description: Succes lead message and true answer color
          example: rgba(55, 215, 175, 1)
        negative_color:
          type: string
          description: Error lead message and false answer color
          example: rgba(253, 103, 76, 1)
        font_family:
          type: string
          description: Font Family of your widget.
          example: '"Averta", "Arial", sans-serif'
        font_family_css:
          type: string
          description: Font Family of your widget.
          example: https://platform.poltio.com/fonts/averta/averta
        font_size_title:
          type: string
          description: Title and title sized font sizes
          example: 1.5rem
        line_height_title:
          type: string
          description: Line height for titles
          example: 1.8rem
        font_size_answer:
          type: string
          description: Font Size of Description and Answer Button Text
          example: 1rem'
        line_height_answer:
          type: string
          description: Line height for answers
          example: 1.4rem
        title_font_weight:
          type: string
          description: Tittle font weight
          example: "700"
        button_font_weight:
          type: string
          description: Button font weight
          example: "600"
        button_border_radius:
          type: string
          description: Border Radius of primary buttons
          example: 0.5rem'
        answer_border_radius:
          type: string
          description: Border Raduis of answers
          example: 0.5rem
        textinput_border_radius:
          type: string
          description: Border Raduis of text inputs
          example: 0.5rem
        card_border_radius:
          type: string
          description: Main Card Border Radius
          example: .5rem
        card_shadow:
          type: string
          description: Main Card Shadow Options
          example: 0 0 1rem rgba(20,36,51,.1)
        footer_img:
          type: string
          description: Footer Image
          example: placeholder/poltio-logo.png
        background_img:
          type: string
          nullable: true
          description: Embed Background Image
        bar_thickness:
          type: string
          description: Progress bar thickness
          example: 0.125rem
        question_load_time:
          type: integer
          minimum: 1000
          maximum: 10000
          description: Question load time (ms)
          example: 1500
        gtm_id:
          type: string
          description: Google Tag Manager Id
          example: G-GCQ3TQDQK6
        gtm_dl:
          type: string
          description: Google Tag Manager function name
          example: dataLayer
        disc_msg:
          type: string
          nullable: true
          description: Disclaimer message
        disc_display_option:
          type: boolean
          description: Disclaimer show button option
          example: false
        show_pb_on_top:
          type: boolean
          description: Indicates if we have progress bar on top of the card
          default: false
          example: true
        show_pb_on_bottom:
          type: boolean
          description: Indicates if we have progress bar on bottom of the card
          default: true
          example: true
        question_title_alignment:
          type: string
          description: Aligns the card titles
          enum:
            - start
            - center
          example: start
          default: start
        percentage_color_selected:
          type: string
          description: Percentage numbers font color
          example: rgb(255, 255, 255)
          default: rgb(255, 255, 255)
        percentage_color_unselected:
          type: string
          description: Percentage numbers font color for the unselected answer
          example: rgba(30, 61, 84, 1)
          default: rgba(30, 61, 84, 1)
        cover_font_size_title:
          type: string
          default: 1.5rem
          example: 1.5rem
        cover_line_height_title:
          type: string
          default: 1.8rem
          example: 1.8rem
        cover_font_size_description:
          type: string
          default: 1rem
          example: 1rem
        cover_line_height_description:
          type: string
          default: normal
          example: normal
        question_font_size_title:
          type: string
          default: 1.5rem
          example: 1.5rem
        question_line_height_title:
          type: string
          default: 1rem
          example: 1rem
        question_font_size_description:
          type: string
          default: 1.0rem
          example: 1.0rem
        question_line_height_description:
          type: string
          default: 1.8rem
          example: 1.8rem
        result_box_shadow:
          type: string
          default: 0px 0px 12px 0px rgba(20, 36, 51, 0.2)
          example: 0px 0px 12px 0px rgba(20, 36, 51, 0.2)
        result_font_size_title:
          type: string
          default: 1.5rem
          example: 1.5rem
        result_line_height_title:
          type: string
          default: 1.8rem
          example: 1.8rem
        result_font_size_description:
          type: string
          default: 1rem
          example: 1rem
        result_line_height_description:
          type: string
          default: normal
          example: normal
        result_image_background:
          type: string
          default: rgba(255, 255, 255, 0)
          example: rgba(255, 255, 255, 0)
        wide_image_background_color:
          type: string
          default: rgba(255, 255, 255, 0)
          example: rgba(255, 255, 255, 0)
        anchor_color:
          type: string
          default: rgb(0, 158, 235)
          example: rgb(0, 158, 235)
        anchor_hover_color:
          type: string
          default: rgb(0, 158, 235)
          example: rgb(0, 158, 235)
        anchor_font_size:
          type: string
          default: 0.875rem
          example: 0.875rem
        bullets_color:
          type: string
          description: Result bullet points color
          nullable: true
        next_question_text_color:
          type: string
          description: Next question text color
          nullable: true
        start_over_text_color:
          type: string
          description: Start over button text color
          nullable: true
        start_over_background_color:
          type: string
          description: Start over button background color
          nullable: true
        mobile_top_border_radius:
          type: string
          description: Top border radius of card for mobile devices
          nullable: true
        content_background_color:
          type: string
          description: Right column bg color
          default: rgb(255, 255, 255)
    ## TODO: Paged Responses are not showing up.
    PagedResponse:
      type: object
      properties:
        per_page:
          type: integer
          description: Meta pagination information about the per page record
        current_page:
          type: integer
          description: Meta pagination information about the current page.
        from:
          type: integer
        to:
          type: integer
        total:
          type: integer
        last_page:
          type: integer
        last_page_url:
          type: string
        first_page_url:
          type: string
        next_page_url:
          type: string
          nullable: true
        path:
          type: string
        prev_page_url:
          type: string
          nullable: true
    ContentType:
      type: string
      enum:
        - poll
        - set
        - quiz
        - test
        - this-that
        - would-you-rather
    PlayOnce:
      type: object
      required:
        - play_once
        - play_once_strategy
        - play_once_msg
        - play_once_img
        - play_once_link
        - play_once_btn
      properties:
        play_once:
          type: integer
          enum:
            - 0
            - 1
          description: Defines if the content is playable once per user.
          default: 0
          example: 1
        play_once_strategy:
          type: string
          enum:
            - start
            - result
          description: Progress in the flow where we the system should consider the user as played. From the start or at the result.
          example: start
        play_once_img:
          type: string
          nullable: true
          description: If you want to display a custom image in the play once message you can use this field.
          example: path/image.ext
        play_once_link:
          type: string
          nullable: true
          description: If you want to display a custom button with a link.
          example: https://www.poltio.com
        play_once_btn:
          type: string
          nullable: true
          description: If you want to display a custom button with a link
          example: Click here to go to the best SaaS site ever.
        play_once_msg:
          type: string
          nullable: true
          description: If you want to display a custom message instead of generic error message you can customize by using this field.
          example: Thank you for playing our content.
    BaseContent:
      type: object
      properties:
        public_id:
          type: string
          description: Public Unique ID for the content.
          example: 7b8fd452c655
        title:
          type: string
          description: Content title, end user facing.
          example: Let me find you your new Computer
        name:
          type: string
          description: Internal name for your content, not end user facing.
          example: Computer finder from DS
        type:
          $ref: '#/components/schemas/ContentType'
        background:
          type: string
          nullable: true
          description: 'Main cover image for the content. '
          example: path/image.ext
        vertical_image:
          type: string
          nullable: true
          description: 'Main cover image for the content for Wide Screen layout '
          example: path/image.ext
        vertical_mobile_image:
          type: string
          nullable: true
          description: 'Main cover image for the content in single column view for Wide Screen layout '
          example: path/image.ext
        alt:
          type: string
          nullable: true
          description: Alt tag content for the background image.
          example: Washed blue jeans displayed on a model
        end_date_day:
          type: integer
          nullable: true
          description: How many days later would you like this content to finish automatically.
          example: 12
        end_date_hour:
          type: integer
          nullable: true
          description: How many hours later would you like this content to finish automatically.
          example: 1
        end_date_minute:
          type: integer
          nullable: true
          description: How many minutes later would you like this content to finish automatically.
          example: 10
        desc:
          type: string
          nullable: true
          description: Content description that will be displayed in the cover screen
          example: Welcome to the computer finder survey, by answering some simple questions we can help you find your next new computer.
        embed_footer_url:
          type: string
          description: URL for the footer image.
          nullable: true
          example: https://www.poltio.com
        skip_start:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to skip the cover sequence and start from the forst question, you can set this as 1
          default: 0
        skip_result:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to skip the result sequence and finish at the last question you can set this as 1
          default: 0
        hide_results:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to hide the vote percentage numbers after voting.
          default: 0
        hide_counter:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to hide the vote numbers after/before voting.
          default: 0
        display_repeat:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to display a play again button on the result screen.
          default: 0
        is_searchable:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to find the result based on search or filtering you need to mark the content as searchable.
          default: 0
        is_calculator:
          type: integer
          enum:
            - 0
            - 1
          description: Defines the content as a calculator content that can use formulas.
          default: 0
          nullable: true
        search_results_per_page:
          type: integer
          description: Defines the result count for the content for the contents that support multi results.
          default: 5
          nullable: true
        result_loading:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to display a loading screen between the last question and result, you can turn this on.
          default: 0
        loading_next_question_label:
          type: string
          nullable: true
          description: Use to customize the loading label between questions.
        loading_result_label:
          type: string
          nullable: true
          description: Use to customize the loading label between the last question and result
        boost_results_min_view:
          type: integer
          description: For searchable contents if you want to boost results until they reach certain view you can set this field with the desired view number. Setting it to 0 will disable boosting results.
          default: 100
        boost_results_ratio:
          type: integer
          description: For searchable contents if you want to boost results you can set a ratio of how many results will be normal and how many of them will be boosted. For example you can set this field to 40 to display 40% of the boosted results. If you have set per page field to 5, 2 of the results will be boosted.
          default: 40
          minimum: 0
          maximum: 100
        attributes:
          $ref: '#/components/schemas/BaseContentAttributes'
    BaseContentAttributes:
      type: object
      properties:
        cal_formula:
          type: string
          nullable: true
          description: The string represantation for the formula to find the result if the content type is calculator content
        gives_feedback:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to mark the answers as correct or wrong and display a feedback based on users answers.
          default: 0
          nullable: true
        show_timer:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to display a timer for the sesssion duration.
          nullable: true
          default: 0
        display_results:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to display the correct answer count for the session at the result screen
          default: 1
          nullable: true
        pool_question_count:
          type: integer
          default: 0
          description: If you want to display a certain number of questions randomly for every session out of all added questions.
          nullable: true
        time_limit:
          type: integer
          description: If you want to add a time limit to the session, you can set this value
          nullable: true
        recom_title:
          type: string
          description: Recommendation title customization
          example: Our Recommendations
          nullable: true
        noindex:
          type: integer
          enum:
            - 0
            - 1
          description: If you want to hide content from search engines, you can turn this on
          default: 0
          nullable: true
        canonical:
          type: string
          description: If this field is set, widget page will include a canonical rel tag
          example: https://www.poltio.com
          nullable: true
        redirect:
          type: string
          description: If this field is set, widget should redirect the request
          example: https://www.poltio.com
          nullable: true
        keywords:
          type: string
          description: If this field is set widget should include meta keywords
          nullable: true
    VoterInput:
      type: object
      properties:
        voter_id:
          type: integer
          description: Unique internal ID for the Poltio Voter
          example: 77148828
        session_id:
          type: string
          description: Unique User Id in uuid format for the session
          example: 343a656b-c91a-45f7-a692-153a526e394d
        answer:
          type: string
          description: Free input that the voter gave.
          nullable: true
          example: Hello World
        ip:
          type: string
          description: IP address for the vote.
          example: 8.8.8.8
        parent:
          type: string
          nullable: true
          description: Parent page URL for the vote. Can be the widget url or the page that the widget is embedded to.
          example: https://www.poltio.com/e/set/42
        created_at:
          type: string
          description: Vote date.
          example: "2022-02-15T09:49:32.000000Z"
    Dashboard:
      type: object
      required:
        - content
        - profile
        - counters
        - metrics
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Content'
        profile:
          $ref: '#/components/schemas/User'
        counters:
          type: object
          properties:
            content:
              type: integer
            vote:
              type: integer
            compRate:
              type: integer
    AccountSummaryResponse:
      type: array
      items:
        $ref: '#/components/schemas/AccountSummary'
    AccountSummary:
      type: object
      properties:
        content_id:
          type: integer
        content_type:
          type: string
        vote_count:
          type: integer
        voter_count:
          type: integer
        start_count:
          type: integer
        finish_count:
          type: integer
        content:
          $ref: '#/components/schemas/ContentSummary'
    ContentSummary:
      type: object
      properties:
        public_id:
          type: string
        title:
          type: string
        created_at:
          type: string
          format: date-time
        is_ended:
          type: integer
          enum:
            - 0
            - 1
    VoteSource:
      type: object
      required:
        - vote_count
        - source
      properties:
        vote_count:
          type: integer
          example: 1
        source:
          type: string
          example: https://www.poltio.com/e/set/42
    SessionUrl:
      type: object
      required:
        - session_count
        - url
      properties:
        session_count:
          type: integer
          description: Total number of sessions happened from this url.
          example: 1
        url:
          type: string
          example: https://www.poltio.com/e/set/42
          description: The url for the session. If embedded and our SDK is active, this will give you the exact page, otherwise widget page url
    QuestionWithCondition:
      type: object
      required:
        - question
        - condition
      properties:
        question:
          $ref: '#/components/schemas/Question'
        condition:
          type: array
          description: Contains question and answer used as conditions, or null if the question has no condition.
          nullable: true
          items:
            type: object
            properties:
              question:
                $ref: '#/components/schemas/Question'
              answer:
                $ref: '#/components/schemas/Answer'
    ConversionSetting:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for this url.
        url:
          type: string
          description: Url for the checkout success page your site uses
        catch_all:
          type: boolean
          default: true
          description: Indiciates if all conversion numbers should be reported
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ContentMetric:
      type: object
      properties:
        metric:
          type: string
          example: start
        month:
          type: integer
          example: 9
        year:
          type: integer
          example: 2022
        value:
          type: integer
          example: 1
        week:
          type: integer
          example: 51
        day:
          type: string
          example: "2022-09-03"
    MonthMetric:
      type: object
      properties:
        metric:
          type: string
          example: vote
        month:
          type: integer
          example: 1
        year:
          type: integer
          example: 2023
        value:
          type: integer
          example: 11
    DayMetric:
      type: object
      properties:
        metric:
          type: string
          example: vote
        day:
          type: string
          example: 1
        value:
          type: integer
          example: 11
    WeekMetric:
      type: object
      properties:
        metric:
          type: string
          example: vote
        week:
          type: integer
          example: 1
        year:
          type: integer
          example: 2023
        value:
          type: integer
          example: 11
    YearMetric:
      type: object
      properties:
        metric:
          type: string
          example: vote
        year:
          type: integer
          example: 2023
        value:
          type: integer
          example: 11
    SheetHook:
      type: object
      properties:
        id:
          type: integer
          description: Hook id
        name:
          type: string
          description: Hook name
        sheet_id:
          type: string
          description: Google Sheet ID for the target sheet file.
        content_type:
          type: string
          description: The type of the target content.
        content_id:
          type: integer
          description: The id for the target content
        public_id:
          type: string
          description: The public id for the content
        is_active:
          type: integer
          description: Wheter or not the hook is active atm.
        health:
          type: string
          nullable: true
    SheetHookLog:
      type: object
      properties:
        id:
          type: integer
        created_at:
          type: string
          format: datetime
        health:
          type: string
        logs:
          type: string
    Webhook:
      type: object
      properties:
        id:
          type: integer
          description: Hook id
        name:
          type: string
          description: Hook name
        url:
          type: string
          description: Url for the webhook.
        content_type:
          type: string
          description: The type of the target content.
        content_id:
          type: integer
          description: The id for the target content
        public_id:
          type: string
          description: The public id for the content
        is_active:
          type: boolean
          description: Wheter or not the hook is active atm.
        health:
          type: string
          nullable: true
        delay:
          type: integer
        send_leads:
          type: boolean
        send_answers:
          type: boolean
        incomplete_delay:
          type: integer
        incomplete_send:
          type: boolean
        account_wide:
          type: boolean
          description: Indicates if the webhook is for all the contents in that account
          default: false
        use_oauth:
          type: boolean
          description: Indicates if the webhook should have auth tokens
        oauth_login_endpoint:
          type: string
          description: Required with use_oauth, the oauth login endpoint
          nullable: true
        oauth_request_body:
          type: object
          description: Any number of additional data in json format to use while doing the oauth token request
          nullable: true
        oauth_request_headers:
          type: object
          description: Any number of additional headers in json format to use while doing the oauth token request
          nullable: true
    WebhookLog:
      type: object
      properties:
        id:
          type: integer
        webhook_id:
          type: integer
        created_at:
          type: string
          format: datetime
        updated_at:
          type: string
          format: datetime
        payload:
          type: string
        http_response:
          type: string
        publisher_id:
          type: string
        user_id:
          type: integer
        health:
          type: string
          enum:
            - grey
            - red
            - green
        http_response_code:
          type: integer
        is_complete:
          type: boolean
    ReportRequest:
      type: object
      properties:
        id:
          type: integer
        created_at:
          type: string
          format: datetime
        report_file:
          type: string
          nullable: true
        updated_at:
          type: string
          format: datetime
        status:
          type: string
        runtime:
          type: integer
    IncompleteSubscription:
      type: object
      properties:
        subscription_id:
          type: string
        client_secret:
          type: string
        total:
          type: integer
    Tier:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: Starter
        price:
          type: string
          example: "0.00"
        price_annual:
          type: string
          example: "0.99"
        engagements_per_month:
          type: integer
          example: 100
        extra_engagement_unit_price:
          type: string
          example: "10.00"
        can_subscribe:
          type: integer
          enum:
            - 1
            - 0
        features:
          type: array
          items:
            $ref: '#/components/schemas/TierFeature'
    TierFeature:
      type: object
      properties:
        feature:
          type: string
          example: Embedding
    Lead:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the Lead
          example: 1
        name:
          type: string
          description: Lead name for humans to identify.
          example: Example Lead
        fields:
          type: string
          description: If you want to gather user input with this lead this is a comma seperated list of input fields.
          example: gsm,email
        image:
          type: string
          nullable: true
          description: IF not null, you should display this image.
          example: path/file.ext
        is_active:
          type: integer
          example: 1
        msg:
          type: string
          description: A message to display to the user when the lead is shown.
          example: Give me your data
        type:
          type: string
          enum:
            - redirect
            - video
            - image
            - input
            - none
          description: The outer shape and the main reason for the lead.
          example: input
        button_value:
          type: string
          description: If not null you should display a button with this value
          nullable: true
          example: Click Me
        redirect_url:
          type: string
          nullable: true
          description: The target for the button.
          example: https://www.poltio.com
        only_image:
          type: string
          default: 0
          example: 0
        youtube_id:
          type: string
          example: dQw4w9WgXcQ
          nullable: true
        terms_conditions:
          type: string
          nullable: true
          description: If not null you should display a checkbox with these text
        terms_conditions2:
          type: string
          nullable: true
          description: If not null you should display a checkbox with these text
        tc_optional:
          type: integer
          enum:
            - 0
            - 1
          description: Defines if the lead can submitted w/out checking terms and conditions
          default: 1
        tc2_optional:
          type: integer
          enum:
            - 0
            - 1
          description: Defines if the lead can submitted w/out checking terms and conditions 2
          default: 1
        input_counter:
          type: integer
          example: 0
        stop_set:
          type: boolean
          example: false
          description: Indicates if the set should be stop if this lead is displayed.
        mandatory:
          type: boolean
          example: true
          description: Indicates this lead window is not dissmissable and should be completed before continuing the session
        has_codes:
          type: boolean
          example: true
          description: Indicates if this lead has coupon codes to give.
        title:
          type: string
          example: Hello World
          description: A title string for the lead window.
        auto_open:
          type: integer
          enum:
            - 0
            - 1
          example: 0
          description: Indicates if the lead should redirect to the url automatically.
        auto_open_delay:
          type: integer
          example: 2500
          description: Delay for automatically redirect in ms.
        link_target:
          type: string
          enum:
            - self
            - parent
            - blank
          description: Link open target.
        redirect_count:
          type: integer
        lead_count:
          type: integer
        open_minimized:
          type: integer
          enum:
            - 0
            - 1
          example: 0
          description: Indicates if the lead should open in minimized state by default.
        delay:
          type: integer
          example: 2000
          description: Delay in miliseconds for loading the lead in the card.
        tc_short:
          type: string
          description: 'Short text for the terms and conditions line that is used to open the long version. '
          nullable: true
          example: I consent to this form
        tc2_short:
          type: string
          description: 'Short text for the terms and conditions line that is used to open the long version. '
          nullable: true
          example: I consent to this form
        tc_approve_button_label:
          type: string
          description: If you want to customize the button label of the I accept section
          nullable: true
          example: I accept
        tc_reject_button_label:
          type: string
          description: If you want to customize the button label of the I reject section
          nullable: true
          example: I reject
        tc2_approve_button_label:
          type: string
          description: If you want to customize the button label of the I accept section
          nullable: true
          example: I accept
        tc2_reject_button_label:
          type: string
          description: If you want to customize the button label of the I reject section
          nullable: true
          example: I reject
        custom_labels:
          type: object
          description: If you want to customize the input field labels for any of the input type, you can set custom labels via this field.
          nullable: true
          properties:
            email:
              type: string
              example: email
            gsm:
              type: string
              example: gsm
            name:
              type: string
              example: name
            comment:
              type: string
              example: comment
    LeadCode:
      type: object
      properties:
        id:
          type: integer
        code:
          type: string
        is_used:
          type: integer
          enum:
            - 0
            - 1
          default: 0
        single_use:
          type: integer
          enum:
            - 0
            - 1
          default: 0
    LeadLog:
      type: object
      properties:
        user_id:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    LeadInput:
      type: object
      properties:
        user_id:
          type: integer
        phone:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        comment:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        tc_checked:
          type: integer
          enum:
            - 0
            - 1
        content_id:
          type: integer
        content_type:
          type: string
          enum:
            - set
            - quiz
            - test
            - poll
            - content
        play_time:
          type: integer
          nullable: true
        quiz_ra:
          type: integer
          nullable: true
        files:
          type: string
          nullable: true
    DataSource:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the DataSource
          example: 1
        name:
          type: string
          description: A recognizeable string for identifying the source
          example: TV Products XML
        source:
          type: string
          description: Fully qualified url for the source
          example: https://developers.google.com/product-review-feeds/sample
        source_file:
          type: string
          format: binary
          description: Required when the type is CSV. Your CSV file.
        type:
          type: string
          enum:
            - xml
            - json
            - csv
          description: Type of your feed
          example: xml
        status:
          type: string
          enum:
            - draft
            - review
            - removed
            - rejected
            - pending
            - processing
            - failed
            - synced
          description: Status for your source
          example: draft
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        data_source_notes:
          type: array
          items:
            $ref: '#/components/schemas/DataSourceNote'
    DataSourceNote:
      type: object
      properties:
        note:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        user:
          $ref: '#/components/schemas/User'
    DataSourceFormatAnalysis:
      type: object
      properties:
        format:
          type: string
          enum:
            - xml
            - json
            - csv
          example: json
        items_path:
          type: string
          nullable: true
          example: products
        total_items:
          type: integer
          description: Total count of items/records in the data source feed file
          example: 15420
        fields_count:
          type: integer
          description: Total number of candidate fields discovered
          example: 12
        fields:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                example: title
              element:
                type: string
                example: title
              slug:
                type: string
                example: title
              type:
                type: string
                example: name
              namespace:
                type: string
                nullable: true
                example: g
              is_array:
                type: boolean
                example: false
              label:
                type: string
                example: title
              samples:
                type: array
                description: Up to 25 sample values for this field
                items:
                  type: string
                example:
                  - Shirt A
                  - Pants B
                  - Hat C
              is_suggested:
                type: boolean
                example: true
              suggested_target:
                type: string
                nullable: true
                example: name
        sample_items:
          type: array
          description: First 25 complete raw item records for UI step 2 preview
          items:
            type: object
        suggested_mappings:
          type: object
          description: Suggested target element mappings based on heuristic analysis and dictionary history
          properties:
            id:
              type: string
              nullable: true
              example: id
            name:
              type: string
              nullable: true
              example: title
            image:
              type: string
              nullable: true
              example: image_url
            url:
              type: string
              nullable: true
              example: product_url
            price:
              type: string
              nullable: true
              example: price
            sale_price:
              type: string
              nullable: true
              example: discount_price
    DataSourceContent:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: My DSC Connection
        data_source_id:
          type: integer
          example: 1
        content_id:
          type: integer
          nullable: true
          example: 456
        result_button_text:
          type: string
          nullable: true
          example: Buy Now
        result_url:
          type: string
          nullable: true
          example: https://myshop.com/products/{item.sku}
        result_title:
          type: string
          nullable: true
          example: '{item.name}'
        result_desc:
          type: string
          nullable: true
          example: '{item.description}'
        filter_desc:
          type: string
          nullable: true
        price_text:
          type: string
          nullable: true
        old_price_text:
          type: string
          nullable: true
        price_format:
          type: boolean
        old_price_text_strike:
          type: boolean
        display_price_discount_percent:
          type: boolean
        search_replace_options:
          type: object
          nullable: true
        alt:
          type: string
          nullable: true
        pixel_code_id:
          type: integer
          nullable: true
        click_pixel_code_id:
          type: integer
          nullable: true
        secondary_click_pixel_code_id:
          type: integer
          nullable: true
        lead_id:
          type: integer
          nullable: true
        secondary_result_url:
          type: string
          nullable: true
        secondary_result_button_text:
          type: string
          nullable: true
        per_page:
          type: integer
        default_filters:
          type: string
          nullable: true
        include_fields:
          type: string
          nullable: true
        score_filters:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - draft
            - processing
            - live
            - failed
          example: draft
        organization_id:
          type: integer
          example: 1
        user_id:
          type: integer
          example: 2
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    DataSourceContentField:
      type: object
      properties:
        id:
          type: integer
          example: 1
        data_source_content_id:
          type: integer
          example: 1
        name:
          type: string
          nullable: true
          example: price
        data_source_item_element_id:
          type: integer
          nullable: true
          example: 12
        type:
          type: string
          enum:
            - primary
            - secondary
            - filter_string
            - filter_string_multi
            - filter_numeric
          example: primary
        normalize:
          type: boolean
        optional:
          type: boolean
        index:
          type: boolean
        use_as_source_id:
          type: boolean
        is_sortable:
          type: boolean
        label:
          type: string
          nullable: true
          example: Price Filter
    DataSourceItemNamespace:
      type: object
      properties:
        id:
          type: integer
          example: 6
        data_source_id:
          type: integer
          example: 45
        namespace:
          type: string
          example: g
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    DataSourceItemElement:
      type: object
      properties:
        id:
          type: integer
          example: 433
        data_source_id:
          type: integer
          example: 45
        data_source_item_namespace_id:
          type: integer
          nullable: true
          example: 6
        element:
          type: string
          example: id
        slug:
          type: string
          example: id
        type:
          type: string
          example: id
        is_array:
          type: boolean
          example: false
        array_first_level:
          type: string
          nullable: true
        array_first_path:
          type: string
          nullable: true
        array_first_key:
          type: string
          nullable: true
        data_source_item_namespace:
          $ref: '#/components/schemas/DataSourceItemNamespace'
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    DataSourceItemElementRequest:
      type: object
      required:
        - element
        - type
      properties:
        element:
          type: string
          example: id
        slug:
          type: string
          nullable: true
          example: id
        type:
          type: string
          example: id
        namespace:
          type: string
          nullable: true
          example: g
        is_array:
          type: boolean
          example: false
        array_first_level:
          type: string
          nullable: true
        array_first_path:
          type: string
          nullable: true
        array_first_key:
          type: string
          nullable: true
    PixelCode:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: Unique identifier for the pixel code
        name:
          type: string
          example: AnswerPixelCode With Dyn Params
          description: Human readable name for the pixel code.
        code:
          type: string
          description: A html code snippet containing iframes, image tags or script tags
        created_at:
          type: string
          format: date-time
          example: "2022-12-20T09:03:56.000000Z"
        updated_at:
          type: string
          format: date-time
          example: "2022-12-20T09:03:56.000000Z"
        is_in_use:
          type: integer
          enum:
            - 1
            - 0
          example: 1
          description: Indicites if the pixel code is in use
        counter:
          type: integer
          example: 100
          description: Fire counter
    OauthClient:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the client
          example: 1
        name:
          type: string
          description: Name for the client
          example: My Cool Backend
    OauthToken:
      type: object
      properties:
        id:
          type: integer
          description: Unique Identifier in INT format for path requests.
          example: 111
        user_id:
          type: integer
          description: User relationship id
          example: 1
        token:
          type: string
          example: XXXXXXXXXXXX
          description: Token identifier string. (Not the full token.)
        type:
          type: string
          example: member
          description: 'internal type for the token. '
        expires_at:
          type: string
          format: date-time
          description: Token expiration date
          example: "2023-02-16T09:18:53.000000Z"
        client:
          $ref: '#/components/schemas/OauthClient'
    DynamicWidget:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the widget id
        is_default:
          type: boolean
          description: Sets if the widget is used in all urls if there is not a more specific match
        is_active:
          type: boolean
          description: Sets if the widget is currently active.
        name:
          type: string
          description: Widget name for you to remember
        public_id:
          type: string
          description: The public id for the content
        starts_at:
          type: string
          format: datetime
          description: indicates if the trigger has a start date
          nullable: true
          example: "2028-05-15T21:00:00.000000Z"
        ends_at:
          type: string
          format: datetime
          description: indicates if the trigger has a end date
          nullable: true
          example: "2028-05-15T21:00:00.000000Z"
        overlay_options:
          type: object
          description: Overlay Widget options when set. can be null
          nullable: true
          properties:
            floating-desc:
              type: string
            floating-title:
              type: string
            widget-bgcolor:
              type: string
            floating-zindex:
              type: string
            floating-bgcolor:
              type: string
            floating-position:
              type: string
            floating-textcolor:
              type: string
            floating-buttontext:
              type: string
            floating-icon-color:
              type: string
            floating-font-family:
              type: string
            floating-hide-button:
              type: string
            floating-initial-position:
              type: string
            floating-scroll-threshold:
              type: string
            floating-widget-icon-color:
              type: string
        urls:
          description: A list of urls that this widget appears on
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                example: https://www.poltio.com/blog
        content:
          description: A summary for the attached content
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            title:
              type: string
            public_id:
              type: string
    Domain:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the domain id
        domain:
          type: string
          description: Domain/Hostname that is unique.  Can be a root domain or a subdomain. Can not contain paths.
        is_default:
          type: boolean
          description: Indicates if the domain is the default for account
        is_verified:
          type: boolean
          description: Indicates if the domain has passed the verification checks.
        is_active:
          type: boolean
          description: Indicates if the domain is live. You can set this field to false to temporarly disable a domain.
        verification_record:
          type: string
          nullable: true
          description: The CNAME record for the verification challange
        status:
          type: string
          description: Indicates the domain status
          enum:
            - pending
            - auth
            - auth_failed
            - live
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    FacetCounts:
      type: object
      properties:
        counts:
          type: array
          items:
            type: object
            properties:
              count:
                type: integer
              highlighted:
                type: string
              value:
                type: string
              parent:
                type: object
        field_name:
          type: string
        stats:
          type: object
          properties:
            max:
              type: number
              format: double
            min:
              type: number
              format: double
            sum:
              type: number
              format: double
            total_values:
              type: integer
            avg:
              type: number
              format: double
    SearchResult:
      type: object
      properties:
        facet_counts:
          type: array
          items:
            $ref: '#/components/schemas/FacetCounts'
        found:
          type: integer
          description: The number of documents found
        search_time_ms:
          type: integer
          description: The number of milliseconds the search took
        out_of:
          type: integer
          description: The total number of documents in the collection
        search_cutoff:
          type: boolean
          description: Whether the search was cut off
        page:
          type: integer
          description: The search result page number
        grouped_hits:
          type: array
          items:
            $ref: '#/components/schemas/SearchGroupedHit'
        hits:
          type: array
          description: The documents that matched the search query
          items:
            $ref: '#/components/schemas/SearchResultHit'
        request_params:
          type: object
          required:
            - collection_name
            - q
            - per_page
          properties:
            collection_name:
              type: string
            q:
              type: string
            per_page:
              type: integer
    SearchGroupedHit:
      type: object
      required:
        - group_key
        - hits
      properties:
        found:
          type: integer
        group_key:
          type: array
          items: {}
        hits:
          type: array
          description: The documents that matched the search query
          items:
            $ref: '#/components/schemas/SearchResultHit'
    SearchResultHit:
      type: object
      properties:
        highlights:
          type: array
          description: (Deprecated) Contains highlighted portions of the search fields
          items:
            $ref: '#/components/schemas/SearchHighlight'
        highlight:
          type: object
          description: Highlighted version of the matching document
          additionalProperties: true
        document:
          type: object
          description: Can be any key-value pair
          additionalProperties:
            type: object
        text_match:
          type: integer
          format: int64
        geo_distance_meters:
          type: object
          description: Can be any key-value pair
          additionalProperties:
            type: integer
        vector_distance:
          type: number
          format: float
          description: Distance between the query vector and matching document's vector value
      example:
        highlights:
          company_name:
            field: company_name
            snippet: <mark>Stark</mark> Industries
        document:
          id: "124"
          company_name: Stark Industries
          num_employees: 5215
          country: USA
        text_match: 1234556
    SearchHighlight:
      type: object
      properties:
        field:
          type: string
          example: company_name
        snippet:
          type: string
          description: Present only for (non-array) string fields
          example: <mark>Stark</mark> Industries
        snippets:
          type: array
          description: Present only for (array) string[] fields
          example:
            - <mark>Stark</mark> Industries
            - <mark>Stark</mark> Corp
          items:
            type: string
        value:
          type: string
          description: Full field value with highlighting, present only for (non-array) string fields
          example: <mark>Stark</mark> Industries is a major supplier of space equipment.
        values:
          type: array
          description: Full field value with highlighting, present only for (array) string[] fields
          example:
            - <mark>Stark</mark> Industries
            - <mark>Stark</mark> Corp
          items:
            type: string
        indices:
          type: array
          description: The indices property will be present only for string[] fields and will contain the corresponding indices of the snippets in the search field
          example: 1
          items:
            type: integer
        matched_tokens:
          type: array
          items:
            type: object
            x-go-type: interface{}
    TriggerDemo:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for this td.
        url:
          type: string
          description: Url for the checkout success page your site uses
        desktop_image:
          type: string
          nullable: true
          description: Fully qualified url for the desktop version of the page
        mobile_image:
          type: string
          nullable: true
          description: Fully qualified url for the mobile version of the page
    ConversionTimeStats:
      type: object
      properties:
        time_bucket:
          type: string
          description: Name of the time slot bucket
          example: 15-30 minutes
        conv_number:
          type: integer
          description: Total number of recommended conversions happened during this time bucket
          example: 12
    ShortLink:
      type: object
      properties:
        link:
          type: string
          description: short link
    Login:
      type: object
      properties:
        token:
          type: string
          description: Bearer token for authonticating the requests
        user:
          $ref: '#/components/schemas/User'
    LoginFirstStepTwoFactor:
      type: object
      properties:
        two_factor_enabled:
          type: boolean
          description: When login response contains this field, it means the account has 2fa enabled and first step, verification of email and password passed. The login flow should display TOTP field and call the second step of the login flow
          example: true
        temp_token:
          type: string
          description: This is a temporary short lived token, lasts for 5 minutes to save the passed credentials in the cache for the 2fa
    OrganizationWithRole:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: Poltio
        pivot:
          type: object
          properties:
            role:
              type: string
              example: owner
    Organization:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: Poltio
        domains:
          description: custom domains defined for this account
          type: array
          items:
            $ref: '#/components/schemas/CustomDomain'
        account_domains:
          description: account domains allowed to use to target snippet and triggers
          type: array
          items:
            $ref: '#/components/schemas/AccountDomain'
    OrganizationInvite:
      type: object
      properties:
        email:
          type: string
          example: acme@poltio.com
        role:
          type: string
          example: admin
        created_at:
          type: string
          format: date-time
          example: "2026-04-24T08:50:15.000000Z"
    IpRule:
      type: object
      properties:
        id:
          type: integer
          example: 1
        organization_id:
          type: integer
          example: 12
        name:
          type: string
          nullable: true
          example: Office Network & VPN
        allowed:
          type: array
          nullable: true
          items:
            type: string
        blocked:
          type: array
          nullable: true
          items:
            type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          ### end of schemas
  requestBodies:
    ## Platform Request Bodies
    BaseContent:
      description: Used in creating or editing the base content
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PlayOnce'
              - $ref: '#/components/schemas/BaseContent'
    Theme:
      description: Update theme
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Theme'
    CalculatorTest:
      description: Calculator Test
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CalculatorTest'
    Question:
      description: Used in creating or editing the questions for the content
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              answer_type:
                type: string
                enum:
                  - media
                  - text
                  - score
                  - star_rating
                  - yesno
                  - free_text
                  - free_number
                  - autocomplete
                  - wheel
                  - mystery-box
                  - scratch-card
                  - slider
                description: Answer type for the question
              title:
                type: string
                description: Question title.
                example: What is your favourite color?
              name:
                type: string
                description: Question name, only for internal use.
                example: 'A question to use for color '
              background:
                type: string
                description: The image for the question
                nullable: true
                example: path/image.ext
              vertical_image:
                type: string
                description: The image for the question for the wide screen layout
                nullable: true
                example: path/image.ext
              alt:
                type: string
                nullable: true
                description: Alt tag content for the background image.
                example: A washed blue jean
              allow_multiple_answers:
                type: integer
                enum:
                  - 0
                  - 1
                default: 0
                description: If you want your users to be able to vote more than one answer in this question you can set this as 1
                nullable: true
              max_multi_punch_answer:
                type: integer
                default: 0
                description: How many answers you like to be voted in one session.
                nullable: true
              recommended_popular_answer:
                type: integer
                description: How many answers do you want to display on auto complete type answers
                default: 0
                nullable: true
              rotate_answers:
                type: integer
                enum:
                  - 0
                  - 1
                description: If you want to change the answer order for this question randomly for every user
                default: 0
                nullable: true
              luv:
                type: string
                description: lead url variable for the question.
                nullable: true
              is_searchable:
                type: integer
                enum:
                  - 0
                  - 1
                description: If you set this as 1 you can use votes to this question to query or filter the search results
                default: 0
              is_skippable:
                type: integer
                enum:
                  - 0
                  - 1
                description: If you set this as 1 you can skip this question w/out voting for it.
                default: 0
              cal_val_default:
                type: string
                nullable: true
                description: The default value for calculator contents for this question if the answer doesn't have any specific value.
              autocomplete_help:
                type: string
                nullable: true
                description: Autocomplete help text if you want to customize it.
              autocomplete_placeholder:
                type: string
                nullable: true
                description: Autocomplete field placeholder text if you want to customize it.
              position:
                type: integer
                nullable: true
                description: Numeric value for the Question position in the content
              conditions:
                type: string
                nullable: true
                description: Comma seperated list of Answer IDs to use as display conditions
                example: 1,2,3
              condition_reverse:
                type: integer
                enum:
                  - 0
                  - 1
                default: 0
                description: Indicates if the conditions should be positive or negative.
              options:
                $ref: '#/components/schemas/QuestionOptions'
    Answer:
      description: Used in creating or editing the answers for the question
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              title:
                type: string
                nullable: true
                description: Title for the answer
                example: Blue
              background:
                type: string
                nullable: true
                description: Uploaded image file path if you want to use an image as your answer
                example: path/file.ext
              alt:
                type: string
                nullable: true
                description: Alt tag content for the background image.
              luv:
                type: string
                nullable: true
                description: Lead url variable for the answer.
                example: '&color=blue'
              has_right_answer:
                type: integer
                enum:
                  - 0
                  - 1
                description: If you want to give feedback based on users choice as wrong or right, you can mark this field as 1
                default: 0
              is_right_answer:
                type: integer
                enum:
                  - 0
                  - 1
                description: if you want to mark this answer as the right answer, you can mark it. only one answer in a question can be marked as right
                default: 0
              is_mutually_exclusive:
                type: integer
                enum:
                  - 0
                  - 1
                description: defines if the answer is mutually exclusive, meaning in a mp question, if this answer is selected, all other selected answers must be disregarded
              search_query:
                type: string
                nullable: true
                description: If you want to query a search index with this answer, you can use this field.
                example: color blue
              search_filter:
                type: string
                nullable: true
                description: If you want to filter a search index with the answer you can use this field.
                example: 'color: [blue]'
              position:
                type: integer
                nullable: true
                description: Numeric value for the Answer position in the question
              max_vote:
                type: integer
                nullable: true
                description: If set, once the answer reaches this vote count, it will be disabled
              addon:
                type: string
                nullable: true
                description: Additional information thats gets shared with GTM and PixelCodes after user selects answer
              disabled_msg:
                type: string
                nullable: true
                description: If you want to customize the disabled state message for the answer
    MultiAnswer:
      description: Single text field with multiple answers, each answer should be on their own line
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              answers:
                type: string
                description: answers each unique answer in single line.
                example: |-
                  answer1
                  answer2
                  answer3
              remove_existing:
                type: boolean
                description: If true or 1, removes existing answers in the question before adding new ones.
                example: true
                enum:
                  - true
                  - false
    Result:
      description: Used in creating or editing the results for the content
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              title:
                type: string
                description: Title for the result
                example: Thank You
              background:
                type: string
                description: Uploaded image for the result main image
                example: path/file.ext
                nullable: true
              alt:
                type: string
                nullable: true
                description: Alt tag content for the background image.
              desc:
                type: string
                description: Description for the result
                example: Thank you for playing this content
              luv:
                type: string
                nullable: true
                description: Lead url variable for the result.
                example: '&result=thanks'
              url:
                type: string
                nullable: true
                description: Result url if you want to add a url redirect for the result screen, supports in-app urls.
                example: https://www.poltio.com
              url_text:
                type: string
                nullable: true
                description: If you want to customize the url button text
                example: Click here for the best website
              search:
                type: string
                nullable: true
                description: Main search terms if you are creating a searchable content
                example: big green strong
              search2:
                type: string
                nullable: true
                description: Secondary search terms if you are creating a searchable content
                example: elastic durable
              min_c:
                type: integer
                nullable: true
                description: If you are creating a calculation based content or the result depends on the right answer count you can use this field to determine minimum number of answers
                example: 0
              max_c:
                type: integer
                nullable: true
                description: Max number of answers
                example: 5
              is_default:
                type: integer
                example: 0
                enum:
                  - 0
                  - 1
                description: Defines if the result can be a catchall default result
    AttachLead:
      description: Update or add a lead to an object (cover, question, answer, result)
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              lead_id:
                type: integer
                description: Unique identifier for the lead object
                example: 1
    AttachPixelCode:
      description: Update or add a lead to an object (cover, question, answer, result)
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              pixel_code_id:
                type: integer
                description: Unique identifier for the pixel code object
                example: 1
    AddCondition:
      description: Adds a single answer to the existing conditions of the question
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              answer_id:
                type: integer
                description: Unique poltio identifier for the answer
                example: 1
              condition_reverse:
                type: boolean
                description: Indicates if the condition is reverse.
                default: false
                nullable: true
    RemoveCondition:
      description: Removes a single answer to the existing conditions of the question
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              answer_id:
                type: integer
                description: Unique poltio identifier for the answer
                example: 1
    AnswerResultPoint:
      description: Update point for Answer - Result relation.
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              content_result_id:
                type: integer
                description: Unique identifier for the result object
                example: 1
              point:
                type: integer
                description: A point to indicate relationship between result and answer
                minimum: 0
                maximum: 9
    Login:
      description: Login with user information
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                example: hello@example.com
              password:
                type: string
                description: A strong password minimum of 8 or more chars.
                example: Str0ng!Pa55W0rsds142!@@
              client_id:
                type: integer
                description: OAuth client ID for the Poltio API Client.
                example: 1
              client_secret:
                type: string
                description: Oauth client secret for the poltio api client.
                example: exampleSecret
    LoginTFAVerify:
      description: Complete 2fa login with temporary token
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              temp_token:
                type: string
                description: The temporary login token you received after login call
                example: abcd
              verification:
                type: string
                description: One time password (TOTP) from Google Authenticator compatible app
                example: "123456"
              client_id:
                type: integer
                description: OAuth client ID for the Poltio API Client.
                example: 1
              client_secret:
                type: string
                description: Oauth client secret for the poltio api client.
                example: exampleSecret
    LoginWithEmail:
      description: Login with user information
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                example: hello@example.com
              client_id:
                type: integer
                description: OAuth client ID for the Poltio API Client.
                example: 1
              client_secret:
                type: string
                description: Oauth client secret for the poltio api client.
                example: exampleSecret
    LoginWithEmailToken:
      description: Login with user information
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              token:
                type: string
                description: Your one time use login token.
                example: Str0ng!Pa55W0rsds142!@@
              client_id:
                type: integer
                description: OAuth client ID for the Poltio API Client.
                example: 1
              client_secret:
                type: string
                description: Oauth client secret for the poltio api client.
                example: exampleSecret
    Register:
      description: Register with user information
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                example: hello@example.com
              password:
                type: string
                description: A strong password minimum of 8 or more chars.
                example: Str0ng!Pa55W0rsds142!@@
              client_id:
                type: integer
                description: OAuth client ID for the Poltio API Client.
                example: 1
              client_secret:
                type: string
                description: Oauth client secret for the poltio api client.
                example: exampleSecret
              first_name:
                type: string
                example: John
              last_name:
                type: string
                example: Doe
              accepted:
                type: integer
                example: 1
              password_confirmation:
                type: string
                description: Password confirmation field.
                example: Str0ng!Pa55W0rsds142!@@
    PasswordForget:
      description: Request an email with a password reset token.
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                example: hello@example.com
              client_id:
                type: integer
                description: OAuth client ID for the Poltio API Client.
                example: 1
              client_secret:
                type: string
                description: Oauth client secret for the poltio api client.
                example: exampleSecret
    PasswordReset:
      description: Reset a password with a password reset token
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              password:
                type: string
                description: A strong password minimum of 8 or more chars.
                example: Str0ng!Pa55W0rsds142!@@
              client_id:
                type: integer
                description: OAuth client ID for the Poltio API Client.
                example: 1
              client_secret:
                type: string
                description: Oauth client secret for the poltio api client.
                example: exampleSecret
              token:
                description: Password reset token
                type: string
                example: longTokenfor password reset
              password_confirmation:
                type: string
                description: Password confirmation field.
                example: Str0ng!Pa55W0rsds142!@@
    QuestionPositions:
      description: Update positions for the questions in a content
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              questions:
                type: array
                items:
                  $ref: '#/components/schemas/QuestionPosition'
    AnswerPositions:
      description: Update positions for the answers in a question
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              answers:
                type: array
                items:
                  $ref: '#/components/schemas/AnswerPosition'
    SheetHook:
      description: Create or Update a SheetHook
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              public_id:
                type: string
                description: PublicID for the content you want to attach the hook to.
                example: 343a656b-c91a-45f7-a692-153a526e394d
              sheet_id:
                type: string
                description: Google sheet id
                example: 1H-_CEY6Tgh7iJyREM2KZEehhuNeEUE32DJevOL6QcZY
              is_active:
                type: integer
                description: IF you want to disable the hook  you can set this to 0
                enum:
                  - 0
                  - 1
                example: 1
                default: 1
              name:
                type: string
                description: Internal name for you to identify the hook.
                example: My Awesome Hook
    Webhook:
      description: Create or Update a Webhook
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              public_id:
                type: string
                description: PublicID for the content you want to attach the hook to. Required unless the hook is account wide
                example: 343a656b-c91a-45f7-a692-153a526e394d
              url:
                type: string
                description: URL end point for the webhook
                example: https://webhook.site/a89475cc-02e5-412c-a655-578d089bfc17
              is_active:
                type: boolean
                description: IF you want to disable the hook  you can set this to false
                example: true
                default: true
              name:
                type: string
                description: Internal name for you to identify the hook.
                example: My Awesome Hook
              delay:
                type: integer
                nullable: true
                description: 'Delay in seconds for the event and triggering of webhook. Use this if you have leads in the result screen and want to give your users some time to fill in the lead details. '
                example: 30
              send_leads:
                type: boolean
                default: false
                example: true
                description: Decides if the leads should be in the webhook json
              send_answers:
                type: boolean
                default: true
                example: true
                description: Decides if the answers/votes should be in the webhook json
              incomplete_send:
                type: boolean
                default: false
                example: true
                description: Select this if you want to recieve webhooks for the sessions that are not complete
              incomplete_delay:
                type: integer
                default: 0
                example: 20
                description: This is the seconds from start of the session. If you combine this with incomplete_send you will recieve the hook after this seconds.
              account_wide:
                type: boolean
                default: false
                example: true
                description: By default you can attach a single webhook to a single content. If you want to recieve all updates from all contents, you can set this field to true without sending a public id to make this webhook account wide. You can only have 2 account wide webhook per account
              use_oauth:
                type: boolean
                description: Indicates if the webhook should have auth tokens
                example: false
              oauth_login_endpoint:
                type: string
                nullable: true
                description: Required with use_oauth and defines the token api endpoint
                example: https://api.poltio.com/platform/auth/login
              oauth_request_body:
                type: object
                description: Any number of additional data in json format to use while doing the oauth token request
                nullable: true
              oauth_request_headers:
                type: object
                description: Any number of additional headers in json format to use while doing the oauth token request
                nullable: true
    ReportRequest:
      description: Request a new report
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              public_id:
                type: string
                description: PublicID for the content you want to attach the hook to.
                example: 343a656b-c91a-45f7-a692-153a526e394d
              report:
                type: string
                description: The name of the report
                example: content-sessions
                enum:
                  - content-sessions
                  - content-voters
              base_id:
                type: integer
                description: If you request a report without a content, you must attach base id
                example: 1
    LeadRequest:
      description: Create a new lead campaign
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Lead'
    LeadCodeRequest:
      description: add lead code
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
              single_use:
                type: integer
                enum:
                  - 0
                  - 1
    MultiLeadCode:
      description: adds new codes to the lead.
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              codes:
                type: string
                description: Coupon codes seperated by line breaks
                example: |
                  Code1
                  Code2
                  Code3
              single_use:
                type: boolean
                description: Indicates if the code is single use or multiple people can use it.
                example: true
              remove_existing:
                type: boolean
                description: Indicates if the existing codes should be deleted before adding new ones
                example: true
    SubscriptionRequest:
      description: Request a new report
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              period:
                type: string
                description: Indicates either you want to create the subscription monthly or yearly
                example: month
                enum:
                  - month
                  - year
    SettingsRequest:
      description: Update your email address, username or photo
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              username:
                type: string
                description: your unique username
                example: awesome_user123
              email:
                type: string
                description: your unique email address, you need to re verifiy your email after you change it
                example: awesome_user123@example.com
              photo:
                type: string
                description: your profile photo
                example: placeholder/profile.jpg
    PasswordRequest:
      description: Update your password
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              password:
                type: string
                description: Your current password
                example: mYSup3r!Str0ngPassWorkd!!!
              new_password:
                type: string
                description: your new password
                example: mYSup3r!Str0ngPassWorkd!!!
              new_password_confirmation:
                type: string
                description: your new password again
                example: mYSup3r!Str0ngPassWorkd!!!
    DataSourceContentRequest:
      description: Create or update a DataSourceContent connection
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                description: Human readable name for the DSC
                example: TV Products Bridge
              data_source_id:
                type: integer
                description: The associated data source ID
                example: 1
              content_id:
                type: integer
                nullable: true
                description: Optional existing content ID to connect to
                example: 456
              result_button_text:
                type: string
                nullable: true
                description: Custom button text for recommended item result cards
                example: Buy Now
              result_url:
                type: string
                nullable: true
                description: Custom result URL format
                example: https://myshop.com/products/{item.sku}
              result_title:
                type: string
                nullable: true
                description: Custom result title format
                example: '{item.name}'
              result_desc:
                type: string
                nullable: true
                description: Custom result description format
                example: '{item.description}'
              filter_desc:
                type: string
                nullable: true
              price_text:
                type: string
                nullable: true
              old_price_text:
                type: string
                nullable: true
              price_format:
                type: boolean
              old_price_text_strike:
                type: boolean
              display_price_discount_percent:
                type: boolean
              search_replace_options:
                type: object
                nullable: true
              alt:
                type: string
                nullable: true
              pixel_code_id:
                type: integer
                nullable: true
              click_pixel_code_id:
                type: integer
                nullable: true
              secondary_click_pixel_code_id:
                type: integer
                nullable: true
              lead_id:
                type: integer
                nullable: true
              secondary_result_url:
                type: string
                nullable: true
              secondary_result_button_text:
                type: string
                nullable: true
              per_page:
                type: integer
                minimum: 1
                maximum: 10
              default_filters:
                type: string
                nullable: true
              include_fields:
                type: string
                nullable: true
              score_filters:
                type: string
                nullable: true
    DataSourceContentFieldRequest:
      description: Create or update a searchable field definition
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - type
            properties:
              label:
                type: string
                nullable: true
                description: Internal label
                example: Product Name
              field:
                type: string
                nullable: true
                description: Standard field name
                example: title
              element:
                type: integer
                nullable: true
                description: Dynamic item element ID
                example: 12
              type:
                type: string
                enum:
                  - primary
                  - secondary
                  - filter_string
                  - filter_string_multi
                  - filter_numeric
                example: primary
              normalize:
                type: boolean
              optional:
                type: boolean
              index:
                type: boolean
              use_as_source_id:
                type: boolean
              is_sortable:
                type: boolean
    DataSourceRequest:
      description: Submit a new data source
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                description: Human readable identifier for the source
                example: My products in XML
              source:
                type: string
                description: Fully qualified url for the feed
                example: https://developers.google.com/product-review-feeds/sample
              type:
                type: string
                description: Format for your feed.
                enum:
                  - xml
                  - json
                example: xml
              notes:
                type: string
                description: If you have any notes on how we should review this source
                example: The url has a rate limit protection and should be polled every hour
    DataSourceNoteRequest:
      description: Submit a new data source
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              notes:
                type: string
                description: If you have any notes on how we should review this source
                example: The url has a rate limit protection and should be polled every hour
    PixelCodeRequest:
      description: Create or update a pixel code.
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                description: Human readable name to identify the code in the backend
                example: Result click
              code:
                type: string
                description: A HTML snippet containing the code including iframes, images or scrtip tags.
    CreateTokenRequest:
      description: Issue a new token.
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                example: My new Backend API
                description: Name your token so you can find and track it later
              expires:
                type: string
                description: Defines when your token gets expired
                enum:
                  - 1 Day
                  - 1 Week
                  - 1 Month
                  - 3 Months
                  - 6 Months
                  - 1 Year
                  - Never
                example: 1 Week
    MetricsRequest:
      description: Request Stats Metrics between 2 dates in given period.
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              start:
                type: string
                format: date
                example: "2022-01-01"
                description: Start date for the range
              end:
                type: string
                format: date
                example: "2022-12-01"
                description: end date for the range
              metrics:
                type: array
                items:
                  type: string
                  enum:
                    - view
                    - vote
                    - voter
                    - start
                    - finish
                    - undo
                    - result_view
                    - result_view_unique
                    - result_click
                    - result_click_secondary
                    - result_click_compare
                    - result_click_compare_submit
                    - result_click_compare_pdp
                    - result_click_unique
                    - result_click_start_over
                    - result_click_share
                    - result_swipe
                    - conversion
                    - cta_view
    DynamicWidget:
      description: Create or Update a Dynamic Widget
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              public_id:
                type: string
                description: PublicID for the content you want to attach the widget to.
                example: 343a656b-c91a-45f7-a692-153a526e394d
              urls:
                type: array
                description: A list of urls for this widget to displayed on.
                items:
                  type: object
                  properties:
                    url:
                      type: string
                      example: https://www.poltio.com/blog/using-dynamic-widgets
              name:
                type: string
                description: Internal name for you to identify the widget.
                example: Poltio Dynamic Widget Blog
              is_default:
                type: boolean
                description: Sets if the widget is used in all urls if there is not a more specific match
                default: false
                example: false
              is_active:
                type: boolean
                description: Sets the trigger active or disabled
                default: true
                example: true
    Domain:
      description: Create or Update a Domain
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              domain:
                type: string
                description: Domain or subdomain that you want to use
                example: poltio.google.com
              is_default:
                type: boolean
                description: You can set a domain as default if you have multiple domains defined in your account after verification
              is_active:
                type: boolean
                description: you can set active status for a domain to temporarly disable or enable a domain after verification.
    SearchPlayground:
      description: You can test a query or a filter against a searchable content
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              content_id:
                type: integer
                description: Poltio Unique integer ID for the content.
                example: 1234
              public_id:
                type: string
                description: Unique content public id (in UUID format.) Required when you do not have access to content_id.
                example: ca68c793-c313-4024-a5f9-f1f7e62a8f9a
              query:
                type: array
                description: the queries you want to play with
                items:
                  type: string
                example:
                  - search param 1
                  - search param 2
              filter:
                type: array
                description: the filters you want to play with
                items:
                  type: string
                example:
                  - 'price: [1000...10000]'
                  - 'brand: [Apple, Poltio]'
    ConversionSetting:
      description: Create or update a url for conversion tracking
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              url:
                type: string
                description: Url with path that your site uses for checkout success page
                example: https://www.examplestore.com/checkout/success
              catch_all:
                type: boolean
                description: Defines if all conversions should be repoted
    TriggerDemoRequest:
      description: Request a page background to use as a Trigger Demo
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              url:
                type: string
                description: Url with path that your site uses for checkout success page
                example: https://www.examplestore.com/checkout/success
    CheckSnippetPage:
      description: Checks if a page url has a snippet code active
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              url:
                type: string
                description: Url with path that your site uses for checkout success page
                example: https://www.examplestore.com/checkout/success
    ShortLink:
      description: Creates polt.io short link from any given url
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              url:
                type: string
                description: a fully qualified url
                example: https://www.examplestore.com/checkout/success
    TFAVerify:
      description: Verify 2fa setup
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              verification:
                type: string
                description: a verification code coming from a TOTP app like google auth
                example: "123456"
    Organization:
      description: Update organization name
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                description: a new name for your organization
                example: Acme Corp
    OrganizationInvite:
      description: Invite new members to organization
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                description: email address of the user
                example: acme@poltio.com
              role:
                type: string
                description: role of the user
                enum:
                  - admin
                  - user
                  - viewer
                example: admin
    OrganizationUpdateMember:
      description: Updates permissions for a member in the given organization
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - user_id
              - role
            properties:
              user_id:
                type: integer
                description: User id for the member in the organization
                example: 42
              role:
                type: string
                description: role of the user
                enum:
                  - admin
                  - user
                  - viewer
                example: admin
    IpRuleRequest:
      description: Updates permissions for a member in the given organization
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                maxLength: 255
                nullable: true
                example: Office Network & VPN
              allowed:
                type: array
                nullable: true
                items:
                  type: string
                  example: 192.168.1.0/24
                description: Array of valid IP addresses or IPv4 CIDR blocks.
              blocked:
                type: array
                nullable: true
                items:
                  type: string
                  example: 203.0.113.50
                description: Array of valid IP addresses or IPv4 CIDR blocks.
                ## end of request bodies
  ## security
  securitySchemes:
    publisherAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
