Skip to main content
POST
Create Key

Key identifier

The caller chooses id. A successful response returns storage timestamps, not a newly generated key identifier. Persist the submitted id; later operations call it keyId.

Signature construction

Let s1 = username + ":" + HTTP-Host + ":" + localName + ":" + namespace + ":" + id.
  • keySignature = Base64(HMAC-SHA256(UTF8(keyPassword), UTF8(s1)))
  • Generate at least 32 random bytes and Base64-encode them as nonce.
  • Let s2 = s1 + ":" + keySignature + ":" + nonce.
  • requestSignature = Base64(HMAC-SHA256(UTF8(accountPassword), UTF8(s2)))
Use the exact HTTP Host header value, including a non-default port. String order and casing are significant. Never reuse a nonce. See the copy-paste key guide for JavaScript.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Referer
string<uri>
required

Your application's HTTPS URL, for example https://app.example.com/. Include this header on every Agent API request, including backend calls, login, and account creation. Browser clients must use a referrer policy that sends the application origin. See /neuron-api/api-basics#required-referer-header.

Body

application/json
localName
string
required

Algorithm local name returned by GetAlgorithms.

namespace
string
required

Algorithm namespace returned by GetAlgorithms.

id
string
required

Caller-chosen key identifier. Persist this value as the keyId used by later operations.

nonce
string
required

Unique random string of at least 32 characters. The maintained client uses Base64 of 32 random bytes.

Minimum string length: 32
keySignature
string
required

Base64-encoded HMAC-SHA256 over the documented key message, keyed by the key password.

requestSignature
string
required

Base64-encoded HMAC-SHA256 over the documented request message, keyed by the account password.

Response

200 - application/json

Success

created
string<date-time>
required
updated
string<date-time>
required