POST
/
v1
/
files
/
delete
Delete a file
curl --request POST \
  --url https://api.weblinq.dev/v1/files/delete \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "fileId": "<string>",
  "deleteFromR2": false
}'
{
  "success": true,
  "data": {
    "fileId": "<string>",
    "wasFound": true,
    "deletedFromDatabase": true,
    "deletedFromR2": true,
    "deletedFile": {
      "id": "<string>",
      "type": "screenshot",
      "url": "<string>",
      "filename": "<string>",
      "r2_key": "<string>",
      "public_url": "<string>",
      "metadata": "<string>",
      "created_at": "<string>",
      "expires_at": "<string>"
    },
    "error": "<string>"
  },
  "creditsCost": 123,
  "requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "timestamp": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Enter your API token or session token

Body

application/json

File deletion parameters

The body is of type object.

Response

File deleted successfully

The response is of type object.