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

# Update conversation status

> Close completed conversations or reopen them for follow-ups.



## OpenAPI

````yaml /api/platform/v1/openapi-platform.yaml patch /whatsapp/conversations/{conversation_id}
openapi: 3.1.0
info:
  title: Kapso Platform API
  version: 0.2.0
  description: >
    Build WhatsApp messaging into your product. Manage customers, connect phone
    numbers, send broadcasts, and handle conversations.
servers:
  - url: https://api.kapso.ai/platform/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Customers
    description: Manage customer accounts
  - name: Setup Links
    description: WhatsApp onboarding via embedded signup
  - name: Phone Numbers
    description: Connect and manage WhatsApp numbers
  - name: Webhooks
    description: Subscribe to WhatsApp events
  - name: Display Names
    description: Update WhatsApp business display names
  - name: Broadcasts
    description: |
      Send template messages at scale

      **Alpha**: This API is in alpha and subject to change
  - name: Conversations
    description: Manage conversation state
  - name: Media
    description: Upload media files for WhatsApp messaging
  - name: Users
    description: Manage project team members
  - name: Inbox Embeds
    description: Create and manage embeddable inbox access links
  - name: Webhook Deliveries
    description: View webhook delivery attempts and their status
  - name: External API Logs
    description: View logs of external API calls made by the project
  - name: Log Search
    description: Search Logs V2 events across API, Meta, workflow, and webhook sources
  - name: Provider Models
    description: List available AI provider models
  - name: WhatsApp Flows
    description: Build interactive WhatsApp Flows for surveys and forms
  - name: Contacts
    description: Manage WhatsApp contacts
paths:
  /whatsapp/conversations/{conversation_id}:
    parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    patch:
      tags:
        - Conversations
      summary: Update conversation status
      description: Close completed conversations or reopen them for follow-ups.
      operationId: updateWhatsappConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappConversationUpdateRequest'
            examples:
              close:
                summary: Close conversation
                value:
                  whatsapp_conversation:
                    status: ended
              reopen:
                summary: Reopen conversation
                value:
                  whatsapp_conversation:
                    status: active
      responses:
        '200':
          description: Conversation updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappConversationResponse'
              examples:
                ended:
                  summary: Closed conversation
                  value:
                    data:
                      id: c63ced48-1283-4d55-8c8d-930f525aa0e5
                      phone_number: '14155550123'
                      status: ended
                      last_active_at: '2025-07-16T09:45:00Z'
                      created_at: '2025-06-01T12:00:00Z'
                      updated_at: '2025-07-16T09:45:00Z'
                      metadata: {}
                      phone_number_id: '1234567890'
                      kapso:
                        contact_name: Alicia
                        messages_count: 42
                        last_message_id: wamid.HBgMMTIzNDU2
                        last_message_type: text
                        last_message_timestamp: '2025-07-16T09:40:00Z'
                        last_message_text: Thanks!
                        last_inbound_at: '2025-07-16T09:35:10Z'
                        last_outbound_at: '2025-07-16T09:40:00Z'
                active:
                  summary: Reopened conversation
                  value:
                    data:
                      id: c63ced48-1283-4d55-8c8d-930f525aa0e5
                      phone_number: '14155550123'
                      status: active
                      last_active_at: '2025-07-16T10:15:00Z'
                      created_at: '2025-06-01T12:00:00Z'
                      updated_at: '2025-07-16T10:15:00Z'
                      metadata: {}
                      phone_number_id: '1234567890'
                      kapso:
                        contact_name: Alicia
                        messages_count: 43
                        last_message_id: wamid.HBgMMTIzNDU3
                        last_message_type: text
                        last_message_timestamp: '2025-07-16T10:15:00Z'
                        last_message_text: Hey, one more thing...
                        last_inbound_at: '2025-07-16T10:15:00Z'
                        last_outbound_at: '2025-07-16T09:40:00Z'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    WhatsappConversationUpdateRequest:
      type: object
      required:
        - whatsapp_conversation
      properties:
        whatsapp_conversation:
          type: object
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - active
                - ended
    WhatsappConversationResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/WhatsappConversation'
    WhatsappConversation:
      type: object
      required:
        - id
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        phone_number:
          type:
            - string
            - 'null'
          description: Contact's WhatsApp number. Can be null for BSUID-only identity.
        business_scoped_user_id:
          type:
            - string
            - 'null'
          description: WhatsApp business-scoped user ID
        parent_business_scoped_user_id:
          type:
            - string
            - 'null'
          description: Parent business-scoped user ID when provided by Meta
        username:
          type:
            - string
            - 'null'
          description: WhatsApp username when available
        status:
          type: string
          enum:
            - active
            - ended
        last_active_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        metadata:
          type: object
          default: {}
          additionalProperties: true
        phone_number_id:
          type:
            - string
            - 'null'
        kapso:
          type:
            - object
            - 'null'
          description: Conversation metadata
          properties:
            contact_name:
              type:
                - string
                - 'null'
            messages_count:
              type: integer
              minimum: 0
            last_message_id:
              type:
                - string
                - 'null'
            last_message_type:
              type:
                - string
                - 'null'
            last_message_timestamp:
              type: string
              format: date-time
            last_message_text:
              type:
                - string
                - 'null'
            last_inbound_at:
              type: string
              format: date-time
            last_outbound_at:
              type: string
              format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    UnauthorizedError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Request validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````