---
title: "Verify a signed challenge and create a session"
method: POST
path: "/api/auth"
---

# Verify a signed challenge and create a session

`POST /api/auth`

## Request

- Base URL: `https://radix.wiki`
- URL: `https://radix.wiki/api/auth`
- Auth: none declared

Sign the blake2b-256 hash of `R` (ASCII) + the challenge (hex-decoded) + one byte holding the length of the dAppDefinitionAddress + that address (UTF-8) + the origin (UTF-8), with Ed25519 (curve25519), and hex-encode the signature. The public key must be an on-ledger `owner_keys` entry for the account.

## Request body

- object
  - `accounts` object[], required
    - `address` string, required
    - `label` string
  - `signedChallenge` object, required
    - `challenge` string, required
    - `address` string, required
    - `proof` object, required
      - `publicKey` string, required: Hex Ed25519 public key
      - `signature` string, required: Hex Ed25519 signature
      - `curve` 'curve25519', required

## Response `200`

Session created (7-day expiry)

- object
  - `token` string: JWT for `Authorization: Bearer`
  - `userId` string
  - `radixAddress` string
  - `expiresAt` string, date-time
  - `isNewUser` boolean

## Other responses

- `401`: Signature verification failed

---

[API](https://skmtc.dev/radix/apis/radix-wiki-api.md) · [All operations](https://skmtc.dev/radix/apis/radix-wiki-api/llms.txt) · [OpenAPI document](https://skmtc.dev/radix/apis/radix-wiki-api/revisions/2489ffad8c96?raw)
