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

# Get system prompt for a council sage

> Returns the compiled system prompt used by the AI model.



## OpenAPI

````yaml /openapi/private/specs/services/pl.yml get /pl/council-sage/{council_sage_id}/prompt/system
openapi: 3.1.0
info:
  title: Prompt Library (PL) Service API
  description: >
    The central configuration store for sages, council sages, contexts, and
    results.

    All entities use versioned soft-delete with history tables for full audit
    trails.


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


    ## Sub-Modules

    - **Sage** -- Base sage templates (interview configurations)

    - **Council Sage** -- Council-specific sage instances with customizations

    - **Context** -- Job description and role analysis data

    - **Results** -- Evaluation template configurations (scoring,
    recommendations)


    ## Data Model

    - **Versioning** -- Every update creates a new version (soft update)

    - **Soft Delete** -- Delete sets `active = false` rather than removing rows

    - **History Tables** -- Each entity has a parallel `_history` table

    - **Relationships** -- Council Sage references Sage, Context, Results, and
    Status


    ## Query Patterns

    - `?details=1` -- Include full object details in list responses

    - `?active=true|false|all` -- Filter by active status

    - `?custom=1` -- Filter for custom sages only

    - List endpoints return `{id: object}` maps; get endpoints return single
    objects
  version: 1.0.0
  contact:
    name: Platform Team
servers:
  - url: '{protocol}://{host}:{port}'
    description: Prompt Library Service
    variables:
      protocol:
        default: https
        enum:
          - http
          - https
      host:
        default: localhost
      port:
        default: '5000'
security: []
tags:
  - name: Sage
    description: Base sage template CRUD
  - name: Council Sage
    description: Council-specific sage instance CRUD and prompts
  - name: Context
    description: Job context CRUD (PL database)
  - name: Results
    description: Results template CRUD
  - name: Service
    description: Health checks and initialization
paths:
  /pl/council-sage/{council_sage_id}/prompt/system:
    get:
      tags:
        - Council Sage
      summary: Get system prompt for a council sage
      description: Returns the compiled system prompt used by the AI model.
      operationId: getSystemPrompt
      parameters:
        - $ref: '#/components/parameters/CouncilSageId'
        - $ref: '#/components/parameters/RequiredPermission_council_sage'
      responses:
        '200':
          description: System prompt returned
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Council sage not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Council sage 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
  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
            apiKeyInsteadOfJwt:
              summary: API key sent to JWT-only endpoint
              value:
                error: Unauthorized - JWT token required, not API key
    InternalError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Internal server error
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: User JWT token passed in Authorization header

````