XEP-0513: Intentional Mention Markup

Abstract
This specification defines a markup format to intentionally mention a person or groups of people.
Author
Snit Guckfung
Copyright
© 2023 – 2026 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Experimental

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
Type
Standards Track
Version
0.1.1 (2026-11-03)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final

1. Introduction

A common feature in online communication is the ability to intentionally and explicitly address a message to a specific person or a group of people, and have the recipient's client notify them. This document provides a mechanism to allow users to intentionally reference individual users, as well as entire groups based on roles, affiliations, and hats in their messages.

This specification is primarily aimed at the markup format for mentions, as opposed to the notification of recipients, which may be covered by a future specification. There has been some success getting current versions of this specification working with push notifications, but it is not expected to work in certain scenarios as-is, such as end-to-end encrypted chats.

2. Glossary

A few terms are used throughout this document that are worth defining.

Mention
A mention is a reference to one or more users, which generally produces a notification for the relevant recipients.
Unintentional Mention
A type of mention which has no explicit wire-based format, and which was not necessarily intended by the sender. The most common form of unintentional mention is for a client to match messages against a regex of the user's name. For users with common words as their nickname, this can result in many false-positives, with no way for the client to determine whether a mention was intended or not. This may also be referred to as an "implicit" mention.
Intentional Mention
As opposed to unintentional mentions, intentional mentions explicitly mark a section of the body as being a mention to a particular user or group of users via a dedicated markup element. This helps to avoid false-positives by conveying the sender's intent. This may also be referred to as an "explicit" mention.

3. Discovering Support

An entity implementing this specification MUST advertise 'urn:xmpp:mentions:0' as a Service Discovery (XEP-0030) [1] feature. Subsequent OPTIONAL features in this document MUST also advertise support, if implemented.

4. Use Cases

Given that this specification is primarily concerned with the markup format, it depends on the use of Message Markup (XEP-0394) [2] <span /> elements to specify the range of effected text. Here, the <mention /> child element is specified, qualified with the 'urn:xmpp:mentions:0' namespace.

The 'type' attribute MUST be specified with a URI determining the type of mention (occupant ID, room, association, etc.). A mention MAY contain a 'target' attribute, which specifies who is being mentioned. The 'target' MUST only be omitted in the scenarios defined by the 'type' below.

Example 1. Mentioning a user in a room
<message to='news@chat.commons.example' type='groupchat'>
  <body>Hello, Alice!</body>
  <markup xmlns='urn:xmpp:markup:0'>
    <span start='7' end='12'>
      <mention xmlns='urn:xmpp:mentions:0'
        type='urn:xmpp:mentions:0#occupant'
        target='dd72603deec90a38ba552f7c68cbcc61bca202cd' />
    </span>
  </markup>
</message>

Multiple mentions may be contained in the same <span />, as well:

Example 2. Mentioning members of an informally-defined group in a channel with many occupants
<message to='news@chat.commons.example' type='groupchat'>
  <body>Hi Spartacists!</body>
  <markup xmlns='urn:xmpp:markup:0'>
    <span start='3' end='14'>
      <mention xmlns='urn:xmpp:mentions:0'
        type='urn:xmpp:mentions:0#occupant'
        target='dd72603deec90a38ba552f7c68cbcc61bca202cd' />
      <mention xmlns='urn:xmpp:mentions:0'
        type='urn:xmpp:mentions:0#occupant'
        target='3deec90a38ba552f7c68cbcc61bca202cddd7260' />
    </span>
  </markup>
</message>

Any mention type MAY restrict the set of targetted users to only those who are currently active, akin to "@here" on legacy messengers, by setting 'active' to true. If an entity receives a mention that was sent when the user was not active, it SHOULD NOT notify them. It is up to implementations what constitutes "currently active". Examples include being online or recently interacting with the client.

Example 3. Mentioning all currently-present users in a room
<message to='news@chat.commons.example' type='groupchat'>
  <body>@here, I need to restart the server. We'll be back in a sec.</body>
  <markup xmlns='urn:xmpp:markup:0'>
    <span start='0' end='5'>
      <mention xmlns='urn:xmpp:mentions:0' 
        type='urn:xmpp:mentions:0#channel'
        active='true' />
    </span>
  </markup>
</message>

4.1 Mentioning an Individual

Individual mentions are the minimum REQUIRED to support this specification, advertised via the 'urn:xmpp:mentions:0' namespace.

The only supported way to mention an individual in this document is to use Anonymous unique occupant identifiers for MUCs (XEP-0421) [3] identifiers as the 'target', with a 'type' of 'urn:xmpp:mentions:0#occupant'. Mentioning a user in a 1:1 chat, or in a Multi-User Chat (XEP-0045) [4] room that does not support occupant IDs, is intentionally unsupported here, but may be defined elsewhere.

Example 4. Mentioning a user in a room
<message to='news@chat.commons.example' type='groupchat'>
  <body>Hello, Alice!</body>
  <markup xmlns='urn:xmpp:markup:0'>
    <span start='7' end='12'>
      <mention xmlns='urn:xmpp:mentions:0'
        type='urn:xmpp:mentions:0#occupant'
        target='dd72603deec90a38ba552f7c68cbcc61bca202cd' />
    </span>
  </markup>
</message>

4.2 Mentioning Groups

Users might wish to mention whole groups of users at once. The following subsections specify several types of groups that can be mentioned, all of which are OPTIONAL.

Each group type has its own URI for the 'type' attribute, which, unless noted otherwise, MUST also be advertised via Service Discovery (XEP-0030) [1] if supported. Custom group types not specified in this document MAY be used, provided they follow the same rules.

4.2.1 Mentioning via Room Occupancy

It is often useful to mention all occupants of the current room at once, similarly to "@everyone" or "@room" on legacy messengers. The 'type' for this mention is 'urn:xmpp:mentions:0#channel', which MUST be advertised if this feature is supported. As the target is all room occupants, the 'target' attribute is redundant, and MUST NOT be specified.

Example 5. Mention all users in a room
<message to='news@chat.commons.example' type='groupchat'>
  <body>Hey, @room!</body>
  <markup xmlns='urn:xmpp:markup:0'>
    <span start='5' end='10'>
      <mention xmlns='urn:xmpp:mentions:0' type='urn:xmpp:mentions:0#channel' />
    </span>
  </markup>
</message>

4.2.2 Mentions via Roles and Affiliations

It is possible to mention occupants with specific Multi-User Chat (XEP-0045) [4] roles or affiliations. Support for this feature is advertised via 'urn:xmpp:mentions:0#associations', rather than the 'type'. The 'type' is one of the seven URNs defined in the table below. A role or affiliation mention MUST NOT contain a 'target'.

Table 1: Mention targets
Type Description
urn:xmpp:mentions:0#moderators Occupants with a moderator role
urn:xmpp:mentions:0#participants Occupants with a participant role
urn:xmpp:mentions:0#visitors Occupants with a visitor role
urn:xmpp:mentions:0#owners Occupants with an owner affiliation
urn:xmpp:mentions:0#admins Occupants with an admin affiliation
urn:xmpp:mentions:0#members Occupants with a member affiliation
urn:xmpp:mentions:0#none Occupants with no affiliation
Example 6. Mention all moderators in a room
<message to='news@chat.commons.example' type='groupchat'>
  <body>Any moderator to handle the spam above please?</body>
  <markup xmlns='urn:xmpp:markup:0'>
    <span start='4' end='13'>
      <mention xmlns='urn:xmpp:mentions:0' type='urn:xmpp:mentions:0#moderators' />
    </span>
  </markup>
</message>

4.2.3 Mentions via Hats

Hats, specified in Hats (XEP-0317) [5], can also be mentioned using the 'urn:xmpp:mentions:0#hats' namespace. The 'target' attribute MUST contain the hat's URI.

Example 7. Mentioning all (hats) students in a room
<message to='news@chat.commons.example' type='groupchat'>
  <body>To all students, [..]</body>
  <markup xmlns='urn:xmpp:markup:0'>
    <span start='7' end='15'>
      <mention xmlns='urn:xmpp:mentions:0'
        type='urn:xmpp:mentions:0#hats'
        target='http://schemas.example.com/hats#students'/>
    </span>
  </markup>
</message>

5. Implementation Notes

This specification allows sending clients to convey a user's intent. Implementations SHOULD also allow sending participants to talk about someone without having to mention them.

Extra characters which are not part of the user's name, such as '@', could interfere with implicit mentions in some implementations.

Receiving entities always have final say on whether they think a mention refers to or notifies the user, and MAY specify further rules than specified here.

6. Design Considerations

Most clients currently use regex-based solutions to determine whether a user is to be notified of a message. This is prone to false positives, especially for users with common words as names. It also provides no mechanism for a user to refer to someone else without notifying them.

Attention (XEP-0224) [6] could be used to provide similar functionality to a room mention. However, it has several downsides compared to this specification, including:

References (XEP-0372) [7] provides a basic means to explicitly mention a single user via JID, but no means of mentioning via occupant ID, mentioning groups of users, nor means to extend mentions further.

7. Accessibility Considerations

This specification allows users to intentionally choose whether to mention a user or group, removing the need to use old regex-based name matches, which are prone to false positives. It also allows users to refer to someone else without unintentionally disturbing them, and without relying on tricks to prevent regex matches.

8. Internationalization Considerations

Mentions which contain an 'xml:lang' attribute correspond to body elements of the same language. Implementations SHOULD send a mention for every language it sends.

9. Security Considerations

Implementations, both on the server- and client-side, SHOULD take care to mitigate the possibility to abuse mentioning groups of people, such as by providing an option to disallow group mentions by unpriviledged users, or turning off notifications for them in the client.

Use of intentional mentions with OMEMO could leak metadata about who the message is directed towards, if the mention markup is left unencrypted, such as in legacy OMEMO.

Using Anonymous unique occupant identifiers for MUCs (XEP-0421) [3] instead of a regular participant JID in MUC prevents moderators possibly leaking JIDs they have access to that other occupants don't. Using occupant IDs even in non-anonymous rooms allows them to become semi-anonymous without leaking JIDs.

10. IANA Considerations

None.

11. XMPP Registrar Considerations

11.1 Protocol Namespaces

The XMPP Registrar shall add 'urn:xmpp:mentions:0' to its registry of protocol namespaces.

12. XML Schema

<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
  xmlns:xs='http://www.w3.org/2001/XMLSchema'
  targetNamespace='urn:xmpp:mentions:0'
  xmlns='urn:xmpp:mentions:0'
  elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
        The protocol documented by this schema is defined in XEP-0513:
        https://xmpp.org/extensions/xep-0513.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='mention'>
    <xs:complexType>
      <xs:attribute name='active' type='xs:boolean'/>
      <xs:attribute name='type' type='xs:anyURI' use='required'/>
      <xs:attribute name='target' type='xs:string'/>
    </xs:complexType>
  </xs:element>
</xs:schema>

13. Acknowledgements

Special thanks to pep for providing the initial document which this one is based off of, and for allowing me to continue work on it.


Appendices

Appendix A: Document Information

Series
XEP
Number
0513
Publisher
XMPP Standards Foundation
Status
Experimental
Type
Standards Track
Version
0.1.1
Last Updated
2026-11-03
Approving Body
XMPP Council
Dependencies
XMPP Core, XEP-0001, XEP-0030, XEP-0045, XEP-0317, XEP-0394, XEP-0421
Supersedes
None
Superseded By
None
Short Name
mentions
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Snit Guckfung
Email
snit@cock.li
JabberID
kuyuhi@isekai.rocks

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

Appendix G: Notes

1. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

2. XEP-0394: Message Markup <https://xmpp.org/extensions/xep-0394.html>.

3. XEP-0421: Anonymous unique occupant identifiers for MUCs <https://xmpp.org/extensions/xep-0421.html>.

4. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.

5. XEP-0317: Hats <https://xmpp.org/extensions/xep-0317.html>.

6. XEP-0224: Attention <https://xmpp.org/extensions/xep-0224.html>.

7. XEP-0372: References <https://xmpp.org/extensions/xep-0372.html>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.1.1 (2026-11-03)

    Revisions based on feedback, including using XEP-0394, making different types of mentions more consistent between each other, using existing terminology from legacy messengers, removing the permissions form, and generally removing unneeded functionality.

    snit
  2. Version 0.1.0 (2026-04-01)

    Accepted as Experimental by council vote on 2026-03-31

    dg
  3. Version 0.0.2 (2026-02-25)

    Proposal handover

    snit
  4. Version 0.0.1 (2023-03-23)

    First draft.

    pep

Appendix I: Bib(La)TeX Entry

@report{guckfung2023mentions,
  title = {Intentional Mention Markup},
  author = {Guckfung, Snit},
  type = {XEP},
  number = {0513},
  version = {0.1.1},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0513.html},
  date = {2023-03-23/2026-11-03},
}

END