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

# Get latest content revision

> Returns the current Program tip from storage. Does not fetch the linked upstream platform unless `sync=true`. With `sync=true`, best-effort ensure-sync may mint a pull revision; platform fetch failure still returns the last known tip (200) with `upstream_sync.status: unreachable`. Get-by-revision is always a DB read.



## OpenAPI

````yaml /openapi/program.openapi.json get /surveys/{surveyId}/content
openapi: 3.1.0
info:
  title: Questra Program API
  version: 0.0.1
  description: >-
    REST API for the Questra Program product. Browser users authenticate through
    Questra Auth SSO; automation uses workspace-scoped API keys (`Authorization:
    Bearer qpk_live_…`). API keys carry scopes enforced before handlers.
    Outbound webhooks follow Standard Webhooks (at-least-once delivery;
    consumers must be idempotent).
servers:
  - url: /v1
    description: Program API base path
security: []
paths:
  /surveys/{surveyId}/content:
    get:
      tags:
        - Survey content
      summary: Get latest content revision
      description: >-
        Returns the current Program tip from storage. Does not fetch the linked
        upstream platform unless `sync=true`. With `sync=true`, best-effort
        ensure-sync may mint a pull revision; platform fetch failure still
        returns the last known tip (200) with `upstream_sync.status:
        unreachable`. Get-by-revision is always a DB read.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: surveyId
          in: path
        - schema:
            type: string
            enum:
              - 'true'
            description: >-
              When `true`, best-effort ensure-sync from the linked upstream
              platform before returning the tip. Omit for a DB read of the last
              known Program revision (no platform fetch).
          required: false
          description: >-
            When `true`, best-effort ensure-sync from the linked upstream
            platform before returning the tip. Omit for a DB read of the last
            known Program revision (no platform fetch).
          name: sync
          in: query
      responses:
        '200':
          description: Latest revision plus upstream reachability
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContentResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
components:
  schemas:
    GetContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ContentRevision'
        upstream_sync:
          $ref: '#/components/schemas/UpstreamSync'
      required:
        - data
        - upstream_sync
    ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        resource:
          type: string
        slug:
          type: string
        file_id:
          type: string
        endpoint_id:
          type: string
        event_id:
          type: string
        delivery_id:
          type: string
        api_key_id:
          type: string
        integration_id:
          type: string
        audit_id:
          type: string
        status:
          type: string
        details: {}
        question_ids:
          type: array
          items:
            type: string
        survey_ids:
          type: array
          items:
            type: string
        revisions:
          type: array
          items:
            type: number
      required:
        - error
    ContentRevision:
      type: object
      properties:
        survey_id:
          type: string
          minLength: 1
          description: >-
            Survey id. For Program-managed surveys this is a UUID; for
            integration surveys it is the provider opaque id.
        revision:
          type: integer
          exclusiveMinimum: 0
        platform:
          $ref: '#/components/schemas/ProgrammingPlatform'
        source:
          type: string
        user_id:
          type: string
          minLength: 1
          example: 60000000-0000-4000-8000-000000000001
          description: >-
            Actor id from the auth session or API key that created this revision
            (never client-supplied).
        message:
          type:
            - string
            - 'null'
          example: Reprogrammed after questionnaire clarifications
          description: Optional reason or commit note for this revision.
        change_source:
          $ref: '#/components/schemas/ContentChangeSource'
        created_at:
          type: string
          format: date-time
      required:
        - survey_id
        - revision
        - platform
        - source
        - user_id
        - message
        - change_source
        - created_at
    UpstreamSync:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/UpstreamSyncStatus'
        error:
          type: string
          description: >-
            Short platform/error text when status is unreachable. Omitted
            otherwise.
      required:
        - status
    ProgrammingPlatform:
      type: string
      enum:
        - questra
        - decipher
        - confirmit
        - qualtrics
        - alchemer
    ContentChangeSource:
      type: string
      enum:
        - manual
        - agent
        - programming
        - pull
      description: >-
        How this tip was written: manual Review Save, Review/content-edit agent,
        programming workflow, or upstream pull.
    UpstreamSyncStatus:
      type: string
      enum:
        - ok
        - disabled
        - unreachable

````