---
title: "Accept an invite to a Matrix room"
method: POST
path: "/ocs/v2.php/apps/spreed/api/{apiVersion}/matrix/invite/{id}"
tags: ["matrix_room"]
---

# Accept an invite to a Matrix room

`POST /ocs/v2.php/apps/spreed/api/{apiVersion}/matrix/invite/{id}`

## Request

- The document declares no server URL.
- Auth: one of:
  - HTTP bearer
  - HTTP basic

## Path parameters

- `apiVersion` 'v1', required
- `id` string, required

## Headers

- `OCS-APIRequest` boolean, required

## Response `200`

Invite accepted, the token is null when the conversation is still created by another sync

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` object, required
      - `token` string, nullable, required

## Other responses

- `401`: Current user is not logged in
- `404`: Invite or Matrix account not found
- `502`: The Matrix homeserver rejected joining the room or could not be reached

## Changes

- **2026-10-10** `839087136ade`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nextcloud/apis/spreed-full/changes/ocs/v2.php/apps/spreed/api/:apiVersion/matrix/invite/:id/post.md)

---

[API](https://skmtc.dev/nextcloud/apis/spreed-full.md) - [All operations](https://skmtc.dev/nextcloud/apis/spreed-full/llms.txt) - [OpenAPI document](https://skmtc.dev/nextcloud/apis/spreed-full/revisions/1d24d3b8fec0?raw)
