Upload API

MapTiler’s Upload API allows you to add new datasets or update existing ones from the command line. To make it easier, you can use the CLI tool to run the commands. See the complete guide: How to upload your data using API & CLI

Idea

If you’re working with JavaScript/TypeScript, we highly recommend to use this API via the Upload JS library. It has extra features and is much more comfortable to use.

Upload API reference

Scalar API Reference
v1.0
OpenAPI 3.0.2

MapTiler Service API

Server:https://service.maptiler.com/v1

MapTiler Service API

Client Libraries

dataset_ingest

Ingest dataset container into a new dataset

Body·DatasetIngestCreate
application/json
  • filename
    Type: string
    required

    name of the file limited to 255 bytes

  • size
    Type: integer
    required

    size in bytes

  • output
    Type: object | null · DatasetIngestOutput

    Specify output properties

  • supported_upload_types
    Type: array string[] · UploadType[]enum
Responses
  • application/json
Request Example for post/datasets/ingest
curl https://service.maptiler.com/v1/datasets/ingest \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "filename": "north-america.mbtiles",
  "size": 723000000,
  "supported_upload_types": [
    "s3_multipart"
  ],
  "output": {
    "type": "raster_tileset"
  }
}'
{
  "id": "e3a507c3-f9dd-4786-8af3-b21f4ca2d9c8",
  "document_id": null,
  "state": "upload",
  "filename": "north-america.mbtiles",
  "size": 723000000,
  "errors": null,
  "progress": 0,
  "upload_url": "https://www.googleapis.com/upload/drive/v3/files/?uploadType=resumable&supportsTeamDrives=true&upload_id=ABg5-UzOoBea-789qB46gXPK7gGIOoTt5rvcGfzdJSxf_iCJ98ysr0WT9asddb-CpBPWFiR_u0DnCWj3oiD9UErtTdVj3w"
}

Ingest dataset container into existing tileset

Path Parameters
  • document_id
    Type: string Format: uuid
    required
Body·DatasetIngestCreate
application/json
  • filename
    Type: string
    required

    name of the file limited to 255 bytes

  • size
    Type: integer
    required

    size in bytes

  • output
    Type: object | null · DatasetIngestOutput

    Specify output properties

  • supported_upload_types
    Type: array string[] · UploadType[]enum
Responses
  • application/json
Request Example for post/datasets/{document_id}/ingest
curl https://service.maptiler.com/v1/datasets/123e4567-e89b-12d3-a456-426614174000/ingest \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "filename": "north-america.mbtiles",
  "size": 723000000,
  "supported_upload_types": [
    "s3_multipart"
  ],
  "output": {
    "type": "raster_tileset"
  }
}'
{
  "id": "e3a507c3-f9dd-4786-8af3-b21f4ca2d9c8",
  "document_id": null,
  "state": "upload",
  "filename": "north-america.mbtiles",
  "size": 723000000,
  "errors": null,
  "progress": 0,
  "upload_url": "https://www.googleapis.com/upload/drive/v3/files/?uploadType=resumable&supportsTeamDrives=true&upload_id=ABg5-UzOoBea-789qB46gXPK7gGIOoTt5rvcGfzdJSxf_iCJ98ysr0WT9asddb-CpBPWFiR_u0DnCWj3oiD9UErtTdVj3w"
}

Get dataset ingest details

Path Parameters
  • ingest_id
    Type: string Format: uuid
    required
Responses
  • application/json
Request Example for get/datasets/ingest/{ingest_id}
curl https://service.maptiler.com/v1/datasets/ingest/123e4567-e89b-12d3-a456-426614174000
{
  "id": "e3a507c3-f9dd-4786-8af3-b21f4ca2d9c8",
  "document_id": null,
  "state": "upload",
  "filename": "north-america.mbtiles",
  "size": 723000000,
  "errors": null,
  "progress": 0,
  "upload_url": "https://www.googleapis.com/upload/drive/v3/files/?uploadType=resumable&supportsTeamDrives=true&upload_id=ABg5-UzOoBea-789qB46gXPK7gGIOoTt5rvcGfzdJSxf_iCJ98ysr0WT9asddb-CpBPWFiR_u0DnCWj3oiD9UErtTdVj3w"
}

Cancel dataset ingest

Path Parameters
  • ingest_id
    Type: string Format: uuid
    required
Responses
  • application/json
Request Example for post/datasets/ingest/{ingest_id}/cancel
curl https://service.maptiler.com/v1/datasets/ingest/123e4567-e89b-12d3-a456-426614174000/cancel \
  --request POST
{
  "id": "e3a507c3-f9dd-4786-8af3-b21f4ca2d9c8",
  "document_id": null,
  "state": "upload",
  "filename": "north-america.mbtiles",
  "size": 723000000,
  "errors": null,
  "progress": 0,
  "upload_url": "https://www.googleapis.com/upload/drive/v3/files/?uploadType=resumable&supportsTeamDrives=true&upload_id=ABg5-UzOoBea-789qB46gXPK7gGIOoTt5rvcGfzdJSxf_iCJ98ysr0WT9asddb-CpBPWFiR_u0DnCWj3oiD9UErtTdVj3w"
}

Start dataset ingest processing

Path Parameters
  • ingest_id
    Type: string Format: uuid
    required
Body·DatasetIngestProcess
application/json
  • upload_result
    Type: object · UploadResult
    • type
      Discriminator
      Type: string · UploadTypeenum
      values
      • s3_multipart
      • google_drive_resumable
    • parts
      Type: array object[] · S3UploadResultItem[]
Responses
  • application/json
Request Example for post/datasets/ingest/{ingest_id}/process
curl https://service.maptiler.com/v1/datasets/ingest/123e4567-e89b-12d3-a456-426614174000/process \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "upload_result": {
    "type": "s3_multipart",
    "parts": [
      {
        "part_id": 1,
        "etag": "fad1c8150539"
      },
      {
        "part_id": 2,
        "etag": "94a6e2002464"
      }
    ]
  }
}'
{
  "id": "e3a507c3-f9dd-4786-8af3-b21f4ca2d9c8",
  "document_id": null,
  "state": "upload",
  "filename": "north-america.mbtiles",
  "size": 723000000,
  "errors": null,
  "progress": 0,
  "upload_url": "https://www.googleapis.com/upload/drive/v3/files/?uploadType=resumable&supportsTeamDrives=true&upload_id=ABg5-UzOoBea-789qB46gXPK7gGIOoTt5rvcGfzdJSxf_iCJ98ysr0WT9asddb-CpBPWFiR_u0DnCWj3oiD9UErtTdVj3w"
}
Using the OpenAPI Specification?
Get the openapi.yaml
Was this helpful?
MapTiler Service API
Upload API
Upload API