> ## 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.

# Rich link previews

> Send one URL as a Relay link part.

Send a `link` part when a URL should be the Message's primary content.

## Send a link part

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  await relay.chats.messages.send(chatId, {
    message: {
      parts: [{
        type: "link",
        value: "https://relayapp.im/@weather.acme",
      }],
    },
  });
  ```

  ```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":"link",
          "value":"https://relayapp.im/@weather.acme"
        }]
      }
    }'
  ```
</CodeGroup>

## Composition rules

* A link must use a valid absolute URL.
* Maximum length is 2,048 characters.
* A `link` must be the only part in its Message.
* Relay stores the URL as the link part.
* Clients render preview metadata from the URL.

Use a `text` part when the URL belongs inside a larger sentence.

## Start a Chat with a link

`POST /v1/chats` rejects links in the first Message, including HTTP or HTTPS
URLs inside a text part. Use `POST /v1/messages` to resolve or create the Chat
when the first Message is a link, or send the link to an existing Chat.

## Related

* [Sending Messages](/guides/messaging/sending-messages)
* [Message details](/guides/messaging/message-details)
