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

# Delete a message via API key

> Delete a specific message using API key authentication. Requires CHAT scope.



## OpenAPI

````yaml delete /api/chat-messages/id/{id}
openapi: 3.0.0
info:
  title: LeanMCP SDK API
  description: >-
    API endpoints for LeanMCP SDK integration. These endpoints use API key
    authentication and are designed for programmatic access from the CLI and
    SDK.
  version: 1.0.0
servers:
  - url: https://api.leanmcp.com
    description: Production
  - url: http://localhost:3001
    description: Local Development
security: []
tags:
  - name: builds-sdk
  - name: chat-messages-api-key
  - name: chats-api-key
  - name: deployments-api-key
  - name: deployments-sdk
  - name: mapping-sdk
  - name: projects-api-key
paths:
  /api/chat-messages/id/{id}:
    delete:
      tags:
        - chat-messages-api-key
      summary: Delete a message via API key
      description: >-
        Delete a specific message using API key authentication. Requires CHAT
        scope.
      operationId: ChatMessagesApiKeyController_deleteMessage
      parameters:
        - name: id
          required: true
          in: path
          description: Message ID
          schema:
            type: string
      responses:
        '200':
          description: Message deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteSuccessResponse'
        '404':
          description: Message not found or access denied
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DeleteSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the operation was successful
          example: true
        message:
          type: string
          description: Descriptive message
          example: Chat deleted successfully
        deletedAt:
          type: string
          description: Timestamp of deletion
          example: '2025-06-16T20:00:00.000Z'
      required:
        - success
        - message
        - deletedAt
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Enter your LeanMCP API key

````