Upload an asset’s file
The file’s bytes (`application/octet-stream` with its Content-Length, the size `create` was given). Checks what the file really is and reads an image’s size; the asset is then ready at its URL. Sending them again before that replaces them. 422 `asset_type_mismatch` when the bytes aren’t the type given (or aren’t a file every email client shows, like WebP or SVG); 422 `asset_size_mismatch` when the size differs; 409 `asset_ready` once it’s ready (a new file is a new asset).
The file’s bytes (application/octet-stream with its Content-Length, the size create was given). Checks what the file really is and reads an image’s size; the asset is then ready at its URL. Sending them again before that replaces them. 422 asset_type_mismatch when the bytes aren’t the type given (or aren’t a file every email client shows, like WebP or SVG); 422 asset_size_mismatch when the size differs; 409 asset_ready once it’s ready (a new file is a new asset).
apiKey writeAuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: write
id*stringuuidbody*fileapplication/octet-streamUp to 20,971,520 bytes, with Content-Length
binaryOK
application/json- response
id*stringThe asset’s id
uuidname*stringWhat people call it, e.g. Black Friday hero
folder*|The folder it’s in; null at the top level
kind*string"image""font"contentType*stringThe file’s type, from its bytes
"image/png""image/jpeg""image/gif""font/woff2""font/woff""font/ttf""font/otf"filename*stringThe file’s name in its URL
bytes*integerThe file’s size in bytes
width*|An image’s width in pixels
height*|An image’s height in pixels
status*stringUploading until its bytes are in and checked; then ready to use
"uploading""ready"url*|Where it’s public, once ready; never changes, and keeps working once archived
uriuploadedBy*The person or API key that uploaded it
createdAt*stringdate-timeupdatedAt*stringdate-timearchivedAt*|When it was deleted from the library; its file and URL stay, so emails that show it keep working
date-timecurl -X PUT 'https://api.postforge.dev/v1/assets/497f6eca-6276-4993-bfeb-53cbbbba6f08/content' \ -H 'Content-Type: application/octet-stream' \ -d 'string'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "folder": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" }, "kind": "image", "contentType": "image/png", "filename": "string", "bytes": 0, "width": 0, "height": 0, "status": "uploading", "url": "http://example.com", "uploadedBy": { "type": "user", "id": "string", "name": "string" }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "archivedAt": "2019-08-24T14:15:22Z"}Delete an asset DELETE
Takes the asset out of the library (archives it, D94): it’s no longer listed or offered, while its file and URL stay, so emails that show it keep showing it. 409 `asset_archived` for changes to it afterwards.
List asset folders GET
Every folder of the workspace (at most 1,000), by name, with the folder each is in and how many images and fonts are directly in it: enough to show any folder’s contents and path.