Create an upload

Creates a resumable upload (tus protocol): the first step to upload a file.

Required role: ORG_VIEWER, to upload documents (DOCUMENT) only, or ORG_EDITOR for all file types. The organization path parameter must be the organization of the access token.

Headers

HeaderRequiredDescription
Tus-ResumableYes1.0.0
Upload-LengthYesSize of the file, in bytes
Upload-MetadataYesThe metadata below, as comma-separated key value pairs, each value encoded in Base64

Metadata (Upload-Metadata)

KeyRequiredDescription
filenameYesName of the file, with its extension. Executable files (.exe, .msi, .bat, .sh, .js, .dll, ...) are refused.
JMC-fileTypeYesVECTOR_DATA, RASTER_DATA or TABULAR_DATA (data to import as a data source), DOCUMENT (attachment of a feature or row) or MEDIA (image of a project presentation page)
JMC-partNumberNoFor a file made of several files (see below): {part}_of_{total}, such as 1_of_3
JMC-partIdNoFor the other parts of a file made of several files: the JMC-partId returned for the first part
JMC-containerTypeNoGDB, for the files of an Esri File Geodatabase folder (VECTOR_DATA only)
JMC-containerNameNoWith JMC-containerType: the name of the folder, such as parcels.gdb

For example, filename myData.zip and JMC-fileType VECTOR_DATA are sent as:

Upload-Metadata: filename bXlEYXRhLnppcA==,JMC-fileType VkVDVE9SX0RBVEE=

Files made of several files

A data set made of several files (such as a shapefile's .shp, .dbf, .shx and .prj, or an image and its world file) can be uploaded as several uploads instead of a ZIP file:

  • send JMC-partNumber (1_of_4, 2_of_4, ...) with each part;
  • the response to the first part has a JMC-partId header: send it as JMC-partId with the other parts.

When all the parts are uploaded, they become one file whose id is the JMC-partId, and it is analyzed.

How to upload a file

Uploads follow the tus 1.0.0 resumable upload protocol: any tus client (such as tus-js-client) can be used, with the access token in its headers.

  1. POST .../upload creates the upload: the response is 201 with its URL in the Location header, .../upload/{fileId}. fileId is the id of the file in this service.
  2. PATCH .../upload/{fileId} sends the content, in one request or in several chunks.
  3. To resume an interrupted upload, HEAD .../upload/{fileId} returns the number of bytes received in Upload-Offset: send the rest from there.

Follow the file with GET .../files/{fileId} (see its status). An upload that isn't completed within 2 days expires.

After the upload

The file is scanned for threats (THREAT_DETECTED; a file that can't be scanned is refused: ERROR), then stored (UPLOADED). Data files (VECTOR_DATA, RASTER_DATA, TABULAR_DATA) are then analyzed by a job of the process service (jobId), and deleted after 10 days: create the data source from them before.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
uuid
required

Id of your organization (must match the access token)

Headers
string
required
Defaults to 1.0.0

tus protocol version: 1.0.0

string
required

Size of the file, in bytes

string
required

Comma-separated key value pairs, values encoded in Base64, such as filename bXlEYXRhLnppcA==,JMC-fileType VkVDVE9SX0RBVEE=. See the operation description.

Responses
201

The upload was created: its URL is in the Location header (empty body). For the first part of a file made of several files, the JMC-partId header is the id to send with the other parts.

412

Tus-Resumable is not 1.0.0

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json