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

# Save culture with workflow run

> Loads culture data from Redis, runs the full culture generation pipeline
(context analysis, tone, intro questions, scoring), and saves results to
the Prompt Library. Transitions through workflow steps during processing.




## OpenAPI

````yaml /openapi/private/specs/services/culture.yml get /culture/{council_sage_id}/save/{run_id}
openapi: 3.1.0
info:
  title: Culture Service API
  description: >
    Manages the culture generation pipeline for council sages. Culture
    encompasses

    the tone, instructions, intro questions, and scoring configuration that
    define

    how a sage conducts screening interviews.


    ## Authentication

    All endpoints require authentication via one of two methods:

    - **API Key**: Pass the key in the `X-Auth` header (service-to-service
    calls)

    - **JWT Token**: Pass a Bearer token in the `Authorization` header
    (user-facing calls)


    The required permission level is noted per endpoint.


    ## Culture Pipeline

    1. **Process** -- Collect all culture inputs (instructions, tone, duration,
    scoring)

    2. **Save Full** -- Start a workflow run and asynchronously generate the
    culture

    3. **Generate** -- Run the full generation pipeline (context analysis, tone
    crafting, intro questions, scoring)

    4. **Save** -- Save individual culture step results to the Prompt Library

    5. **End** -- Finalize the council sage after culture generation


    ## Business Rules

    - Culture data is stored in Redis during the generation pipeline

    - The `save/full` endpoint starts a workflow run and fires async generation

    - The `generate` endpoint validates payload via `CreateSageGenerate` schema

    - Customizable sages use the full pipeline; non-customizable sages skip AI
    tone/context steps

    - The `end` endpoint finalizes the council sage in the Prompt Library
  version: 1.0.0
  contact:
    name: Platform Team
servers:
  - url: '{protocol}://{host}:{port}'
    description: Culture Service
    variables:
      protocol:
        default: https
        enum:
          - http
          - https
      host:
        default: localhost
      port:
        default: '5000'
security: []
tags:
  - name: Culture
    description: Culture CRUD, generation, and pipeline operations
  - name: Service
    description: Health checks and initialization
paths:
  /culture/{council_sage_id}/save/{run_id}:
    get:
      tags:
        - Culture
      summary: Save culture with workflow run
      description: >
        Loads culture data from Redis, runs the full culture generation pipeline

        (context analysis, tone, intro questions, scoring), and saves results to

        the Prompt Library. Transitions through workflow steps during
        processing.
      operationId: saveCulture
      parameters:
        - $ref: '#/components/parameters/CouncilSageId'
        - name: run_id
          in: path
          required: true
          description: UUID of the workflow run to track progress
          schema:
            type: string
            format: uuid
          example: d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a
        - $ref: '#/components/parameters/RequiredPermission_council_sage'
      responses:
        '200':
          description: Culture saved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
              example:
                message: Culture process complete
        '400':
          description: Missing required parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingCouncilSageId:
                  summary: Missing council_sage_id
                  value:
                    error: council_sage_id is required
                missingRunId:
                  summary: Missing run_id
                  value:
                    error: run_id is required
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Culture data or council sage not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: >-
                  Culture with ID c3d4e5f6-7890-4abc-def0-123456789abc (CSI) not
                  found
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - jwtAuth: []
components:
  parameters:
    CouncilSageId:
      name: council_sage_id
      in: path
      required: true
      description: UUID of the council sage
      schema:
        type: string
        format: uuid
      example: c3d4e5f6-7890-4abc-def0-123456789abc
    RequiredPermission_council_sage:
      name: X-Permission-Info
      in: header
      required: false
      description: >-
        **Required JWT permission: `council_sage`** (informational only --
        enforced server-side)
      schema:
        type: string
  schemas:
    MessageResponse:
      type: object
      properties:
        message:
          type: string
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            noApiKey:
              summary: Missing API key
              value:
                error: Unauthorized - API key required
            invalidApiKey:
              summary: Invalid API key
              value:
                error: Unauthorized - Invalid API key
            noToken:
              summary: Missing JWT token
              value:
                error: Unauthorized - No valid token
            invalidToken:
              summary: Invalid or expired JWT
              value:
                error: Unauthorized3
            insufficientPermissions:
              summary: Token lacks required permission
              value:
                error: Unauthorized4
    InternalError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Internal server error
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: User JWT token passed in Authorization header

````