Skip to main content

Webhooks

Coming Soon

Webhooks are not yet available. This page describes planned functionality and the current workaround for tracking post status.

Planned Webhook Events

When webhooks launch, you will be able to subscribe to real-time notifications for these events:

EventDescription
post.publishedA scheduled post was successfully published to a platform.
post.failedA post failed to publish to one or more platforms after all retries.
media.processedAn uploaded media file has finished processing and is ready to use.
account.disconnectedA connected social account's token expired or was revoked.

Each webhook will deliver a JSON payload to your registered endpoint via HTTPS POST, with a signature header for verification.

Current Workaround: Polling

Until webhooks are available, you can poll the Get Post Results endpoint to track publishing status.

Polling Example

const API_KEY = "pe_live_abc123...";
const BASE_URL = "https://app.posteverywhere.ai/api/v1";

async function waitForResults(postId, timeoutMs = 300000) {
const startTime = Date.now();
const pollInterval = 10000; // 10 seconds

while (Date.now() - startTime < timeoutMs) {
const response = await fetch(`${BASE_URL}/posts/${postId}/results`, {
headers: { Authorization: `Bearer ${API_KEY}` },
});

const data = await response.json();

// Check if all destinations have a final status
const allComplete = data.destinations.every(
(d) => d.status === "published" || d.status === "failed"
);

if (allComplete) {
return data;
}

// Wait before polling again
await new Promise((resolve) => setTimeout(resolve, pollInterval));
}

throw new Error(`Timed out waiting for post ${postId} results`);
}

// Usage
const results = await waitForResults("post_abc123");

for (const dest of results.destinations) {
if (dest.status === "published") {
console.log(`Published to ${dest.platform}: ${dest.url}`);
} else {
console.log(`Failed on ${dest.platform}: ${dest.error}`);
}
}
# Single poll request
curl https://app.posteverywhere.ai/api/v1/posts/post_abc123/results \
-H "Authorization: Bearer pe_live_abc123..."

Polling Best Practices

  1. Poll no more than once every 10 seconds. More frequent polling wastes your rate limit budget (60 requests/minute).
  2. Set a timeout. Most posts publish within 2 minutes, but platform delays can extend this. A 5-minute timeout is reasonable.
  3. Handle partial results. A post targeting 5 platforms may have 3 published and 2 still pending. Only treat the post as complete when every destination has a final status.
  4. Retry failed destinations. If some platforms failed, use Retry Failed Post rather than creating a new post.

Handling Failed Posts

When polling reveals failures, retry them programmatically:

curl -X POST https://app.posteverywhere.ai/api/v1/posts/post_abc123/retry \
-H "Authorization: Bearer pe_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"destinationIds": ["dest_456", "dest_789"]
}'

Then resume polling for the retried destinations.

Subscribe to Updates

Want to be notified when webhooks launch? Email [email protected] to join the developer preview list. We will notify you when the feature enters beta.