# Embed model

What a share's link shows where it's pasted: its card's title, line, site, author, colour and pictures, the same for everyone.

## Fields

| Field | Type | Present | Notes |
|---|---|---|---|
| `title` | `string` |  | The card's title. |
| `description` | `string` |  | The line under the title, plain text. |
| `site` | `object` |  | The site the card is from: hematite. |
| `site.name` | `string` |  | The site's name, over the title. |
| `site.url` | `string` |  | Where the site's name links. |
| `author` | `object \| null` |  | Who shared it, over the title: the uploader or the folder's owner. Null when the image hides its uploader or they hide their page. |
| `author.name` | `string` |  | Their username. |
| `author.url` | `string \| null` |  | Their profile, where the name links; null until profiles have a public address. |
| `color` | `string` |  | The colour of the card's bar in Discord: `#` and six hex digits, lowercase. Matches ^#[0-9a-f]{6}$. |
| `layout` | `enum` |  | `large`: the pictures large under the text. `small`: one picture, square, beside the text. `alone`: in Discord the pictures by themselves, without the text; elsewhere the large card. `none`: no picture. One of `large`, `small`, `alone`, `none`. |
| `pictures` | `object[]` |  | An image's picture, or up to four of a folder's: never one marked NSFW or shielded. Empty with the layout `none`. At most 4 items. |
| `pictures.url` | `string` |  | The picture on hematite's cdn, made for cards: at most 1200 px wide, with its owner's watermark. |
| `pictures.width` | `integer` |  | Its width in pixels, as served. |
| `pictures.height` | `integer` |  | Its height in pixels, as served. |
| `pictures.alt` | `string` |  | Its title, or the file's name without one. |
| `pictures.type` | `enum` |  | Its format. One of `image/jpeg`, `image/gif`, `image/webp`. |
| `pictures.animated` | `boolean` |  | An animated GIF or WebP, served animated in its own format. |
| `publishedAt` | `string \| null` |  | When it was uploaded (a folder: made), RFC 3339 in UTC, which Discord shows under the card in each reader's own time; null when the card's style doesn't show the time. |
| `indexable` | `boolean` |  | Whether search engines may index the share's page: only a public image's. |

## Returned by

The endpoints whose `data` holds an Embed as it is, and where.

- [`POST /images/:imageId/embed-preview`](https://hematite.gg/docs/developers/reference/images#post-images-imageid-embed-preview), in `data.card`
- [`GET /shares/by-code/embed`](https://hematite.gg/docs/developers/reference/shares#get-shares-by-code-embed), in `data`

## Example

```json
{
  "title": "Clutch on Ascent",
  "description": "1v4 on the last round",
  "site": {
    "name": "Ranked",
    "url": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png"
  },
  "author": {
    "name": "Ranked",
    "url": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png"
  },
  "color": "#c4d4e0",
  "layout": "large",
  "pictures": [
    {
      "url": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png",
      "width": 1920,
      "height": 1080,
      "alt": "string",
      "type": "image/jpeg",
      "animated": false
    }
  ],
  "publishedAt": "string",
  "indexable": false
}
```
