---
title: "Create or update a device"
method: PUT
path: "/_matrix/client/v3/devices/{deviceId}"
tags: ["Device management"]
---

# Create or update a device

`PUT /_matrix/client/v3/devices/{deviceId}`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v3/devices/{deviceId}`
- Auth: one of:
  - API key in query parameter `access_token`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/matrix/apis/matrix-client-server-api/docs/_matrix/client/v3/devices/:deviceId/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates the metadata on the given device, or creates a new device.

The ability to create new devices is only available to application
services: regular clients may only update existing devices.

When a new device was created, the homeserver MUST return a 201 HTTP
status code. It MUST return a 200 HTTP status code if a device was
updated.

This endpoint is rate-limited for device creation. Servers MAY use login
rate limits.

## Path parameters

- `deviceId` string, required

## Request body

- object
  - `display_name` string: The new display name for this device. If not given, the display name is unchanged.

## Response `200`

The device was successfully updated.

- object

## Other responses

- `201`: The device was successfully created by the application service.
- `404`: The current user has no device with the given ID.

---

[API](https://skmtc.dev/matrix/apis/matrix-client-server-api.md) - [All operations](https://skmtc.dev/matrix/apis/matrix-client-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/matrix/apis/matrix-client-server-api/revisions/c7fe4072c681?raw)
