---
title: "Prepare a SIWE message"
method: GET
path: "/siwe/message"
tags: ["auth", "siwe"]
---

# Prepare a SIWE message

`GET /siwe/message`

## Request

- Base URL: `https://api.namefi.io/v-next`
- URL: `https://api.namefi.io/v-next/siwe/message`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Verify that a previously issued nonce still exists and return the canonical SIWE message payload to sign.

## Query parameters

- `signerAddress` string, required: Wallet address that will sign the SIWE message.
- `nonce` string, required: Nonce previously issued by the server for this signer.
- `chainId` integer: Optional EIP-155 chain ID to bind the SIWE session to.

## Headers

- `x-namefi-eip7702-account` string
- `x-namefi-eip1271-account` string
- `x-namefi-erc1271-account` string

## Response `200`

OK

- union: Result of preparing a canonical SIWE message after verifying the nonce exists.
  - object
    - `valid` unknown, required
    - `message` object, required: Wire-format SIWE message payload with ISO timestamps.
      - `address` unknown
      - `chainId` integer, required: EIP-155 chain ID the SIWE session is bound to.
      - `domain` string, required: Domain requesting the SIWE signature.
      - `expirationTime` string, date-time: ISO 8601 timestamp for a SIWE temporal field.
      - `issuedAt` string, date-time: ISO 8601 timestamp for a SIWE temporal field.
      - `nonce` string, required: Nonce previously issued by the server for this signer.
      - `notBefore` string, date-time: ISO 8601 timestamp for a SIWE temporal field.
      - `requestId` string: Optional identifier used to correlate the SIWE request.
      - `resources` string[]: Optional resources referenced by the SIWE message.
      - `scheme` string: Optional URI scheme for the relying party.
      - `statement` string: Human-readable statement presented during signing.
      - `uri` string, uri, required: URI that is the subject of the SIWE sign-in.
      - `version` '1', required: SIWE message version.
    - `messageString` string, required: Canonical EIP-4361 message string to sign.
  - object
    - `valid` unknown, required
    - `error` string, required

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `403`: 403
- `404`: 404
- `406`: 406
- `408`: 408
- `409`: 409
- `412`: 412
- `429`: 429
- `500`: 500

---

[API](https://skmtc.dev/namefi/apis/namefi-api.md) · [All operations](https://skmtc.dev/namefi/apis/namefi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/namefi/apis/namefi-api/revisions/3c7c3ade95c9?raw)
