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

# Change assignee

> Changes who an open conversation is assigned to: another assignee or a team.



## OpenAPI

````yaml api-reference/change-assignee.json POST /api/v1/conversation/{conversation_id}/events
openapi: 3.1.0
info:
  title: WotNot API
  version: 1.0.0
  description: 'WotNot API: Change assignee.'
servers:
  - url: https://api.wotnot.io
    description: Production
security:
  - bearerAuth: []
paths:
  /api/v1/conversation/{conversation_id}/events:
    post:
      summary: Change assignee
      description: >-
        Changes who an open conversation is assigned to: another assignee or a
        team.
      operationId: changeAssignee
      parameters:
        - name: conversation_id
          in: path
          required: true
          description: >-
            The ID of the conversation to reassign. It's the `conversation.id`
            you get back from Create conversation.
          schema:
            type: string
      requestBody:
        required: true
        description: >-
          Who is making the change and who the conversation goes to. Send `user`
          to assign it to another assignee, or `team` to assign it to a team.
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  title: To an assignee
                  description: Change from one assignee to another.
                  required:
                    - event
                    - user
                  properties:
                    event:
                      type: string
                      description: >-
                        Set it to `assignee` to change who the conversation is
                        assigned to.
                      example: assignee
                    user:
                      type: object
                      description: Who is making the change, and the new assignee.
                      required:
                        - by
                        - to
                      properties:
                        by:
                          type: string
                          description: The email address of the agent making the change.
                          example: agent_email@domain.com
                        to:
                          type: string
                          description: The email address of the new assignee.
                          example: assignee@domain.com
                - type: object
                  title: To a team
                  description: Change from an assignee to a team.
                  required:
                    - event
                    - team
                  properties:
                    event:
                      type: string
                      description: >-
                        Set it to `assignee` to change who the conversation is
                        assigned to.
                      example: assignee
                    team:
                      type: object
                      description: >-
                        Who is making the change, and the team to assign the
                        conversation to.
                      required:
                        - by
                        - to
                      properties:
                        by:
                          type: string
                          description: The email address of the agent making the change.
                          example: agent_email@domain.com
                        to:
                          type: string
                          description: The name of the team, for example `Sales`.
                          example: Sales
            examples:
              to_assignee:
                summary: To an assignee
                value:
                  event: assignee
                  user:
                    by: agent_email@domain.com
                    to: assignee@domain.com
              to_team:
                summary: To a team
                value:
                  event: assignee
                  team:
                    by: agent_email@domain.com
                    to: Sales
      responses:
        '200':
          description: The assignee was changed. Returns `ok` set to `true`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                properties:
                  ok:
                    type: boolean
                    description: '`true` when the request worked. Errors return `false`.'
                    example: true
              example:
                ok: true
        '400':
          description: >-
            The assignee couldn't be changed. The examples show the possible
            reasons, such as a team that doesn't exist, a closed conversation,
            or assigning to the same person. Check `error` to see which.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              examples:
                team_not_found:
                  summary: Team not found
                  value:
                    ok: false
                    error: TEAM_NOT_FOUND
                    code: TEAM_NOT_FOUND
                    message: Team does not exist.
                    status: 400
                conversation_closed:
                  summary: Conversation is closed
                  value:
                    ok: false
                    error: CONVERSATION_CLOSED
                    code: CONVERSATION_CLOSED
                    message: Assignee cannot be changed on closed conversation.
                    status: 400
                same_user:
                  summary: Same assignee
                  value:
                    ok: false
                    error: ASSIGNEE_CHANGE_EXCEPTION
                    code: ASSIGNEE_CHANGE_EXCEPTION
                    message: >-
                      By and To user are same. Can not assign conversation to
                      same user.
                    status: 400
                user_limit:
                  summary: User limit reached
                  value:
                    ok: false
                    error: ASSIGNEE_NOT_CHANGED
                    code: ASSIGNEE_NOT_CHANGED
                    message: Assignee is not changed due to user limit validationt.
                    status: 400
        '401':
          description: Your token is invalid. Check the `Authorization` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              example:
                ok: false
                error: JWT_SIGNATURE_EXCEPTION
                code: JWT_SIGNATURE_EXCEPTION
                message: Invalid JWT token
                status: 401
        '404':
          description: No conversation was found with this `conversation_id`. Check the ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              example:
                ok: false
                error: CONVERSATION_NOT_FOUND
                code: CONVERSATION_NOT_FOUND
                message: Conversation is not available.
                status: 404
components:
  schemas:
    CodedError:
      type: object
      description: An error with a short code that says what went wrong.
      required:
        - ok
        - message
        - error
        - code
      properties:
        ok:
          type: boolean
          description: Always `false` when something went wrong.
          example: false
        message:
          type: string
          description: What went wrong, in plain words.
          example: Please reach out to support to use this feature
        error:
          type: string
          description: >-
            A short error code in capital letters, for example
            `UNAUTHORIZED_FEATURE`. Check this in your code to tell errors
            apart.
          example: UNAUTHORIZED_FEATURE
        code:
          type: string
          description: A code for the result. In these examples it matches `error`.
          example: UNAUTHORIZED_FEATURE
        status:
          type: integer
          description: >-
            The HTTP status code, repeated in the body. Not every error includes
            it.
          example: 401
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        All of WotNot's APIs use Bearer token authentication. Send your account
        token as `Bearer <token>`. You can find it in Settings > Account
        Settings > Developer. Keep it on your server: anyone who has it can call
        the API as your account.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.