> ## 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.

# Close conversation

> Closes an open conversation.



## OpenAPI

````yaml api-reference/close-conversation.json POST /api/v1/conversation/{conversation_id}/events
openapi: 3.1.0
info:
  title: WotNot API
  version: 1.0.0
  description: 'WotNot API: Close conversation.'
servers:
  - url: https://api.wotnot.io
    description: Production
security:
  - bearerAuth: []
paths:
  /api/v1/conversation/{conversation_id}/events:
    post:
      summary: Close conversation
      description: Closes an open conversation.
      operationId: closeConversation
      parameters:
        - name: conversation_id
          in: path
          required: true
          description: >-
            The ID of the conversation to close. It's the `conversation.id` you
            get back from Create conversation.
          schema:
            type: string
      requestBody:
        required: true
        description: The status change to make and who is making it.
        content:
          application/json:
            schema:
              type: object
              required:
                - event
                - status
                - user
              properties:
                event:
                  type: string
                  description: >-
                    The kind of event. Set it to `status` to change the
                    conversation's status.
                  example: status
                status:
                  type: string
                  description: The new status. Set it to `CLOSE` to close the conversation.
                  example: CLOSE
                user:
                  $ref: '#/components/schemas/AgentUser'
                  description: The agent closing the conversation.
            example:
              event: status
              status: CLOSE
              user:
                by: agent_email@domain.com
      responses:
        '200':
          description: The conversation was closed. 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 conversation couldn't be closed because of a user limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              example:
                ok: false
                error: CONVERSATION_NOT_CLOSED
                code: CONVERSATION_NOT_CLOSED
                message: Conversation is not closed due to user limit validation.
                status: 400
        '401':
          $ref: '#/components/responses/InvalidJwt'
        '404':
          $ref: '#/components/responses/ConversationNotFound'
components:
  schemas:
    AgentUser:
      type: object
      description: The agent doing this.
      required:
        - by
      properties:
        by:
          type: string
          description: The agent's email address.
          example: agent_email@domain.com
    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
  responses:
    InvalidJwt:
      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
    ConversationNotFound:
      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
  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.