Replace every weekly queue slot with PUT /api/v1/queues/{queueId}/slots. Requires an API key with the publish scope or a signed-in workspace owner.
Request
Round-trip slot IDs to keep them. An omitted ID creates a slot. A removed slot leaves historical assignments with no slot ID.
| Parameter | In | Type | Required |
|---|---|---|---|
queueId |
path | UUID | Yes |
workspaceId |
query | UUID | Yes |
| Body field | Type | Required |
|---|---|---|
expectedVersion |
integer | Yes |
slots |
array of QueueSlotInput | Yes |
Response
- HTTP 200:
Queuewithid,workspaceId,accountId,name,timezone,status,isDefault,limits,slots,version,pausedAt,archivedAt,createdAt,updatedAt.status:active,paused,archived
The OpenAPI document has each field’s type.
Examples
const queue = await workspace.queues.replaceSlots(queueId, {
expectedVersion: 3,
slots: [
{ dayOfWeek: 2, time: "12:30" },
{ dayOfWeek: 4, time: "12:30" },
],
});queue = workspace.queues.replace_slots(
queue_id,
expected_version=3,
slots=[
{"dayOfWeek": 2, "time": "12:30"},
{"dayOfWeek": 4, "time": "12:30"},
],
)curl -X PUT "https://pubnio.com/api/v1/queues/$QUEUE_ID/slots?workspaceId=$WORKSPACE_ID" \
-H "Authorization: Bearer $PUBNIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"expectedVersion":3,"slots":[{"dayOfWeek":2,"time":"12:30"},{"dayOfWeek":4,"time":"12:30"}]}'pnio queues slots "$QUEUE_ID" --version 3 --slot tue@12:30 --slot thu@12:30async () => {
const queueId = "<queueId>";
const response = await codemode.request({
method: "PUT",
path: `/api/v1/queues/${queueId}/slots`,
query: { workspaceId: codemode.workspaceId },
body: {
expectedVersion: 3,
slots: [
{ dayOfWeek: 2, time: "12:30" },
{ dayOfWeek: 4, time: "12:30" },
],
},
});
return response.data;
};Errors
It declares no problem of its own.
It declares the problems most operations declare.
Idempotency
No key. The required expectedVersion makes a stale retry fail instead of applying twice.
Limits
- Field lengths and ranges are in the OpenAPI document.