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

# Public demo signup

> Creates a demo user record and a linked demo screen, then sends
an email with the screen link. The candidate accesses the screen
without logging in.

Registered as both `wp_ajax_` and `wp_ajax_nopriv_` — **public**.

**Duplicate detection:** Email is normalized (dots removed from
local part, `+suffix` aliases stripped) and checked per sage.
Phone is also checked for duplicates per sage.




## OpenAPI

````yaml /openapi/private/specs/wp/demo-public.yml post /wp-admin/admin-ajax.php?action=sagescreen_demo_signup
openapi: 3.1.0
info:
  title: SageScreen — Demo Module
  description: |
    Demo mode management. Handles public demo signups, demo key
    generation/toggling, and CSV-based bulk candidate uploads.

    **CPT:** `ss_demo_user`
    Demo users sign up via a public `/screen/demo/{demo_key}` link,
    which creates both a `ss_demo_user` record and a linked `ss_screen`
    with `is_demo_screen = 1`.
  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: Demo
    description: Demo signup and management AJAX endpoints
  - name: CSV Upload
    description: Bulk candidate CSV upload
paths:
  /wp-admin/admin-ajax.php?action=sagescreen_demo_signup:
    post:
      tags:
        - Demo
      summary: Public demo signup
      description: |
        Creates a demo user record and a linked demo screen, then sends
        an email with the screen link. The candidate accesses the screen
        without logging in.

        Registered as both `wp_ajax_` and `wp_ajax_nopriv_` — **public**.

        **Duplicate detection:** Email is normalized (dots removed from
        local part, `+suffix` aliases stripped) and checked per sage.
        Phone is also checked for duplicates per sage.
      operationId: ajaxDemoSignup
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DemoSignupRequest'
      responses:
        '200':
          description: Signup result
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/DemoSignupSuccess'
                  - $ref: '#/components/schemas/AjaxErrorResponse'
              examples:
                success:
                  summary: Demo screen created and email sent
                  value:
                    success: true
                    redirect_url: /screen/demo/email-sent
                invalidNonce:
                  summary: Nonce check failed
                  value:
                    success: false
                    message: Invalid security token
                recaptchaFail:
                  summary: reCAPTCHA failed
                  value:
                    success: false
                    message: Security verification failed. Please try again.
                missingFields:
                  summary: Required fields missing
                  value:
                    success: false
                    message: Please complete all required fields
                invalidKey:
                  summary: Demo key does not match sage
                  value:
                    success: false
                    message: Invalid demo link
                duplicateEmail:
                  summary: Email already used for this demo
                  value:
                    success: false
                    message: This email has already been used for this demo
                duplicatePhone:
                  summary: Phone already used for this demo
                  value:
                    success: false
                    message: This phone number has already been used for this demo
                createFailed:
                  summary: Post creation failed
                  value:
                    success: false
                    message: Failed to create demo user
      security: []
components:
  schemas:
    DemoSignupRequest:
      type: object
      required:
        - action
        - demo_signup_nonce
        - recaptcha_token
        - demo_key
        - council_sage_id
        - council_id
        - first_name
        - last_name
        - email
        - phone
        - company
      properties:
        action:
          type: string
          const: sagescreen_demo_signup
        demo_signup_nonce:
          type: string
          description: WP nonce for `demo_signup_nonce_action`
        recaptcha_token:
          type: string
          description: Cloudflare Turnstile / reCAPTCHA token
        demo_key:
          type: string
          description: 16-char hex key matching the sage's `demo_key` meta
          examples:
            - a1b2c3d4e5f67890
        council_sage_id:
          type: integer
          description: Post ID of `ss_council_sage`
          examples:
            - 101
        council_id:
          type: string
          description: Council identifier
          examples:
            - c9d8e7f6-5a4b-3c2d-1e0f-a1b2c3d4e5f6
        first_name:
          type: string
          examples:
            - John
        last_name:
          type: string
          examples:
            - Doe
        email:
          type: string
          format: email
          examples:
            - john@example.com
        phone:
          type: string
          examples:
            - 555-1234
        company:
          type: string
          examples:
            - ACME Corp
        url:
          type: string
          format: uri
          description: Optional website URL
          examples:
            - https://acme.com
    DemoSignupSuccess:
      type: object
      properties:
        success:
          type: boolean
          const: true
        redirect_url:
          type: string
          description: Frontend redirect path
          examples:
            - /screen/demo/email-sent
    AjaxErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        message:
          type: string
          examples:
            - Invalid security token

````