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

# Create testing session

> Creates a disconnected simulated session with testMode enabled. Team API keys require projectId in the body.

Requires `sessions:manage`. Project tokens only access resources in their own project.



## OpenAPI

````yaml api-reference/features/connect.json POST /platform/sessions/testing
openapi: 3.0.3
info:
  title: Connect API methods
  version: 1.0.0
  description: Task-focused connect methods across supported Polymorfa connection types.
servers: []
security: []
paths:
  /platform/sessions/testing:
    post:
      tags:
        - Sessions
      summary: Create testing session
      description: >-
        Creates a disconnected simulated session with testMode enabled. Team API
        keys require projectId in the body.


        Requires `sessions:manage`. Project tokens only access resources in
        their own project.
      operationId: managementCreateTestingSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/management__CreateTestingNumberRequest'
      responses:
        '200':
          description: Success
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Stable request correlation identifier.
            Polymorfa-Version:
              schema:
                type: string
              description: API version applied to this response.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/management__TestingSessionId'
                    description: |-
                      Structured data carried by this object.

                      <!-- polymorfa-input-table -->
                      **Value constraints**
                      | Constraint | Accepted input |
                      | --- | --- |
                      | Pattern | `^test_[A-Za-z0-9_-]{16}$` |
                required:
                  - data
        '400':
          $ref: '#/components/responses/management__BadRequest'
        '401':
          $ref: '#/components/responses/management__Unauthorized'
        '403':
          $ref: '#/components/responses/management__Forbidden'
        '404':
          $ref: '#/components/responses/management__NotFound'
        '500':
          $ref: '#/components/responses/management__InternalError'
      security:
        - management__ApiKeyAuth: []
      servers:
        - url: https://api.polymorfa.com
        - url: http://localhost:8080
          description: local dev
components:
  schemas:
    management__CreateTestingNumberRequest:
      type: object
      additionalProperties: false
      properties:
        projectId:
          allOf:
            - $ref: '#/components/schemas/management__ProjectId'
          description: |-
            Identifier of the Polymorfa project that owns this resource.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        customerId:
          type: string
          format: uuid
          description: >-
            Customer owner. Defaults to the protected Default customer when
            Customers is enabled.


            <!-- polymorfa-input-table -->

            **Value constraints**

            | Constraint | Accepted input |

            | --- | --- |

            | Format | `uuid` |
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: |-
            Optional Console display name.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | String length | `1` through `100` characters |
        country:
          type: string
          enum:
            - ES
            - DE
            - MX
            - GB
            - SA
            - IT
            - AF
            - AX
            - AL
            - DZ
            - AS
            - AD
            - AO
            - AI
            - AG
            - AR
            - AM
            - AW
            - AC
            - AU
            - AT
            - AZ
            - BS
            - BH
            - BD
            - BB
            - BY
            - BE
            - BZ
            - BJ
            - BM
            - BT
            - BO
            - BQ
            - BA
            - BW
            - BR
            - IO
            - VG
            - BN
            - BG
            - BF
            - BI
            - CI
            - KH
            - CM
            - CA
            - CV
            - KY
            - CF
            - TD
            - CL
            - CN
            - CX
            - CC
            - CO
            - KM
            - CG
            - CD
            - CK
            - CR
            - HR
            - CU
            - CW
            - CY
            - CZ
            - DK
            - DJ
            - DM
            - DO
            - EC
            - EG
            - SV
            - GQ
            - ER
            - EE
            - ET
            - FK
            - FO
            - FJ
            - FI
            - FR
            - GF
            - PF
            - GA
            - GM
            - GE
            - GH
            - GI
            - GR
            - GL
            - GD
            - GP
            - GU
            - GT
            - GG
            - GN
            - GW
            - GY
            - HT
            - HN
            - HK
            - HU
            - IS
            - IN
            - ID
            - IR
            - IQ
            - IE
            - IM
            - IL
            - JM
            - JP
            - JE
            - JO
            - KZ
            - KE
            - KI
            - KW
            - KG
            - LA
            - LV
            - LB
            - LS
            - LR
            - LY
            - LI
            - LT
            - LU
            - MO
            - MK
            - MG
            - MW
            - MY
            - MV
            - ML
            - MT
            - MH
            - MQ
            - MR
            - MU
            - YT
            - FM
            - MD
            - MC
            - MN
            - ME
            - MS
            - MA
            - MZ
            - MM
            - NA
            - NR
            - NP
            - NL
            - NC
            - NZ
            - NI
            - NE
            - NG
            - NU
            - NF
            - KP
            - MP
            - 'NO'
            - OM
            - PK
            - PW
            - PS
            - PA
            - PG
            - PY
            - PE
            - PH
            - PL
            - PT
            - PR
            - QA
            - RO
            - RU
            - RW
            - RE
            - BL
            - SH
            - KN
            - LC
            - MF
            - PM
            - VC
            - WS
            - SM
            - SN
            - RS
            - SC
            - SL
            - SG
            - SX
            - SK
            - SI
            - SB
            - SO
            - ZA
            - KR
            - SS
            - LK
            - SD
            - SR
            - SJ
            - SZ
            - SE
            - CH
            - SY
            - ST
            - TW
            - TJ
            - TZ
            - TH
            - TL
            - TG
            - TK
            - TO
            - TT
            - TN
            - TR
            - TM
            - TC
            - TV
            - VI
            - UG
            - UA
            - AE
            - US
            - UY
            - UZ
            - VU
            - VA
            - VE
            - VN
            - WF
            - YE
            - ZM
            - ZW
            - XK
          default: US
          description: >-
            WhatsApp-supported ISO 3166-1 alpha-2 country used to generate a
            realistic E.164 identity.


            <!-- polymorfa-input-table -->

            **Allowed values**

            | Value | Meaning |

            | --- | --- |

            | `ES` | Es. |

            | `DE` | De. |

            | `MX` | Mx. |

            | `GB` | Gb. |

            | `SA` | Sa. |

            | `IT` | It. |

            | `AF` | Af. |

            | `AX` | Ax. |

            | `AL` | Al. |

            | `DZ` | Dz. |

            | `AS` | As. |

            | `AD` | Ad. |

            | `AO` | Ao. |

            | `AI` | Ai. |

            | `AG` | Ag. |

            | `AR` | Ar. |

            | `AM` | Am. |

            | `AW` | Aw. |

            | `AC` | Ac. |

            | `AU` | Au. |

            | `AT` | At. |

            | `AZ` | Az. |

            | `BS` | Bs. |

            | `BH` | Bh. |

            | `BD` | Bd. |

            | `BB` | Bb. |

            | `BY` | By. |

            | `BE` | Be. |

            | `BZ` | Bz. |

            | `BJ` | Bj. |

            | `BM` | Bm. |

            | `BT` | Bt. |

            | `BO` | Bo. |

            | `BQ` | Bq. |

            | `BA` | Ba. |

            | `BW` | Bw. |

            | `BR` | Br. |

            | `IO` | Io. |

            | `VG` | Vg. |

            | `BN` | Bn. |

            | `BG` | Bg. |

            | `BF` | Bf. |

            | `BI` | Bi. |

            | `CI` | Ci. |

            | `KH` | Kh. |

            | `CM` | Cm. |

            | `CA` | Ca. |

            | `CV` | Cv. |

            | `KY` | Ky. |

            | `CF` | Cf. |

            | `TD` | Td. |

            | `CL` | Cl. |

            | `CN` | Cn. |

            | `CX` | Cx. |

            | `CC` | Cc. |

            | `CO` | Co. |

            | `KM` | Km. |

            | `CG` | Cg. |

            | `CD` | Cd. |

            | `CK` | Ck. |

            | `CR` | Cr. |

            | `HR` | Hr. |

            | `CU` | Cu. |

            | `CW` | Cw. |

            | `CY` | Cy. |

            | `CZ` | Cz. |

            | `DK` | Dk. |

            | `DJ` | Dj. |

            | `DM` | Dm. |

            | `DO` | Do. |

            | `EC` | Ec. |

            | `EG` | Eg. |

            | `SV` | Sv. |

            | `GQ` | Gq. |

            | `ER` | Er. |

            | `EE` | Ee. |

            | `ET` | Et. |

            | `FK` | Fk. |

            | `FO` | Fo. |

            | `FJ` | Fj. |

            | `FI` | Fi. |

            | `FR` | Fr. |

            | `GF` | Gf. |

            | `PF` | Pf. |

            | `GA` | Ga. |

            | `GM` | Gm. |

            | `GE` | Ge. |

            | `GH` | Gh. |

            | `GI` | Gi. |

            | `GR` | Gr. |

            | `GL` | Gl. |

            | `GD` | Gd. |

            | `GP` | Gp. |

            | `GU` | Gu. |

            | `GT` | Gt. |

            | `GG` | Gg. |

            | `GN` | Gn. |

            | `GW` | Gw. |

            | `GY` | Gy. |

            | `HT` | Ht. |

            | `HN` | Hn. |

            | `HK` | Hk. |

            | `HU` | Hu. |

            | `IS` | Is. |

            | `IN` | In. |

            | `ID` | Id. |

            | `IR` | Ir. |

            | `IQ` | Iq. |

            | `IE` | Ie. |

            | `IM` | Im. |

            | `IL` | Il. |

            | `JM` | Jm. |

            | `JP` | Jp. |

            | `JE` | Je. |

            | `JO` | Jo. |

            | `KZ` | Kz. |

            | `KE` | Ke. |

            | `KI` | Ki. |

            | `KW` | Kw. |

            | `KG` | Kg. |

            | `LA` | La. |

            | `LV` | Lv. |

            | `LB` | Lb. |

            | `LS` | Ls. |

            | `LR` | Lr. |

            | `LY` | Ly. |

            | `LI` | Li. |

            | `LT` | Lt. |

            | `LU` | Lu. |

            | `MO` | Mo. |

            | `MK` | Mk. |

            | `MG` | Mg. |

            | `MW` | Mw. |

            | `MY` | My. |

            | `MV` | Mv. |

            | `ML` | Ml. |

            | `MT` | Mt. |

            | `MH` | Mh. |

            | `MQ` | Mq. |

            | `MR` | Mr. |

            | `MU` | Mu. |

            | `YT` | Yt. |

            | `FM` | Fm. |

            | `MD` | Md. |

            | `MC` | Mc. |

            | `MN` | Mn. |

            | `ME` | Me. |

            | `MS` | Ms. |

            | `MA` | Ma. |

            | `MZ` | Mz. |

            | `MM` | Mm. |

            | `NA` | Na. |

            | `NR` | Nr. |

            | `NP` | Np. |

            | `NL` | Nl. |

            | `NC` | Nc. |

            | `NZ` | Nz. |

            | `NI` | Ni. |

            | `NE` | Ne. |

            | `NG` | Ng. |

            | `NU` | Nu. |

            | `NF` | Nf. |

            | `KP` | Kp. |

            | `MP` | Mp. |

            | `NO` | No. |

            | `OM` | Om. |

            | `PK` | Pk. |

            | `PW` | Pw. |

            | `PS` | Ps. |

            | `PA` | Pa. |

            | `PG` | Pg. |

            | `PY` | Py. |

            | `PE` | Pe. |

            | `PH` | Ph. |

            | `PL` | Pl. |

            | `PT` | Pt. |

            | `PR` | Pr. |

            | `QA` | Qa. |

            | `RO` | Ro. |

            | `RU` | Ru. |

            | `RW` | Rw. |

            | `RE` | Re. |

            | `BL` | Bl. |

            | `SH` | Sh. |

            | `KN` | Kn. |

            | `LC` | Lc. |

            | `MF` | Mf. |

            | `PM` | Pm. |

            | `VC` | Vc. |

            | `WS` | Ws. |

            | `SM` | Sm. |

            | `SN` | Sn. |

            | `RS` | Rs. |

            | `SC` | Sc. |

            | `SL` | Sl. |

            | `SG` | Sg. |

            | `SX` | Sx. |

            | `SK` | Sk. |

            | `SI` | Si. |

            | `SB` | Sb. |

            | `SO` | So. |

            | `ZA` | Za. |

            | `KR` | Kr. |

            | `SS` | Ss. |

            | `LK` | Lk. |

            | `SD` | Sd. |

            | `SR` | Sr. |

            | `SJ` | Sj. |

            | `SZ` | Sz. |

            | `SE` | Se. |

            | `CH` | Ch. |

            | `SY` | Sy. |

            | `ST` | St. |

            | `TW` | Tw. |

            | `TJ` | Tj. |

            | `TZ` | Tz. |

            | `TH` | Th. |

            | `TL` | Tl. |

            | `TG` | Tg. |

            | `TK` | Tk. |

            | `TO` | To. |

            | `TT` | Tt. |

            | `TN` | Tn. |

            | `TR` | Tr. |

            | `TM` | Tm. |

            | `TC` | Tc. |

            | `TV` | Tv. |

            | `VI` | Vi. |

            | `UG` | Ug. |

            | `UA` | Ua. |

            | `AE` | Ae. |

            | `US` | Us. |

            | `UY` | Uy. |

            | `UZ` | Uz. |

            | `VU` | Vu. |

            | `VA` | Va. |

            | `VE` | Ve. |

            | `VN` | Vn. |

            | `WF` | Wf. |

            | `YE` | Ye. |

            | `ZM` | Zm. |

            | `ZW` | Zw. |

            | `XK` | Xk. |
      required:
        - projectId
    management__TestingSessionId:
      type: string
      pattern: ^test_[A-Za-z0-9_-]{16}$
      description: Generated testing-session slug.
    management__ProjectId:
      type: string
      format: uuid
      description: >-
        Project UUID. Optional where an operation can infer or search
        organization scope; required where the operation creates a project-owned
        resource.
    management__ErrorEnvelope:
      type: object
      required:
        - error
        - data
        - docs
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - conflict_error
                - rate_limit_error
                - api_error
                - upstream_error
              description: |-
                Type discriminator for this object.

                <!-- polymorfa-input-table -->
                **Allowed values**
                | Value | Meaning |
                | --- | --- |
                | `invalid_request_error` | Invalid request error. |
                | `authentication_error` | Authentication error. |
                | `permission_error` | Permission error. |
                | `conflict_error` | Conflict error. |
                | `rate_limit_error` | Rate limit error. |
                | `api_error` | Api error. |
                | `upstream_error` | Upstream error. |
            code:
              type: string
              description: Stable failure code. Use this value for programmatic handling.
            message:
              type: string
              description: Safe explanation of the failure.
            param:
              type: string
              nullable: true
              description: |-
                Invalid request field, or null when no field applies.

                <!-- polymorfa-input-table -->
                **Accepted alternatives**
                | Alternative | Accepted input |
                | --- | --- |
                | Alternative 1 | Type: `string` |
                | Alternative 2 | `null` |
          description: Error details returned when the operation fails.
        data:
          type: string
          nullable: true
          enum:
            - null
          description: |-
            Always null for a failed request.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `null` | Null. |

            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        docs:
          type: string
          format: uri
          description: |-
            Documentation link to this failure code.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uri` |
  responses:
    management__BadRequest:
      description: A path, query, or request-body value did not pass validation.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Unauthorized:
      description: Missing/invalid credential for this audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Forbidden:
      description: Authenticated but lacks the required scope/role/audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__NotFound:
      description: >-
        The requested resource was not found inside the authenticated
        organization or project scope.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__InternalError:
      description: >-
        The session-control publisher or testing-number persistence path is
        temporarily unavailable.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
  securitySchemes:
    management__ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Polymorfa server credential: a scoped pmfa_ organization key, or a
        pmfa_pt_ project token on project- and session-bound operations inside
        its exact authenticated project. Keys may be personal or service-account
        owned. Both enforce selected action scopes; organization keys can
        address team resources and every project in the organization. Listener
        and browser client credentials are rejected.

````