# User links and mentions in Confluence storage format

URL: https://goingstellar.ro/reference/confluence-storage-format/user-links-mentions/

An @mention is stored as an ac:link with a ri:user child that carries ri:account-id. The ADF form is a mention node with the same id. A legacy ri:userkey is accepted and is rewritten into an account id with a userkey- prefix.

## Storage format

```xml
<ac:link><ri:user ri:account-id="<accountId>" /></ac:link>
<ac:structured-macro ac:name="profile"><ac:parameter ac:name="user"><ri:user ri:account-id="<accountId>" /></ac:parameter></ac:structured-macro>
```

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
ADF:{"content": [{"content": [{"attrs": {"id": "<accountId>", "text": "@someone"}, "type": "mention"}], "type": "paragraph"}], "type": "doc", "version": 1}
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "type": "mention",
     "attrs": {
      "id": "<accountId>",
      "text": "@<display name>"
     }
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<p><ac:link><ri:user ri:account-id="<accountId>" /></ac:link></p>
```

A mention of a person by account id, written in storage.

Rendered view (HTML):

```html
<macro output not published: it lists pages, tasks or people from the site>
```

Storage format after the round trip through ADF:

```xml
<p><ac:link><ri:user ri:account-id="<accountId>" /></ac:link></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"content": [{"attrs": {"id": "<accountId>", "text": "@someone"}, "type": "mention"}], "type": "paragraph"}], "type": "doc", "version": 1}
```

A mention node sent as ADF, to see the storage that Confluence writes for it.

Rendered view (HTML):

```html
<macro output not published: it lists pages, tasks or people from the site>
```

Storage format after the round trip through ADF:

```xml
<p><ac:link><ri:user ri:account-id="<accountId>" /></ac:link></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<p><ac:link><ri:user ri:userkey="2c9680f7405147ee0140514c26120003"/></ac:link></p>
```

A mention using the old userkey attribute, as found in older content.

Rendered view (HTML):

```html
<macro output not published: it lists pages, tasks or people from the site>
```

Storage format after the round trip through ADF:

```xml
<p><ac:link><ri:user ri:account-id="userkey-2c9680f7405147ee0140514c26120003" /></ac:link></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:structured-macro ac:name="profile"><ac:parameter ac:name="user"><ri:user ri:account-id="<accountId>" /></ac:parameter></ac:structured-macro>
```

The user profile macro, which takes the same ri:user element as a parameter.

Rendered view (HTML):

```html
<macro output not published: it lists pages, tasks or people from the site>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="profile" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="user"><ri:user ri:account-id="<accountId>" /></ac:parameter></ac:structured-macro>
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- The ac:link with ri:user and the ADF mention node are equivalent. The account id is kept both ways and the ADF text holds the display name.
- A ri:userkey value is not kept. The ADF save writes ri:account-id with the old key after the prefix userkey-, and the display name is Unlicensed user.
- In the profile macro the user stays as a ri:user parameter and the macro returns unchanged.

## Pitfalls

- A mention has no link text in storage. The name shown comes from the account at view time, so it cannot be fixed in the markup.
- A userkey from older content resolved to the name Unlicensed user in the ADF form, so convert old content to account ids before relying on mentions.
- The rendered view of a mention and of the profile macro was not captured, because the probe output replaces macros that list people.

## Related

- [<ac:link> to a page](https://goingstellar.ro/reference/confluence-storage-format/page-links/)
- [Space, blog post, content and shortcut links](https://goingstellar.ro/reference/confluence-storage-format/space-blog-shortcut-links/)
- [<ac:task-list> task lists](https://goingstellar.ro/reference/confluence-storage-format/task-lists/)
- [Reporting macros (content by label, recently updated, attachments...)](https://goingstellar.ro/reference/confluence-storage-format/report-macros/)

## Sources

- [Confluence storage format (Atlassian Documentation)](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
- [Atlassian Document Format: document structure (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)
- [Insert the user profile macro (Atlassian Support)](https://support.atlassian.com/confluence-cloud/docs/insert-the-user-profile-macro/)

