Media

Upload a file directly

Uploads a file in the request itself and returns a public URL, for cases where a two-step presign is inconvenient and the file is small — chiefly direct message attachments, where Meta fetches the URL itself. The stored object is deleted automatically after seven days, so it is not a substitute for POST /v1/media/presign when publishing posts. Maximum 25MB. Requires a read-write API key.

post/v1/media/upload-direct

Request

  • Base URL: https://api.postzen.dev
  • URL: https://api.postzen.dev/v1/media/upload-direct
  • Auth: HTTP bearer

Response

File stored.

urlstring uri required

Publicly fetchable URL for the stored file. Pass it as attachmentUrl when sending a direct message.

filenamestring required

Sanitized file name the object was stored under.

contentTypestring required
sizeinteger required

Stored size in bytes.

Changes

No recorded changes to this operation across all 1 revision of this API.