Menú

Referencia de la API · CRM

Archivos

crm · files · 4 operaciones

DELETE/v1/crm/files/{file_id}

Delete a file attached to a record

crm.files.delete

IrreversibleIdempotenteDesde 2026-11-01

Deletes a file attached to a deal, person, company or prospect (its Files tab): the stored file and its entry. Pass the record the file belongs to (entity_type and entity_id, the same as in crm.files.list) and the file_id. The stored file is removed only when its key is in this record's own folder of CRM files (organizations/{org_id}/crm/files/{entity_type}/{entity_id}/, where MB Suite uploads them); an entry whose stored key points anywhere else is removed and the object it points to is left untouched. It does NOT go to the trash and cannot be restored. Its size goes back to the storage quota: right away for a file stored more than a day ago, and with the next storage recount (within 6 hours) for a newer one. The timeline entry of the upload stays, marked as deleted (who and when). Deleting a file that no longer exists succeeds without changes. To attach a file use crm.files.create. Requires the edit permission of that record type (edit_deal, edit_person, edit_company or edit_prospect; a seller only on their own or unassigned records). Outside the screen it requires a confirmation (dry run and confirm_token) and a key allowed to delete.

Pide confirmación: primero dry_run: true (vista previa y confirm_token, que vale 10 minutos y una sola vez), después el mismo cuerpo con confirm_token. En unas pocas, solo con ciertos datos: la descripción dice cuándo. Por qué y cómo: Vista previa y confirmación.

Alcance
crm:write y «Permitir eliminar» (crm:delete en OAuth)
Permiso
Editar en el módulo
Tool del MCP
crm_files_deleteEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.files.delete".

Costo declarado: hasta 7 lecturas y 7 escrituras por llamada (cuentan en el cupo diario).

Parámetros

file_idstringrutarequerido

The file: an id of crm.files.list for that record.

entity_typeenumcuerporequerido

The kind of record the file belongs to: deal, person, company or prospect (the one passed to crm.files.list).

Valores: deal, person, company, prospect

entity_idstringcuerporequerido

The id of the record the file belongs to (the one passed to crm.files.list).

Respuesta

oktrue

Errores

Ejemplo

curl -X DELETE "https://api.mb-suite.com/v1/crm/files/{file_id}" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "entity_type": "deal",
  "entity_id": "ENTITY_ID",
  "dry_run": true
}'

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl -X DELETE "https://api.mb-suite.com/v1/crm/files/{file_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "entity_type": "deal",
  "entity_id": "ENTITY_ID",
  "dry_run": true
}'
GET/v1/crm/files

List the files attached to a record

crm.files.list

LecturaIdempotenteDesde 2026-11-01

Lists the files attached to a deal, person, company or prospect (its Files tab), newest first, paginated by cursor (limit up to 200). Each file brings file_name, mime_type, size in bytes, who uploaded it and when, storage_path and download_url: a signed link to download it without a session that expires in an hour (download_url_expires_at); it is null when the stored key is not in this record's own folder of CRM files (organizations/{org_id}/crm/files/{entity_type}/{entity_id}/). Not found (entity_not_found) if the record does not exist or is out of the caller's scope (a seller with a restricted scope sees the files of their own or unassigned records, and of the people and companies of their deals). Needs view access to the CRM.

Alcance
crm:read
Permiso
Ver el módulo
Tool del MCP
crm_files_listEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.files.list".

Costo declarado: hasta 203 lecturas y 0 escrituras por llamada (cuentan en el cupo diario).

Parámetros

entity_typeenumqueryrequerido

The kind of record the files belong to: deal, person, company or prospect.

Valores: deal, person, company, prospect

entity_idstringqueryrequerido

The record's id (crm.deals.list, crm.persons.list, crm.companies.list or crm.prospects.list).

limitintegerqueryopcional

How many items this page brings at most (see the maximum and the default in the schema).

Por defecto: 50

cursorstringqueryopcional

The next_cursor of the previous page, exactly as it came (only for the same list and filters); without it, the first page.

Respuesta

dataarray<object>
has_moreboolean
next_cursorstring

Errores

Ejemplo

curl "https://api.mb-suite.com/v1/crm/files?entity_type=deal&entity_id=ENTITY_ID" \
  -H "Authorization: Bearer $MB_API_KEY"

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl "https://api.mb-suite.com/v1/crm/files?entity_type=deal&entity_id=ENTITY_ID" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/crm/files

Attach a file to a record

crm.files.create

EscrituraIdempotenteDesde 2026-11-01

Attaches a file to a deal, person, company or prospect (its Files tab) and leaves a file entry in the record's timeline, like uploading it from the app. Two ways: send the file itself as content_base64 with content_type (up to 768000 bytes = 750 KB decoded, because the request body is capped at 1 MB), or upload it first with crm.files.uploads.create (up to 50 MB), PUT the bytes and pass the storage_path it returned. file_name is the name shown in the app. Accepted types: images (JPEG, PNG, WebP, GIF), videos (MP4, MOV, WebM), PDF, Word, Excel, PowerPoint, CSV, plain text, Markdown, ZIP and audio (MP3, M4A, OGG, WAV). Idempotent: the same storage_path, or the same content with the same name on the same record, returns the file already there with created: false. Returns file_id, the file (with a download_url signed for one hour) and activity_id. Inline bytes count toward the organization's storage quota (a storage_path already counted when its upload URL was issued). Errors: entity_not_found, invalid_input (also an entity_id that is a reserved storage folder name: thumbnails, booking_avatar, and a content_type outside the accepted ones, with the list), storage_path_invalid (a key that is not from crm.files.uploads.create for this record), storage_object_not_found (nothing was PUT to it), unsupported_media_type (the file PUT to storage_path is of a type the Files tab does not take), file_too_large, limit_reached (details.resource storage: the storage is full), crm_action_denied (the edit permission of that record type: edit_deal, edit_person, edit_company or edit_prospect; a seller only on their own or unassigned records). Does not send the file to anyone: to send it by WhatsApp use crm.whatsapp.uploads.create and crm.whatsapp.send_media.

Instrucciones para agentes

Tell the person the file was attached to the record (or that it was already there, when created is false), with its name.

Alcance
crm:write
Permiso
Editar en el módulo
Tool del MCP
crm_files_createEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.files.create".

Costo declarado: hasta 170 lecturas y 3 escrituras por llamada (cuentan en el cupo diario).

Parámetros

entity_typeenumcuerporequerido

The kind of record the files belong to: deal, person, company or prospect.

Valores: deal, person, company, prospect

entity_idstringcuerporequerido

The record's id (crm.deals.list, crm.persons.list, crm.companies.list or crm.prospects.list).

file_namestringcuerporequerido

The name the Files tab and the timeline show.

storage_pathstringcuerpoopcional

The storage_path crm.files.uploads.create returned, once its PUT finished. Exactly one of storage_path and content_base64.

content_base64stringcuerpoopcional

The file itself, standard base64, up to 750 KB decoded. Exactly one of storage_path and content_base64.

content_typeenumcuerpoopcional

Its type, one of the accepted ones (another is invalid_input on content_type). Required with content_base64; with storage_path, if sent, it must be the uploaded file's.

Valores: image/jpeg, image/png, image/webp, image/gif, video/mp4, video/quicktime, video/webm, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain, text/markdown, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/zip, application/x-zip-compressed, audio/mpeg, audio/mp4, audio/ogg, audio/wav

sizeintegercuerpoopcional

Optional: if sent, it must be the real size in bytes.

Respuesta

file_idstring
createdboolean
fileobject
activity_idstring | null

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/files" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "entity_type": "deal",
  "entity_id": "ENTITY_ID",
  "file_name": "FILE_NAME"
}'

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl -X POST "https://api.mb-suite.com/v1/crm/files" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "entity_type": "deal",
  "entity_id": "ENTITY_ID",
  "file_name": "FILE_NAME"
}'
POST/v1/crm/files/uploads

Get a signed URL to upload a file for a record

crm.files.uploads.create

EscrituraDesde 2026-11-01

First step to attach a file of up to 50 MB to a deal, person, company or prospect through the API (a file of up to 750 KB can go in one call: crm.files.create with content_base64). Send entity_type, entity_id, file_name, content_type and the exact size in bytes; it checks the record, its edit permission and the storage quota, and returns upload_url, the headers to send, storage_path and expires_at (10 minutes to start the upload). Then PUT the raw bytes to upload_url from a server with exactly those headers and exactly size bytes (the URL is bound to that size and content type: anything else is rejected), and call crm.files.create with that storage_path and file_name: until then the file is not in the record. The size counts toward the storage quota when the URL is issued. Each call issues a new URL (not idempotent). Errors: entity_not_found, invalid_input (also an entity_id that is a reserved storage folder name: thumbnails, booking_avatar), filename_invalid, limit_reached (details.resource storage: the storage is full), crm_action_denied (the record's edit permission, as in crm.files.create). Needs full access to the CRM.

Instrucciones para agentes

If the upload URL expired before the PUT, ask for a new one; do not register a storage_path that was never uploaded.

Alcance
crm:write
Permiso
Editar en el módulo
Tool del MCP
crm_files_uploads_createEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.files.uploads.create".

Costo declarado: hasta 151 lecturas y 1 escrituras por llamada (cuentan en el cupo diario).

Parámetros

entity_typeenumcuerporequerido

The kind of record the files belong to: deal, person, company or prospect.

Valores: deal, person, company, prospect

entity_idstringcuerporequerido

The record's id (crm.deals.list, crm.persons.list, crm.companies.list or crm.prospects.list).

file_namestringcuerporequerido

The file's name (it goes, cleaned, into the storage key).

content_typeenumcuerporequerido

The file's type: the PUT must send exactly this Content-Type.

Valores: image/jpeg, image/png, image/webp, image/gif, video/mp4, video/quicktime, video/webm, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain, text/markdown, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/zip, application/x-zip-compressed, audio/mpeg, audio/mp4, audio/ogg, audio/wav

sizeintegercuerporequerido

The exact size in bytes of the file to upload: the URL accepts only that size.

Respuesta

upload_urlstring
method"PUT"
headersobject
storage_pathstring
expires_atnumber
max_sizenumber

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/files/uploads" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "entity_type": "deal",
  "entity_id": "ENTITY_ID",
  "file_name": "FILE_NAME",
  "content_type": "image/jpeg",
  "size": 1
}'

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl -X POST "https://api.mb-suite.com/v1/crm/files/uploads" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "entity_type": "deal",
  "entity_id": "ENTITY_ID",
  "file_name": "FILE_NAME",
  "content_type": "image/jpeg",
  "size": 1
}'