Skip to main content
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

Overview

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:
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:
signature = BASE64( HMAC-SHA256(secret, nonce) )
Then call:
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.
If the requested username is already taken, the error response includes alternative name suggestions you can present to the user.

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:
POST /Agent/Account/VerifyEMail
Content-Type: application/json

{
  "eMail": "user@example.com",
  "code": "<verification code>"
}
A successful response enables the account.
Too many failed verification attempts will trigger a temporary — and eventually permanent — block on the calling endpoint. Build retry logic with appropriate backoff.

Step 4: Log in

Once verified, exchange credentials for a JWT using the same HMAC signing pattern:
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:
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