MCP Control
Файлы и медиа · Изменение

Файлы · Подготовка · Загрузка

files_prepare_upload
Фотокамера и образцы цвета

Попробуйте три запроса

Подготовить
  1. Вы указываетеОбъект
  2. ПомощникПодготовка
  3. Вы получаетеПредпросмотр
Запрос в чат
Подготовь «Файлы / Подготовка / Загрузка». Для изменения нужны entityType, объект. Покажи объект и ожидаемый эффект до выполнения.
Что входит в подготовку
entityType
Параметр
entityId
Объект
fileName
Параметр
Применить
  1. Вы указываетеСогласованные значения
  2. ПомощникОдин вызов
  3. Вы получаетеОтвет операции
Запрос в чат
На учебной записи подготовь «Файлы / Подготовка / Загрузка» с параметром entityType = customer. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
Фрагмент учебных параметров
entityType
customer
mimeType
video/mp4
entityId
DEMO-101
Проверить итог
  1. Вы указываетеИсходный ответ
  2. ПомощникСверка результата
  3. Вы получаетеПодтверждение
Запрос в чат
Проверь результат «Файлы / Подготовка / Загрузка» по исходному ответу. Покажи файл, referenceId. Объясни, чем подтвердить эффект для выбранного объекта.
Как проследить одну попытку
  1. ЗапросСохранить исходный ключ
  2. ОтветПроверить статус
  3. ПроверкаСверить эффект операции
Как работает действие

Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения.

Описание разработчика

Prepare a private PDF, UTF-8 text/CSV/JSON, bounded ZIP, non-macro Office or MP4/WebM video upload for an existing authorized entity. For a product video, use the returned private 15-minute upload URL with the raw bytes; no separate login is required. Other files use a bearer-authenticated PUT. Send bytes outside MCP/model context; preparation does not attach a file to native business fields. For storefront product photos and videos, use the single catalog_products_upload_media action: prepare, PUT original parts, then complete with uploadId (Control retrieves the current revision). For completed private/managed media use complete with fileId or mediaId.

Параметры запроса
entityType
Existing entity type. Current company, location and entity permissions are checked before accepting or reading a private file. обязательно по схеме · string · варианты customer, lead, task, order, product, company, employee
entityId
Canonical existing entity ID, verified with the current account permissions. обязательно по схеме · string · до символов 128
fileName
Download filename with the extension matching the declared MIME type. обязательно по схеме · string · до символов 160
mimeType
Actual supported document or MP4/WebM video format. Video playback depends on browser codec support. HTML, SVG, scripts, executables, encrypted archives and macro-enabled Office files are not accepted. обязательно по схеме · string · варианты video/mp4, video/webm, application/pdf, text/plain, text/csv, application/json, application/zip, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.presentationml.presentation
byteLength
Exact source file length, at most20MiB. Submit bytes through the authenticated PUT handoff. обязательно по схеме · integer · максимум 20971520
requestId
Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string · до символов 128
Что вернёт команда
fileId
Server-issued private file UUID, separate from managed image IDs. обязательно по схеме · string
referenceId
Internal attachment reference file:<fileId>; never proof of access. обязательно по схеме · string
uploadUrl
Authenticated raw-byte PUT handoff on this deployment. обязательно по схеме · string
method
Send original file bytes with HTTP PUT to the authenticated handoff URL. обязательно по схеме · string
mimeType
Actual supported document or MP4/WebM video format. Video playback depends on browser codec support. HTML, SVG, scripts, executables, encrypted archives and macro-enabled Office files are not accepted. обязательно по схеме · string · варианты video/mp4, video/webm, application/pdf, text/plain, text/csv, application/json, application/zip, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.presentationml.presentation
byteLength
Exact source/stored file byte length, at most20MiB. обязательно по схеме · integer · максимум 20971520
expiresAt
UTC deadline for first submission of file bytes. обязательно по схеме · string
status
Prepared, already accepted, or completed state for this exact retry identifier. обязательно по схеме · string · варианты prepared, uploading, completed
Поля и технические схемы
Входные поля и поля ответа files_prepare_upload
Вход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "entityType": {
      "type": "string",
      "enum": [
        "customer",
        "lead",
        "task",
        "order",
        "product",
        "company",
        "employee"
      ],
      "description": "Existing entity type. Current company, location and entity permissions are checked before accepting or reading a private file."
    },
    "entityId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_~:@+.-]+$",
      "description": "Canonical existing entity ID, verified with the current account permissions."
    },
    "fileName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160,
      "description": "Download filename with the extension matching the declared MIME type."
    },
    "mimeType": {
      "type": "string",
      "enum": [
        "video/mp4",
        "video/webm",
        "application/pdf",
        "text/plain",
        "text/csv",
        "application/json",
        "application/zip",
        "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "application/vnd.openxmlformats-officedocument.presentationml.presentation"
      ],
      "description": "Actual supported document or MP4/WebM video format. Video playback depends on browser codec support. HTML, SVG, scripts, executables, encrypted archives and macro-enabled Office files are not accepted."
    },
    "byteLength": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 20971520,
      "description": "Exact source file length, at most20MiB. Submit bytes through the authenticated PUT handoff."
    },
    "requestId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_-]+$",
      "description": "Retry identifier for this exact declaration; preserve every argument on retry. File bytes and base64 never belong in MCP arguments."
    }
  },
  "required": [
    "entityType",
    "entityId",
    "fileName",
    "mimeType",
    "byteLength",
    "requestId"
  ],
  "additionalProperties": false
}
Выход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "fileId": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      "description": "Server-issued private file UUID, separate from managed image IDs."
    },
    "referenceId": {
      "type": "string",
      "pattern": "^file:[0-9a-f-]{36}$",
      "description": "Internal attachment reference file:<fileId>; never proof of access."
    },
    "uploadUrl": {
      "type": "string",
      "format": "uri",
      "description": "Authenticated raw-byte PUT handoff on this deployment."
    },
    "method": {
      "type": "string",
      "const": "PUT",
      "description": "Send original file bytes with HTTP PUT to the authenticated handoff URL."
    },
    "mimeType": {
      "type": "string",
      "enum": [
        "video/mp4",
        "video/webm",
        "application/pdf",
        "text/plain",
        "text/csv",
        "application/json",
        "application/zip",
        "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "application/vnd.openxmlformats-officedocument.presentationml.presentation"
      ],
      "description": "Actual supported document or MP4/WebM video format. Video playback depends on browser codec support. HTML, SVG, scripts, executables, encrypted archives and macro-enabled Office files are not accepted."
    },
    "byteLength": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 20971520,
      "description": "Exact source/stored file byte length, at most20MiB."
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "description": "UTC deadline for first submission of file bytes."
    },
    "status": {
      "type": "string",
      "enum": [
        "prepared",
        "uploading",
        "completed"
      ],
      "description": "Prepared, already accepted, or completed state for this exact retry identifier."
    }
  },
  "required": [
    "fileId",
    "referenceId",
    "uploadUrl",
    "method",
    "mimeType",
    "byteLength",
    "expiresAt",
    "status"
  ],
  "additionalProperties": false
}