---
title: "Debug Login"
method: POST
path: "/api/v1/auth/debug-login"
tags: ["auth"]
---

# Debug Login

`POST /api/v1/auth/debug-login`

Passwordless login for E2E tests.

Gated by two explicit opt-in flags, both required:
- ``DEBUG=True``
- ``ENABLE_DEBUG_LOGIN=True`` (separate flag, never default-on)

These flags must never be set in production. The double opt-in is the
security gate; no additional IP restriction is applied so that tests
running against a Docker-hosted backend also work.

## Request body

- LoginRequest — Login request with username, password, and optional tenant.
  - `username` string, required
  - `password` string, required
  - `tenant` string, nullable — Tenant slug or numeric ID

## Response `200`

Successful Response

- TokenResponse — JWT token pair response returned on login and refresh.
  - `access_token` string, required
  - `refresh_token` string, required
  - `token_type` string
  - `expires_in` integer, required
  - `is_first_login` boolean

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/ninjavan/apis/salesforce-sales-cloud-replacement.md) · [All operations](https://skmtc.net/ninjavan/apis/salesforce-sales-cloud-replacement/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ninjavan/salesforce-sales-cloud-replacement/revisions/fd3a41a6260b/schema)
