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

# Delete a file

> Deletes a file by its ID.



## OpenAPI

````yaml /api/files/openapi.yaml delete /files/{id}/delete
openapi: 3.1.0
info:
  title: Unified CDN API | Files
  description: Interact with files on the Unified CDN system.
  version: 0.1.0
servers:
  - url: https://{Unified_CDN_domain}/api
    description: Production server where your Unified CDN is hosted.
    variables:
      Unified_CDN_domain:
        default: api.example.com
        description: >-
          The domain where your Unified CDN is hosted. Change this to your
          custom domain if you have one.
security: []
paths:
  /files/{id}/delete:
    delete:
      summary: Delete a file
      description: Deletes a file by its ID.
      parameters:
        - name: id
          description: ID of the file to delete.
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted the file.
          content:
            application/json:
              example:
                message: File deleted successfully.
        '400':
          description: Bad request due to invalid configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                timezone_not_set:
                  value:
                    error: InvalidConfigurationError
                    message: The site's timezone is not set.
                provider_failed:
                  value:
                    error: InvalidConfigurationError
                    message: >-
                      Could not connect to database provider. Please check your
                      database key configurations.
                provider_unsupported:
                  value:
                    error: InvalidConfigurationError
                    message: The configured database provider is not supported.
        '401':
          $ref: '#/components/responses/UnauthorisedError'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKeyAuth: []
        - CodeAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - message
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    UnauthorisedError:
      description: The request lacks valid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorised:
              value:
                error: UnauthorisedError
                message: You are unauthorised to perform this action.
    NotFound:
      description: The specified resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            notFound:
              value:
                error: NotFoundError
                message: The requested resource was not found.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Enter your API key using the format `Bearer <your-api-key>`.
    CodeAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Enter your code using the format `Code <your-code>`.

````

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