---
title: "Authenticate a user"
method: POST
path: "/auth/login"
tags: ["auth"]
---

# Authenticate a user

`POST /auth/login`

## Request body

- object
  - `email` string, required
  - `password` string, required

## Response `200`

User login successfully

- object
  - `status` string — success response
  - `status_code` integer — HTTP status Code response
  - `message` string
  - `data` UserSchema — Object describing the user related to the issued access and refresh tokens.
    - `first_name` string — firstname of the user
    - `last_name` string — lastname of the user
    - `role` integer — User's role type (superadmin or user)
    - `email` string — User's primary contact email.
    - `phone` string, phone — User's primary contact phone number.
    - `username` string — Last updated time
    - `created_at` string, date-time — Time of registration
    - `updated_at` string, date-time — Last updated time
    - `access_token` string — A valid JWT that will expire in `expires_in` seconds.
    - `expires_at` string, date-time — UNIX timestamp after which the `access_token` should be renewed by using the refresh token with the `refresh_token` grant type.

## Other responses

- `401` — Unauthorized
- `422` — Unprocessed Entity

---

[API](https://skmtc.net/hngprojects/apis/kimiko-golang-swagger.md) · [All operations](https://skmtc.net/hngprojects/apis/kimiko-golang-swagger/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hngprojects/kimiko-golang-swagger/revisions/2d1d3ed96bb9/schema)
