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

# Create Production Test

> Create a new production test challenge for an app.

Creates a new production test challenge. The app name is automatically used as the host name. Provider IDs are validated against eligibility criteria.

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer <API_KEY>` from Console > Developers > Workspace API Keys.
</ParamField>

<ParamField header="Content-Type" type="string">
  `application/json`
</ParamField>

<ParamField header="Idempotency-Key" type="string">
  Optional client-generated string (max 255 chars) to safely retry without creating duplicates. Scoped per workspace. A key is valid for 24 hours. If the same key is replayed with an identical body, the original response is returned with an `Idempotency-Replayed: true` header. Reusing the same key with a different body returns `409 IDEMPOTENCY_KEY_CONFLICT`.
</ParamField>

### Path parameters

<ParamField path="client_id" type="string" required>
  Client identifier of the app.
</ParamField>

### Request body

<ParamField body="title" type="string" required>
  Challenge title (max 200 characters).
</ParamField>

<ParamField body="description" type="string">
  Challenge description (max 1000 characters).
</ParamField>

<ParamField body="providerIds" type="string[]">
  Provider IDs to test. Each provider must be:

  * Registered in the system
  * Enabled for the app (`app.providers` configuration)
  * Not a chip-based provider (type 2)
  * Available in the current deployment environment

  If omitted, all eligible providers are included.
</ParamField>

<ParamField body="targetPlatform" type="string">
  Target platform filter: `ios` or `android`.
</ParamField>

<ParamField body="maxStamps" type="number">
  Maximum number of stamps (first-come limit). Minimum 1, default 3.
</ParamField>

<ParamField body="allowDuplicateParticipation" type="boolean">
  Whether to allow the same user to participate multiple times with the same provider. Default `false`.
</ParamField>

## Response

Returns a challenge request object. This represents a pending request that will be scheduled with the tpas-backend service, not a fully activated challenge yet.

<ResponseField name="id" type="string">
  Request ID. Identifies this challenge request record.
</ResponseField>

<ResponseField name="clientId" type="string">
  The app client ID this challenge request belongs to.
</ResponseField>

<ResponseField name="status" type="string">
  Current status of the challenge request (e.g. `pending`, `scheduled`, `failed`).
</ResponseField>

<ResponseField name="payload" type="object">
  The challenge configuration payload forwarded to tpas-backend. Contains the parameters passed at creation (title, providerIds, maxStampClaims, etc.).
</ResponseField>

<ResponseField name="challengeId" type="string | null">
  The tpas-backend challenge ID, populated once the request has been successfully scheduled. Use this ID when fetching the challenge report (`GET /apps/{client_id}/production-tests/{challenge_id}/report`). `null` or absent if not yet scheduled.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp when the challenge request was created.
</ResponseField>

<Note>
  The `challengeId` field is only populated after the challenge has been scheduled with tpas-backend. If you need to fetch the report immediately after creation, poll the list endpoint (`GET /apps/{client_id}/production-tests`) and wait for the item's `type` to become `"challenge"` before using `challengeId`.
</Note>

<Note>
  The response includes a `Location` header pointing at the newly-created resource (e.g., `/connect/v1/apps/{clientId}/production-tests/{id}`).
</Note>

<RequestExample>
  ```bash theme={null}
  curl -X POST \
    -H "Authorization: Bearer sk_workspace_test_..." \
    -H "Content-Type: application/json" \
    -d '{"title":"BankID SE Test","providerIds":["bankidse"],"maxStamps":3}' \
    "https://sandbox.api.hopae.com/connect/v1/apps/FK5b0KSM/production-tests"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "req_7f3a9c1e-4b2d-4f88-9e1a-0c3d5b6e7f8a",
    "clientId": "FK5b0KSM",
    "status": "pending",
    "payload": {
      "title": "BankID SE Test",
      "providerIds": ["bankidse"],
      "maxStampClaims": 3,
      "targetPlatform": null
    },
    "challengeId": null,
    "createdAt": "2026-04-08T10:00:00.000Z"
  }
  ```
</ResponseExample>
