---
title: "Utility endpoint to allow submitting multiple independent requests at once."
method: POST
path: "/batch"
tags: ["Batch"]
---

# Utility endpoint to allow submitting multiple independent requests at once.

`POST /batch`

This is used, for example, to poll multiple rooms on the same server for updates in a single query rather than needing to make multiple requests for each room.
No guarantee is made as to the order in which sub-requests are processed; use the `/sequence` instead if you need that.
For contained subrequests that specify a body (i.e. POST or PUT requests) exactly one of `json`, `b64`, or `bytes` must be provided with the request body.

## Request body

- object[]
  - `method` string, required — The request method, typically GET for batched requests, though other methods are also permitted.
  - `path` string, required — The request path, e.g. `/room/123/messages/since/45678`
  - `headers` object — Dict of HTTP headers for the subrequest. Optional.
  - `json` object — Nested json structure containing a json body for a POST/PUT request. Exclusive of `b64` and `bytes`.
  - `b64` string, byte — Byte data for the body for a POST/PUT request. Exclusive of `json` and `bytes`
  - `bytes` string, binary — Optional binary body, as raw octets. Exclusive of `b64` and `json`. Not recommended when using json unless the data happens to be mostly safe ascii

## Response `200`

Batch jobs completed. Note that 200 only means the batch was processed; for individual sub-requests see the relevant sub-response code.  The returned array returns responses in exactly the same order as the request's list of sub-requests (regardless of the actual order jobs were processed).

- object[]
  - `code` integer, required — HTTP response code for the subrequest (e.g. 200, 404, etc.)
  - `content-type` string, required — HTTP content-type of the subrequest response (e.g. `application/json`)
  - `body` union, required — The response body. For responses with `content-type` set to `application/json` this will be the direct object or array response; for any other content otherwise this will be a string containing the base64-encoded response data.
    - object
    - string, byte

## Changes

- **2022-01-28** `95f09949217a` — 1 breaking
  - the `items/bytes` request property type/format changed from ``/`binary` to `string`/`binary`
- **2022-01-12** `2592dbb08414` — 1 breaking, 2 info
  - the `items/bytes` request property type/format changed from `string`/`byte` to ``/`binary`
  - added the new optional request property `items/b64`
  - added the new optional request property `items/headers`
- **2021-11-10** `fbd68862ef17` — 1 breaking, 2 warning
  - the `items/bytes` request property type/format changed from `string`/`binary` to `string`/`byte`
  - removed the request property `items/b64`
  - removed the request property `items/headers`

[Change history](https://skmtc.dev/oxen-io/apis/session-open-group-server/changes/batch/post.md)

---

[API](https://skmtc.dev/oxen-io/apis/session-open-group-server.md) · [All operations](https://skmtc.dev/oxen-io/apis/session-open-group-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/oxen-io/session-open-group-server/revisions/39a4ebc32b95/schema)
