Set a profile field for a user.
Set or update a profile field for a user. Must be authenticated with an access token authorised to make changes. Servers MAY impose size limits on individual fields, and the total profile MUST be under 64 KiB.
Servers MAY reject null values. Servers that accept null values SHOULD store them rather than treating null as a deletion request. Clients that want to delete a field, including its key and value, SHOULD use the DELETE endpoint instead.
This endpoint uses capabilities negotiation depending on the keyName. Clients SHOULD check the value of the m.profile_fields capability to detect which keyNames they are allowed to modify.
Request
- Base URLhttps://matrix.org
- Auth
- API key in query parameter access_token
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The user whose profile field should be set.
The name of the profile field to set. This MUST be either avatar_url, displayname, m.tz, or a custom field following the Common Namespaced Identifier Grammar.
Request body
An object which contains exactly one property. The key of that property MUST match the keyName specified in the URL.
For avatar_url, the value MUST be an MXC URI string.
For displayname, the value MUST be a string.
For m.tz, the value MUST be a valid identifier from the IANA Time Zone Database. Servers MAY choose to validate the value. Clients MUST expect unknown or invalid values.
For custom keys, any JSON type is allowed. Servers MAY not validate these values, but clients SHOULD follow the format defined for that key.
Example request
{
"displayname": "Alice Wonderland"
}Response
The profile field was set.
Changes
No recorded changes to this operation across all 1 revision of this API.