> This page is for version V3 - Beta (default).
> For other versions, use one of these documentation indexes:
> - V3 - Beta (default): https://docs.authlyx.dev/v3/llms.txt
> - V2 - Legacy: https://docs.authlyx.dev/v2/llms.txt
> - V1 - End of support: https://docs.authlyx.dev/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.authlyx.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.authlyx.dev/_mcp/server.

# Prepare sign-in

POST http://127.0.0.1:4000/v3/challenge
Content-Type: application/json

Creates a single-use login challenge for an Ed25519 installation public key. Challenges expire after two minutes. Sign the exact challenge payload together with the normalized login operation; the SDK handles this.

Reference: https://docs.authlyx.dev/api-reference/client/authentication/sign-in/prepare-sign-in

## Servers

- `http://127.0.0.1:4000` (Local development, default)
- `https://api.authlyx.dev` (Production host - deployment pending)

## Request

### Headers

- `X-AuthlyX-Nonce` (string, optional) — Random nonce for binding and verifying the signed response.

### Body (application/json)

This endpoint expects an object.

- `appKey` (string, required) — Application identifier copied from the dashboard. Not an Elite Key or Bot Key.
- `installationPublicKey` (string, required) — PEM-encoded Ed25519 public key for this installation. Never send its private key.

## Response

### 200

Successful

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (Challenge, required, nullable)
- `requestId` (string, required)
- `verification` (V3ChallengePostResponsesContentApplicationJsonSchemaVerification, required)

## Errors

### 400 Bad Request Error

Bad request

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

### 401 Unauthorized Error

Unauthorized

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

### 403 Forbidden Error

Forbidden

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

### 404 Not Found Error

Not found

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

### 413 Content Too Large Error

Payload too large

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

### 415 Unsupported Media Type Error

Unsupported content type

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

### 429 Too Many Requests Error

Too many requests

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

### 503 Service Unavailable Error

Service unavailable

- `success` (boolean, required)
- `code` (string, required)
- `message` (string, required)
- `data` (map from string to any, required, nullable)
- `requestId` (string, required)
- `verification` (SignedResponseVerification, required)

## Types

### Challenge

- `challengeId` (string, required)
- `payload` (string, required) — Exact challenge JSON string to include in the installation proof.
- `expiresAt` (datetime, required)

### V3ChallengePostResponsesContentApplicationJsonSchemaVerification

- `keyId` (string, required)
- `signedPayload` (string, required)
- `signature` (string, required)

### SignedResponseVerification

- `keyId` (string, required)
- `signedPayload` (string, required)
- `signature` (string, required)

## Examples

**Request**

```json
{
  "appKey": "ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78",
  "installationPublicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=\n-----END PUBLIC KEY-----\n"
}
```

**Response**

```json
{
  "success": true,
  "code": "CHALLENGE_CREATED",
  "message": "Request completed.",
  "data": {
    "challengeId": "98b6a22d-2ea3-4863-91f8-c575cdccf1a2",
    "payload": "{\"id\":\"98b6a22d-2ea3-4863-91f8-c575cdccf1a2\",\"purpose\":\"login\",\"nonce\":\"a6e4c18b379520dfa6e4c18b379520df\"}",
    "expiresAt": "2026-10-24T12:02:00.000Z"
  },
  "requestId": "98b6a22d-2ea3-4863-91f8-c575cdccf1a2",
  "verification": {
    "keyId": "324be2dea8bc44461b0233e51fa48902ed6b1cc671e7739af2551e0bfe68f54e",
    "signedPayload": "{\"type\":\"authlyx.response.v3\",\"keyId\":\"324be2dea8bc44461b0233e51fa48902ed6b1cc671e7739af2551e0bfe68f54e\",\"httpStatus\":200,\"serverTime\":\"2026-10-24T12:00:00.000Z\",\"request\":{\"method\":\"POST\",\"path\":\"/v3/challenge\",\"nonce\":\"a6e4c18b379520dfa6e4c18b379520df\",\"bodySha256\":\"12612ce36146ab8e43cff80aa705a016da8a08fd9a8147b09d1135d3f79e1db3\"},\"response\":{\"success\":true,\"code\":\"CHALLENGE_CREATED\",\"message\":\"Request completed.\",\"data\":{\"challengeId\":\"98b6a22d-2ea3-4863-91f8-c575cdccf1a2\",\"payload\":\"{\\\"id\\\":\\\"98b6a22d-2ea3-4863-91f8-c575cdccf1a2\\\",\\\"purpose\\\":\\\"login\\\",\\\"nonce\\\":\\\"a6e4c18b379520dfa6e4c18b379520df\\\"}\",\"expiresAt\":\"2026-10-24T12:02:00.000Z\"},\"requestId\":\"98b6a22d-2ea3-4863-91f8-c575cdccf1a2\"}}",
    "signature": "+WALwSetkH00QXd9ISCyBDHeaHxcwftp2hnPerb7FsWhnooaP1Za42tS7h04X1Lbk6Z5oXbHE6t1rRHaNUS6DA=="
  }
}
```

**SDK Code**

```python
import requests

url = "http://127.0.0.1:4000/v3/challenge"

payload = {
    "appKey": "ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78",
    "installationPublicKey": "-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=
-----END PUBLIC KEY-----
"
}
headers = {
    "X-AuthlyX-Nonce": "a6e4c18b379520dfa6e4c18b379520df",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://127.0.0.1:4000/v3/challenge';
const options = {
  method: 'POST',
  headers: {
    'X-AuthlyX-Nonce': 'a6e4c18b379520dfa6e4c18b379520df',
    'Content-Type': 'application/json'
  },
  body: '{"appKey":"ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78","installationPublicKey":"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=\n-----END PUBLIC KEY-----\n"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://127.0.0.1:4000/v3/challenge"

	payload := strings.NewReader("{\n  \"appKey\": \"ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78\",\n  \"installationPublicKey\": \"-----BEGIN PUBLIC KEY-----\\nMCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=\\n-----END PUBLIC KEY-----\\n\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-AuthlyX-Nonce", "a6e4c18b379520dfa6e4c18b379520df")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://127.0.0.1:4000/v3/challenge")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["X-AuthlyX-Nonce"] = 'a6e4c18b379520dfa6e4c18b379520df'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"appKey\": \"ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78\",\n  \"installationPublicKey\": \"-----BEGIN PUBLIC KEY-----\\nMCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=\\n-----END PUBLIC KEY-----\\n\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://127.0.0.1:4000/v3/challenge")
  .header("X-AuthlyX-Nonce", "a6e4c18b379520dfa6e4c18b379520df")
  .header("Content-Type", "application/json")
  .body("{\n  \"appKey\": \"ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78\",\n  \"installationPublicKey\": \"-----BEGIN PUBLIC KEY-----\\nMCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=\\n-----END PUBLIC KEY-----\\n\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://127.0.0.1:4000/v3/challenge', [
  'body' => '{
  "appKey": "ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78",
  "installationPublicKey": "-----BEGIN PUBLIC KEY-----\\nMCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=\\n-----END PUBLIC KEY-----\\n"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-AuthlyX-Nonce' => 'a6e4c18b379520dfa6e4c18b379520df',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://127.0.0.1:4000/v3/challenge");
var request = new RestRequest(Method.POST);
request.AddHeader("X-AuthlyX-Nonce", "a6e4c18b379520dfa6e4c18b379520df");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"appKey\": \"ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78\",\n  \"installationPublicKey\": \"-----BEGIN PUBLIC KEY-----\\nMCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=\\n-----END PUBLIC KEY-----\\n\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-AuthlyX-Nonce": "a6e4c18b379520dfa6e4c18b379520df",
  "Content-Type": "application/json"
]
let parameters = [
  "appKey": "ger_5607ad6df93c49359adfa5a8dc6f3c96cacd6275d9a44d78",
  "installationPublicKey": "-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEA6kpsY+KcUgq+9VB7Ey7F+ZVHdq6+vnuSQh7qaRRG0iw=
-----END PUBLIC KEY-----
"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:4000/v3/challenge")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```