---
title: "Initialize a new publication"
method: POST
path: "/publications"
tags: ["publish"]
---

# Initialize a new publication

`POST /publications`

Initializes a new publication for publishing metadata. Determines the publication type based on the provided layer IDs. A publication can only consist of layer IDs that have the same layer type. For example, you can have a publication for multiple layers of type `versioned`, but you cannot have a single publication that publishes to both `versioned` and `volatile` layers. In addition, you may only have one `versioned` publication in process at a time. The body field `versionDependencies` is optional and is used for `versioned` layers to declare version dependencies.

## Query parameters

- `billingTag` string

## Request body

- Publication
  - `id` string — The ID of the publication.
  - `details` Details — Details of the publication.
    - `state` 'initialized' | 'submitted' | 'cancelled' | 'failed' | 'succeeded' | 'expired' — The state of the publication. * `initialized` - The publication is active and able to receive partitions. The publication can also be submitted while in this state. If you cancel the publication while it is in this state all uploaded partitions are discarded and a new publication is created. An initialized publication expires after a period of inactivity. * `submitted` - The publication is active and is processing the uploaded partitions. When a publication is in this state you cannot upload more partitions to the publication. You cannot cancel the publication at this point. It can only succeed, fail, or expire. * `cancelled` - The publication was cancelled, either by a cancel request from a user or by initializing a new publication while this one was in the `initialized` state. * `succeeded` - The publication was successfully processed. * `failed` - The publication failed due to an error. The error is provided in the `message` field. * `expired` - The publication has expired due to inactivity.
    - `message` string — A message describing the state.
    - `started` integer — The time when the publication started, expressed as the number of milliseconds since the Unix epoch.
    - `modified` integer — The time when the publication was last modified, expressed as the number of milliseconds since the Unix epoch.
    - `expires` integer — The time when the publication expires, expressed as the number of milliseconds since the Unix epoch.
  - `layerIds` string[]
  - `catalogVersion` integer — The current version of the catalog. If this is the catalog's first publication, the version is `-1`. After the first publication, the catalog version becomes 0. Each subsequent publication increments the catalog version by 1.
  - `versionDependencies` VersionDependency[] — The upstream version dependencies for the publication.
    - `direct` boolean, required — Indicates the type of data dependency. If this value is set to false, this dependency is an indirect dependency. This means that data from this catalog was not directly used by a data processing pipeline to update the current version of the catalog. Instead, the data was only used by upstream pipeline(s) to generate the input data.
    - `hrn` string, required — The HERE Resource Name (HRN) of the catalog that the batch commit depends on.
    - `version` integer, required — The version of the catalog metadata that the batch commit depends on.

## Response `200`

New publication created.

- Publication
  - `id` string — The ID of the publication.
  - `details` Details — Details of the publication.
    - `state` 'initialized' | 'submitted' | 'cancelled' | 'failed' | 'succeeded' | 'expired' — The state of the publication. * `initialized` - The publication is active and able to receive partitions. The publication can also be submitted while in this state. If you cancel the publication while it is in this state all uploaded partitions are discarded and a new publication is created. An initialized publication expires after a period of inactivity. * `submitted` - The publication is active and is processing the uploaded partitions. When a publication is in this state you cannot upload more partitions to the publication. You cannot cancel the publication at this point. It can only succeed, fail, or expire. * `cancelled` - The publication was cancelled, either by a cancel request from a user or by initializing a new publication while this one was in the `initialized` state. * `succeeded` - The publication was successfully processed. * `failed` - The publication failed due to an error. The error is provided in the `message` field. * `expired` - The publication has expired due to inactivity.
    - `message` string — A message describing the state.
    - `started` integer — The time when the publication started, expressed as the number of milliseconds since the Unix epoch.
    - `modified` integer — The time when the publication was last modified, expressed as the number of milliseconds since the Unix epoch.
    - `expires` integer — The time when the publication expires, expressed as the number of milliseconds since the Unix epoch.
  - `layerIds` string[]
  - `catalogVersion` integer — The current version of the catalog. If this is the catalog's first publication, the version is `-1`. After the first publication, the catalog version becomes 0. Each subsequent publication increments the catalog version by 1.
  - `versionDependencies` VersionDependency[] — The upstream version dependencies for the publication.
    - `direct` boolean, required — Indicates the type of data dependency. If this value is set to false, this dependency is an indirect dependency. This means that data from this catalog was not directly used by a data processing pipeline to update the current version of the catalog. Instead, the data was only used by upstream pipeline(s) to generate the input data.
    - `hrn` string, required — The HERE Resource Name (HRN) of the catalog that the batch commit depends on.
    - `version` integer, required — The version of the catalog metadata that the batch commit depends on.

## Other responses

- `400` — Bad request, it is impossible to publish to all the requested layers in one single publication.
- `401` — Unauthorized.
- `403` — Forbidden.
- `409` — Conflict with an another active publication.

---

[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)
