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

# Delete a conversation

> Deletes every message in a conversation, as DELETE /messages/{message_id} does for one: the conversation and its messages are removed from every list at once, attachments within 48 hours, and the phone is asked to delete the conversation's messages on its side up to the newest message deleted here (anything it holds that is newer, including texts it has not passed on yet, stays). The response returns at once, with phone_deletion.status pending while the phone has not answered; Axilio keeps checking for up to 7 days, asking the phone again until it confirms (phone_deletion.next_check_at is the next check), and a phone not yet set up to delete messages (not_default_app) is asked once it can. GET /messages/{message_id} on any of the deleted messages shows where the phone's copy stands, and each message fires message.deleted, then message.phone_deleted or message.phone_delete_failed, as DELETE /messages/{message_id} describes. Deleting a conversation does not stop a message in it the phone is still sending. A conversation with no messages left is a 404.

Minimum role required: Member


## OpenAPI

````yaml /api-reference/openapi-backend.json delete /conversations/{conversation_id}
openapi: 3.1.0
info:
  description: Axilio backend HTTP API.
  title: Axilio API
  version: 0.155.0
servers:
  - url: https://api.axilio.ai/api/v1
    description: Production
security: []
tags:
  - name: Agents
  - name: API Keys
  - name: Billing
  - name: Conversations
  - name: Files
  - name: Messages
  - name: Models
  - name: Organization
  - name: Phones
  - name: Runs
  - name: Sessions
  - name: Skill
  - name: Usage
  - name: Webhooks
paths:
  /conversations/{conversation_id}:
    delete:
      tags:
        - Conversations
      summary: Delete a conversation
      description: >-
        Deletes every message in a conversation, as DELETE
        /messages/{message_id} does for one: the conversation and its messages
        are removed from every list at once, attachments within 48 hours, and
        the phone is asked to delete the conversation's messages on its side up
        to the newest message deleted here (anything it holds that is newer,
        including texts it has not passed on yet, stays). The response returns
        at once, with phone_deletion.status pending while the phone has not
        answered; Axilio keeps checking for up to 7 days, asking the phone again
        until it confirms (phone_deletion.next_check_at is the next check), and
        a phone not yet set up to delete messages (not_default_app) is asked
        once it can. GET /messages/{message_id} on any of the deleted messages
        shows where the phone's copy stands, and each message fires
        message.deleted, then message.phone_deleted or
        message.phone_delete_failed, as DELETE /messages/{message_id} describes.
        Deleting a conversation does not stop a message in it the phone is still
        sending. A conversation with no messages left is a 404.
      operationId: conversations_delete
      parameters:
        - description: conversation identifier
          in: path
          name: conversation_id
          required: true
          schema:
            description: conversation identifier
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationDeleted'
          description: OK
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Internal Server Error
      security:
        - apiKeyAuth: []
components:
  schemas:
    ConversationDeleted:
      additionalProperties: false
      description: >-
        A deleted conversation: every message in it is deleted and it no longer
        appears in any list or read.
      properties:
        deleted_at:
          description: When the conversation was deleted.
          format: date-time
          type: string
        id:
          description: The deleted conversation's id.
          type: string
        message_count:
          description: How many messages were deleted.
          format: int64
          type: integer
        phone_deletion:
          $ref: '#/components/schemas/PhoneMessagePhoneDeletion'
          description: >-
            What the delete did to the conversation on the phone. Each deleted
            message's GET /messages/{message_id} shows the same outcome.
      required:
        - id
        - deleted_at
        - message_count
        - phone_deletion
      type: object
    V2ErrorModel:
      additionalProperties: false
      description: >-
        Error response, following RFC 9457 (Problem Details for HTTP APIs).
        Returned with a application/problem+json content type.
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/V2ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    PhoneMessagePhoneDeletion:
      additionalProperties: false
      description: What the delete did to the copy on the phone itself.
      properties:
        next_check_at:
          description: >-
            When Axilio next checks this delete: it asks the phone again if the
            phone can delete and the 7 days after the delete aren't over, or
            settles it. Null once the outcome is final: deleted, not_found,
            ambiguous, not_matched and not_sent at once, unconfirmed when the 7
            days run out; message.phone_deleted or message.phone_delete_failed
            fires then.
          format: date-time
          type:
            - string
            - 'null'
        reason:
          description: A human-readable explanation of status.
          type: string
        status:
          description: >-
            pending (the phone has been asked and has not answered yet), deleted
            (the phone deleted its copy), not_found (the phone has no copy),
            ambiguous (an older text the phone cannot tell apart from an
            identical one; left on the phone), not_default_app (the phone is not
            set up to delete messages yet; it is asked once it can), not_matched
            (the phone stored this message before it became the phone's
            messaging app and could not identify it; its copy may still be
            there), failed (the phone tried and failed; it is asked again),
            unconfirmed (the phone has not confirmed the delete: the request
            could not be sent, or 7 days passed without an answer; its copy may
            still be there), or not_sent (the organization no longer rents the
            phone, so nothing was sent). next_check_at is null once the outcome
            is final. More values may be added.
          enum:
            - pending
            - deleted
            - not_found
            - ambiguous
            - not_default_app
            - not_matched
            - failed
            - unconfirmed
            - not_sent
          type: string
      required:
        - status
        - reason
        - next_check_at
      type: object
    V2ErrorDetail:
      additionalProperties: false
      description: >-
        One specific problem within an error response, locating the offending
        part of the request.
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    apiKeyAuth:
      description: Customer API key (axl_ prefix).
      in: header
      name: X-Axilio-Api-Key
      type: apiKey

````

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