> ## 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.

# One-call workspace overview

> The `/workspaces/me` block plus the workspace review gate and
up to 25 projects enriched with stored LinkedIn connection
health and posting streaks. The LinkedIn block reports the
STORED status as of `lastValidatedAt` — this endpoint never
probes LinkedIn live. `projectsTruncated: true` means the
workspace has more than 25 projects; page the rest via
`GET /projects`. Requires the `workspace:read` scope.




## OpenAPI

````yaml /openapi/v1.yaml get /workspaces/context
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:
  /workspaces/context:
    get:
      tags:
        - Workspace
      summary: One-call workspace overview
      description: |
        The `/workspaces/me` block plus the workspace review gate and
        up to 25 projects enriched with stored LinkedIn connection
        health and posting streaks. The LinkedIn block reports the
        STORED status as of `lastValidatedAt` — this endpoint never
        probes LinkedIn live. `projectsTruncated: true` means the
        workspace has more than 25 projects; page the rest via
        `GET /projects`. Requires the `workspace:read` scope.
      operationId: getWorkspaceContext
      parameters:
        - $ref: '#/components/parameters/ScripeApiVersion'
      responses:
        '200':
          description: Workspace context pack.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceContext'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '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'
  schemas:
    WorkspaceContext:
      type: object
      required:
        - workspace
        - principal
        - requireReviewWorkflow
        - projects
        - projectsTruncated
      properties:
        workspace:
          $ref: '#/components/schemas/Workspace'
        principal:
          $ref: '#/components/schemas/Principal'
        requireReviewWorkflow:
          type: boolean
        projects:
          type: array
          maxItems: 25
          items:
            $ref: '#/components/schemas/WorkspaceContextProject'
        projectsTruncated:
          type: boolean
    Workspace:
      type: object
      required:
        - id
        - name
        - plan
        - features
      properties:
        id:
          type: string
          example: org_2abcDEF
        name:
          type: string
        plan:
          type: string
          example: ADVANCED
        features:
          type: object
          additionalProperties:
            type: boolean
    Principal:
      description: |
        The credential this request authenticated with. API keys and
        OAuth tokens carry different fields — an OAuth token names the
        host, the consenting human, and the project that writes fall
        back to when a call omits `projectId`.
      oneOf:
        - $ref: '#/components/schemas/ApiKeyPrincipal'
        - $ref: '#/components/schemas/OAuthTokenPrincipal'
      discriminator:
        propertyName: type
        mapping:
          api_key:
            $ref: '#/components/schemas/ApiKeyPrincipal'
          oauth_token:
            $ref: '#/components/schemas/OAuthTokenPrincipal'
    WorkspaceContextProject:
      allOf:
        - $ref: '#/components/schemas/Project'
        - type: object
          required:
            - streak
          properties:
            streak:
              anyOf:
                - type: object
                  required:
                    - currentStreak
                    - longestStreak
                  properties:
                    currentStreak:
                      type: integer
                    longestStreak:
                      type: integer
                - type: 'null'
    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.
    ApiKeyPrincipal:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - api_key
        id:
          type: string
          example: key_a1b2c3d4e5f6g7h8
        scopes:
          type: array
          items:
            type: string
    OAuthTokenPrincipal:
      type: object
      required:
        - type
        - id
        - clientId
        - actingUserId
        - scopes
        - defaultProject
      properties:
        type:
          type: string
          enum:
            - oauth_token
        id:
          type: string
          description: Encoded access-token id the host is presenting.
          example: oat_a1b2c3d4e5f6g7h8
        clientId:
          type: string
          description: Registered OAuth client (the MCP host).
        actingUserId:
          type: string
          description: Clerk user id of the consenting human.
        scopes:
          type: array
          items:
            type: string
        defaultProject:
          nullable: true
          description: |
            Project pinned on the consent screen. Every write — and
            every project-scoped read — falls back to it when the call
            omits `projectId`, so this is the project an agent should
            name when it reports what it did. `name` is the display
            name (the same one `/projects` returns), not the stored
            column, which is empty for most personal brands. `null`
            when the user pinned nothing or the project is gone.
          type: object
          required:
            - id
            - name
          properties:
            id:
              type: string
              example: proj_a1b2c3d4e5f6g7h8
            name:
              type: string
              example: Lisa Holzinger
    Project:
      type: object
      required:
        - id
        - name
        - type
        - typeLabel
        - status
        - username
        - avatarUrl
        - isActive
        - createdAt
        - linkedIn
      properties:
        id:
          type: string
          example: proj_a1b2c3d4e5f6g7h8
        name:
          type: string
          description: |
            Display name used in the Scripe dashboard. For personal brands
            and amplifier accounts, this is the connected LinkedIn user's
            full name. For company pages, this is the LinkedIn-localized
            company name. Falls back to the internal project slug when no
            display data is available yet (e.g. mid-onboarding).
        type:
          type: string
          enum:
            - PERSONAL_BRAND
            - COMPANY_PAGE
            - AMPLIFIER
          example: PERSONAL_BRAND
        typeLabel:
          type: string
          description: |
            Human wording for `type`, matching the dashboard sidebar.
          enum:
            - LinkedIn Account
            - Company Page
            - Amplifier Account
          example: LinkedIn Account
        status:
          type: string
          example: ACTIVE
        username:
          type: string
          nullable: true
          description: |
            LinkedIn vanity slug. For personal brands and amplifiers this
            is the author profile slug (e.g. `lukematthws`, resolving to
            `https://linkedin.com/in/lukematthws`). For company pages this
            is the company vanity name (resolving to
            `https://linkedin.com/company/<vanity>`). `null` until the
            account has finished its LinkedIn handshake.
          example: lukematthws
        avatarUrl:
          type: string
          nullable: true
          description: |
            CDN-cached profile picture / company logo URL. Falls back to
            the LinkedIn-hosted source if our CDN copy is not yet ready.
            `null` until LinkedIn data is available.
        isActive:
          type: boolean
        createdAt:
          type: string
          format: date-time
        linkedIn:
          oneOf:
            - $ref: '#/components/schemas/LinkedInConnection'
            - type: 'null'
          description: |
            Whether Scripe can publish as this project right now. `null` only
            when the project has no LinkedIn context at all — a company page
            that was never linked to an admin account — which is itself the
            answer "nothing can publish for it".
    LinkedInConnection:
      type: object
      description: |
        The publishing precondition for one project, and the answer to
        "is my LinkedIn still connected?".

        **Branch on `canPublish` / `state`, never on `connectionStatus`.**
        `connectionStatus` is the stored health cache written by whatever last
        talked to LinkedIn; it reads `CONNECTED` for accounts that hold no
        access token at all, and `UNKNOWN` for accounts that were simply never
        connected. `state` applies token presence first, which is the
        precedence the Scripe dashboard's own connect/publish switch uses.

        A company page has no connection of its own — it publishes through the
        personal account it was linked to, so its block (including
        `reconnectUrl`) describes that account.

        Stored health only: reading a project never probes LinkedIn. The live
        check runs in the schedule and publish pre-flights, where a write is
        about to happen.
      required:
        - state
        - canPublish
        - connectionStatus
        - lastValidatedAt
        - accessTokenExpiresAt
        - detail
        - reconnectUrl
      properties:
        state:
          type: string
          enum:
            - connected
            - expiring_soon
            - degraded
            - disconnected
            - revoked
          description: >
            Exactly one is true of any project at any instant.


            | state | publishes? | meaning |

            |---|---|---|

            | `connected` | yes | a token is on file and nothing is wrong |

            | `expiring_soon` | yes | the access token lapses within 14 days (or
            already has) and has not been renewed |

            | `degraded` | yes | recent LinkedIn calls failed; 3 consecutive
            failures revoke the connection |

            | `disconnected` | no | no usable token — never connected, or the
            token was cleared |

            | `revoked` | no | the authorization was withdrawn |
          example: revoked
        canPublish:
          type: boolean
          description: |
            Whether publishing as this project is possible right now. True for
            `connected`, `expiring_soon` and `degraded`.
        connectionStatus:
          type: string
          description: |
            The raw stored status (`CONNECTED` / `DEGRADED` / `DISCONNECTED` /
            `REVOKED` / `UNKNOWN`). Kept so an integrator can see the cache
            value; it disagrees with `state` whenever token presence disagrees
            with it.
          example: CONNECTED
        lastValidatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the connection was last confirmed working.
        accessTokenExpiresAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the current access token lapses.
        detail:
          type:
            - string
            - 'null'
          description: |
            One sentence naming what is wrong and what to do about it. `null`
            when `state` is `connected`.
        reconnectUrl:
          type:
            - string
            - 'null'
          description: |
            Where a human reconnects the account in the Scripe dashboard.
            Reconnecting cannot be done through this API. `null` when there is
            nothing to fix.
  responses:
    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'
    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.

````