Skip to main content
POST
Sign Contract

Signature construction

Let s1 = username + ":" + HTTP-Host + ":" + localName + ":" + namespace + ":" + keyId, using the algorithm stored with the key.
  • 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 + ":" + legalId + ":" + contractId + ":" + role.
  • requestSignature = Base64(HMAC-SHA256(UTF8(accountPassword), UTF8(s2)))
Use the exact HTTP Host header value, including a non-default port. Preserve the documented field order and exact casing. Never reuse a nonce. The Neuron then decrypts the stored private key, signs the normalized contract bytes, and returns the updated Contract object. See the contract lifecycle guide for a JavaScript implementation.

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
keyId
string
required

The caller-chosen id submitted to CreateKey and associated with this approved Legal Identity.

Approved Legal Identity owned by the authenticated account.

contractId
string
required

Contract to sign.

role
string
required

Exact role name assigned to this Legal Identity in the contract.

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 contract-signing request message, keyed by the account password.

Response

200 - application/json

Success

Contract
object
required