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

# Delete a file

> Deletes a file. Batches already created from it are not affected.



## OpenAPI

````yaml delete /v1/files/{file_id}
openapi: 3.1.0
info:
  title: Perplexity AI API
  description: Perplexity AI API
  version: 1.0.0
servers:
  - url: https://api.perplexity.ai
    description: Perplexity AI API
security: []
paths:
  /v1/files/{file_id}:
    delete:
      tags:
        - Batches
      summary: Delete a file
      description: Deletes a file. Batches already created from it are not affected.
      operationId: deleteFile
      parameters:
        - $ref: '#/components/parameters/BatchFileId'
      responses:
        '200':
          description: The file was deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchFileDeleted'
        '404':
          description: File not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - HTTPBearer: []
components:
  parameters:
    BatchFileId:
      name: file_id
      in: path
      required: true
      schema:
        type: string
      description: File identifier (file_...)
  schemas:
    BatchFileDeleted:
      type: object
      required:
        - id
        - object
        - deleted
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - file
        deleted:
          type: boolean
    ApiError:
      type: object
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              description: Human-readable error message
              type: string
            type:
              type: string
              description: Error type identifier
            code:
              type: integer
              description: HTTP status code
            param:
              type: string
              description: Parameter that caused the error
              nullable: true
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````