---
title: "Obtain a temporary auto-login URL"
method: POST
path: "/api/login_url"
tags: ["Sessions"]
---

# Obtain a temporary auto-login URL

`POST /api/login_url`

Returns a temporary URL that logs a user in without requiring them to
enter their credentials. The URL expires after `expire` seconds (default 15).
Requires `admin` or the `log_user_in` permission.

## Request body

- object
  - `username` string, email, required
  - `password` string, required
  - `i` string — Interview filename to redirect to after login.
  - `session` string — Session ID (when `i` is also provided).
  - `resume_existing` 0 | 1 — Set to 1 to resume an existing session for the interview.
  - `expire` integer — Seconds until the URL expires (default 15).
  - `url_args` object — Additional URL arguments included in the destination URL.
  - `next` string — Alternative destination path (e.g. "playground", "config") or full URL.

## Response `200`

Temporary login URL.

- string

## Other responses

- `400` — Bad request.
- `403` — Access denied or authentication failed.

---

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