API reference

Posting slots

3 endpoints, served at https://orbitwrite.com/api/v1. Each one lists the credentials it accepts, its parameters and every response it can give.

Posting slots for every connected account#

GET/api/v1/posting-slots/by-account

Requires postingSchedule:read. One entry per live connected account with its weekly slots and the timezone they're anchored to. GET /posting-slots collapses the workspace to one distinct set of times; this keeps them separated, which is what a per-account posting queue needs to place a post.

Authentication

An API key or OAuth access token as a bearer token, or a signed-in session.

Query parameters

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

Responses

200AccountPostingScheduleList

Each account's posting schedule

Response attributes
accountsAccountPostingSchedule[]Required
Child attributes
accountIdstringRequired
timezonestring | nullRequired

IANA timezone the account's slot times are anchored to — the workspace's, falling back to the account's own for a workspace that never set one. Workspace-first on purpose: the calendar renders every account's slots against the single workspace zone, and a queue anchored to a diverging per-account zone places its instants off the slots the calendar shows — so it re-offers a slot that visibly holds a post. Slots recur at this wall-clock time, so the instant they fire shifts with DST. Null when neither is configured: the caller applies its own fallback, because only it knows the zone the times will be read in (the app uses the viewer's display timezone, matching the calendar).

slotsPostingSlot[]Required

The account's own slots, falling back to the workspace's distinct set when it has none of its own — an account connected after onboarding has no rows, and the calendar already places it on the workspace's times. Empty only when the workspace has no slots at all; callers apply their own default there rather than being handed an invented one.

Child attributes
dayOfWeekintegerRequired

0 = Monday … 6 = Sunday

Between 0 and 6.

minuteOfDayintegerRequired

Minutes since local midnight

Between 0 and 1439.

400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/posting-slots/by-account
curl -X GET "https://orbitwrite.com/api/v1/posting-slots/by-account" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "accounts": [
    {
      "accountId": "string",
      "timezone": "string",
      "slots": [
        {
          "dayOfWeek": 0,
          "minuteOfDay": 0
        }
      ]
    }
  ]
}

List a workspace's posting slots#

GET/api/v1/posting-slots

Requires postingSchedule:read. Returns the distinct weekly (dayOfWeek, minuteOfDay) slots for the organization, plus its timezone. Used by the settings “Posting schedule” tab.

Authentication

An API key or OAuth access token as a bearer token, or a signed-in session.

Query parameters

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

accountIdstring

Scope to one connected account's schedule instead of the organization-wide default. When the account has no customized schedule yet, the organization's values are returned as a fallback.

At least 1 character.

Responses

200PostingSlotList

The workspace's posting slots

Response attributes
slotsPostingSlot[]Required
Child attributes
dayOfWeekintegerRequired

0 = Monday … 6 = Sunday

Between 0 and 6.

minuteOfDayintegerRequired

Minutes since local midnight

Between 0 and 1439.

timezonestring | nullRequired

IANA timezone the slots are anchored to, e.g. "Europe/London"

frequencyPerWeeknumber | nullRequired

Posts-per-week goal the schedule was set to (from onboarding), used to restore the smart-mode stepper. Null when never configured.

modestring | nullRequired

Whether the schedule was last saved in smart or manual mode. Null when never configured.

  • "smart"
  • "manual"
  • null
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/posting-slots
curl -X GET "https://orbitwrite.com/api/v1/posting-slots" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "slots": [
    {
      "dayOfWeek": 0,
      "minuteOfDay": 0
    }
  ],
  "timezone": "string",
  "frequencyPerWeek": 0,
  "mode": "smart"
}

Replace a workspace's posting slots#

POST/api/v1/posting-slots

Requires postingSchedule:update. Replaces the posting slots for every connected account in the organization — or for one account, with accountId — with the set derived from the chosen schedule (frequency + smart/manual). Idempotent: re-running replaces rather than accumulates.

Authentication

An API key or OAuth access token as a bearer token, or a signed-in session.

Body application/json

organizationIdstring

Session callers only — an API key already determines the workspace.

At least 1 character.

accountIdstring

Scope the update to one connected account instead of every account in the organization. The organization's own schedule columns are seeded from this write only while they're still unconfigured — once set, account-scoped writes never touch the org-wide fallback.

At least 1 character.

modestring

Defaults to "smart".

  • "smart"
  • "manual"
frequencyPerWeeknumber

Smart mode: how many slots to spread across the week

Between 0 and 100. Defaults to 1.

slotsManualSlotInput[]

Manual mode: the checked day×time grid cells

At most 50 items.

Child attributes
timestringRequired

Display time, e.g. "9:00 AM" or "14:30"

daysboolean[]Required

One boolean per day, Monday..Sunday

At most 7 items.

timezonestring

IANA timezone to anchor the schedule to, e.g. "America/Los_Angeles". Checked against the runtime's zone database — an unknown zone is a 400 rather than a schedule whose times nothing can resolve later.

Between 1 and 100 characters.

Responses

200ReplacePostingSlotsResult

How many slots were created across how many accounts

Response attributes
createdintegerRequired
accountsintegerRequired
slotsPerAccountintegerRequired
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
403Error

Not a member of the organization

Response attributes
errorstringRequired
issuesany[]
404Error

The resource does not exist

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/posting-slots
curl -X POST "https://orbitwrite.com/api/v1/posting-slots" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "organizationId": "string",
  "accountId": "string",
  "mode": "smart",
  "frequencyPerWeek": 1,
  "slots": [
    {
      "time": "9:00 AM",
      "days": [
        true
      ]
    }
  ],
  "timezone": "string"
}'
Response
{
  "created": 0,
  "accounts": 0,
  "slotsPerAccount": 0
}