PostFast API
Programmatically schedule and publish posts across 11 social platforms, upload media, and read analytics. REST over HTTPS, authenticated with a single workspace API key.
pf-api-keyQuickstart: a 200 in under 2 minutes
- Generate a workspace API key from Workspace Settings (requires an ADMIN role).
- Send it in the
pf-api-keyheader. - Make a cheap read to confirm it works: list your connected accounts.
curl -X GET "https://api.postfa.st/social-media/my-social-accounts" \
-H "pf-api-key: YOUR_WORKSPACE_API_KEY"API Endpoints
I. Authentication
Overview
All API requests must be authenticated using an API key specific to your workspace. The API key must be included in the request headers as pf-api-key.
Generating an API Key
Users with an ADMIN role in a workspace can generate an API key from the Workspace Settings page within the PostFast web application. Each API key is uniquely tied to a single workspace and grants access only to the social media accounts connected within that specific workspace. This key is then used for authenticating your REST API requests.
Example Header:
pf-api-key: YOUR_WORKSPACE_API_KEYRate Limiting
All API endpoints are subject to both global rate limits and endpoint-specific limits. Rate limits are tracked per API key, meaning each workspace has its own separate rate limit allowances.
The most restrictive limit applies first - if any rate limit is exceeded, the request will be rejected with a 429 status code.
Global Rate Limits (All Endpoints)
60 requests per minute150 requests per 5 minutes300 requests per hour2000 requests per day
Rate Limit Headers
API responses include relevant rate limit headers for active throttlers:
X-RateLimit-Limit-short: 60
X-RateLimit-Remaining-short: 59
X-RateLimit-Reset-short: 60
X-RateLimit-Limit-medium: 150
X-RateLimit-Remaining-medium: 149
X-RateLimit-Reset-medium: 300
Retry-After-long: 2395Header meanings:
X-RateLimit-Limit-[throttler]: Maximum requests allowedX-RateLimit-Remaining-[throttler]: Requests remaining in windowX-RateLimit-Reset-[throttler]: Seconds until window resetsRetry-After-[throttler]: Seconds to wait before retry (when limited)
Rate Limit Exceeded (429 Response)
When rate limits are exceeded, you'll receive:
{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Note: Headers vary by endpoint and show only active throttlers. Different endpoints may display different header combinations based on their specific rate limits.
Error Responses
Common HTTP status codes you might encounter:
- 400 Bad Request - The request was malformed (e.g., missing required fields, invalid JSON). Check the response body for specific error messages. Also returned when scheduling a post to a social account that is currently
DISABLED(revoked/expired token or suspended account) — reconnect it in the PostFast app first. - 401 Unauthorized - The API key is missing, invalid, or not authorized for the workspace.
- 403 Forbidden - The API key is valid, but does not have permissions for the requested action (e.g., trying to access resources of another workspace).
- 404 Not Found - The requested resource (e.g., a specific social post for deletion) could not be found.
- 429 Too Many Requests - You have exceeded the rate limit for the endpoint.
- 500 Internal Server Error - An unexpected error occurred on our server.
III. Typical Workflow: Scheduling Posts with Media
- Authentication: Ensure you have a valid
pf-api-keyfor your workspace. - (Optional) Identify Target Account: Call
GET /social-media/my-social-accountsto list available social media accounts and retrieve theidof the account you want to post to. Store these IDs as they are generally stable. - Request Signed URLs for Media: If your posts include media:
- Call
POST /file/get-signed-upload-urlswith thecontentType(e.g.,image/png) andcount. - Receive a response containing an array of
{ key, signedUrl }objects.
- Call
- Upload Media to S3: For each media item:
- Perform an HTTP
PUTrequest to thesignedUrl. - The request body must be the raw file data.
- The
Content-Typeheader of this PUT request must match thecontentTypeused in the previous step.
// Upload file to S3 using the signed URL from previous step const fs = require('fs'); const file = fs.readFileSync('/path/to/your/image.png'); const response = await fetch(signedUrl, { method: 'PUT', body: file, headers: { 'Content-Type': 'image/png' // Must match contentType from step 1 } }); if (response.ok) { // File uploaded successfully // Use the 'key' from step 1 in your social posts } - Perform an HTTP
- Create the Social Posts:
- Call
POST /social-posts. - In the request body, include an array of posts in the
postsfield, each containingcontent,scheduledAt, andsocialMediaId. - If media was uploaded, populate the
mediaItemsarray for each post using thekey(s) from step 3 (e.g.,image/a1b2c3d4-e5f6-7890-1234-567890abcdef.png). Ensure thetypefield ('IMAGE' or 'VIDEO') matches the key prefix. - Optionally include
controlsfor platform-specific settings.
- Call
Social Media Account Management
/social-media/my-social-accountsRetrieves a list of social media accounts connected to the workspace associated with the API key. Each account includes its latest daily follower or subscriber count.
/social-media/{socialMediaId}/follower-historyReturns daily follower/subscriber snapshots for one connected account, plus the current count and the net change over the range. Build growth charts without storing your own snapshots. The latest count is also on
GET /social-media/my-social-accounts./social-media/search-placesSearch real-world places (restaurants, venues, hotels, landmarks) to geotag on Facebook and Instagram posts. The returned
idworks as bothfacebookPlaceIdandinstagramLocationId./social-media/{socialMediaId}/pinterest-boardsRetrieves all Pinterest boards for a connected Pinterest account. Use the
boardIdfield when settingpinterestBoardIdon a Pinterest post./social-media/{socialMediaId}/youtube-playlistsRetrieves all YouTube playlists for a connected YouTube account. Use the
playlistIdfield when settingyoutubePlaylistIdon a YouTube post./social-media/{socialMediaId}/gbp-locationsReturns all synced Google Business Profile locations for a connected account. Use the
locationIdfield asgbpLocationIdwhen creating GBP posts./social-media/connect-linkGenerates a secure connect link that lets someone connect their social accounts to your workspace without a PostFast account. Optionally emails the link.