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

# Close an SMS conversation

> Closes an open SMS conversation. If reason is omitted, PAM records admin_closed.



## OpenAPI

````yaml /openapi/v1.json post /sms-conversations/{id}/close
openapi: 3.0.3
info:
  title: PAM Outbound API
  version: 1.0.0
  description: >-
    External API for creating outbound calls, starting SMS conversations,
    managing API keys, and receiving webhook events.
servers:
  - url: https://api.pamhq.com/v1
    description: Production
security:
  - bearerApiKey: []
tags:
  - name: Calls
    description: Start and manage outbound voice calls.
  - name: SMS Conversations
    description: Start and manage outbound SMS conversations.
  - name: API Keys
    description: Create, list, inspect, and revoke API keys.
  - name: Webhooks
    description: Configure direct call and SMS conversation webhook destinations.
  - name: Webhook Events
    description: Canonical webhook payloads emitted by calls and SMS conversations.
paths:
  /sms-conversations/{id}/close:
    post:
      tags:
        - SMS Conversations
      summary: Close an SMS conversation
      description: >-
        Closes an open SMS conversation. If reason is omitted, PAM records
        admin_closed.
      operationId: closeSmsConversation
      parameters:
        - $ref: '#/components/parameters/conversationId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversationCloseRequest'
      responses:
        '200':
          description: Conversation closed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationCloseResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    conversationId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Conversation ID.
  schemas:
    ConversationCloseRequest:
      type: object
      properties:
        reason:
          type: string
          minLength: 1
          maxLength: 128
          description: Optional close reason. Defaults to admin_closed when omitted.
    ConversationCloseResponse:
      allOf:
        - $ref: '#/components/schemas/ResponseEnvelope'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/ConversationClosed'
    ResponseEnvelope:
      type: object
      properties:
        data: {}
        meta:
          $ref: '#/components/schemas/Meta'
    ConversationClosed:
      type: object
      properties:
        conversationId:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/ConversationStatus'
        endedAt:
          type: string
          format: date-time
          nullable: true
        endReason:
          type: string
          nullable: true
        alreadyClosed:
          type: boolean
          description: True when the conversation was already terminal before this request.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              description: Optional field-level validation details.
              nullable: true
        meta:
          $ref: '#/components/schemas/Meta'
    Meta:
      type: object
      properties:
        requestId:
          type: string
    ConversationStatus:
      type: string
      enum:
        - queued
        - in_progress
        - completed
        - failed
        - cancelled
  responses:
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing, expired, revoked, or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: 'API key provided as `Authorization: Bearer <key>`.'
      x-default: pk_live_your_api_key

````