PostGuild

Publishing API

Publish, schedule, and check delivery across the social accounts connected to a PostGuild profile.

Download the OpenAPI definition

Authentication

Create an API key in your dashboard. Send it as Authorization: Apikey <key> or Authorization: Bearer <key>. Use the origin of your PostGuild installation for POSTGUILD_URL.

Send a post

Create a profile and connect a Facebook Page first. Replace studio with the profile slug. Use a stable Idempotency-Key when retrying the same request.

curl -X POST "$POSTGUILD_URL/api/upload_text" \
  -H "Authorization: Apikey $POSTGUILD_API_KEY" \
  -H "Idempotency-Key: product-update-2027-01" \
  -F "user=studio" \
  -F "platform[]=facebook" \
  -F "text=The January product update is now available." \
  -F "external_id=product-update-2027-01"

Use request_id from the accepted response to check the status of each destination.

curl "$POSTGUILD_URL/api/uploadposts/status?request_id=$REQUEST_ID" \
  -H "Authorization: Apikey $POSTGUILD_API_KEY"

To schedule a publish, add scheduled_date with a future ISO 8601 timestamp. Send an explicit offset or include the relevant IANA timezone. Use add_to_queue: true to let PostGuild select the next available slot.

Publishing and schedules

Send uploads as multipart form data. Pass user as the profile slug, repeat platform[] for each destination, and send the relevant text, title, video, or photos[] fields. Pass an optional external_id to correlate the request with a record in your system.

JSON uploads use user, an array of platforms, and text or media IDs. For direct media uploads, create a staging upload, PUT its bytes using the signed URL and returned headers, then complete the upload. Use the resulting asset_id or media_url in your publishing request. Use the destination IDs facebook, instagram, x, youtube, and tiktok.

Each destination uses one publish from the account allowance. Provider permissions and media support vary by destination.

POST /api/upload
Upload a video for immediate or scheduled publishing.
POST /api/upload_photos
Upload photos for immediate or scheduled publishing.
POST /api/upload_text
Publish or schedule text for a destination that supports text posts.
GET /api/uploadposts/status?request_id=…
Look up a request and its per-destination results.
GET /api/uploadposts/history
List publishing history.
GET /api/uploadposts/schedule
List scheduled posts.
PATCH /api/uploadposts/schedule/:id
Send a new scheduled_date for a queued post.
DELETE /api/uploadposts/schedule/:id
Cancel a scheduled post.
POST /api/uploadposts/posts/retry
Queue one confirmed failed destination using request_id and platform.

Platform and media tools

Connect a profile first. Provider management endpoints use that profile’s granted permissions. Reconnect an account after its operator enables additional OAuth scopes.

Meta tools cover Page information, Insights, captions, media, comments, and Instagram messaging. YouTube tools cover video and channel data, playlists, comments, captions, live streaming, and reporting. X reads and list actions draw from the account’s X allowance. TikTok inbox delivery and TikTok Ads require their own grants.

Queue MP4 edits with the FFmpeg endpoints and poll for the finished download. Use the OpenAPI definition for available methods and request requirements.

Profiles and connections

A profile groups the social identities for one brand or client. A profile holds one connected identity per platform.

GET /api/uploadposts/users
List profiles owned by the account.
POST /api/uploadposts/users
Create a profile with username and optional display_name.
PATCH /api/uploadposts/users/:slug
Change a profile's display_name.
DELETE /api/uploadposts/users
Archive a profile by username.
DELETE /api/uploadposts/users/social
Disconnect a destination by username and platform.
POST /api/uploadposts/users/generate-jwt
Create a hosted connection link for username and optional platforms.

Analytics and Page lookup

YouTube counters reflect the totals returned by YouTube. Counter values are decimal strings, with null for a missing or hidden value. Other platforms return an unsupported status. The Facebook Page lookup uses the destination already selected for each profile.

GET /api/analytics/:slug
Read cumulative metrics for the profile’s connected YouTube channel.
GET /api/uploadposts/post-analytics/:requestId
Read metrics for a confirmed YouTube delivery with its original channel still connected.
GET /api/uploadposts/facebook/pages
List selected Facebook Pages. Add profile to limit results to one profile.

Webhooks

Register a public HTTPS receiver by sending a JSON object with its url. Save the signing_secret returned when a new subscription is created.

Read the raw request body and compute HMAC-SHA256 of timestamp.deliveryId.rawBody using that secret. Read the timestamp and delivery ID from X-PostGuild-Timestamp and X-PostGuild-Delivery. Verify the timestamp is recent and compare the hex signature with X-PostGuild-Signature using a timing-safe comparison after stripping its sha256= prefix.

Acknowledge successful deliveries with a 2xx response. Deduplicate using the delivery ID, which stays the same on automatic retries. A manual redelivery creates a new delivery ID.

The post.delivery.updated event carries request_id, delivery_id, external_id, platform, status, platform_post_id, post_url, and error.

POST /api/uploadposts/webhooks/subscriptions
Register a receiving URL.
GET /api/uploadposts/webhooks/subscriptions
List subscriptions.
GET /api/uploadposts/webhooks/subscriptions/:id
Read a subscription.
DELETE /api/uploadposts/webhooks/subscriptions/:id
Delete a subscription.
POST /api/uploadposts/webhooks/subscriptions/:id/test
Queue a signed test event.
GET /api/uploadposts/webhooks/deliveries
List deliveries, with an optional cursor.
GET /api/uploadposts/webhooks/deliveries/:id
Read a delivery and its payload.