Add a picture to a post
Create an asset
cURL
201 with the asset’s id. Use "type": "video" for a video. Clients can’t create assets, and a full storage answers 402 with entity: bytes.Upload the file
The file never goes in the API request itself. Use Uploading again replaces the file. Use
POST /assets/{id}/image, or /video for a video, in one of two ways:- Upload URL
- From a public URL
Start the upload with the file’s name and type:Then
cURL
PUT the bytes to the presigned_url from the answer within 10 minutes, with the file’s content type. Don’t send your API key there. There’s no confirm call.cURL
"visibility": "public" for anything you publish: public files get a stable CDN URL, private ones a signed URL that expires after 12 hours.Check processing
cURL
data.image.status goes from pending to analyzing to analyzed (or error), usually in 1 to 2 minutes. Publishing doesn’t wait for it. A file that stays pending never got its bytes: upload it again.Attach it to a post
cURL
assets_ids. On update, the list replaces the old one. See Publishing posts.Video covers
Instagram, YouTube and Pinterest can show a cover picture on a video. Upload it to the post withPOST /posts/{id}/cover, the same way.
Organize the library
- Folders: create with
POST /companies/{company_id}/folders, then set an asset’sfolder_id. Move many assets withPUT /companies/{company_id}/assets/bulk. - Delete an asset with
DELETE /assets/{id}, or only its file withDELETE /files/{id}.
