---
title: POST /api/v1/auth/login
description: Login
locale: en
version: 0.2.0
canonical: https://enterium-developer-docs.pages.dev/developers/api/auth/post-auth-login/
---

> Documentation index: https://enterium-developer-docs.pages.dev/developers/llms.txt — every page of this portal has a Markdown twin at <route>.md; the frozen API contract is at https://enterium-developer-docs.pages.dev/developers/api/openapi.json.

:::note
Generated from the OpenAPI contract — do not edit by hand. Interactive explorer with full schemas: [https://entherium.duckdns.org:8443/reference](https://entherium.duckdns.org:8443/reference); frozen spec for this build: [openapi.json](/developers/api/openapi.json). Group: [auth](../).
:::

Login

OAuth2 password flow. `username` field is the user's email.

**Auth:** no token required

## Request

```sh
curl -sS -X POST "https://entherium.duckdns.org:8443/api/v1/auth/login" \
  --data-urlencode "client_id=<client_id>" \
  --data-urlencode "client_secret=<client_secret>" \
  --data-urlencode "grant_type=<grant_type>" \
  --data-urlencode "password=<password>" \
  --data-urlencode "scope=<scope>" \
  --data-urlencode "username=<username>"
```

## Response `200`

The contract carries no example for this response; schema: `TokenPair`. Field-level shape: [interactive explorer](https://entherium.duckdns.org:8443/reference).

## Returns

`TokenPair` — Successful Response

| Field | Type | Description |
| --- | --- | --- |
| `access_token` | `string` |  |
| `expires_in` | `integer` |  |
| `refresh_token` | `string` |  |
| `token_type` | `string` (opt.) |  |

## Parameters

| Parameter | In | Required | Type | Default | Constraints | Description |
| --- | --- | --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | no | `string` | — | uuid | Optional. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `client_id` | `string \| null` | no |  |
| `client_secret` | `string \| null` | no |  |
| `grant_type` | `string \| null` | no |  |
| `password` | `string` | yes |  |
| `scope` | `string` | no |  |
| `username` | `string` | yes |  |

## Errors

| Code | Meaning | Body |
| --- | --- | --- |
| `422` | Validation Error | `HTTPValidationError` |

Every error body is `{detail, code?, request_id, doc_url}` — `request_id` is the value to quote, `doc_url` points at the [Errors reference](../../../reference/errors/).
