Embeds

The Embeds API converts URLs into embedded videos, images and rich article previews.

Create embed

Create an embed.

POST /api/embeds
Body parameters
type object required

The type of embed.

title string

The title describing the resource.

description string

Gets or sets a description for the resource.

image string

The embed image. Can be a public URL, a base64 encoded data URI or a blob id.

url string

Url to the embedded resource (when applicable).

actions array of strings

Optional embed actions (when type is "link"). Will be rendered as buttons in the embed card, e.g. ["View", "Share", "Download"].

metadata object

Additional metadata properties, e.g. { "color": "blue", "size": "XL" }.

html string

The html required to display the resource (when type is "rich" or "video"). Must be a single <iframe> element.

width string

The width in pixels of the embed (when type is "rich" or "video").

height string

The height in pixels of the embed (when type is "rich" or "video").

Example request
curl {WEAVY-URL}/api/embeds
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
--json "{ 'type': 'link', 'title': 'Example', 'description': 'An example embed', 'url': 'https://www.example.com' }"
Response codes

201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
422 Validation Failed

Response schema
{
  "id": "string",
  "type": "object",
  "title": "string",
  "description": "string",
  "image": {
    "id": "string",
    "name": "string",
    "media_type": "string",
    "width": "string",
    "height": "string",
    "size": "string",
    "thumbnail_url": "string",
    "raw": "string"
  },
  "url": "string",
  "thumbnail_url": "string",
  "actions": [
    "string"
  ],
  "metadata": "object",
  "author_name": "string",
  "author_url": "string",
  "provider_name": "string",
  "provider_url": "string",
  "html": "string",
  "width": "string",
  "height": "string"
}

Get embed

Get an embed by id.

GET /api/embeds/{id}
Path parameters
id integer required

Id of embed.

Example request
curl {WEAVY-URL}/api/embeds/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes

200 OK
401 Unauthorized
404 Not Found

Response schema
{
  "id": "string",
  "type": "object",
  "title": "string",
  "description": "string",
  "image": {
    "id": "string",
    "name": "string",
    "media_type": "string",
    "width": "string",
    "height": "string",
    "size": "string",
    "thumbnail_url": "string",
    "raw": "string"
  },
  "url": "string",
  "thumbnail_url": "string",
  "actions": [
    "string"
  ],
  "metadata": "object",
  "author_name": "string",
  "author_url": "string",
  "provider_name": "string",
  "provider_url": "string",
  "html": "string",
  "width": "string",
  "height": "string"
}

Get embed for url

Get an embed for the specified url.

GET /api/embeds
Query parameters
url string required

The URL to retrieve embedding information for.

Example request
curl {WEAVY-URL}/api/embeds?url=https%3A%2F%2Fbaconipsum.com
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes

200 OK
201 Created
400 Bad Request
401 Unauthorized
404 Not Found

Response schema
{
  "id": "string",
  "type": "object",
  "title": "string",
  "description": "string",
  "image": {
    "id": "string",
    "name": "string",
    "media_type": "string",
    "width": "string",
    "height": "string",
    "size": "string",
    "thumbnail_url": "string",
    "raw": "string"
  },
  "url": "string",
  "thumbnail_url": "string",
  "actions": [
    "string"
  ],
  "metadata": "object",
  "author_name": "string",
  "author_url": "string",
  "provider_name": "string",
  "provider_url": "string",
  "html": "string",
  "width": "string",
  "height": "string"
}