---
title: "Open-ended challenge"
method: POST
path: "/api/challenge/open"
tags: ["Challenges"]
---

# Open-ended challenge

`POST /api/challenge/open`

Create a challenge that any 2 players can join.
Share the URL of the challenge. the first 2 players to click it will be paired for a game.
The response body also contains `whiteUrl` and `blackUrl`.
You can control which color each player gets by giving them these URLs,
instead of the main challenge URL.
Open challenges expire after 24h.
If the challenge creation is [authenticated with OAuth2](#description/authentication),
then you can use the [challenge cancel endpoint](#tag/challenges/POST/api/challenge/{challengeId}/cancel) to cancel it.
To directly pair 2 known players, use [this endpoint](#tag/bulk-pairings/GET/api/bulk-pairing) instead.

## Response `200`

The challenge was successfully created.

- ChallengeOpenJson
  - `id` string, required
  - `url` string, uri, required
  - `status` 'created' | 'offline' | 'canceled' | 'declined' | 'accepted', required
  - `challenger` unknown, required
  - `destUser` unknown, required
  - `variant` Variant, required
    - `key` 'standard' | 'chess960' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingOfTheHill' | 'racingKings' | 'threeCheck' | 'fromPosition', required
    - `name` string, required
    - `short` string
  - `rated` boolean, required
  - `speed` 'ultraBullet' | 'bullet' | 'blitz' | 'rapid' | 'classical' | 'correspondence', required
  - `timeControl` union, required
    - object
      - `type` 'clock'
      - `limit` integer
      - `increment` integer
      - `show` string
    - object
      - `type` 'correspondence'
      - `daysPerTurn` integer
    - object
      - `type` 'unlimited'
  - `color` 'white' | 'black' | 'random', required
  - `finalColor` 'white' | 'black'
  - `perf` object, required
    - `icon` string
    - `name` string
  - `initialFen` string
  - `urlWhite` string, uri, required
  - `urlBlack` string, uri, required
  - `open` object, required
    - `userIds` string[] — An optional array of two user ids. If set, only these users will be allowed to join the game. The first username gets the white pieces.

## Other responses

- `400` — The creation of the challenge failed.

---

[API](https://skmtc.net/lichess/apis/lichess-org-api-reference.md) · [All operations](https://skmtc.net/lichess/apis/lichess-org-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lichess/lichess-org-api-reference/revisions/f16676f55a94/schema)
