---
title: "Create a 1-1 chat between two app users (v2, tenant actor)"
method: POST
path: "/v2/apps/{appId}/chats/private"
tags: ["Chats"]
---

# Create a 1-1 chat between two app users (v2, tenant actor)

`POST /v2/apps/{appId}/chats/private`

## Request

- Base URL: `https://api.chat.ethora.com`
- URL: `https://api.chat.ethora.com/v2/apps/{appId}/chats/private`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

**Auth**: Tenant Actor

Opens a private (1-1) chat between two users of the target app on
behalf of an integration backend, without either user being the
caller. Supports `B2B Server JWT` and `User JWT`: the app's owner
(its creator, e.g. from the dashboard app settings page), or an app
admin with app-settings update rights.

The room is the same one `POST /v1/chats/private` addresses for that
pair (name `<xmppUsernameA>-<xmppUsernameB>`, sorted, plus `-e2ee`
for the encrypted room), so the call is idempotent: if the room
already exists it is returned with `created: false` and status 200.
A new room answers 201 with `created: true`. The room is owned by
the app's system chat account, which also sends both invites.

## Path parameters

- `appId` string, required

## Request body

- object
  - `members` string[], required: Exactly two different users, as `xmppUsername` (`<appId>_<userId>`) or bare user id - the `<appId>_` prefix is added when missing.
  - `e2ee` boolean: Address the pair's end-to-end encrypted (OMEMO 2) room instead of the plaintext one. Requires the app's `e2eeEnabled` opt-in, otherwise `403 E2EE_DISABLED`. Encrypted rooms stay encrypted for life.

## Response `200`

Room already existed (`created: false`).

## Other responses

- `201`: Room created (`created: true`).
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Not allowed to manage the app, or `E2EE_DISABLED`.
- `404`: `APP_NOT_FOUND` or `USER_NOT_FOUND`.
- `422`: `VALIDATION_ERROR` (not exactly two different users).
- `500`: Internal Server Error
- `502`: `XMPP_ROOM_CREATE_FAILED`.

---

[API](https://skmtc.dev/ethora/apis/platform-api.md) · [All operations](https://skmtc.dev/ethora/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ethora/apis/platform-api/revisions/01b6e64378ee?raw)
