Embeds
The Embeds API converts URLs into embedded videos, images and rich article previews.
Create embed
Create an embed.
POST /api/embeds
Body parameters
typestringrequiredIndicates the type of embed.
titlestringThe title describing the resource.
descriptionstringGets or sets a description for the resource.
imagestringThe embed image. Can be a public URL, a base64 encoded data URI or a blob id.
urlstringUrl to the embedded resource (when applicable).
actionsarray of stringsOptional embed actions (when type is "link"). Will be rendered as buttons in the embed card, e.g. ["View", "Share", "Download"].
metadataobjectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }.
htmlstringThe html required to display the resource (when type is "rich" or "video"). Must be a single
widthintegerThe width in pixels of the embed (when type is "rich" or "video").
heightintegerThe 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": "integer",
"type": "string",
"title": "string",
"description": "string",
"image": {
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"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": "integer",
"height": "integer"
}
Get embed
Get an embed by id.
GET /api/embeds/{id}
Path parameters
idintegerrequiredId 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": "integer",
"type": "string",
"title": "string",
"description": "string",
"image": {
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"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": "integer",
"height": "integer"
}
Get embed for url
Get an embed for the specified url.
GET /api/embeds
Query parameters
urlstringrequiredThe 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": "integer",
"type": "string",
"title": "string",
"description": "string",
"image": {
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"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": "integer",
"height": "integer"
}