Create an asset
Starts an asset: send its bytes next to `upload` (`PUT /v1/assets/{id}/content`). Images: PNG, JPEG or GIF up to 20 MB (not WebP, SVG or AVIF: classic Outlook shows nothing for them); fonts: WOFF2, WOFF, TTF or OTF up to 5 MB. 422 `asset_too_large` past its type's size. An asset whose bytes never arrive is removed after a day.
Starts an asset: send its bytes next to upload (PUT /v1/assets/{id}/content). Images: PNG, JPEG or GIF up to 20 MB (not WebP, SVG or AVIF: classic Outlook shows nothing for them); fonts: WOFF2, WOFF, TTF or OTF up to 5 MB. 422 asset_too_large past its type's size. An asset whose bytes never arrive is removed after a day.
apiKey writeAuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: write
idempotency-key?stringRun this write once: a retry with the same key gets the first answer (24 hours).
1 <= length <= 255application/json- body
name*string1 <= length <= 200folderId?|uuidnullfilename*string1 <= length <= 200contentType*string"image/png""image/jpeg""image/gif""font/woff2""font/woff""font/ttf""font/otf"bytes*integer1 <= value <= 20971520Created
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 POST 'https://api.postforge.dev/v1/assets' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "filename": "string", "contentType": "image/png", "bytes": 1}'{ "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"}