files

Register a file upload

Changed on

Registers an image or video in the org's file library and returns a presigned S3 URL to upload the bytes to. PUT the raw file to upload_url with the declared Content-Type and Content-Length headers before the URL expires, then call the complete endpoint to make it ready. The registered file has source=upload. Uploads are capped per file and per org by total size.

post/files

Request

Request body

$schemastring uri

A URL to the JSON Schema for this object.

filenamestring required

Display name for the file (also its name on the phone).

mime_typestring required

MIME type of the upload; must be an allowed image or video type.

size_bytesinteger required

Exact size of the upload in bytes, up to 100 MiB (the phone-delivery ceiling); the presigned URL pins it.

Example request

{
  "$schema": "/api/v1/FileCreateRequest.json"
}

Response

Created

$schemastring uri

A URL to the JSON Schema for this object.

upload_expires_in_secondsinteger required

How long the upload URL stays valid.

upload_urlstring required

Presigned S3 PUT URL. PUT the raw file bytes to it with the declared Content-Type and Content-Length headers.

Example response

{
  "$schema": "/api/v1/FileUploadResponse.json",
  "file": {
    "$schema": "/api/v1/FileSummary.json"
  }
}

Changes

    • warning

      added the new message enum value to the / response property for the response status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • breaking

      the request property's max was decreased to 104857600.00