FoPost LogoFoPost Docs
Pro Features

Batch Publishing

Publish to multiple platforms simultaneously.

Batch Publishing

Pro

Batch publishing lets you publish a single post to multiple platforms in one API call with parallel execution on the server.

Basic usage

use OwlStack\Content\Post;
use OwlStack\Enums\Platform;

$post = Post::create('Launching our new product today!')
    ->withUrl('https://example.com/launch')
    ->withHashtags(['launch', 'product']);

$results = $client->publish($post, [
    Platform::Twitter,
    Platform::LinkedIn,
    Platform::Facebook,
    Platform::Telegram,
]);

foreach ($results as $result) {
    echo "{$result->platform()->value}: {$result->status()->value}\n";
}

How it works

  1. Your code sends a single API request to OwlStack
  2. OwlStack processes all platforms in parallel on the server
  3. Each platform gets its own formatted version of the content
  4. Results are returned as a collection, one per platform

Partial failures

Batch operations can partially succeed. If Twitter fails but LinkedIn succeeds, you get results for both:

foreach ($results as $result) {
    if ($result->isPublished()) {
        // Handle success
    } else {
        // Handle failure for this specific platform
        echo $result->error();
    }
}

Multiple posts

To publish different content to different platforms, make separate calls:

$tweet = Post::create('Short tweet version');
$linkedInPost = Post::create('Longer LinkedIn version with more detail...');

$client->publish($tweet, [Platform::Twitter]);
$client->publish($linkedInPost, [Platform::LinkedIn]);

On this page