API reference

Streak

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

Get the workspace's weekly posting streak#

GET/api/v1/streak

Consecutive weeks in which the workspace published at least one post, with the longest run, the current week's status and a trailing week-by-week history. Weeks are anchored to the workspace timezone and start on Monday.

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.

weekStartsOninteger | null

First day of the week as a getDay() index (0=Sun, 1=Mon, 6=Sat). Defaults to Monday.

Responses

200Streak

The workspace's posting streak

Response attributes
currentintegerRequired

Consecutive weeks with a published post, ending this week.

longestintegerRequired

The workspace's longest run of consecutive posting weeks.

statestringRequired

new (never published), active (this week satisfied), at_risk (streak alive but this week still empty), broken (a run ended and this week is empty).

  • "new"
  • "active"
  • "at_risk"
  • "broken"
currentWeekSatisfiedbooleanRequired
willExtendStreakbooleanRequired

A scheduled post is set to fire this week, so an at-risk streak is already covered.

weekEndsAtstringRequired

Instant the current week rolls over (ISO 8601).

historyStreakWeek[]Required
Child attributes
weekKeystringRequired

Week-start date ("YYYY-MM-DD", Monday) in the workspace timezone.

satisfiedbooleanRequired
countintegerRequired

Distinct posts (composer groups) published that week.

last7DaysStreakDay[]Required

The trailing 7 days (oldest → today) with per-day counts.

Child attributes
dateKeystringRequired

"YYYY-MM-DD" of the day in the workspace timezone.

countintegerRequired

Distinct posts (composer groups) published that day.

lastPostAtstring | nullRequired

When the workspace most recently published (ISO), or 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[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/streak
curl -X GET "https://orbitwrite.com/api/v1/streak" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "current": 0,
  "longest": 0,
  "state": "new",
  "currentWeekSatisfied": true,
  "willExtendStreak": true,
  "weekEndsAt": "string",
  "history": [
    {
      "weekKey": "string",
      "satisfied": true,
      "count": 0
    }
  ],
  "last7Days": [
    {
      "dateKey": "string",
      "count": 0
    }
  ],
  "lastPostAt": "string"
}

Posts published per day#

GET/api/v1/posting-activity

Posts published on each day of the last weeks whole weeks, ending today, in the workspace timezone: a synced multi-channel post counts once, thread replies don't count. Pass userId for one member's posts (the ones they wrote). Requires analytics:read, which covers your own userId; anyone else's takes analytics:readAny (manager and up). An API key is nobody's self, so any userId on a key takes analytics:readAny.

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.

userIdstring

A member's user id: only the posts they wrote.

At least 1 character.

weeksinteger

Whole weeks ending with this one, 1–53. Defaults to 26.

Between 1 and 53.

weekStartsOninteger | null

First day of the week as a getDay() index (0=Sun, 1=Mon, 6=Sat). Defaults to Monday.

Responses

200PostingActivity

Posts per day

Response attributes
timezonestringRequired
userIdstring | nullRequired

The member the counts are for, or null for the whole workspace.

weekStartsOnintegerRequired
fromstringRequired

First day of the first week (YYYY-MM-DD).

tostringRequired

Today in the workspace timezone (YYYY-MM-DD).

daysPostingActivityDay[]Required

Every day from from to to, oldest first, empty days included.

Child attributes
dateKeystringRequired

"YYYY-MM-DD" of the day in the workspace timezone.

countintegerRequired

Distinct posts (composer groups) published that day.

totalintegerRequired
activeDaysintegerRequired
longestStreakDaysintegerRequired

Longest run of consecutive posting days inside the window.

currentStreakDaysintegerRequired

Consecutive posting days ending today (or yesterday, while today has nothing yet).

busiestDayPostingActivityDay | any | nullRequired
Child attributes
dateKeystringRequired

"YYYY-MM-DD" of the day in the workspace timezone.

countintegerRequired

Distinct posts (composer groups) published that day.

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[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
GET /api/v1/posting-activity
curl -X GET "https://orbitwrite.com/api/v1/posting-activity" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY"
Response
{
  "timezone": "string",
  "userId": "string",
  "weekStartsOn": 0,
  "from": "string",
  "to": "string",
  "days": [
    {
      "dateKey": "string",
      "count": 0
    }
  ],
  "total": 0,
  "activeDays": 0,
  "longestStreakDays": 0,
  "currentStreakDays": 0,
  "busiestDay": {
    "dateKey": "string",
    "count": 0
  }
}