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

# Advance Step

> Persist the resume point so a refresh continues where the user left off.



## OpenAPI

````yaml /openapi.json patch /api/study/sessions/{session_id}/step
openapi: 3.1.0
info:
  title: HAI-Co² API
  description: Human-AI Co-Construction reference implementation.
  version: 0.1.0
servers:
  - url: https://haico.gr
    description: Production
  - url: https://dev.haico.gr
    description: Development
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /api/study/sessions/{session_id}/step:
    patch:
      tags:
        - Study
      summary: Advance Step
      description: Persist the resume point so a refresh continues where the user left off.
      operationId: advance_step_api_study_sessions__session_id__step_patch
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: integer
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdvanceStepRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudySessionSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AdvanceStepRequest:
      properties:
        step:
          type: string
          maxLength: 64
          minLength: 1
          title: Step
      type: object
      required:
        - step
      title: AdvanceStepRequest
    StudySessionSchema:
      properties:
        id:
          type: integer
          title: Id
        study_code:
          type: string
          title: Study Code
        participant_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Participant Code
        condition_order:
          items:
            type: string
          type: array
          title: Condition Order
          default: []
        task_order:
          items:
            type: string
          type: array
          title: Task Order
          default: []
        counterbalance_index:
          type: integer
          title: Counterbalance Index
          default: 0
        current_step:
          type: string
          title: Current Step
        status:
          type: string
          title: Status
        started_at:
          type: string
          format: date-time
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        study_thread_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Study Thread Id
      type: object
      required:
        - id
        - study_code
        - current_step
        - status
        - started_at
      title: StudySessionSchema
      description: A study session as returned to the participant.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    HTTPBearer:
      type: http
      description: >-
        A personal access token (`haico_pat_...`), created under Profile → API
        keys. Send it as `Authorization: Bearer <key>`. The browser session JWT
        is also accepted but is an internal mechanism and is not part of the
        public contract.
      scheme: bearer

````