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

# Change ticket assignee

> Changes the assignee of the current active ticket.

Required API key scope: `read-write`.

`newAssigneeId` must reference an active employee with access to the ticket channel. The endpoint only works for the current ticket in the chat, and the ticket must already be `active` with an existing assignee.



## OpenAPI

````yaml /openapi/public-api-v1.json patch /v1/tickets/{ticketId}/assignee
openapi: 3.1.0
info:
  title: YoLead Public API
  version: 1.0.0
  description: >-
    Public REST API for YoLead integrations. Only endpoints mounted under /v1
    are included. Management endpoints used by the YoLead UI, including
    /integrations/*, are intentionally excluded.
servers:
  - url: https://api.yo-lead.com
    description: Production
security:
  - YoLeadPublicKey: []
    YoLeadTimestamp: []
    YoLeadSignature: []
tags:
  - name: Employees
    description: Employee data available to integrations.
  - name: Embed
    description: Iframe session creation for embedding YoLead UI.
  - name: Tickets
    description: Ticket history and status operations.
paths:
  /v1/tickets/{ticketId}/assignee:
    patch:
      tags:
        - Tickets
      summary: Change ticket assignee
      description: >-
        Changes the assignee of the current active ticket.


        Required API key scope: `read-write`.


        `newAssigneeId` must reference an active employee with access to the
        ticket channel. The endpoint only works for the current ticket in the
        chat, and the ticket must already be `active` with an existing assignee.
      operationId: changeTicketAssignee
      parameters:
        - $ref: '#/components/parameters/TicketId'
      requestBody:
        description: Ticket assignee change.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeTicketAssigneeRequest'
            example:
              newAssigneeId: 64f000000000000000000004
      responses:
        '200':
          description: Ticket assignee changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangeTicketAssigneeResponse'
              example:
                data:
                  ticketId: 64f000000000000000000003
                  chatId: 64f000000000000000000002
                  previousAssigneeId: 64f000000000000000000001
                  newAssigneeId: 64f000000000000000000004
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Ticket state conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 40972
                message: Active ticket has no assignee
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    TicketId:
      name: ticketId
      in: path
      required: true
      description: Ticket id.
      schema:
        $ref: '#/components/schemas/ObjectId'
      example: 64f000000000000000000003
  schemas:
    ChangeTicketAssigneeRequest:
      type: object
      additionalProperties: false
      required:
        - newAssigneeId
      properties:
        newAssigneeId:
          $ref: '#/components/schemas/ObjectId'
    ChangeTicketAssigneeResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/TicketAssigneeChange'
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 40001
        message:
          type: string
          example: Validation error
    ObjectId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: MongoDB ObjectId represented as a 24-character hexadecimal string.
      example: 64f000000000000000000001
    TicketAssigneeChange:
      type: object
      additionalProperties: false
      required:
        - ticketId
        - chatId
        - previousAssigneeId
        - newAssigneeId
      properties:
        ticketId:
          $ref: '#/components/schemas/ObjectId'
        chatId:
          $ref: '#/components/schemas/ObjectId'
        previousAssigneeId:
          $ref: '#/components/schemas/ObjectId'
        newAssigneeId:
          $ref: '#/components/schemas/ObjectId'
  responses:
    ValidationError:
      description: Validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40001
            message: Validation error
    Unauthorized:
      description: Invalid API credentials, stale timestamp, or invalid request signature.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40121
            message: Invalid API credentials
    Forbidden:
      description: API key scope is not sufficient for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40361
            message: API key scope is not sufficient
    NotFound:
      description: Requested entity was not found or is not accessible for this company.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40471
            message: Ticket not found
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 50001
            message: Internal server error
  securitySchemes:
    YoLeadPublicKey:
      type: apiKey
      in: header
      name: X-YoLead-Key
      description: Public API key generated in the YoLead UI.
    YoLeadTimestamp:
      type: apiKey
      in: header
      name: X-YoLead-Timestamp
      description: >-
        Unix timestamp in milliseconds. Requests must be signed within a
        5-minute window.
    YoLeadSignature:
      type: apiKey
      in: header
      name: X-YoLead-Signature
      description: >-
        Hex HMAC-SHA256 signature over `<timestamp>.<raw_body>` using the API
        secret.

````