# Auth endpoints

These endpoints implement the wallet-based **challenge → verify** flow described in [Authentication](/api-reference/readme/authentication.md).

### POST `/auth/challenge`

Request a challenge message to sign with your Solana wallet.

{% hint style="info" %}
**Public endpoint** — no JWT required.
{% endhint %}

#### Request body

```json
{
  "walletAddress": "DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK"
}
```

#### Response (`200 OK`)

```json
{
  "challenge": "Sign this message to authenticate: 1234567890",
  "expiresAt": "2024-01-01T12:05:00Z"
}
```

### POST `/auth/verify`

Verify the signed challenge message and receive a JWT token for authenticated requests.

{% hint style="info" %}
**Public endpoint** — no JWT required.
{% endhint %}

#### Request body

```json
{
  "walletAddress": "DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK",
  "signature": "base58_encoded_signature",
  "message": "Sign this message to authenticate: 1234567890"
}
```

#### Response (`200 OK`)

```json
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "uuid",
    "walletAddress": "DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK"
  }
}
```

#### Token expiry

* JWT token expires in: **7 days**

### Related

* [Authentication](/api-reference/readme/authentication.md)
* [Error handling](/api-reference/readme/error-handling.md)
* [Rate limits](/api-reference/readme/rate-limits.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.taxsplit.app/api-reference/readme/auth-endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
