> For the complete documentation index, see [llms.txt](https://docs.netauthpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netauthpay.com/guides/api-reference.md).

# API Reference

Base URL: `http://localhost:3000` (or your deployed URL).\
All request/response bodies are JSON. Standard HTTP status codes apply.

***

#### Agents

**Register an agent**

**`POST /api/agents/register`**

Creates a new agent and a Solana wallet (or links an existing public key if provided).

**Request body:**

```json
{
  "agentId": "string (required)",
  "publicKey": "string (optional, existing Solana public key)"
}
```

**Response:** `201 Created`

```json
{
  "id": "agent-id",
  "publicKey": "Base58SolanaPublicKey...",
  "createdAt": "ISO8601",
  "updatedAt": "ISO8601",
  "isActive": true
}
```

**Errors:** `400` if `agentId` missing; `500` if registration fails (e.g. duplicate agent).

***
