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

# Delete a model

> Delete a model. By default, only the latest version is deleted, and it must have no model runs.
Use the all_versions parameter to delete all versions of the model at once.




## OpenAPI

````yaml DELETE /models/{model_id}
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /models/{model_id}:
    delete:
      summary: Delete a model
      description: >
        Delete a model. By default, only the latest version is deleted, and it
        must have no model runs.

        Use the all_versions parameter to delete all versions of the model at
        once.
      operationId: delete-model
      parameters:
        - name: model_id
          in: path
          description: Model friendly ID (e.g., mdl_abc123def456)
          schema:
            type: string
          required: true
        - name: all_versions
          in: query
          description: |
            When true, deletes all versions of the model.
            When false or omitted, deletes only the latest version.
            The model(s) must not have any model runs to be deleted.
          schema:
            type: boolean
          required: false
      responses:
        '204':
          description: 204 No Content
        '422':
          description: '422'
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: error
                    statusCode: 422
                    errors:
                      - message: Cannot delete model with existing model runs
              schema:
                type: object
                properties:
                  status:
                    type: string
                  statusCode:
                    type: integer
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````