---
title: "Get the linked Matrix account and the homeservers an account can be linked on"
method: GET
path: "/ocs/v2.php/apps/spreed/api/{apiVersion}/matrix/account"
tags: ["matrix_account"]
---

# Get the linked Matrix account and the homeservers an account can be linked on

`GET /ocs/v2.php/apps/spreed/api/{apiVersion}/matrix/account`

## Request

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

The access token of the linked account is checked with the homeserver, the result is reused for 5 minutes.

## Path parameters

- `apiVersion` 'v1', required

## Headers

- `OCS-APIRequest` boolean, required

## Response `200`

Account information returned

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` object, required
      - `canLink` boolean, required
      - `account` MatrixAccount, required
        - `id` string, required: SnowflakeID
        - `homeserverId` string, required: SnowflakeID of the homeserver
        - `mxid` string, required: Full Matrix user id, e.g. `@alice:example.org`
        - `deviceId` string, required: Matrix device id of Talk
        - `status` 0 | 1, required: 0 = active, 1 = the homeserver rejected the access token and the user has to log in again
        - `lastError` string, nullable, required: Error reported by the homeserver when it rejected the access token or the last sync failed
        - `lastSync` integer, required: Unix timestamp of the last sync, `0` if it never synced
        - `verified` boolean, nullable, required: Whether another device cross-signed the device of the server, null when encryption is not available on the server
      - `connected` boolean, required
      - `homeservers` MatrixHomeserver[], required
        - `id` string, required: SnowflakeID
        - `name` string, required
        - `serverName` string, required
        - `baseUrl` string, required
        - `enabled` boolean, required
        - `specVersions` string[], required

## Other responses

- `401`: Current user is not logged in

## Changes

- **2026-10-12** `d31435356a15`: 1 info
  - added the required property `ocs/data/account/allOf[#/components/schemas/MatrixAccount]/verified` to the response with the `200` status
- **2026-10-09** `d53448e507ad`: 1 info
  - added the required property `ocs/data/account/allOf[#/components/schemas/MatrixAccount]/lastSync` to the response with the `200` status
- **2026-10-09** `4382ecd589de`: 3 info
  - added the required property `ocs/data/account/allOf[#/components/schemas/MatrixAccount]/lastError` to the response with the `200` status
  - added the required property `ocs/data/account/allOf[#/components/schemas/MatrixAccount]/status` to the response with the `200` status
  - added the required property `ocs/data/connected` to the response with the `200` status
- **2026-10-09** `3cff8058abe9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nextcloud/apis/spreed-full/changes/ocs/v2.php/apps/spreed/api/:apiVersion/matrix/account/get.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)
