Skip to content
Peal
Esc
↑↓navigate↵open⌘Jpreview
On this page

List posts

List a workspace's posts, filtered by state, channel, tag or time.

You can find the posts that failed last week, everything still scheduled on one channel, or the posts a key created. The samples build the client as Posting through the API explains.

GET …/posts lists the workspace’s posts, whatever their state, a page at a time. A page holds 20 posts unless limit says otherwise, and 100 at most. When you give several filters, a post must match all of them. The MCP tool list_posts takes the same filters, and peal posts list lists the same posts (Command line).

The request takes these parameters:

Parameter What it keeps
status draft, awaitingApproval (waiting for an approval, with its time kept), scheduled, publishing, finished or cancelled
outcome How a finished post ended: published, partiallyPublished, unconfirmed, failed or cancelled
channelId Posts with a target on that channel
platform Posts with a target on a connected channel of that platform
tagId Posts filed under that tag
queueId Posts that queue placed (Queues)
recyclingId Posts that recycling rule made (Repeat a post)
removed true: posts Peal deleted from at least one channel’s platform; false: posts deleted from none (Unpublish a post)
from, to Posts scheduled from from (included) to to (excluded). Either one leaves out posts without a time.
createdVia web, apiKey or application
authorId Posts that user created
sort createdDesc (the default) or createdAsc, by creation; scheduledDesc or scheduledAsc, by scheduled instant, which list only posts with a time
limit How many posts a page holds, from 1 to 100
cursor The nextCursor of the previous page

This request lists the failed Bluesky posts, the latest scheduled first:

import { PealClient } from "@peal-social/sdk";

const peal = new PealClient({ token: process.env.PEAL_API_KEY });

const page = await peal.posts.list({
  status: "finished",
  outcome: "failed",
  platform: "bluesky",
  sort: "scheduledDesc",
  limit: "50",
});
import os

from peal import Peal

peal = Peal(token=os.environ["PEAL_API_KEY"])

page = peal.posts.list(
    status="finished",
    outcome="failed",
    platform="bluesky",
    sort="scheduledDesc",
    limit="50",
)
import (
	"context"
	"os"

	peal "github.com/peal-social/peal/packages/peal-sdk/go"
	"github.com/peal-social/peal/packages/peal-sdk/go/client"
	"github.com/peal-social/peal/packages/peal-sdk/go/option"
)

client := client.NewClient(option.WithToken(os.Getenv("PEAL_API_KEY")))

page, err := client.Posts.List(context.TODO(), &peal.ListPostsRequest{
	Status:   peal.PostStatusFinished.Ptr(),
	Outcome:  peal.PostOutcomeFailed.Ptr(),
	Platform: peal.PlatformBluesky.Ptr(),
	Sort:     peal.PostSortScheduledDesc.Ptr(),
	Limit:    peal.String("50"),
})
require "peal"

peal = Peal::Client.new(token: ENV.fetch("PEAL_API_KEY"))

page = peal.posts.list(
  status: "finished",
  outcome: "failed",
  platform: "bluesky",
  sort: "scheduledDesc",
  limit: "50"
)
import social.peal.PealClient;
import social.peal.resources.posts.requests.ListPostsRequest;
import social.peal.types.*;

PealClient peal = PealClient.builder()
    .token(System.getenv("PEAL_API_KEY"))
    .build();

PostPage page = peal.posts().list(
    ListPostsRequest.builder()
        .status(PostStatus.FINISHED)
        .outcome(PostOutcome.FAILED)
        .platform(Platform.BLUESKY)
        .sort(PostSort.SCHEDULED_DESC)
        .limit("50")
        .build());
<?php
use Peal\PealClient;
use Peal\Posts\Requests\ListPostsRequest;

$peal = new PealClient(token: getenv('PEAL_API_KEY'));

$page = $peal->posts->list(new ListPostsRequest([
    'status' => 'finished',
    'outcome' => 'failed',
    'platform' => 'bluesky',
    'sort' => 'scheduledDesc',
    'limit' => '50',
]));
using Peal;

var peal = new PealClient(Environment.GetEnvironmentVariable("PEAL_API_KEY")!);

var page = await peal.Posts.ListAsync(new ListPostsRequest
{
    Status = PostStatus.Finished,
    Outcome = PostOutcome.Failed,
    Platform = Platform.Bluesky,
    Sort = PostSort.ScheduledDesc,
    Limit = "50",
});
use peal_sdk::prelude::*;

let peal = PealClient::new(ClientConfig {
    token: std::env::var("PEAL_API_KEY").ok(),
    ..Default::default()
})?;

let page = peal
    .posts
    .list(
        &PostsListQueryRequest::builder()
            .status(PostStatus::Finished)
            .outcome(PostOutcome::Failed)
            .platform(Platform::Bluesky)
            .sort(PostSort::ScheduledDesc)
            .limit("50")
            .build()?,
        None,
    )
    .await?;
curl "https://api.example.com/api/v1/posts?status=finished&outcome=failed&platform=bluesky&sort=scheduledDesc&limit=50" \
  -H "Authorization: Bearer $PEAL_API_KEY"
{
  "status": "finished",
  "outcome": "failed",
  "platform": "bluesky",
  "sort": "scheduledDesc",
  "limit": 50
}
{
  "items": [
    {
      "id": "0190f3a0-0000-7000-8000-00000000b003",
      "status": "finished",
      "outcome": "failed",
      "schedule": {
        "at": "2026-11-12T08:00:00.000Z",
        "timeZone": "Europe/Paris"
      },
      "targets": [
        {
          "id": "0190f3a0-0000-7000-8000-00000000d003",
          "channelId": "0190f3a0-0000-7000-8000-00000000c001",
          "status": "failed",
          "permalink": null,
          "failureReason": "tokenExpired"
        }
      ]
    }
  ],
  "channels": [
    {
      "channelId": "0190f3a0-0000-7000-8000-00000000c001",
      "platform": "bluesky"
    }
  ],
  "nextCursor": "eyJhZnRlciI6IjAxOTBmM2EwIn0"
}

Each post comes whole, with its targets, their status, address and failure reason. channels gives the platform of each channel on the page that’s still connected, so you can label each target without another request.

Read the next page

Pass nextCursor as cursor, with the same filters and sort. It’s null on the last page.

A cursor marks where its page ended, so posts created, moved or deleted in the meantime never make a page repeat a post or skip one. A cursor from another sort, or one no page returned, answers 400.

Was this page helpful?