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

# Update ticket

> Update a ticket title, description, priority, assignees, or stage in one request. Use add_assignee_user_id, remove_assignee_user_id, or assignee_user_ids to manage assignees. Stage changes validate required stage fields.



## OpenAPI

````yaml PATCH /tickets/{id}
openapi: 3.0.1
info:
  title: Masivo's REST API
  description: Learn how to use Masivo's REST API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.masivo.ai/api/storefront/v1
security:
  - bearerAuth: []
paths:
  /tickets/{id}:
    patch:
      description: >-
        Update a ticket title, description, priority, assignees, or stage in one
        request. Use add_assignee_user_id, remove_assignee_user_id, or
        assignee_user_ids to manage assignees. Stage changes validate required
        stage fields.
      parameters:
        - in: header
          name: x-account-id
          description: The account that owns the ticket
          required: true
          schema:
            type: string
            format: uuid
        - in: path
          name: id
          description: The ticket unique identifier
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TicketPatch'
      responses:
        '200':
          description: Ticket updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Ticket'
        '400':
          description: Ticket update failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TicketPatch:
      type: object
      properties:
        to_pipeline_id:
          type: string
          format: uuid
          description: >-
            Target ticket pipeline. Include to_stage_code when moving between
            pipelines.
        to_stage_code:
          type: string
          description: Target ticket stage code.
        add_assignee_user_id:
          type: string
          format: uuid
          description: Account member id to add as an assignee.
        remove_assignee_user_id:
          type: string
          format: uuid
          description: Account member id to remove from the assignees.
        assignee_user_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Replaces the current assignees with this exact list.
        title:
          type: string
          maxLength: 200
        description:
          type: string
          maxLength: 5000
          nullable: true
        priority:
          type: string
          enum:
            - low
            - medium
            - high
            - urgent
        required_fields:
          type: object
          description: Values required by the target stage, keyed by field_key.
          additionalProperties:
            type: string
          example:
            resolution_summary: Refund issued and customer notified.
    Ticket:
      type: object
      properties:
        id:
          type: string
          format: uuid
        account_id:
          type: string
          format: uuid
        pipeline_id:
          type: string
          format: uuid
        stage_code:
          type: string
          example: new
        status:
          type: string
          enum:
            - open
            - resolved
            - closed
        priority:
          type: string
          enum:
            - low
            - medium
            - high
            - urgent
        title:
          type: string
        description:
          type: string
          nullable: true
        source_type:
          type: string
          enum:
            - manual
            - review
            - journey
            - system
        created_by_user_id:
          type: string
          format: uuid
        assignees:
          type: array
          description: Current assignee snapshots synced from the ticket_assignees table.
          items:
            $ref: '#/components/schemas/TicketAssignee'
        communication_summary:
          $ref: '#/components/schemas/TicketCommunicationSummary'
        review_id:
          type: string
          format: uuid
          nullable: true
        brand_id:
          type: string
          nullable: true
        channel_id:
          type: string
          nullable: true
        store_id:
          type: string
          nullable: true
        resolved_at:
          type: string
          format: date-time
          nullable: true
        closed_at:
          type: string
          format: date-time
          nullable: true
        reopened_at:
          type: string
          format: date-time
          nullable: true
        first_resolved_at:
          type: string
          format: date-time
          nullable: true
        resolution_count:
          type: number
        resolution_summary:
          type: string
          nullable: true
        closure_reason:
          type: string
          nullable: true
        associations:
          type: array
          items:
            $ref: '#/components/schemas/TicketAssociation'
        comments:
          type: array
          items:
            $ref: '#/components/schemas/TicketComment'
        stage_history:
          type: array
          items:
            $ref: '#/components/schemas/TicketStageHistoryEntry'
        dedupe_fingerprint:
          type: string
          nullable: true
        idempotency_key:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type: string
          format: date-time
          nullable: true
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
    TicketAssignee:
      type: object
      description: Active assignee snapshot stored on the ticket.
      properties:
        user_id:
          type: string
          format: uuid
        role:
          type: string
          enum:
            - assignee
            - watcher
        assigned_at:
          type: string
          format: date-time
        assigned_by_user_id:
          type: string
          format: uuid
    TicketCommunicationSummary:
      type: object
      properties:
        thread_count:
          type: number
        latest_thread_id:
          type: string
          format: uuid
          nullable: true
        latest_message_id:
          type: string
          format: uuid
          nullable: true
        latest_message_at:
          type: string
          format: date-time
          nullable: true
        latest_message_preview:
          type: string
          nullable: true
        channel:
          $ref: '#/components/schemas/CommunicationChannel'
        channel_account_id:
          type: string
          nullable: true
        external_thread_id:
          type: string
          nullable: true
        direction:
          $ref: '#/components/schemas/CommunicationDirection'
        unread_count:
          type: number
        status:
          type: string
          enum:
            - open
            - closed
          nullable: true
    TicketAssociation:
      type: object
      properties:
        associated_type:
          type: string
          enum:
            - review
            - customer
            - journey
            - campaign
            - event
        associated_id:
          type: string
        created_at:
          type: string
          format: date-time
    TicketComment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        author_user_id:
          type: string
          format: uuid
        body:
          type: string
        is_internal:
          type: boolean
        created_at:
          type: string
          format: date-time
    TicketStageHistoryEntry:
      type: object
      properties:
        from_pipeline_id:
          type: string
          format: uuid
          nullable: true
        to_pipeline_id:
          type: string
          format: uuid
          nullable: true
        from_stage_code:
          type: string
          nullable: true
        to_stage_code:
          type: string
        changed_by_user_id:
          type: string
          format: uuid
        changed_at:
          type: string
          format: date-time
        duration_seconds:
          type: number
          nullable: true
    CommunicationChannel:
      type: string
      enum:
        - email
        - whatsapp
        - chat
        - review
        - system
        - other
    CommunicationDirection:
      type: string
      enum:
        - inbound
        - outbound
        - internal
        - system
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````