File Upload

Issue a POST request to the /asset/v1/content/assets endpoint to upload files, such as gif, pdf, and png files. Add a file to the asset as an encoded base64 string using the file attribute. The maximum size file size is 5 MB.

File Upload Example

POST /asset/v1/content/assets HTTP/1.1
Host: SUBDOMAIN.rest.marketingcloudapis.com
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN

{
  "name": "1px transparent gif asset",
  "assetType": {
    "name": "gif",
    "id": 20
  },
  "file": "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
  "modelVersion": 2,
  "fileProperties": {
    "fileName": "1px_transparent.gif"
  }
}

See Also