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

# Delete File

> Delete the content of file fields.

#### Recipes

<AccordionGroup>
  <Accordion title="Delete file with API key">
    <Steps>
      <Step title="1. Use 'Authorization' header to pass API key">
        ```curl {2} theme={null}
        curl -X DELETE \
        -H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
        -d "field_name=avatar" \
        https://api.quickblox.com/data/UserProfileClass/5d863a78a0eb474dae6099c6/file.json
        ```
      </Step>

      <Step title="2. As a result, the file is removed from the record.">
        ```text theme={null}
        HTTP/1.1 200 OK
        ```
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

#### Path Parameters

<ParamField path="class_name" type="string" required>
  Custom object class name.
</ParamField>

<ParamField path="custom_object_record_id" type="string" required>
  ID of the custom object record. Generated automatically by the server after record creation.
</ParamField>

#### Body Parameters

<ParamField body="field_name" type="string" required>
  Custom object record field which contains a file.
</ParamField>

#### Headers

<ParamField header="QB-Token" type="string" required> A user or application session token. See [Authentication](/reference/authentication) page to learn more about session tokens. Must be used either QB-Token or Authorization. </ParamField>

<ParamField header="Authorization" type="string" default="ApiKey {your_api_key}">
  API key from Dashboard. Expected format: `ApiKey {your_api_key}`. Must be used
  either QB-Token or Authorization.
</ParamField>

<ParamField header="On-Behalf-Of" type="string">
  User ID. The user ID of the user on whose behalf the request is being made.
</ParamField>

#### Responses

<AccordionGroup>
  <Accordion title="200">
    A successful response
  </Accordion>

  <Accordion title="403">
    An error response

    <ResponseField name="errors" type="array of strings" />
  </Accordion>

  <Accordion title="404">
    An error response

    <ResponseField name="errors" type="array of strings" />
  </Accordion>
</AccordionGroup>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE \
  -H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
  -d "field_name=avatar" \
  https://api.quickblox.com/data/UserProfileClass/5d863a78a0eb474dae6099c6/file.json
  ```
</RequestExample>

<ResponseExample>
  ```json 403 theme={null}
  {
    "errors": [
      "Wrong permission"
    ]
  }
  ```

  ```json 404 theme={null}
  {
    "errors": [
      "The resource wasn't found"
    ]
  }
  ```
</ResponseExample>
