> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating an account

> Create and verify a Neuron account using the Agent API

This guide walks through creating a Neuron broker account via the Agent API. A broker account is the foundation for everything else — Legal Identities, wallets, smart contracts, and tokens all require one.

## Prerequisites

* A Neuron domain (`{host}`) issued by your operator
* An **API key** and **API secret** for that Neuron
* Familiarity with [HMAC signing](/neuron-api/authentication)

## Overview

```mermaid theme={null}
sequenceDiagram
  participant Client
  participant Neuron
  Client->>Neuron: Account/DomainInfo (optional)
  Client->>Neuron: Account/Create (HMAC signed)
  Neuron-->>Client: JWT + disabled account
  Neuron-->>User: Verification email
  Client->>Neuron: Account/VerifyEMail (code)
  Neuron-->>Client: Account enabled
  Client->>Neuron: Account/Login (HMAC signed)
  Neuron-->>Client: JWT
```

## Step 1: Check the domain (optional)

Before creating an account, you can retrieve human-readable information about the Neuron domain to present to the user:

```http theme={null}
GET /Agent/Account/DomainInfo
```

This returns a localized name and description for the Neuron, which is useful if you are letting users choose between multiple Neurons.

## Step 2: Create the account

Account creation uses HMAC-SHA-256 signing. Compute the signature as:

```text theme={null}
signature = BASE64( HMAC-SHA256(secret, nonce) )
```

Then call:

```http theme={null}
POST /Agent/Account/Create
Content-Type: application/json

{
  "userName": "myaccount",
  "eMail": "user@example.com",
  "password": "<secure password>",
  "apiKey": "YOUR_API_KEY",
  "nonce": "<unique nonce>",
  "signature": "<HMAC signature>",
  "seconds": 3600
}
```

The response includes an initial JWT and confirms the account was created in a **disabled** state. The nonce must be unique per request — reusing one will cause an error.

<Note>
  If the requested username is already taken, the error response includes **alternative name suggestions** you can present to the user.
</Note>

## Step 3: Verify the email address

The Neuron sends a verification code to the email address provided. The account cannot be used until it is verified. Submit the code:

```http theme={null}
POST /Agent/Account/VerifyEMail
Content-Type: application/json

{
  "eMail": "user@example.com",
  "code": "<verification code>"
}
```

A successful response enables the account.

<Warning>
  Too many failed verification attempts will trigger a temporary — and eventually permanent — block on the calling endpoint. Build retry logic with appropriate backoff.
</Warning>

## Step 4: Log in

Once verified, exchange credentials for a JWT using the same HMAC signing pattern:

```http theme={null}
POST /Agent/Account/Login
Content-Type: application/json

{
  "userName": "myaccount",
  "nonce": "<unique nonce>",
  "signature": "<HMAC signature>",
  "seconds": 3600
}
```

Store the returned JWT and use it in the `Authorization: Bearer {token}` header for all subsequent requests.

## Keeping the session alive

Tokens are valid for up to 3600 seconds. Refresh before expiry:

```http theme={null}
POST /Agent/Account/Refresh
Authorization: Bearer {token}
```

## Common pitfalls

* The `nonce` must be unique for every signing call — never reuse one.
* The `host` used in the HMAC signature must exactly match the Neuron domain.
* An unverified account returns errors on most endpoints.

## Next steps

* [Creating cryptographic keys](/neuron-api/guides/creating-cryptographic-keys) — required before applying for a Legal Identity.
* [Applying for a Legal Identity](/neuron-api/guides/applying-for-a-legal-identity) — create a verified digital identity on the account.
