Skip to navigation

Delete File (Move to Trash)

View as Markdown

Delete File (Move to Trash)

Moves a file to trash instead of permanently deleting it. The file can typically be restored later depending on the system’s trash management.

Method: DELETE
URL: {{base_url}}/files/{{file_id}}


Authentication

This endpoint requires authentication.

  • Recommended: Bearer token in the Authorization header:
Authorization: Bearer {{access_token}}

Notes:

  • If your collection/folder already sets auth, this request can inherit auth.

  • Ensure {{access_token}} is a valid, non-expired token.


Required variables

Set these variables at the environment or collection level:

VariableRequiredDescription
base_urlYesBase API URL (e.g. https://app.getgabs.com/partners/wp-gallery/manage)
access_tokenYesAccess token used to authorize the request
file_idYesID of the file to delete

Path Parameters

ParameterTypeRequiredDescription
file_idintegerYesUnique identifier of the file to move to trash

Example request URL:

{{base_url}}/files/34

Sample request

curl --request DELETE "{{base_url}}/files/{{file_id}}" \
--header "Authorization: Bearer {{access_token}}"

Sample success response

A successful request typically returns HTTP 200 OK.

{
"success": true,
"message": "File moved to trash"
}

Common errors

  • 400 Bad Request

    • Invalid or missing file_id
  • 401 Unauthorized / 403 Forbidden

    • Missing/invalid Authorization header

    • Expired {{access_token}}

  • 404 Not Found

    • File with the given file_id does not exist

Notes

  • This endpoint performs a soft delete by moving the file to trash.

  • The file is not permanently deleted immediately.

  • The file may be restored later if the system supports trash recovery.

  • Permanent deletion may require a separate endpoint or automatic cleanup policy.

Response

OK
messagestring
successboolean