Skip to content

Upload new content
Stable

Request

Uploads a file to the enterprise content library, creating a new Content record. Accepts a multipart/form-data payload with the binary file in the key field and returns the resulting Content object including id, download_url, MIME type, hash, and size. This is the primary mechanism for adding files to Esper's content library for device distribution.

About Upload Content

The content upload endpoint stores an arbitrary file in Esper's enterprise content library, which acts as a managed file repository for pushing files to enrolled devices. This is not intented for application uploads. Use the app upload enpoint instead. On successful upload, Esper returns a Content record with a download_url, a computed hash for integrity verification, and a detected kind (MIME type). The returned id is used to reference the content in distribution commands and PATCH operations. Unlike the APK upload endpoint, content upload accepts any supported file type — configuration files, scripts, media, documents, and more.

Key Fields

key — required; the binary file to upload, sent as multipart/form-data

id — returned in the response; integer identifier for this content record used in downstream operations

download_url — direct URL to retrieve the uploaded file

hash — SHA hash of the uploaded file for integrity verification

kind — MIME type detected from the uploaded file

tags / description — not set at upload; add via PATCH .../content/{content_id}/ after upload

Common Use Cases

Upload configuration files, scripts, or reference documents to the content library for device distribution. Add media or resource files that devices need to download as part of a provisioning Workflow. Automate content updates as part of a CI/CD or content management pipeline.

Best Practices

Tags and descriptions cannot be set at upload time — immediately follow a successful upload with PATCH .../content/{content_id}/ to add tags and a description, which are needed for the search parameter on the list endpoint to find this file later. Store the id from the response; it is an integer (not a UUID) and is the reference for all downstream content operations. Verify the returned hash against your local file hash to confirm upload integrity.

Workflow

POST the file binary as key in a multipart/form-data request. Capture the id, download_url, and hash from the response. Immediately PATCH the new content record to add tags and description for searchability.

Security
esper_cloud_api_apiKey
Path
enterprise_idstringrequired

A UUID string identifying this enterprise.

Bodymultipart/form-datarequired
keystring, (binary)required

Valid file to upload

cURL
curl -i -X POST \
  'https://api.esper.io/_mock/openapi/v0/enterprise/{enterprise_id}/content/upload/' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F key=string

Responses

Successful Operation

Bodyapplication/json
idinteger(Id)read-onlyrequired

Unique content Identifier

download_urlstring, (url)(Content download URL)

URL to download the content

namestring(Name)

Name of the content

keystring, [ 1 .. 255 ] characters(Key)
is_dirboolean(Is Directory)
Default:false
kindstring or null, <= 255 characters(Content kind)

The mime type of the content

hashstring(Content Hash)

Hash string of the content

sizestring, <= 255 characters(Content Size)

Size of the content in bytes

pathstring(Path)

Path to the content

permissionsstring(Permissions)

The permssion string for the content

tagsArray of strings(Content tags)

Tags for the content

descriptionstring or null(Content description)

Description for the content

createdstring, (date-time)(Created on)read-only
modifiedstring, (date-time)(Modified on)read-only
enterprisestring, (url)(Enterprise)

URL of the enterprise resource

ownerobject(Owner)

Owner of the content

Response
{ "id": 0, "download_url": "string", "name": "string", "key": "string", "is_dir": false, "kind": "string", "hash": "string", "size": "string", "path": "string", "permissions": "string", "tags": [ "string" ], "description": "string", "created": "2019-08-24T14:15:22Z", "modified": "2019-08-24T14:15:22Z", "enterprise": "string", "owner": { "id": 0, "username": "string" } }