Skip to content

Black out a queue date range

PubNio API queues.blackouts.create: black out a queue date range. Request fields, examples in five clients, errors, and idempotency.

Black out a queue date range with POST /api/v1/queues/{queueId}/blackouts. Requires an API key with the publish scope or a signed-in workspace owner.

Request

Use YYYY-MM-DD dates in the queue time zone with startsOn before or equal to endsOn and at most 90 days. Overlaps with other blackouts are allowed.

Parameter In Type Required
queueId path UUID Yes
workspaceId query UUID Yes
Body field Type Required
startsOn string Yes
endsOn string Yes
reason string No

Response

  • HTTP 201: QueueBlackout with id, queueId, startsOn, endsOn, reason, createdAt.

The OpenAPI document has each field’s type.

Examples

const blackout = await workspace.queues.blackout(queueId, {
  startsOn: "2026-12-24",
  endsOn: "2026-12-26",
  reason: "Holiday",
});
blackout = workspace.queues.create_blackout(
    queue_id,
    starts_on="2026-12-24",
    ends_on="2026-12-26",
    reason="Holiday",
)
curl -X POST "https://pubnio.com/api/v1/queues/$QUEUE_ID/blackouts?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"startsOn":"2026-12-24","endsOn":"2026-12-26","reason":"Holiday"}'
pnio queues blackout "$QUEUE_ID" --starts-on 2026-12-24 --ends-on 2026-12-26 --reason Holiday
async () => {
  const queueId = "<queueId>";
  const response = await codemode.request({
    method: "POST",
    path: `/api/v1/queues/${queueId}/blackouts`,
    query: { workspaceId: codemode.workspaceId },
    body: {
      startsOn: "2026-12-24",
      endsOn: "2026-12-26",
      reason: "Holiday",
    },
  });
  return response.data;
};

Errors

It declares no problem of its own.

It declares the problems most operations declare.

Idempotency

No key, so a retried POST is not deduplicated. Read the current state before you retry.

Limits

Type to search…

↑↓ navigate↵ selectEsc close