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

# Store test screen ID during build

> Called by the Python service during the `transcending_training`
build step to store the test screen ID created for the sage.
The front-end polls for this value via `sagescreen_get_step_status`
and uses it to embed the test screen.

Requires the `X-API-Key` header matching the stored
`sage_screen_api_key` option.




## OpenAPI

````yaml /openapi/private/specs/wp/wp-webhooks.yml get /callback/set-test-screen
openapi: 3.1.0
info:
  title: >-
    SageScreen — Webhooks & CRM Integrations (Billing · Council · User · Deal ·
    Sage)
  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: Billing – Stripe
    description: Stripe webhook and subscription endpoints
  - name: Billing – Broadcast
    description: Postmark broadcast unsubscribe endpoint
  - name: Billing – Pipedrive
    description: Pipedrive CRM ID set-* webhook endpoints (called by Zapier)
  - name: Billing – AJAX
    description: Credit ledger, reactivation, and portal AJAX endpoints
  - name: Council – REST
    description: Zapier-facing REST endpoints for council data sync
  - name: Council – AJAX
    description: Council user and sage management AJAX endpoints
  - name: User – REST
    description: Zapier-facing REST endpoints
  - name: User – AJAX
    description: Council user management AJAX endpoints
  - name: User – Profile
    description: Self-service profile updates
  - name: Deal REST
    description: REST API endpoints authenticated via X-API-Key
  - name: Deal AJAX
    description: AJAX endpoints authenticated via WordPress nonce + capability check
  - 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:
  /callback/set-test-screen:
    get:
      tags:
        - Sage – REST
      summary: Store test screen ID during build
      description: |
        Called by the Python service during the `transcending_training`
        build step to store the test screen ID created for the sage.
        The front-end polls for this value via `sagescreen_get_step_status`
        and uses it to embed the test screen.

        Requires the `X-API-Key` header matching the stored
        `sage_screen_api_key` option.
      operationId: restSetTestScreenCallback
      parameters:
        - name: council_sage_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - a1b2c3d4-e5f6-7890-abcd-ef1234567890
          description: Python council_sage UUID
        - name: screen_id
          in: query
          required: true
          schema:
            type: string
            examples:
              - scr_abc123def456
          description: Test screen ID created by Python
      responses:
        '200':
          description: Test screen ID stored successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetTestScreenResponse'
              example:
                success: true
                message: Test screen ID stored
                sage_id: 1234
        '400':
          description: Missing required parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SagePublicWPError'
              examples:
                missingSageId:
                  summary: Missing council_sage_id
                  value:
                    code: missing_param
                    message: council_sage_id is required
                    data:
                      status: 400
                missingScreenId:
                  summary: Missing screen_id
                  value:
                    code: missing_param
                    message: screen_id is required
                    data:
                      status: 400
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SagePublicWPError'
              examples:
                missing:
                  summary: No X-API-Key header
                  value:
                    code: invalid_api_key
                    message: Missing API key
                    data:
                      status: 401
                invalid:
                  summary: Key does not match
                  value:
                    code: invalid_api_key
                    message: Invalid API key
                    data:
                      status: 401
        '404':
          description: Council sage not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SagePublicWPError'
              example:
                code: sage_not_found
                message: >-
                  No council sage found with UUID:
                  a1b2c3d4-e5f6-7890-abcd-ef1234567890
                data:
                  status: 404
        '500':
          description: API key not configured on server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SagePublicWPError'
              example:
                code: api_not_configured
                message: API key not configured
                data:
                  status: 500
      security:
        - apiKey: []
components:
  schemas:
    SetTestScreenResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
          examples:
            - true
        message:
          type: string
          examples:
            - Test screen ID stored
        sage_id:
          type: integer
          description: WordPress post ID of the sage
          examples:
            - 1234
    SagePublicWPError:
      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
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: SageScreen API key stored in `ss_zapier_api_key` option

````