---
title: "Log in again after the homeserver rejected the access token"
method: PUT
path: "/ocs/v2.php/apps/spreed/api/{apiVersion}/matrix/account"
tags: ["matrix_account"]
---

# Log in again after the homeserver rejected the access token

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

## Request

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

## Path parameters

- `apiVersion` 'v1', required

## Headers

- `OCS-APIRequest` boolean, required

## Request body

- object
  - `password` string, required: Matrix password

## Response `200`

Logged in again

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` 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

## Other responses

- `400`: Homeserver is not available anymore, the login belongs to another Matrix user or was rejected by the homeserver
- `401`: Wrong credentials
- `403`: User is not allowed to link an account
- `404`: No linked account
- `502`: Homeserver unreachable

## Changes

- **2026-10-12** `d31435356a15`: 1 info
  - added the required property `ocs/data/verified` to the response with the `200` status
- **2026-10-09** `d53448e507ad`: 1 info
  - added the required property `ocs/data/lastSync` to the response with the `200` status
- **2026-10-09** `4382ecd589de`: 1 info
  - endpoint added

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