Recipes
Add Posts to a Queue
Push posts into a queue so they publish automatically at the next available slot.
Queues automate scheduling — add content items and they'll be published at the next available time slot.
JavaScript
// List existing queues
const queuesRes = await fetch(
`https://api.wahlu.com/v1/brands/${brandId}/queues`,
{ headers: { Authorization: "Bearer wahlu_live_your_api_key_here" } }
);
const { data: queues } = await queuesRes.json();
const queue = queues[0];
// Add content item IDs to the queue
const updateRes = await fetch(
`https://api.wahlu.com/v1/brands/${brandId}/queues/${queue.id}`,
{
method: "PATCH",
headers: {
Authorization: "Bearer wahlu_live_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
content_item_ids: [...queue.content_item_ids, "content_item_new1", "content_item_new2"],
}),
}
);
const { data: updatedQueue } = await updateRes.json();
console.log(`Queue now has ${updatedQueue.content_item_ids.length} content items`);