Blobs
The Blobs API enables the uploading of blobs. Blobs are used as references when creating files and attachments.
Upload blob
Uploads a blob using multipart/form-data.
After creation the blob can be used as reference when creating attachments and/or files.
POST /api/blobs
Example request
curl {WEAVY-URL}/api/blobs
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
-F blob=@/test/image.png
Response codes
201 Created
401 Unauthorized
422 Validation Failed
Response schema
{
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string",
"raw": "string"
}
Create external blob
Creates a blob that links to an external blob provider. After creation the blob can be used as reference when creating attachments and/or files.
POST /api/blobs/external
Body parameters
providerstringrequiredGets or sets the provider name.
linkstringrequiredGets or sets an url for viewing the blob.
namestringrequiredGets or sets the file name of the blob.
widthintegerGets or sets the width, in pixels, of the blob (only for images).
heightintegerGets or sets the height, in pixels, of the blob (only for images).
sizeintegerrequiredGets or sets the size, in bytes, of the file.
media_typestringGets or sets the Media Type (https://www.iana.org/assignments/media-types/media-types.xhtml) of the file, e.g. "image/png".
downloadstringGets or sets an url for downloading the blob.
embedstringGets or sets an url used for embedding the blob.
rawobjectGets or sets the raw metadata from the provider.
Response codes
201 Created
401 Unauthorized
422 Validation Failed
Response schema
{
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string",
"raw": "string"
}
Get blob
Get the metadata of a blob.
GET /api/blobs/{id}
Path parameters
idintegerrequiredId of blob.
Example request
curl {WEAVY-URL}/api/blobs/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string",
"raw": "string"
}