---
title: "Login"
method: POST
path: "/v1/spl/login"
---

# Login

`POST /v1/spl/login`

Verifies the wallet's signature over the challenge issued by `/v1/spl/challenge` and returns an authentication token. Pass the token as `Authorization: Bearer <token>` on `/v1/spl/private-balance` and on `/v1/spl/transfer` requests that need to connect to the Private Ephemeral Rollup.

## Request body

- object
  - `pubkey` string, required — The public key of the wallet that will read private data.
  - `challenge` string, required — The challenge string returned by `/v1/spl/challenge`.
  - `signature` string, required — The wallet's signature over the challenge string.
  - `cluster` union — Optional. Use `mainnet` for BASE_RPC_URL and EPHEMERAL_RPC_URL, `devnet` for BASE_DEVNET_RPC_URL and EPHEMERAL_DEVNET_RPC_URL, or provide a custom http(s) RPC URL to override the base RPC while keeping the configured ephemeral RPC.
    - 'mainnet' | 'devnet'
    - string
  - `mock` boolean — Optional. When `true`, the API uses a mock login flow for testing. Defaults to `false`.

## Response `200`

Authentication token

- object
  - `token` string, required — The authentication token provided by the Private Ephemeral Rollup.

## Other responses

- `403` — Signature verification failed
- `422` — Validation error
- `500` — Internal server error

---

[API](https://skmtc.dev/magicblock/apis/magicblock-router-api.md) · [All operations](https://skmtc.dev/magicblock/apis/magicblock-router-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/magicblock/magicblock-router-api/revisions/f024efa907c6/schema)
