Documents

Update an existing file's metadata or content.

patch/documents/v1/{file_id}

Request

  • Base URL
    https://api.mitti.com
  • Auth
    HTTP bearer

Path parameters

file_idstring required

The ID of the file you want to update. To get the file_id, open the file in the SafetyCulture web app and copy the last part of the URL. For example, in this link https://app.safetyculture.com/documents/document/765aa2e6-69cb-43b5-8ab4-48ab26e2a094, the file ID is 765aa2e6-69cb-43b5-8ab4-48ab26e2a094.

Request body

file_type'MEDIA_TYPE_IMAGE' | 'MEDIA_TYPE_VIDEO' | 'MEDIA_TYPE_PDF' | 'MEDIA_TYPE_DOCX' | 'MEDIA_TYPE_XLSX' | 'MEDIA_TYPE_PPTX' | 'MEDIA_TYPE_CSV'
  • MEDIA_TYPE_IMAGE: An image file (GIF, JPG, PNG, WEBP).
  • MEDIA_TYPE_VIDEO: A video file (MP4, MOV).
  • MEDIA_TYPE_PDF: A PDF document.
  • MEDIA_TYPE_DOCX: A Microsoft Word document (DOCX, DOC).
  • MEDIA_TYPE_XLSX: A Microsoft Excel spreadsheet (XLSX, XLS).
  • MEDIA_TYPE_PPTX: A Microsoft PowerPoint presentation (PPTX, PPT).
  • MEDIA_TYPE_CSV: A CSV file.
file_sizeinteger

The size of the file in bytes. Must not exceed 50MB. This field is required if file_type is provided.

namestring

The new name of the file. Maximum of 255 characters and must exclude invalid characters.

file_extensionstring

The file extension of the uploaded blob (e.g. "pdf", "jpg"), without the leading dot. Used to populate the file's extension when the extension cannot be derived from name or the underlying media metadata is unavailable.

Response

A successful response.

upload_urlstring

The URL where you must upload the file’s binary content. It is valid for 20 minutes.

version_numberinteger

The version number of the file after the update.

Changes