POST/file/get-signed-upload-urls

Generates pre-signed URLs for uploading media files (images, videos, PDFs, or YouTube caption files) directly to S3.

https://api.postfa.st/Auth: pf-api-keyRate limit: 1,260 requests per day, 180 per minuteMaximum 250 MB per video, 10 MB per image, 60 MB per document (PDF, DOC, DOCX, PPT, PPTX), and 10 MB per caption file (SRT, VTT).

Uploading to S3

After obtaining the signedUrl and key, perform an HTTP PUT request to the signedUrl with the raw file data as the request body. The Content-Type header in this PUT request must match the contentType used to generate the signed URL.

Request body

contentTypestringrequired

The MIME type of the file. Supported image types: image/jpeg, image/png, image/gif, image/webp. Supported video types: video/mp4, video/webm, video/mov, video/quicktime. Supported document types (for LinkedIn document posts only): application/pdf, application/msword (.doc), application/vnd.openxmlformats-officedocument.wordprocessingml.document (.docx), application/vnd.ms-powerpoint (.ppt), application/vnd.openxmlformats-officedocument.presentationml.presentation (.pptx). Supported caption types (for YouTube captions only): application/x-subrip (.srt), text/vtt (.vtt); the returned file/ key goes in controls.youtubeCaptionKey, not in mediaItems.

countnumberrequired

Number of signed URLs to generate. Min 1. Max 8 for images, max 1 for videos, max 1 for documents (PDF, DOC, DOCX, PPT, PPTX) and caption files (SRT, VTT).

Response

201 Created An array of objects, each containing:

keystringoptional

The S3 object key for upload.

signedUrlstringoptional

The pre-signed S3 URL for the PUT request.