> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.scripe.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics overview across every reachable workspace

> The same current-vs-previous-period rollup as
`GET /v1/analytics/overview`, computed for EVERY workspace the
caller can reach and returned in one response, each row attributed
to the workspace it came from.

Reach is Clerk membership **or** the billing-based agency-owner
grant — the workspaces an agency the caller owns pays for — and
`workspaces[].workspace.reach` says which one applies. Inside each
workspace, project visibility is the same admin-or-assignment rule
every other read applies, so a plain member of a client workspace
still sees only the projects they are assigned to.

`data.totals` is the same figures over the union of every project
above, computed by one query rather than summed here: an
engagement rate has no meaningful average. It is `null` when there
was nothing to total or when the union was too large for a further
aggregate pass — `meta.totals_omitted_reason` says which.

A reachable workspace whose projects the caller cannot read is
named in `meta.skipped` rather than dropped, because a missing
workspace reads as "this client posted nothing". When
`meta.truncated` is true the response holds the first
`meta.max_workspaces` of `meta.workspaces_reachable`; name the
rest explicitly in `workspaceId` to cover them.

**OAuth only.** An API key is bound to one workspace at creation,
so there is nothing to aggregate across; a key gets
`400 invalid_request`. `projectId` is rejected here — use
`GET /v1/analytics/overview` for specific projects.

Required scopes: `analytics:read` **and** `workspace:read` (the
response enumerates workspaces).




## OpenAPI

````yaml /openapi/v1.yaml get /analytics/cross-workspace/overview
openapi: 3.1.0
info:
  title: Scripe Public API
  version: '2026-08-10'
  summary: >-
    Read and write Scripe workspace data — posts, notes, ideas, sources,
    knowledge, media, analytics, usage, async jobs, and webhooks.
  description: |
    The Scripe public API gives integrators stable, versioned access to a
    workspace's content surface: reads across every resource, synchronous
    writes (notes, posts, ideas, text sources, media assets), async jobs
    (post generation, file/URL/YouTube ingest, image and carousel
    generation), usage meters, and outbound webhooks.

    All endpoints (except `/v1/health`) require a Bearer token — either a
    workspace API key (`scripe_sk_*`) or an OAuth 2.1 access token
    (`scripe_oat_*`). Pin the API version with the `Scripe-Api-Version`
    request header to opt out of breaking changes.
  contact:
    name: Scripe Support
    url: https://scripe.io/support
    email: support@scripe.io
  license:
    name: Proprietary
servers:
  - url: https://api.scripe.io/v1
    description: Production
security:
  - BearerApiKey: []
tags:
  - name: Health
    description: Liveness and authenticated key smoke tests.
  - name: Workspace
    description: The workspace + principal resolved from your API key.
  - name: Projects
    description: Personal-brand, company-page, and amplifier projects.
  - name: Notes
    description: Project notes with paired calendar slot.
  - name: Posts
    description: Drafts, scheduled, and published LinkedIn posts.
  - name: Analytics
    description: Your own LinkedIn analytics and viral-post inspiration search.
  - name: Sources
    description: Transcriptions (audio/video sources) with truncated body.
  - name: Uploads
    description: >-
      Pre-signed S3 PUT URLs the customer uploads bytes to before referencing
      via Sources or Knowledge.
  - name: Knowledge
    description: >-
      Knowledge-base documents indexed for RAG. Async ingest via text, file,
      URL, or YouTube.
  - name: Jobs
    description: >-
      Async-job lifecycle — submitted via post-generation, knowledge ingest,
      file source.
  - name: Calendar
    description: >-
      The content calendar — scheduled/planned posts, note slots, idea
      placements, and the posting-time template.
  - name: Ideas
    description: >-
      The idea board — creative briefs with derived workflow statuses and
      date-level calendar placement.
  - name: Media
    description: >-
      Media-library search, own-image imports, AI image generation, and
      full-state media writes onto posts.
  - name: Settings
    description: >-
      Curated project settings, engagement policy, and company pages (read-only
      over REST).
  - name: Webhooks
    description: |
      Outbound HTTP callbacks. Subscribe an endpoint to one or more
      event names; we POST a signed JSON payload every time a matching
      event fires in the workspace. The signing secret is shown once
      on create and once on rotate — verify the
      `Webhook-Signature: t=<ts>,v1=<hmac>` header on every delivery.
paths:
  /analytics/cross-workspace/overview:
    get:
      tags:
        - Analytics
      summary: Analytics overview across every reachable workspace
      description: |
        The same current-vs-previous-period rollup as
        `GET /v1/analytics/overview`, computed for EVERY workspace the
        caller can reach and returned in one response, each row attributed
        to the workspace it came from.

        Reach is Clerk membership **or** the billing-based agency-owner
        grant — the workspaces an agency the caller owns pays for — and
        `workspaces[].workspace.reach` says which one applies. Inside each
        workspace, project visibility is the same admin-or-assignment rule
        every other read applies, so a plain member of a client workspace
        still sees only the projects they are assigned to.

        `data.totals` is the same figures over the union of every project
        above, computed by one query rather than summed here: an
        engagement rate has no meaningful average. It is `null` when there
        was nothing to total or when the union was too large for a further
        aggregate pass — `meta.totals_omitted_reason` says which.

        A reachable workspace whose projects the caller cannot read is
        named in `meta.skipped` rather than dropped, because a missing
        workspace reads as "this client posted nothing". When
        `meta.truncated` is true the response holds the first
        `meta.max_workspaces` of `meta.workspaces_reachable`; name the
        rest explicitly in `workspaceId` to cover them.

        **OAuth only.** An API key is bound to one workspace at creation,
        so there is nothing to aggregate across; a key gets
        `400 invalid_request`. `projectId` is rejected here — use
        `GET /v1/analytics/overview` for specific projects.

        Required scopes: `analytics:read` **and** `workspace:read` (the
        response enumerates workspaces).
      operationId: getCrossWorkspaceAnalyticsOverview
      parameters:
        - $ref: '#/components/parameters/ScripeApiVersion'
        - name: workspaceId
          in: query
          required: false
          description: >-
            One Clerk organisation id, or a comma-separated list, from `GET
            /v1/workspaces`. Omit (or pass `all`) for every reachable workspace.
            A named workspace the caller cannot reach is refused with
            `workspace_unavailable`, never silently dropped.
          schema:
            type: string
            example: org_a1b2c3d4e5f6g7h8
        - $ref: '#/components/parameters/DateFrom'
        - $ref: '#/components/parameters/DateTo'
      responses:
        '200':
          description: Per-workspace analytics overview plus the combined totals.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrossWorkspaceOverviewResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    ScripeApiVersion:
      name: Scripe-Api-Version
      in: header
      required: false
      description: |
        Pin the API version. Format `YYYY-MM-DD`. Omit to receive the
        currently rolling default. Unknown versions return `400
        version_unsupported`.
      schema:
        type: string
        example: '2026-08-10'
    DateFrom:
      name: dateFrom
      in: query
      required: false
      description: ISO 8601 or `YYYY-MM-DD` lower bound (inclusive).
      schema:
        type: string
        format: date-time
    DateTo:
      name: dateTo
      in: query
      required: false
      description: ISO 8601 or `YYYY-MM-DD` upper bound (inclusive).
      schema:
        type: string
        format: date-time
  schemas:
    CrossWorkspaceOverviewResponse:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - range
            - workspaces
            - totals
          properties:
            range:
              type: object
              required:
                - from
                - to
                - days
              properties:
                from:
                  type: string
                  format: date-time
                to:
                  type: string
                  format: date-time
                days:
                  type: integer
            workspaces:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/CrossWorkspaceOverviewFigures'
                  - type: object
                    required:
                      - workspace
                      - projects
                    properties:
                      workspace:
                        $ref: '#/components/schemas/CrossWorkspaceRef'
                      projects:
                        type: object
                        required:
                          - count
                        properties:
                          count:
                            type: integer
                            description: >-
                              Projects the caller can read in this workspace,
                              which is what the row's figures cover.
            totals:
              anyOf:
                - $ref: '#/components/schemas/CrossWorkspaceOverviewFigures'
                - type: 'null'
              description: >-
                The same figures over the union of every project above, computed
                by one query rather than summed. Null when there was nothing to
                total or the union was too large — see
                `meta.totals_omitted_reason`.
        meta:
          allOf:
            - $ref: '#/components/schemas/CrossWorkspaceMeta'
            - type: object
              required:
                - totals_omitted_reason
              properties:
                totals_omitted_reason:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Why `data.totals` is null: `no_readable_projects` (nothing
                    to total) or `too_many_projects` (the union was past the cap
                    a further aggregate pass is worth). Null when `totals` is
                    present.
    CrossWorkspaceOverviewFigures:
      type: object
      required:
        - posts
        - impressions
        - engagement
        - followers
        - activity
      properties:
        posts:
          type: object
          required:
            - current
            - previous
          properties:
            current:
              type: integer
            previous:
              type: integer
        impressions:
          type: object
          required:
            - current
            - previous
          properties:
            current:
              type: integer
            previous:
              type: integer
        engagement:
          type: object
          required:
            - current_rate
            - previous_rate
          properties:
            current_rate:
              type: number
            previous_rate:
              type: number
        followers:
          type: object
          required:
            - current
            - growth
          properties:
            current:
              type: integer
            growth:
              type: integer
        activity:
          type: object
          required:
            - current_posts_per_week
            - previous_posts_per_week
          properties:
            current_posts_per_week:
              type: number
            previous_posts_per_week:
              type: number
    CrossWorkspaceRef:
      type: object
      required:
        - id
        - name
        - is_default
        - reach
      properties:
        id:
          type: string
          description: Clerk organisation id.
          example: org_a1b2c3d4e5f6g7h8
        name:
          type: string
          description: Empty when the workspace's Clerk identity could not be resolved.
        is_default:
          type: boolean
          description: True for the consent-pinned workspace.
        reach:
          $ref: '#/components/schemas/WorkspaceReach'
    CrossWorkspaceMeta:
      type: object
      required:
        - selection
        - workspaces_reachable
        - workspaces_returned
        - max_workspaces
        - truncated
        - skipped
        - projects_truncated
      properties:
        selection:
          type: string
          enum:
            - all_reachable
            - explicit
          description: >-
            `explicit` when the caller named workspaces, `all_reachable`
            otherwise.
        workspaces_reachable:
          type: integer
          description: >-
            How many workspaces the caller can reach in total — the same figure
            whichever selector was used, never the count they named. It is NOT a
            truncation signal: on an explicit selection it normally exceeds
            `workspaces_returned` while `truncated` is false. Read `truncated`
            for that.
        workspaces_returned:
          type: integer
          description: >-
            Rows in `data.workspaces`. Lower than `workspaces_reachable` when
            the call was truncated, when workspaces were skipped, or both.
        max_workspaces:
          type: integer
          description: How many workspaces this endpoint visits per call.
        truncated:
          type: boolean
        skipped:
          type: array
          items:
            $ref: '#/components/schemas/CrossWorkspaceSkip'
        projects_truncated:
          type: array
          description: >-
            Ids of workspaces holding more readable projects than one call
            measures, so their row — and their contribution to `data.totals` —
            covers only the newest slice. Empty when every workspace fitted.
            Narrow the range or read those workspaces through `GET
            /v1/analytics/overview` with explicit `projectId`s.
          items:
            type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
            - docs_url
          properties:
            code:
              type: string
              description: Stable, machine-readable error identifier.
              example: not_found
            message:
              type: string
            request_id:
              type: string
              example: req_a1b2c3d4e5f6
            docs_url:
              type: string
              format: uri
            details:
              description: Optional structured payload — shape varies per code.
    WorkspaceReach:
      type: string
      enum:
        - member
        - agency_owner
      description: |
        Which grant makes a workspace reachable. `member` — the consenting
        user is a member of the Clerk organisation. `agency_owner` — the
        workspace is billed to an agency they own, the same grant the
        dashboard applies, which reaches a client workspace whose Clerk
        org they were never added to.

        The two revoke differently: `member` disappears when Clerk
        membership is removed (within ~60s), `agency_owner` when the
        workspace stops being billed to the caller's customer. An API key
        is always `member` — it is bound to its own workspace.
    CrossWorkspaceSkip:
      type: object
      required:
        - workspace_id
        - reason
      properties:
        workspace_id:
          type: string
        reason:
          type: string
          enum:
            - no_readable_projects
          description: >-
            The workspace is reachable, but the caller can read no projects in
            it. Named rather than dropped: an absent workspace reads as "no
            activity", which is a different claim.
  responses:
    BadRequest:
      description: Malformed request (bad cursor, bad limit, etc.).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, malformed, expired, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Plan not eligible, scope missing, or workspace mismatch.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found in this workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Sliding-window rate limit exceeded.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: scripe_sk_live_*
      description: |
        Pass `Authorization: Bearer scripe_sk_live_<...>` (or
        `scripe_sk_test_<...>` for test keys) on every request. Keys
        are scoped to a single workspace and can be revoked from the
        Scripe dashboard.

        The same header also accepts an OAuth 2.1 access token
        (`scripe_oat_*`); both credentials share one scope vocabulary
        and every operation below documents the scope it requires.
        An API key can hold every scope named on this surface except
        `webhooks:manage`, which is grantable to OAuth tokens only
        today — the webhook-endpoint operations answer
        `403 scope_missing` to every API key. Operations that name no
        scope accept any valid token of the workspace.

````