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

# Send test invite to current user

> Creates an `ss_screen` post with `is_test_screen=1` and sends a
screening invite email to the currently logged-in user for the
specified sage.

**Idempotent:** if a non-expired, non-accessed test invite already
exists for this sage and user, the existing invite is returned with
`already_sent: true` instead of creating a new one.

**Permission:** `ss_admin_all` or council admin for the sage's council.

Registered as `wp_ajax_sagescreen_send_test_invite` — **login required**.




## OpenAPI

````yaml /openapi/private/specs/wp/screen.yml post /wp-admin/admin-ajax.php?action=sagescreen_send_test_invite
openapi: 3.1.0
info:
  title: SageScreen — Screen Module
  description: |
    Screen (interview) lifecycle management. A screen represents a single
    candidate screening session — from invite creation through completion,
    results generation, and PDF download.

    **CPT:** `ss_screen`
    **Custom statuses:** `ss_draft`, `ss_invited`, `ss_accepted`, `ss_started`,
    `ss_completed`, `ss_closed`, `ss_cancelled`, `ss_expired`

    Screens are created when candidates are invited to a sage, progress through
    the interview, and conclude with AI-generated results including category
    scores, a summary, recommendation, and a hire/no-hire determination.
  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: Screen – Testing
    description: Test invite and temperature check endpoints
  - name: Screen – Results
    description: Results generation, checking, regeneration, feedback, and download
  - name: Screen – Workflow
    description: Workflow progression (skip testing)
paths:
  /wp-admin/admin-ajax.php?action=sagescreen_send_test_invite:
    post:
      tags:
        - Screen – Testing
      summary: Send test invite to current user
      description: >
        Creates an `ss_screen` post with `is_test_screen=1` and sends a

        screening invite email to the currently logged-in user for the

        specified sage.


        **Idempotent:** if a non-expired, non-accessed test invite already

        exists for this sage and user, the existing invite is returned with

        `already_sent: true` instead of creating a new one.


        **Permission:** `ss_admin_all` or council admin for the sage's council.


        Registered as `wp_ajax_sagescreen_send_test_invite` — **login
        required**.
      operationId: ajaxSendTestInvite
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SendTestInviteRequest'
      responses:
        '200':
          description: Test invite result (check `success` field)
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/SendTestInviteSuccess'
                  - $ref: '#/components/schemas/AjaxErrorResponse'
              examples:
                sent:
                  summary: New test invite sent
                  value:
                    success: true
                    message: Test invite sent successfully
                    data:
                      sage_id: 1234
                      sent_to: admin@greenville.gov
                      invite_url: >-
                        https://api.sagescreen.app/screen/invite/abc123def456ghi789jkl012mno345pq
                      already_sent: false
                alreadySent:
                  summary: Existing invite returned (idempotent)
                  value:
                    success: true
                    message: Test invite already sent
                    data:
                      sage_id: 1234
                      sent_to: admin@greenville.gov
                      invite_url: >-
                        https://api.sagescreen.app/screen/invite/abc123def456ghi789jkl012mno345pq
                      already_sent: true
                nonceFail:
                  summary: Nonce check failed
                  value:
                    success: false
                    message: Security check failed
                invalidSage:
                  summary: Invalid sage ID
                  value:
                    success: false
                    message: Invalid sage ID
                permissionDenied:
                  summary: User lacks council access
                  value:
                    success: false
                    message: You do not have permission to access this sage
                sendFailed:
                  summary: Email send failure
                  value:
                    success: false
                    message: 'Failed to send test invite: SMTP connection error'
      security:
        - wpAjaxNonce: []
components:
  schemas:
    SendTestInviteRequest:
      type: object
      required:
        - action
        - nonce
        - sage_id
      properties:
        action:
          type: string
          const: sagescreen_send_test_invite
        nonce:
          type: string
          description: WP nonce for `sagescreen_frontend_nonce`
          examples:
            - abc123def456
        sage_id:
          type: integer
          description: Post ID of the `ss_council_sage` to test
          examples:
            - 1234
    SendTestInviteSuccess:
      type: object
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
          examples:
            - Test invite sent successfully
        data:
          type: object
          required:
            - sage_id
            - sent_to
            - invite_url
            - already_sent
          properties:
            sage_id:
              type: integer
              examples:
                - 1234
            sent_to:
              type: string
              format: email
              description: Email address the invite was sent to
              examples:
                - admin@greenville.gov
            invite_url:
              type: string
              format: uri
              description: Full invite URL for the test screen
              examples:
                - >-
                  https://api.sagescreen.app/screen/invite/abc123def456ghi789jkl012mno345pq
            already_sent:
              type: boolean
              description: True if an existing invite was returned (idempotent)
              examples:
                - false
    AjaxErrorResponse:
      type: object
      description: |
        Standard AJAX error. The `data` field is either a plain string
        or an object with a `message` field.
      properties:
        success:
          type: boolean
          const: false
        data:
          oneOf:
            - type: string
              description: Error message as plain string
              examples:
                - Security check failed
            - type: object
              properties:
                message:
                  type: string
                  examples:
                    - Screen ID is required
        message:
          type: string
          description: |
            Present on some endpoints that use `wp_send_json()` directly
            instead of `wp_send_json_error()`.
          examples:
            - Security check failed
  securitySchemes:
    wpAjaxNonce:
      type: apiKey
      in: query
      name: nonce
      description: WordPress AJAX nonce (passed as form field, verified per-action)

````