> ## 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 sages for a council

> Returns all council sages for the given council. Non-admin users
(`council_member` role) only see sages in `ss_active` status.
All other roles see sages in all valid statuses.

Requires a valid JWT Bearer token and the `ss_council_sage` capability.




## OpenAPI

````yaml /openapi/private/specs/wp/sage-internal.yml get /councils/{council_id}/sages
openapi: 3.1.0
info:
  title: SageScreen — Sage Module
  description: >
    Council sage management. Sages are AI screening assistants customized

    per council. Each council can have system sages (non-customizable,

    auto-attached) and custom sages (built through a multi-step workflow).


    **CPT:** `ss_council_sage`

    **Custom statuses:** `ss_draft`, `ss_building`, `ss_active`, `ss_inactive`,
    `ss_paused`


    ## Build Workflow


    Custom sages go through a 6-step creation workflow:

    1. **Context** — Define role, level, and job description

    2. **Culture** — Configure tone, scoring, intro question, evaluation
    guidelines

    3. **Build** — Automated build via Python service (8 sub-steps)

    4. **Test** — Optional test screen to verify sage behavior

    5. **Finalize** — Review and confirm build

    6. **Deploy** — Set email config and activate sage


    Build sub-steps (step 3) run sequentially in the Python service:

    `starting` → `creating_sage` → `sage_generation` → `test_shu` →

    `test_ha` → `test_ri` → `transcending_training` → `enlightenment`
  version: 1.0.0
servers:
  - url: https://{domain}/wp-json/sagescreen/v1
    description: WordPress REST API
    variables:
      domain:
        default: api.sagescreen.app
security: []
tags:
  - name: Sage – REST
    description: REST API endpoints for sage operations and Python callbacks
  - name: Sage – CRUD
    description: AJAX endpoints for sage creation, editing, and status management
  - name: Sage – Build Workflow
    description: AJAX endpoints for the multi-step sage build process
paths:
  /councils/{council_id}/sages:
    get:
      tags:
        - Sage – REST
      summary: Get sages for a council
      description: |
        Returns all council sages for the given council. Non-admin users
        (`council_member` role) only see sages in `ss_active` status.
        All other roles see sages in all valid statuses.

        Requires a valid JWT Bearer token and the `ss_council_sage` capability.
      operationId: restGetCouncilSages
      parameters:
        - name: council_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - c9d8e7f6-5a4b-3c2d-1e0f-a1b2c3d4e5f6
          description: Council UUID
      responses:
        '200':
          description: Sage list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCouncilSagesResponse'
              example:
                success: true
                data:
                  - id: 1234
                    name: Customer Service - Core Representative
                    status: Active
                    created_on: '2025-01-15 09:30:00'
                    last_screen: John Doe - Customer Service
                    created_by: Admin User
                    screens_count: 12
                    is_system_sage: 1
                  - id: 1235
                    name: Software Engineer - Senior Developer
                    status: 'Draft (Step: 3)'
                    created_on: '2025-02-01 14:00:00'
                    last_screen: ''
                    created_by: Jane Smith
                    screens_count: 0
                    is_system_sage: 0
                message: Council sages retrieved successfully
        '400':
          description: Missing council_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              example:
                code: missing_council_id
                message: No council context found
                data:
                  status: 400
        '401':
          description: Invalid or missing JWT token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              example:
                code: rest_not_logged_in
                message: You are not currently logged in.
                data:
                  status: 401
        '403':
          description: Insufficient capabilities
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              example:
                code: rest_forbidden
                message: Sorry, you are not allowed to do that.
                data:
                  status: 403
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              example:
                code: internal_error
                message: Error retrieving council sages
                data:
                  status: 500
      security:
        - wpNonce: []
components:
  schemas:
    GetCouncilSagesResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
          examples:
            - true
        data:
          type: array
          items:
            $ref: '#/components/schemas/CouncilSage'
        message:
          type: string
          examples:
            - Council sages retrieved successfully
    WPError:
      type: object
      description: Standard WordPress REST API error envelope
      required:
        - code
        - message
        - data
      properties:
        code:
          type: string
          description: Machine-readable error code
          examples:
            - missing_param
        message:
          type: string
          description: Human-readable error message
          examples:
            - council_sage_id is required
        data:
          type: object
          required:
            - status
          properties:
            status:
              type: integer
              description: HTTP status code
              examples:
                - 400
    CouncilSage:
      type: object
      description: |
        Council sage entity — a sage instance customized for a specific
        council. System sages are auto-attached and non-editable. Custom
        sages go through the 6-step build workflow.
      properties:
        id:
          type: integer
          description: WordPress post ID
          examples:
            - 1234
        name:
          type: string
          description: Sage display name (post_title, HTML-decoded)
          examples:
            - Customer Service - Core Representative
        status:
          type: string
          description: Human-readable status with optional step info
          examples:
            - Active
        created_on:
          type: string
          description: Formatted creation date (per council date settings)
          examples:
            - '2025-01-15 09:30:00'
        last_screen:
          type: string
          description: Title of the most recent screen using this sage
          examples:
            - John Doe - Customer Service
        created_by:
          type: string
          description: Display name of the post author
          examples:
            - Admin User
        screens_count:
          type: integer
          description: Total number of screens (excluding test screens)
          examples:
            - 12
        is_system_sage:
          type: integer
          description: 1 if system (non-customizable), 0 if custom
          enum:
            - 0
            - 1
          examples:
            - 1
  securitySchemes:
    wpNonce:
      type: apiKey
      in: header
      name: X-WP-Nonce
      description: WordPress REST nonce (`wp_rest` action)

````