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.

POST /api/blobs
Example request
curl https://{WEAVY-SERVER}/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
provider string required

Gets or sets the provider name.

link string required

Gets or sets an url for viewing the blob.

name string required

Gets or sets the file name of the blob.

width integer

Gets or sets the width, in pixels, of the blob (only for images).

height integer

Gets or sets the height, in pixels, of the blob (only for images).

size integer required

Gets or sets the size, in bytes, of the file.

media_type string

Gets or sets the Media Type (https://www.iana.org/assignments/media-types/media-types.xhtml) of the file, e.g. "image/png".

download string

Gets or sets an url for downloading the blob.

embed string

Gets or sets an url used for embedding the blob.

raw

Gets 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
id integer required

Id of blob.

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

200 Success
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"
}