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

# Delete file

> Permanently delete a file from the system. This action cannot be undone.



## OpenAPI

````yaml delete /v1/files/{file_id}
openapi: 3.0.3
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.writer.com
security:
  - bearerAuth: []
paths:
  /v1/files/{file_id}:
    delete:
      tags:
        - File API
      summary: Delete file
      description: Permanently delete a file from the system. This action cannot be undone.
      operationId: gatewayDeleteFile
      parameters:
        - name: file_id
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the file.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete_file_response'
              example:
                id: 7c36a365-392f-43ba-840d-8f3103b42572
                deleted: true
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: cURL
          source: >-
            curl --location --request DELETE
            https://api.writer.com/v1/files/{file_id} \
             --header "Authorization: Bearer <token>"
        - lang: JavaScript
          source: |-
            import Writer from 'writer-sdk';

            const client = new Writer({
              apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
            });

            async function main() {
              const file = await client.files.delete('file_id');

              console.log(file.id);
            }

            main();
        - lang: Python
          source: |-
            import os
            from writerai import Writer

            client = Writer(
                # This is the default and can be omitted
                api_key=os.environ.get("WRITER_API_KEY"),
            )
            file = client.files.delete(
                "file_id",
            )
            print(file.id)
components:
  schemas:
    delete_file_response:
      title: delete_file_response
      required:
        - id
        - deleted
      type: object
      properties:
        id:
          type: string
          description: A unique identifier of the deleted file.
        deleted:
          type: boolean
          description: Indicates whether the file was successfully deleted.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your [Writer API
        key](https://dev.writer.com/api-reference/api-keys).

````