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

# Update Opt-in Prompt Condition

> Updates opt-in prompt condition by ID

Note: If autoPrompt is set to true, seconds_delay, scroll_delay, and pages_delay should be set to NULL. If autoPrompt is set to false, provide a value for only one of the delay options, setting the other two to NULL (e.g. seconds_delay = 5, scroll_delay = NULL, pages_delay = NULL) 

If values are set for multiple delay options, they will be evaluated in the following order: autoPrompt, scroll_delay, seconds_delay, pages_delay.

When updating the default prompt condition, priority should be set to 0 and page should be set to *



## OpenAPI

````yaml /api-reference/misc-openapi.json put /prod/prompts/{idSite}/condition/{id}
openapi: 3.1.0
info:
  title: other
  version: '1.1'
servers:
  - url: https://api.aimtell.com
security:
  - sec0: []
tags:
  - name: Analytics
    description: Analytics and reporting
  - name: Logs
    description: Activity logs
  - name: Pixels
    description: Tracking pixels
  - name: Prompts
    description: Subscription prompt management
paths:
  /prod/prompts/{idSite}/condition/{id}:
    put:
      tags:
        - Prompts
      summary: Update Opt-in Prompt Condition
      description: >-
        Updates opt-in prompt condition by ID


        Note: If autoPrompt is set to true, seconds_delay, scroll_delay, and
        pages_delay should be set to NULL. If autoPrompt is set to false,
        provide a value for only one of the delay options, setting the other two
        to NULL (e.g. seconds_delay = 5, scroll_delay = NULL, pages_delay =
        NULL) 


        If values are set for multiple delay options, they will be evaluated in
        the following order: autoPrompt, scroll_delay, seconds_delay,
        pages_delay.


        When updating the default prompt condition, priority should be set to 0
        and page should be set to *
      operationId: api-update-opt-in-prompt-condition
      parameters:
        - name: idSite
          in: path
          description: Website ID
          required: true
          schema:
            type: string
        - name: id
          in: path
          description: Condition ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - page
                - promptId
                - autoPrompt
                - priority
              properties:
                page:
                  type: string
                  description: Page
                promptId:
                  type: integer
                  description: Prompt ID to add condition
                autoPrompt:
                  type: integer
                  description: Auto Prompt (1 = true, 0 = false)
                priority:
                  type: integer
                  description: Priority (1-10, 10 = highest)
                device_type:
                  type: string
                  description: Device Type (any, mobile, desktop)
                seconds_delay:
                  type: integer
                  description: Seconds Delay (number of seconds)
                scroll_delay:
                  type: integer
                  description: Scroll Delay (percent of page e.g. 50)
                pages_delay:
                  type: integer
                  description: Pages Delay (pages viewed e.g. 3)
                cookie_required:
                  type: string
                  description: Cookie Required (name of cookie)
                browser:
                  type: string
                  description: Browser (any, chrome, firefox, edge, opera, safari)
                disabled:
                  type: integer
                  description: Disabled (1 = true, 0 = false)
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    result: success
                    message: Updated prompt condition succesfully.
                    id: '6705'
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value:
                    result: error
                    message: Invalid token.
                    error_code: 71831
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: error
                  message:
                    type: string
                    example: Invalid token.
                  error_code:
                    type: integer
                    example: 71831
                    default: 0
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      name: X-Authorization-Api-Key
      in: header
      x-default: ''

````