---
title: "Authenticate user"
method: POST
path: "/api/custom-auth/signin"
tags: ["auth"]
---

# Authenticate user

`POST /api/custom-auth/signin`

## Request

- Base URL: `https://localhost:8080`
- URL: `https://localhost:8080/api/custom-auth/signin`
- Auth: none declared

Signs in a user with email and password, returns user data with session token

## Request body

- CustomSignInDto
  - `email` string, required: User email address
  - `password` string, required: User password
  - `totpCode` string: Authenticator code, for an account with two-factor on
  - `backupCode` string: One of the account backup codes, in place of totpCode

## Response `200`

User successfully authenticated

- AuthResponseDto
  - `user` AuthUserDto, required
    - `id` string, required: User ID
    - `name` string, required: User full name
    - `email` string, required: User email address
    - `emailVerified` boolean, required: Whether email is verified
    - `firstName` string: User first name
    - `lastName` string: User last name
    - `createdAt` string, date-time, required: Account creation date
    - `updatedAt` string, date-time, required: Last update date
  - `session` AuthSessionDto, required
    - `id` string, required: Session ID
    - `token` string, required: Session token
    - `expiresAt` string, date-time, required: Token expiration date
    - `userId` string, required: User ID

## Other responses

- `401`: Invalid credentials

---

[API](https://skmtc.dev/opencase/apis/opencase-backend-api.md) · [All operations](https://skmtc.dev/opencase/apis/opencase-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/opencase/apis/opencase-backend-api/revisions/f16c77cfd9a8?raw)
