---
title: "Commits offsets of the last message read"
method: PUT
path: "/layers/{layerId}/offsets"
tags: ["stream"]
---

# Commits offsets of the last message read

`PUT /layers/{layerId}/offsets`

After reading data, you should commit the offset of the last message read from each partition so that your application can resume reading new messages from the correct partition in the event that there is a disruption to the subscription, such as an application crash. An offset can also be useful if you delete a subscription then recreate a subscription for the same layer, because the new subscription can start reading data from the offset. To read messages already committed, use the /seek endpoint, then use /partitions. The base path to use is the value of 'nodeBaseURL' returned from /subscribe POST request.

## Path parameters

- `layerId` string, required

## Query parameters

- `subscriptionId` string
- `mode` 'serial' | 'parallel'

## Request body

- CommitOffsetsRequest
  - `offsets` StreamOffset[]
    - `partition` integer, required — The partition of the stream layer for which this offset applies. It is not the same as [Partitions object](https://heremaps.github.io/here-workspace-examples-java-scala/scala/com/here/platform/data/client/scaladsl/Partition.html).
    - `offset` integer, required — The offset in the partition of the stream layer.

## Response `200`

OK, offsets committed

## Other responses

- `202` — OK, offsets committed. This status indicates that your multi-region catalog had a failover or failback event, and you have committed offsets from previous region. No actions are needed from you.
- `400` — Bad Request
- `401` — Unauthorized - the request didn't provide correct authentication details
- `403` — Forbidden - the specific account doesn't have correct privileges to perform the operation
- `404` — Not found
- `409` — Conflict
- `412` — Pre-condition failed
- `500` — Internal Server Error

---

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