---
title: "Login and receive access/refresh tokens"
method: POST
path: "/auth/login"
tags: ["Auth"]
---

# Login and receive access/refresh tokens

`POST /auth/login`

## Request

- Base URL: `https://dummyjson.com`
- URL: `https://dummyjson.com/auth/login`
- Auth: none required

## Request body

- object
  - `username` string, required
  - `password` string, required
  - `expiresInMins` integer

## Response `200`

Login success

- LoginResponse
  - `id` integer
  - `username` string
  - `email` string
  - `firstName` string
  - `lastName` string
  - `gender` string
  - `image` string
  - `accessToken` string
  - `refreshToken` string

## Other responses

- `400`: Error

---

[API](https://skmtc.dev/dummyjson/apis/dummyjson-api.md) - [All operations](https://skmtc.dev/dummyjson/apis/dummyjson-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dummyjson/apis/dummyjson-api/revisions/5e704f33a559?raw)
