Easymailing
Files

Delete a file

DELETE /files/{uuid}

DELETE/files/{uuid}

Permanently deletes an available file from its record and frees its storage. There is no trash and no undo. On a file whose upload is still in progress (uploading), it cancels the upload instead.

When to use: Only when the user explicitly asks to delete this file, for example one attached to the wrong record, or to replace it by a new version. To abandon an upload started with create_file that will not be completed, call it without expected_version.

When not to use: To rename it, use update_file. Deleting a contact, company or opportunity already removes its files; do not delete them one by one for that.

Side effects: A file.removed entry appears in the activity of the record, done by the person who owns the token (marked «via Maia» when Maia made the request). The space is returned to the account at once and the stored bytes are removed in the background. Cancelling an upload adds no activity entry and returns its reserved space. Nothing is sent to anyone and no webhook fires.

Permissions: Requires a CRM seat and the crm.contacts_companies.write capability. A file inherits the access of the record it is attached to: for a file of an opportunity the user needs the crm.opportunities.work capability and work access to its pipeline instead. A file the user cannot reach is reported as not found, never as forbidden.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

uuid*string

UUID of the file. Get it from list_files (or from create_file while uploading).

Formatuuid

Query Parameters

expected_version?integer

Version of the file you read (version). Required to delete an available file: if it has changed since, nothing is deleted and you get crm_file_version_conflict. Leave it out only to cancel an upload still in progress.

Range1 <= value

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X DELETE "https://api.easymailing.com/files/6e2b8f14-3a7c-4d95-b0e1-8c5a2d7f9341?expected_version=1" \  -H "X-Auth-Token: YOUR_API_KEY"
Empty