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

# Load a workstream's header and trend



## OpenAPI

````yaml /api-reference/openapi.json get /workstreams/{id}
openapi: 3.1.0
info:
  title: OpenLens API
  version: 1.4.0
  description: >-
    Public REST API for OpenLens. Onboard clients, run scans across the major AI
    platforms, read visibility metrics, and download client-ready reports. Beta
    — endpoints may evolve before GA.
  contact:
    name: OpenLens support
    email: contact@aibread.com
servers:
  - url: https://openlens.com/api
security:
  - bearerAuth: []
tags:
  - name: Onboarding
  - name: Runs
  - name: Metrics
  - name: Citations
  - name: Deliverables
  - name: Resources
  - name: Account
  - name: Workstreams
paths:
  /workstreams/{id}:
    get:
      tags:
        - Workstreams
      summary: Load a workstream's header and trend
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: '#/components/schemas/WorkstreamHeader'
                  trend:
                    type: object
                    properties:
                      series:
                        type: array
                        items:
                          $ref: '#/components/schemas/WorkstreamTrendPoint'
                      contentUpdates:
                        type: array
                        items:
                          type: object
                    required:
                      - series
                      - contentUpdates
                required:
                  - header
                  - trend
        '400':
          description: Missing or invalid request parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Monthly included API calls for your tier are used up (code
            `USAGE_LIMIT`). Body includes a `limit` object — `{ limitHit,
            currentTier, targetTier, feature, cap, used, resetAt }` — describing
            the cap and the upgrade that lifts it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found or not owned by your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit, project cap, or daily quota hit. Body includes a `code`
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error. Retry; if persistent, contact support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WorkstreamHeader:
      type: object
      properties:
        workstream:
          type: object
          properties:
            id:
              type: string
              format: uuid
            projectId:
              type: string
              format: uuid
            name:
              type: string
            attributeMode:
              type: string
              enum:
                - any
                - all
            archivedAt:
              type:
                - string
                - 'null'
              format: date-time
            topicIds:
              type: array
              items:
                type: string
                format: uuid
            attributes:
              type: array
              items:
                type: string
            currentGoal:
              oneOf:
                - type: object
                  properties:
                    goalText:
                      type:
                        - string
                        - 'null'
                    targetVisibility:
                      type:
                        - number
                        - 'null'
                      minimum: 0
                      maximum: 100
                    targetDeadline:
                      type:
                        - string
                        - 'null'
                      format: date
                    effectiveFrom:
                      type: string
                      format: date-time
                  required:
                    - effectiveFrom
                - type: 'null'
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
          required:
            - id
            - projectId
            - name
            - attributeMode
            - topicIds
            - attributes
        currentVisibility:
          type: number
        deltaPts:
          type: number
        windowDays:
          type: integer
        progressPct:
          type:
            - number
            - 'null'
        daysToDeadline:
          type:
            - integer
            - 'null'
        sparkline:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date
              visibility:
                type: number
            required:
              - date
              - visibility
      required:
        - workstream
        - currentVisibility
        - deltaPts
        - windowDays
        - sparkline
    WorkstreamTrendPoint:
      type: object
      properties:
        date:
          type: string
          format: date
        visibility:
          type: number
      required:
        - date
        - visibility
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code for programmatic handling, when applicable.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Clerk API key. Create one from your account settings under API Keys.

````