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

# Close or reopen a conversation

> Sets the conversation to `closed` or `open`. Asking for the state it is already in changes nothing.

A customer writing in a closed conversation reopens it.

Required scope: `conversations:write`.




## OpenAPI

````yaml /openapi.yaml patch /conversations/{conversationId}
openapi: 3.1.0
info:
  title: Cerium API
  version: 1.0.0
  description: |
    Send your customers and their conversations to Cerium from your own backend.
    Every request is authenticated with an API key.
servers:
  - url: https://api.usecerium.com/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Customers
  - name: Conversations
  - name: Messages
paths:
  /conversations/{conversationId}:
    parameters:
      - $ref: '#/components/parameters/ConversationId'
    patch:
      tags:
        - Conversations
      summary: Close or reopen a conversation
      description: >
        Sets the conversation to `closed` or `open`. Asking for the state it is
        already in changes nothing.


        A customer writing in a closed conversation reopens it.


        Required scope: `conversations:write`.
      operationId: updateConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  $ref: '#/components/schemas/ConversationStatus'
            example:
              status: closed
      responses:
        '200':
          description: The updated conversation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationResponse'
        '400':
          $ref: '#/components/responses/Invalid'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    ConversationId:
      name: conversationId
      in: path
      required: true
      description: The conversation's id.
      schema:
        type: string
      example: thr_01k9z3m4q8
  schemas:
    ConversationStatus:
      type: string
      enum:
        - open
        - closed
    ConversationResponse:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          example: success
        data:
          $ref: '#/components/schemas/Conversation'
    Conversation:
      type: object
      properties:
        id:
          type: string
          example: thr_01k9z3m4q8
        customer:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              example: prt_8271
            externalId:
              type:
                - string
                - 'null'
              example: user_8271
            name:
              type:
                - string
                - 'null'
            email:
              type:
                - string
                - 'null'
        status:
          $ref: '#/components/schemas/ConversationStatus'
        channel:
          type: string
          example: api
        tags:
          type: array
          items:
            type: string
        assignmentStatus:
          type: string
          enum:
            - assigned
            - unassigned
        agentName:
          type:
            - string
            - 'null'
          description: The team member handling it
          if any.: null
        firstRespondedAt:
          type:
            - string
            - 'null'
          format: date-time
        closedAt:
          type:
            - string
            - 'null'
          format: date-time
        lastMessageAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      description: >
        `message` is always present. `code` is a stable identifier for specific
        errors you may want to handle in code.

        A validation error has a `message` that is a list of everything to fix.
      properties:
        code:
          type: string
          description: A stable identifier you can match on.
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: integer
        error:
          type: string
      required:
        - message
  responses:
    Invalid:
      description: The request is not valid. `message` says what to fix.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message:
              - email must be an email
    Unauthorized:
      description: The key is missing or not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Authentication token is missing.
    Forbidden:
      description: The key does not have the scope this call needs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            message: This key cannot do that.
    NotFound:
      description: Nothing has that id.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: thread_not_found
            message: No conversation has that id.
    RateLimited:
      description: Too many requests. Wait, then try again.
      headers:
        Retry-After:
          description: Seconds to wait before trying again.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >
        Your API key, sent as `Authorization: Bearer <key>`. Create keys in the
        Cerium dashboard.

        Keep them on your servers only.

````