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

# Customize Study Plan

> Run one resumable turn through the same planning agent and tools used by
the dashboard's Customize Plan page.

The conversation id is stored on the study. Questions are returned to the
caller; completed plan markdown is persisted automatically.



## OpenAPI

````yaml /api-reference/openapi.json post /api/public/v1/studies/{study_id}/customize-plan
openapi: 3.1.0
info:
  title: User Intuition Public API
  description: >-
    ## Public Integration API


    Programmatic access to User Intuition for external integrators: manage
    studies, participants, interviews, reports, and panels.


    ### Authentication


    All endpoints require a Bearer token — either an API key (prefixed `ui_sk_`,
    created in the dashboard) or a dashboard JWT:


    ```

    Authorization: Bearer <ui_sk_… or JWT>

    ```


    ### Base URLs


    - **Production:** `https://api.userintuition.ai`

    - **Staging:** `https://staging.userintuition.ai`


    ### Support


    For API support, contact support@userintuition.ai
  version: 1.0.0
  contact:
    name: User Intuition Support
    email: support@userintuition.ai
servers:
  - url: https://api.userintuition.ai
    description: Production
  - url: https://staging.userintuition.ai
    description: Staging
security:
  - BearerAuth: []
paths:
  /api/public/v1/studies/{study_id}/customize-plan:
    post:
      tags:
        - public-studies
      summary: Customize Study Plan
      description: >-
        Run one resumable turn through the same planning agent and tools used by

        the dashboard's Customize Plan page.


        The conversation id is stored on the study. Questions are returned to
        the

        caller; completed plan markdown is persisted automatically.
      operationId: customizeStudyPlan
      parameters:
        - name: study_id
          in: path
          required: true
          schema:
            type: string
            title: Study Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicCustomizeStudyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicCustomizeStudyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PublicCustomizeStudyRequest:
      properties:
        message:
          type: string
          maxLength: 20000
          minLength: 1
          title: Message
        concept_image:
          anyOf:
            - $ref: '#/components/schemas/PublicCustomizeConceptImage'
            - type: 'null'
          description: >-
            Optional native concept-image attachment for this turn. The backend
            validates, stores, and makes it available to Customize Plan.
      additionalProperties: false
      type: object
      required:
        - message
      title: PublicCustomizeStudyRequest
      description: One user turn for the stateful Customize Plan conversation.
    PublicCustomizeStudyResponse:
      properties:
        message:
          type: string
          title: Message
        response_type:
          type: string
          enum:
            - question
            - message
            - study_plan
          title: Response Type
        conversation_id:
          type: string
          title: Conversation Id
        study:
          $ref: '#/components/schemas/PublicStudySummary'
      type: object
      required:
        - message
        - response_type
        - conversation_id
        - study
      title: PublicCustomizeStudyResponse
      description: The next Customize Plan message plus the study's resulting state.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PublicCustomizeConceptImage:
      properties:
        data_base64:
          type: string
          maxLength: 14000000
          minLength: 1
          title: Data Base64
          description: 'Base64-encoded image bytes (maximum decoded size: 10 MB).'
        filename:
          type: string
          maxLength: 255
          minLength: 1
          title: Filename
        content_type:
          type: string
          enum:
            - image/png
            - image/jpeg
            - image/gif
            - image/webp
          title: Content Type
        label:
          type: string
          maxLength: 120
          minLength: 1
          title: Label
          description: User-approved participant-facing label.
      additionalProperties: false
      type: object
      required:
        - data_base64
        - filename
        - content_type
        - label
      title: PublicCustomizeConceptImage
      description: A client-provided image attached to a Customize Plan turn.
    PublicStudySummary:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
              maxLength: 40
            - type: 'null'
          title: Name
        study_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Study Type
          description: Study-type template slug
        recruiting_method:
          anyOf:
            - type: string
            - type: 'null'
          title: Recruiting Method
          description: panel or byop
        interview_format:
          anyOf:
            - type: string
              enum:
                - chat
                - video
                - voice
            - type: 'null'
          title: Interview Format
          description: chat, video, or voice
        voice:
          anyOf:
            - type: string
              enum:
                - male
                - female
            - type: 'null'
          title: Voice
          description: male or female
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: Interview language code, e.g. 'en'
        expected_duration_seconds:
          type: integer
          minimum: 300
          title: Expected Duration Seconds
          description: >-
            Maximum planned interview duration in seconds, including transitions
            and likely follow-up probes. This is an estimate, not a guaranteed
            length.
          default: 900
        byop_config:
          $ref: '#/components/schemas/PublicByopConfigOut'
        study_link:
          anyOf:
            - type: string
            - type: 'null'
          title: Study Link
          description: Universal interview link for the study
        provisioning_status:
          type: string
          enum:
            - draft
            - ready
            - provisioned
          title: Provisioning Status
          description: >-
            draft when required interviewer settings are missing, ready when the
            study can be provisioned, and provisioned when interviews can run
        missing_requirements:
          items:
            type: string
          type: array
          title: Missing Requirements
          description: Fields still required before the study can be provisioned
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - id
        - provisioning_status
      title: PublicStudySummary
      description: |-
        Lightweight study shape returned by the list endpoint (heavy fields such
        as the study plan and screener questions are stripped — fetch by id).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PublicByopConfigOut:
      properties:
        incentive_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Incentive Amount
        is_incentives_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Incentives Enabled
        auto_send_incentives:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Auto Send Incentives
      type: object
      title: PublicByopConfigOut
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authenticate with an API key (prefixed `ui_sk_`) or a JWT token from the
        dashboard.

````