> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Login REST reference

> Request fields, service registrations, QR formats, and client events for /QuickLogin

The Quick Login service uses **`POST /QuickLogin`** to register a backend or request a QR code. `GET` retrieves a QR image using the returned `src` URL. Use HTTPS on a public Neuron.

This is separate from [`/Agent/Account/QuickLogin`](/neuron-api/api-reference/authentication-and-sessions/quick-login). The browser-only request does not require an Agent API JWT.

## Request a QR code

Send JSON with `Content-Type: application/json`:

| Field             | Type             | Meaning                                                                                                      |
| ----------------- | ---------------- | ------------------------------------------------------------------------------------------------------------ |
| `mode`            | string           | `image`, `base64`, or `text`.                                                                                |
| `purpose`         | string           | Human-readable explanation displayed to the person approving.                                                |
| `serviceId`       | string           | Registered backend/session identifier, or `""` for browser-only mode.                                        |
| `tab`             | string           | Registered event tab identifier. May be empty when no browser event delivery is needed.                      |
| `agentApiTimeout` | number, optional | Requested token lifetime in seconds; enables [session-proxy mode](/quick-login/sessions#session-proxy-mode). |

The first four fields are required by the public REST guide, although `serviceId` and `tab` may be empty. Use a nonempty registered tab to receive browser results.

```json theme={null}
{
  "mode": "base64",
  "purpose": "Display my identity in Example.",
  "serviceId": "",
  "tab": "<REGISTERED_TAB_ID>"
}
```

The deployed browser client also sends optional `propertyFilter` and `attachmentFilter` strings. The public guide does not define their grammar or guarantees. Confirm these with your provider before relying on them to limit disclosed data.

## QR response formats

All three modes include `signUrl`, the URL encoded by the QR code and opened when the user clicks it on the same device.

<Tabs>
  <Tab title="Base64">
    ```json theme={null}
    {
      "base64": "<BASE64_IMAGE>",
      "contentType": "image/png",
      "width": 300,
      "height": 300,
      "signUrl": "<APP_SIGNING_URL>"
    }
    ```

    Build the image source as `data:<contentType>;base64,<base64>`. The image arrives in the POST response, with no separate image fetch.
  </Tab>

  <Tab title="Image">
    ```json theme={null}
    {
      "src": "<QR_IMAGE_URL>",
      "width": 300,
      "height": 300,
      "signUrl": "<APP_SIGNING_URL>"
    }
    ```

    Fetch the image from `src`; resolve a relative URL against the Neuron origin. Use the returned dimensions, not the illustrative values here.
  </Tab>

  <Tab title="Text">
    ```json theme={null}
    {
      "text": "<QR_BLOCK_CHARACTERS>",
      "signUrl": "<APP_SIGNING_URL>"
    }
    ```

    Render `text` in a preformatted, monospaced element preserving spaces and line breaks. Font metrics affect whether the code can be scanned.
  </Tab>
</Tabs>

Codes remain valid for five minutes. The reference client refreshes every two seconds. The QR response is not the identity result.

## Register or renew a backend

| Field       | Type                 | Meaning                                                              |
| ----------- | -------------------- | -------------------------------------------------------------------- |
| `service`   | string               | HTTPS callback URL.                                                  |
| `sessionId` | string               | Opaque identifier generated by your backend for the pending attempt. |
| `serviceId` | string, renewal only | Existing service registration to extend before it expires.           |

Both registration and renewal return `{"serviceId":"..."}`. Registrations last five minutes, and renewal restarts that lifetime. See the [backend guide](/quick-login/backend).

## Client events

Connect to `wss://<NEURON_HOST>/ClientEventsWS` using WebSocket subprotocol `ls`.

| Direction                           | Payload                                                                       |
| ----------------------------------- | ----------------------------------------------------------------------------- |
| Client to Neuron                    | `{"cmd":"Register","tabId":"...","location":"https://app.example.com/login"}` |
| Client to Neuron, every ten seconds | `{"cmd":"Ping"}`                                                              |
| Client to Neuron, on teardown       | `{"cmd":"Unregister"}`                                                        |
| Neuron to browser-only client       | `{"type":"SignatureReceived","data":{...}}`                                   |
| Neuron to backend-mode client       | `{"type":"SignatureReceivedBE","data":""}`                                    |

The reference `Events.js` also supports a long-poll fallback through `/ClientEvents`. Custom clients should follow the transport supported by their deployment. Do not evaluate arbitrary event names as JavaScript; explicitly handle expected events.

For payload fields, see [identity responses](/quick-login/identity-response). For failures, see [troubleshooting](/quick-login/troubleshooting); the public guide does not provide a complete HTTP error catalog.

Sources: [Quick Login REST guide](https://eu.quicklog.in/QuickLogin.md#restApi), [deployed QR client](https://eu.quicklog.in/QuickLogin.js), and [deployed event client](https://eu.quicklog.in/Events.js).
