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

# Activate a new user account

> Completes the new-user activation flow. The `verify_key` is
checked against the stored verification token. On success the
user's password and username are set and the account is activated.

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




## OpenAPI

````yaml /openapi/private/specs/wp/auth.yml post /wp-admin/admin-ajax.php?action=sagescreen_complete_new_user_activation
openapi: 3.1.0
info:
  title: SageScreen — Auth Module
  description: >
    Authentication and session management. Handles JWT token lifecycle

    (issue, refresh, validate, revoke) and WordPress-based login/logout

    with reCAPTCHA/Turnstile protection.


    Uses RS256-signed JWTs stored in the `wp_sage_screen_jwt` table.

    Tokens have a configurable TTL (`sage_screen_jwt_expires`, default 3600 s)

    and a separate refresh window (`sage_screen_jwt_refresh_expires`, default
    604800 s / 7 days).
  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: Auth – REST
    description: JWT token endpoints (REST API)
  - name: Auth – AJAX
    description: Session-based login / logout / password flows (AJAX)
paths:
  /wp-admin/admin-ajax.php?action=sagescreen_complete_new_user_activation:
    post:
      tags:
        - Auth – AJAX
      summary: Activate a new user account
      description: |
        Completes the new-user activation flow. The `verify_key` is
        checked against the stored verification token. On success the
        user's password and username are set and the account is activated.

        Registered as both `wp_ajax_` and `wp_ajax_nopriv_` — **public**.
      operationId: ajaxCompleteNewUserActivation
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AjaxActivateUserRequest'
      responses:
        '200':
          description: Activation result
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AjaxActivateUserSuccess'
                  - $ref: '#/components/schemas/AjaxErrorResponse'
              examples:
                success:
                  summary: Account activated
                  value:
                    success: true
                    data:
                      message: User activation completed successfully
                      user_id: 123
                nonceFail:
                  summary: Nonce check failed
                  value:
                    success: false
                    data: Security check failed
                missingFields:
                  summary: Required fields missing
                  value:
                    success: false
                    data: All fields are required
      security: []
components:
  schemas:
    AjaxActivateUserRequest:
      type: object
      required:
        - action
        - nonce
        - verify_key
        - username
        - password
      properties:
        action:
          type: string
          const: sagescreen_complete_new_user_activation
        nonce:
          type: string
          description: WP nonce for `sagescreen_frontend_nonce`
        verify_key:
          type: string
          description: Verification token from the activation email
          examples:
            - verify_abc123
        username:
          type: string
          description: Desired username
          examples:
            - jane.smith
        password:
          type: string
          format: password
          examples:
            - SecurePass789
    AjaxActivateUserSuccess:
      type: object
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          required:
            - message
            - user_id
          properties:
            message:
              type: string
              examples:
                - User activation completed successfully
            user_id:
              type: integer
              examples:
                - 123
    AjaxErrorResponse:
      type: object
      description: |
        Standard AJAX error. The `data` field is either a plain string
        or an object with additional context (e.g. `no_council: true`).
      properties:
        success:
          type: boolean
          const: false
        data:
          oneOf:
            - type: string
              examples:
                - Security check failed
            - type: object
              properties:
                message:
                  type: string
                no_council:
                  type: boolean

````