Prepare Auth Requests
Prepare signer-neutral Namefi API requests using live authentication helpers
Keep request preparation separate from wallet signing. Resolve the operation's method, URL, parameters and authentication requirements from the current OpenAPI reference and authentication overview. A global security declaration alone does not identify every operation's effective authentication mode.
| Operation mode | Preparation |
|---|---|
none | Build the anonymous request from its input schema. |
siwe-optional | Use the anonymous request when appropriate, or prepare a SIWE session for authenticated behavior. |
siwe-required | Obtain and verify a SIWE message, then attach the returned session token. |
eip712 | Fetch the operation's live typed-data definition and sign a fresh envelope. |
SIWE requests
- Fetch
GET /v4/siwe/allowed-chainsand choose an allowed chain. - Get a nonce for the signer from
GET /v4/siwe/nonce. - Pass the signer, nonce and chain to
GET /v4/siwe/message. - Have the wallet sign the returned
messageStringusing ERC-191personal_sign. - Send the structured message and signature to
POST /v4/siwe/verify. - Attach the returned token as
x-namefi-siwe-tokento the protected request.
Preserve the returned message exactly. Preparation does not prove wallet access; verification must succeed before treating the session as authenticated. The SIWE guide contains request and response examples.
EIP-712 requests
- Send the normal operation body with
$metadata.authcontainingmethod: "eip712",mode: "typed-data", the wallet account and the server's configured account-authentication chain ID. A different chain returns 400; it is never silently replaced. - Read the HTTP 401 response's signing requirements, including the validated chain and canonical API audience; no action has run.
- Have the wallet sign the returned typed data exactly.
- Retry the same operation body with the returned nonce and timestamp and
the signature in
$metadata.auth.
mode: "payload" is a compatibility alias. This flow has no stored challenge or
challenge ID. Inspect the action before signing; the
EIP-712 guide includes the request format and the
separate legacy /v-next envelope.
SDK and agent options
@namefi/api-client handles signing and SIWE bootstrapping when configured with
its EIP-712 signer. For API-key REST helpers or an MCP-capable client, see the
current namefi-skills repository:
skills/namefi-domain-api contains curl scripts and skills/namefi-mcp describes
the MCP connection.