Register for an account on this homeserver.

POST {{baseUrl}}/register?kind=user

This API endpoint uses the User-Interactive Authentication API, except in the cases where a guest account is being registered.

Register for an account on this homeserver.

There are two kinds of user account:

  • user accounts. These accounts may use the full API described in this specification.

  • guest accounts. These accounts may have limited permissions and may not be supported by all servers.

If registration is successful, this endpoint will issue an access token the client can use to authorize itself in subsequent requests.

If the client does not supply a device_id, the server must auto-generate one.

The server SHOULD register an account with a User ID based on the username provided, if any. Note that the grammar of Matrix User ID localparts is restricted, so the server MUST either map the provided username onto a user_id in a logical manner, or reject username\s which do not comply to the grammar, with M_INVALID_USERNAME.

Matrix clients MUST NOT assume that localpart of the registered user_id matches the provided username.

The returned access token must be associated with the device_id supplied by the client or generated by the server. The server may invalidate any access token previously associated with that device. See Relationship between access tokens and devices.

When registering a guest account, all parameters in the request body with the exception of initial_device_display_name MUST BE ignored by the server. The server MUST pick a device_id for the account regardless of input.

Any user ID returned by this API must conform to the grammar given in the Matrix specification.

Request Params

KeyDatatypeRequiredDescription
kindstringThe kind of account to register. Defaults to user.

Request Body

{"auth"=>{"value"=>"reference definitions/auth_data.yaml not found in the OpenAPI spec"}, "username"=>"cheeky_monkey", "password"=>"ilovebananas", "device_id"=>"GHTYAJCE", "initial_device_display_name"=>"Jungle Phone", "inhibit_login"=>false}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"user_id":"@cheeky_monkey:matrix.org","access_token":"abc123","device_id":"GHTYAJCE"}