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

# Purge Storage Items

> Purge storage items based on specified criteria

Purge multiple storage items based on filtering criteria such as age, MIME type, or metadata. Use this for bulk cleanup operations.

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer <your-api-key>`
</ParamField>

## Required Permission

`STORAGE_WRITE`

## Request Body

<ParamField body="kind" type="string">
  Filter by file kind. Available values: `image`, `video`, `audio`, `document`
</ParamField>

<ParamField body="before" type="string">
  ISO 8601 date - purge items created before this date
</ParamField>

<ParamField body="after" type="string">
  ISO 8601 date - purge items created after this date
</ParamField>

## Response

<ResponseField name="message" type="string">
  Success message indicating the operation result
</ResponseField>

<ResponseField name="purgedCount" type="number">
  Number of items purged (or would be purged if dry run)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.nonefivem.com/cloud/storage/purge" \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "kind": "image",
      "before": "2025-01-01T00:00:00Z"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.nonefivem.com/cloud/storage/purge", {
    method: "DELETE",
    headers: {
      Authorization: "Bearer your-api-key",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      kind: "image",
      before: "2025-01-01T00:00:00Z"
    })
  });
  const result = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "message": "42 items purged successfully",
    "purgedCount": 42
  }
  ```
</ResponseExample>

<Warning>
  This action is irreversible. Deleted files cannot be recovered.
</Warning>

<Tip>
  Combine `kind`, `before`, and `after` to target specific files. For example,
  purge all images created before a specific date.
</Tip>
