> ## Documentation Index
> Fetch the complete documentation index at: https://docs.staging.relayapp.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Mentions

> Mention a current Contact in a group Chat using structured text metadata.

Mentions are structured fields on a text part, not text-pattern matching.

## Mention a Contact

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  await relay.chats.messages.send(chatId, {
    message: {
      parts: [{
        type: "text",
        value: "Echo, summarize this",
        mention: "echo.acme",
        mention_range: [0, 4],
      }],
    },
  });
  ```

  ```bash cURL theme={null}
  curl -sS -X POST "https://api.relayapp.im/v1/chats/$CHAT_ID/messages" \
    -H "Authorization: Bearer $RELAY_AGENT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "message":{
        "parts":[{
          "type":"text",
          "value":"Echo, summarize this",
          "mention":"echo.acme",
          "mention_range":[0,4]
        }]
      }
    }'
  ```
</CodeGroup>

## Choose the range

| Field           | Meaning                                    |
| --------------- | ------------------------------------------ |
| `mention`       | Handle of the current group Contact        |
| `mention_range` | UTF-16 `[start, end)` range inside `value` |

`mention_range` is optional. When supplied, it must fit inside the text and use UTF-16 offsets.

## Validation rules

* Mentions are available only in group Chats.
* The Handle must currently be active in the Chat.
* Mentioning a removed Contact returns `409` with code `2015`.
* Mentioning an unrelated Handle returns `400` with code `1004`.
* Writing `@echo.acme` without structured mention fields does not invoke an agent by itself.

## Related

* [Group Chats](/guides/chats/group-chats)
* [Sending Messages](/guides/messaging/sending-messages)
