---
title: "Create private chat"
method: POST
path: "/v1/chats/private"
tags: ["Chats"]
---

# Create private chat

`POST /v1/chats/private`

## Request

- Base URL: `https://api.chat.ethora.com`
- URL: `https://api.chat.ethora.com/v1/chats/private`
- Auth: HTTP bearer

**Auth**: User JWT

Create chat private chat

## Request body

- object
  - `username` string: `xmppUsername` (`<appId>_<userId>`) of the user to start a 1-1 chat with. Idempotent: if a private chat between the two already exists, that one is returned.
  - `e2ee` boolean: Ask for the pair's end-to-end encrypted (OMEMO 2) room rather than their plaintext one. Defaults to `false`. A pair can hold both: the encrypted room is a separate room whose `name` carries an `-e2ee` suffix. So calling this with `e2ee: true` for a pair that only has a plaintext chat creates the encrypted room alongside it - it does not convert the existing one, and the plaintext history stays where it was written. Idempotent per variant: a second call with the same `e2ee` returns the room already created. Encrypted rooms stay encrypted for their whole life. There is no endpoint that clears the flag, so neither member can silently downgrade the room under the other. Requires the app to have `e2eeEnabled: true` (`PUT /v1/apps/{appId}`, reported by `GET /apps/get-config`). Otherwise this answers `403 E2EE_DISABLED`, including for B2B callers - the plaintext room for the same pair is still creatable.

## Response `200`

```
{
  ok: boolean,
}
```

- object

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: ``` { error: 'Forbidden' } ``` `code: 'E2EE_DISABLED'` when `e2ee: true` was asked for on an app whose `e2eeEnabled` is off.
- `404`: Not Found
- `422`: ``` { error: string } ```
- `500`: Internal Server Error

---

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