Skip to content

Queue

A group's recurring posting slots: the times next-free-slot fills.

5 endpoints

GET/groups/{groupId}/queue/slots

The group's posting slots

Any key

Path

  • groupIduuidrequired

    A social group id from GET /groups.

Returns

200 with these fields; an error answers in the Error envelope.

curl https://postacio.com/api/v1/groups/$GROUP_ID/queue/slots \
  -H "Authorization: Bearer $POSTACIO_API_KEY"
POST/groups/{groupId}/queue/slots

Add a posting slot

Any keyIdempotency-Key

Every account must be a live account of this group, and no account may pass 21 slot times a week.

Path

  • groupIduuidrequired

    A social group id from GET /groups.

Headers

  • Idempotency-Keystring

    Up to 128 visible ASCII characters. Retrying with the same key and body within 24 hours replays the first answer (with Idempotent-Replayed: true) instead of doing the work twice; the same key with a different body is 422 idempotency_conflict.

    up to 128 characters

Body

  • labelstringrequired

    A name for the slot, shown in Postacio's queue.

    1 to 60 characters

  • daysarray of integersrequired

    Weekdays it runs on: 0 = Monday … 6 = Sunday.

    1 to 7 items

  • minutesintegerrequired

    Minutes past midnight in the group's timezone (540 = 09:00).

    0 to 1439

  • account_idsarray of uuidrequired

    The group's accounts this slot posts to.

    1 to 100 items

  • starts_onstring or null

    First local date it runs (YYYY-MM-DD). Null or absent: no start.

    matches ^\d{4}-\d{2}-\d{2}$

  • ends_onstring or null

    Last local date it runs (YYYY-MM-DD). Null or absent: no end.

    matches ^\d{4}-\d{2}-\d{2}$

  • skip_datesarray of strings

    Local dates it does not run on.

    up to 366 items

Returns

201 with a Slot object; an error answers in the Error envelope.

curl -X POST https://postacio.com/api/v1/groups/$GROUP_ID/queue/slots \
  -H "Authorization: Bearer $POSTACIO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "label": "Morning",
    "days": [
      0,
      2,
      4
    ],
    "minutes": 540,
    "account_ids": [
      "8c1d0f3e-5b2a-4e7c-9a61-2f4b7d9e0c13"
    ]
  }'
PATCH/groups/{groupId}/queue/slots/{slotId}

Change a posting slot

Any key

Only the fields sent change. Posts already scheduled keep their times.

Path

  • groupIduuidrequired

    A social group id from GET /groups.

  • slotIduuidrequired

    A slot id from GET /queue/slots.

Body

  • labelstring

    A name for the slot, shown in Postacio's queue.

    1 to 60 characters

  • daysarray of integers

    Weekdays it runs on: 0 = Monday … 6 = Sunday.

    1 to 7 items

  • minutesinteger

    Minutes past midnight in the group's timezone (540 = 09:00).

    0 to 1439

  • account_idsarray of uuid

    The group's accounts this slot posts to.

    1 to 100 items

  • starts_onstring or null

    First local date it runs (YYYY-MM-DD). Null or absent: no start.

    matches ^\d{4}-\d{2}-\d{2}$

  • ends_onstring or null

    Last local date it runs (YYYY-MM-DD). Null or absent: no end.

    matches ^\d{4}-\d{2}-\d{2}$

  • skip_datesarray of strings

    Local dates it does not run on.

    up to 366 items

Returns

200 with a Slot object; an error answers in the Error envelope.

curl -X PATCH https://postacio.com/api/v1/groups/$GROUP_ID/queue/slots/$SLOT_ID \
  -H "Authorization: Bearer $POSTACIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "minutes": 600
  }'
DELETE/groups/{groupId}/queue/slots/{slotId}

Remove a posting slot

Any key

Posts already scheduled keep their times.

Path

  • groupIduuidrequired

    A social group id from GET /groups.

  • slotIduuidrequired

    A slot id from GET /queue/slots.

Returns

204 with no body; an error answers in the Error envelope.

curl -X DELETE https://postacio.com/api/v1/groups/$GROUP_ID/queue/slots/$SLOT_ID \
  -H "Authorization: Bearer $POSTACIO_API_KEY"
GET/groups/{groupId}/queue/next

The next open queue times ("next-free-slot" takes the first)

Any key

Path

  • groupIduuidrequired

    A social group id from GET /groups.

Query

  • accountsstring

    Comma-separated account ids. Default: every account in the group.

    up to 2000 characters

  • fromdatetime

    Earliest time to offer. Default: now.

  • limitinteger

    1 to 10, default 10

Returns

200 with these fields; an error answers in the Error envelope.

  • itemsarray of objects
    Show 4 fields
    • slot_iduuid
    • atdatetime
    • labelstring
    • account_idsarray of uuid
curl https://postacio.com/api/v1/groups/$GROUP_ID/queue/next \
  -H "Authorization: Bearer $POSTACIO_API_KEY"

Ready to send your first draft?

Start your free trial, create a key in Settings, and call the API in a minute.