MailerLite API
Files
List the images, PDFs and EPUBs in your account's media library.
You can list the files in your media library
List all files
If you want to list the files in your media library, use this GET request
GET https://connect.mailerlite.com/api/filesReturns a paginated list of the images, PDFs and EPUBs in your account's media library, newest first unless you pass sort. Each file's url is public and can be used as-is, for example as the src of an image block or the href of a button or link.
Request parameters
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| limit | integer | no | Number of files to return per page. Between 1 and 100, defaults to 25. |
| page | integer | no | Page number to return. Counting starts from 1. |
| filter[name] | string | no | Return only files whose name contains this value. Maximum string length of 255 characters |
| filter[type] | string | no | Return only files of this type. One of image, pdf or epub. |
| sort | string | no | Field to sort results by. One of created_at, name or size. Prefix with - for descending order, e.g. -size. Defaults to -created_at. |
width and height are only set for images, and are null for PDFs and EPUBs.
Response
Response code: 200 OK{
"data": [
{
"id": "123456",
"type": "image",
"name": "logo.png",
"url": "https://storage.mlcdn.com/account_image/123/logo.png",
"size": 2048,
"width": 640,
"height": 200,
"created_at": "2026-10-01 09:12:44"
},
{
"id": "123455",
"type": "pdf",
"name": "price-list.pdf",
"url": "https://storage.mlcdn.com/account_file/123/price-list.pdf",
"size": 184320,
"width": null,
"height": null,
"created_at": "2026-09-28 14:03:10"
}
],
"links": {
"first": "https://connect.mailerlite.com/api/files?page=1",
"last": "https://connect.mailerlite.com/api/files?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{ "url": null, "label": "« Previous", "page": null, "active": false },
{ "url": "https://connect.mailerlite.com/api/files?page=1", "label": "1", "page": 1, "active": true },
{ "url": null, "label": "Next »", "page": null, "active": false }
],
"path": "https://connect.mailerlite.com/api/files",
"per_page": 25,
"to": 2,
"total": 2
}
}Error
When providing an invalid parameter, such as a limit above 100
Response code: 422 Unprocessable Entity{
"message": "The limit field must not be greater than 100.",
"errors": {
"limit": ["The limit field must not be greater than 100."]
}
}