---
title: "Upload partitions"
method: POST
path: "/layers/{layerId}/publications/{publicationId}/partitions"
tags: ["publish"]
---

# Upload partitions

`POST /layers/{layerId}/publications/{publicationId}/partitions`

Upload partitions to the given layer. Dependending on the publication type, post processing may be required before the partitions are published. For better performance batch your partitions (e.g. 10000 per request), rather than uploading them individually.

## Path parameters

- `layerId` string, required
- `publicationId` string, required

## Query parameters

- `billingTag` string

## Request body

- PublishPartitions
  - `partitions` PublishPartition[] — Array of partitions.
    - `partition` string, required — A key that specifies the partition that the content is related to. It is required. If the layer's partitioning scheme is set to `heretile`, the partition key is the tile key. The maximum length of the partition key is 500 characters. Partition field is used as a `key` field within Kafka message.
    - `checksum` string, [0-9a-fA-F]+ — The checksum of the content when published to Blob API. The algorithm used to calculate the checksum is user specific which is defined in catalog configuration for the layer. Algorithms that you can use are, for example, MD5 or SHA1. This is not a secure hash, so you should only use it to detect changes in content. Checksum is passed as `dsChecksum` kafka record header.
    - `compressedDataSize` integer — The compressed size in bytes of the content published to Blob API. Applicable when Content-Encoding is set to gzip when uploading and downloading data in the Blob API. CompressedDataSize is passed as `dsCompressedDataSize` kafka record header.
    - `dataSize` integer — The nominal size in bytes of the content published to Blob API. When compression is enabled, this is the size of the uncompressed content. DataSize is passed as `dsDataSize` kafka record header.
    - `data` string, byte — The content published directly in the metadata and encoded in base64. The size of the content is limited to 1MB before base64 encryption. Either `data` or `dataHandle` must be present. Data is passed as `value` field kafka record.
    - `dataHandle` string — The handle created when uploading the content to the Blob API, that is used to retrieve the content at a later stage. Either `data` or `dataHandle` must be present. DataHandle is passed as `dsDataHandle` kafka record header.
    - `timestamp` integer — The timestamp of the content, in milliseconds since the Unix epoch. The format of the timestamp is user specific. If the content contains multiple elements each having its own timestamp, we recommend setting the metadata timestamp to the earliest of them. This field if present is used as kafka record timestamp.
    - `crc` string — User provided CRC of the partition data in bytes. Should be lowercase. Crc is passed as `dsCrc` kafka record header.

## Response `204`

Partitions successfully submitted.

## Other responses

- `400` — Bad request, trying to publish partitions with fields not applicable or mandatory fields missing, given the layer type.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Publication not found.

---

[API](https://skmtc.dev/here/apis/query-api-v1.md) · [All operations](https://skmtc.dev/here/apis/query-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/here/query-api-v1/revisions/30e5d2645407/schema)
