> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polymorfa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload selected AppStateSyncKeys for passthrough_plus mode



## OpenAPI

````yaml /api-reference/openapi.json post /api/sessions/{session}/upload-appstate-keys
openapi: 3.0.3
info:
  title: Polymorfa WhatsApp API
  version: 0.0.0
  description: >-
    Public Polymorfa REST API for sessions, messaging, media, webhooks,
    campaigns, templates, client tokens, widgets, and bridge routing.
  contact:
    name: Polymorfa API
    url: https://docs.polymorfa.com
servers:
  - url: https://api.polymorfa.com
security:
  - BearerAuth: []
paths:
  /api/sessions/{session}/upload-appstate-keys:
    post:
      tags:
        - Sessions
      summary: Upload selected AppStateSyncKeys for passthrough_plus mode
      operationId: sessionUploadAppStateKeys
      parameters:
        - schema:
            type: string
          required: true
          name: session
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadAppStateKeysRequest'
      responses:
        '200':
          description: Keys accepted by the active connection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadAppStateKeysSuccess'
        '400':
          description: Bad request — request body or params failed validation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Authenticated but not permitted (missing scope or rule violation)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    UploadAppStateKeysRequest:
      type: object
      properties:
        keys:
          type: array
          items:
            type: object
            properties:
              keyId:
                type: string
                description: Base64-encoded AppStateSyncKey id (URL-safe-no-pad).
              keyB64:
                type: string
                description: Base64-encoded 32-byte symmetric key bytes.
              fingerprintB64:
                type: string
                description: Base64-encoded WA fingerprint blob (optional).
              timestamp:
                type: number
                description: Unix timestamp, in seconds, stamped on the key by WhatsApp.
            required:
              - keyId
              - keyB64
              - timestamp
        upgradeTo:
          type: string
          enum:
            - passthrough_plus
          description: >-
            Optional literal accepted with the key-upload request. Only
            passthrough_plus is valid.
      required:
        - keys
    UploadAppStateKeysSuccess:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/SuccessResponse'
      required:
        - success
        - data
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
        docs:
          type: string
          description: URL to the documentation for this error
      required:
        - error
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
      required:
        - success
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Polymorfa organization key (titan_ prefix), project token (titan_pt_
        prefix), or client token (titan_ct_ prefix), where the operation permits
        that audience.

````