# Week overview

2 endpoints.

## The week ahead and what's holding it up

```http
GET https://orbitwrite.com/api/v1/week-overview
```

One read for a weekly check-in: the posting streak, each of the next `days` days (posts against the workspace's posting slots, so empty slots and empty days show), and what's stuck — posts awaiting approval and for how long, changes requested, failed publishes from the last two weeks, and drafts never given a time, oldest first. Lists carry up to five items and a `total`. Requires `post:read`; the streak needs `analytics:read`, the slots `postingSchedule:read` and `account:read`, and the approval lists `approval:read` — each is `null` without them. Contains no best-time heuristics.

**Authentication:** bearer token or session cookie.

### Query parameters

- `organizationId` (string, optional) — Session callers only — an API key already determines the workspace.
- `days` (integer, optional) — Days to lay out, starting today. Defaults to 7.
- `weekStartsOn` (integer | null, optional) — First day of the week for the streak, as a getDay() index (0=Sun, 1=Mon, 6=Sat). Defaults to Monday.

### Responses

#### 200

The week overview

- `timezone` (string, required)
- `generatedAt` (string, required)
- `range` (object, required)
  - `from` (string, required)
  - `to` (string, required)
- `streak` (object | any | null, required) — Null without `analytics:read`.
- `days` (object[], required)
  - `date` (string, required) — "YYYY-MM-DD" in the workspace timezone.
  - `startsAt` (string, required)
  - `posts` (WeekOverviewPost[], required)
    - `groupId` (string, required)
    - `title` (string | any | null, required)
    - `excerpt` (string, required) — The first ~140 characters of the copy.
    - `channels` (object[], required)
      - `platform` (string, required)
      - `name` (string | any | null, required)
    - `scheduledAt` (string | any | null, required)
    - `bucket` (string, required) — The board column the post sits in.
  - `slots` (object[] | any | null, required) — The day's posting slots, with the calendar's inheritance and occupancy rules. Null without `postingSchedule:read` and `account:read`.
  - `openSlots` (integer | any | null, required)
- `awaitingApproval` (object | any | null, required) — Oldest first. Null without `approval:read`.
- `changesRequested` (object | any | null, required) — Oldest first. Null without `approval:read`.
- `failed` (object, required)
  - `total` (integer, required)
  - `items` (WeekOverviewFailed[], required)
    - `groupId` (string, required)
    - `title` (string | any | null, required)
    - `excerpt` (string, required) — The first ~140 characters of the copy.
    - `channels` (object[], required)
      - `platform` (string, required)
      - `name` (string | any | null, required)
    - `scheduledAt` (string | any | null, required)
    - `bucket` (string, required) — The board column the post sits in.
    - `failedAt` (string, required)
    - `errors` (object[], required)
      - `platform` (string, required)
      - `error` (string | any | null, required)
- `drafts` (object, required)
  - `total` (integer, required)
  - `items` (WeekOverviewDraft[], required)
    - `groupId` (string, required)
    - `title` (string | any | null, required)
    - `excerpt` (string, required) — The first ~140 characters of the copy.
    - `channels` (object[], required)
      - `platform` (string, required)
      - `name` (string | any | null, required)
    - `scheduledAt` (string | any | null, required)
    - `bucket` (string, required) — The board column the post sits in.
    - `createdAt` (string, required)
    - `ready` (boolean, required) — Has content and fits every channel's limit.
  - `ready` (integer, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

#### 429

Rate limit exceeded

- `error` (string, required)
- `issues` (any[], optional)

## Last week's results and the week ahead

```http
GET https://orbitwrite.com/api/v1/weekly-digest
```

The weekly digest: last week (or the week containing `week`) against the week before — posts published, impressions, engagements and link clicks received, follower change, the best post and the strongest pattern of the last four weeks — plus the week overview for the seven days from today. Requires `post:read`; the `analytics` half needs `analytics:read` and is null without it, and the week ahead degrades as `GET /week-overview` does.

**Authentication:** bearer token or session cookie.

### Query parameters

- `organizationId` (string, optional) — Session callers only — an API key already determines the workspace.
- `week` (string, optional) — Any day of the week to report, YYYY-MM-DD in the workspace timezone. Defaults to the last complete week.
- `weekStartsOn` (integer | null, optional) — First day of the week as a getDay() index (0=Sun, 1=Mon, 6=Sat). Defaults to Monday.

### Responses

#### 200

The weekly digest

- `timezone` (string, required)
- `generatedAt` (string, required)
- `week` (object, required)
  - `start` (string, required) — "YYYY-MM-DD", the first day, in the workspace timezone.
  - `end` (string, required) — "YYYY-MM-DD", the last day, included.
  - `from` (string, required) — The week's first instant (ISO).
  - `to` (string, required) — The instant after the week ends (ISO).
- `previousWeek` (object, required)
  - `start` (string, required) — "YYYY-MM-DD", the first day, in the workspace timezone.
  - `end` (string, required) — "YYYY-MM-DD", the last day, included.
  - `from` (string, required) — The week's first instant (ISO).
  - `to` (string, required) — The instant after the week ends (ISO).
- `complete` (boolean, required) — The week has ended. False when the current week is asked for.
- `analytics` (object | any | null, required) — Null without `analytics:read`.
- `ahead` (WeekOverview, required)
  - `timezone` (string, required)
  - `generatedAt` (string, required)
  - `range` (object, required)
    - `from` (string, required)
    - `to` (string, required)
  - `streak` (object | any | null, required) — Null without `analytics:read`.
  - `days` (object[], required)
    - `date` (string, required) — "YYYY-MM-DD" in the workspace timezone.
    - `startsAt` (string, required)
    - `posts` (WeekOverviewPost[], required)
      - `groupId` (string, required)
      - `title` (string | any | null, required)
      - `excerpt` (string, required) — The first ~140 characters of the copy.
      - `channels` (object[], required)
        - `platform` (string, required)
        - `name` (string | any | null, required)
      - `scheduledAt` (string | any | null, required)
      - `bucket` (string, required) — The board column the post sits in.
    - `slots` (object[] | any | null, required) — The day's posting slots, with the calendar's inheritance and occupancy rules. Null without `postingSchedule:read` and `account:read`.
    - `openSlots` (integer | any | null, required)
  - `awaitingApproval` (object | any | null, required) — Oldest first. Null without `approval:read`.
  - `changesRequested` (object | any | null, required) — Oldest first. Null without `approval:read`.
  - `failed` (object, required)
    - `total` (integer, required)
    - `items` (WeekOverviewFailed[], required)
      - `groupId` (string, required)
      - `title` (string | any | null, required)
      - `excerpt` (string, required) — The first ~140 characters of the copy.
      - `channels` (object[], required)
        - `platform` (string, required)
        - `name` (string | any | null, required)
      - `scheduledAt` (string | any | null, required)
      - `bucket` (string, required) — The board column the post sits in.
      - `failedAt` (string, required)
      - `errors` (object[], required)
        - `platform` (string, required)
        - `error` (string | any | null, required)
  - `drafts` (object, required)
    - `total` (integer, required)
    - `items` (WeekOverviewDraft[], required)
      - `groupId` (string, required)
      - `title` (string | any | null, required)
      - `excerpt` (string, required) — The first ~140 characters of the copy.
      - `channels` (object[], required)
        - `platform` (string, required)
        - `name` (string | any | null, required)
      - `scheduledAt` (string | any | null, required)
      - `bucket` (string, required) — The board column the post sits in.
      - `createdAt` (string, required)
      - `ready` (boolean, required) — Has content and fits every channel's limit.
    - `ready` (integer, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

#### 429

Rate limit exceeded

- `error` (string, required)
- `issues` (any[], optional)
