Easymailing
Files

Rename or describe a file

PUT /files/{uuid}

PUT/files/{uuid}

Changes the name shown for a file and/or its description. Fields you leave out keep their value; description: null clears it. The bytes, the type and the record never change.

When to use: To give a file a clearer name or add context ("version signed by the client"). Read version first with get_file or list_files and send it as expected_version.

When not to use: To replace the content, delete the file with delete_file and upload a new one with create_file. To move the file to another record, upload it again there. The extension cannot be changed: Proposal.pdf can become Proposal v2.pdf, never Proposal.docx.

Side effects: Only the file changes. No activity entry is added to the record, nothing is sent and no webhook fires. Sending the same name and description changes nothing and keeps the version.

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

Request Body

The updated File resource

TypeScript Definitions

Use the request body type in TypeScript.

CRM Files of the public API (fase 5). Generated from the proposal by fase-5/tools/gen_files_api.py and edited by hand afterwards: the texts are the proposal's. Every operation checks the CRM access in its provider or processor before anything else, because API Platform evaluates security after the provider.

Two operations are binary, as in the panel's internal API: set_file_content takes the raw bytes (deserialize: false, its Content-Type is checked by the processor before the body is opened) and get_file_content answers a streamed attachment (output: false, serialize: false). Their bodies are declared by hand in openapiContext.

list_files pages forward only by cursor (cursor[gt], the use case has no backwards page): cursor is the opaque position API Platform copies into hydra:next, and {@see ForwardOnlyCursor} drops the hydra:previous it would also build. It is never published.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PUT "https://api.easymailing.com/files/6e2b8f14-3a7c-4d95-b0e1-8c5a2d7f9341" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "display_name": "string",    "description": "string",    "expected_version": 1  }'
{  "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",  "record": "/entity/1",  "record_type": "contact",  "display_name": "string",  "description": "string",  "original_name": "string",  "mime_type": "string",  "size_bytes": 0,  "source": "upload",  "status": "uploading",  "previewable": true,  "created_by": {    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",    "kind": "user",    "name": "string"  },  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}