Dummy JSON
  1. Auth
Dummy JSON
  • Start your journey
  • Dummy JSON
    • Auth
      • Login user and get tokens
        POST
      • Get current auth user
        GET
    • Users
      • Get all users
      • Get a single user
      • Add a new user
      • Update a user
      • Delete a user
    • Products
      • Get all products
      • Get a single product
      • Search product
      • Limit and skip product
      • Sort products
      • Get all products categories
      • Get products category list
      • Get products by a category
      • Add a new product
      • Update a product
      • Delete a product
    • Posts
      • Get all post
      • Get a single post
      • Search posts
      • Limit and skip posts
      • Sort posts
      • Get all posts tags
      • Get posts tag list
      • Get posts by a tag
      • Get all post by user id
      • Get post's comments
      • Add a new post
      • Update a post
      • Delete a post
  1. Auth

Login user and get tokens

POST
/auth/login
Last modified:2025-05-19 14:41:26
Maintainer:ekovegeance

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params multipart/form-data

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://dummyjson.com/auth/login' \
--form 'username="emilys"' \
--form 'password="emilyspass"'

Responses

🟢200OK
application/json
Body

Example
{
    "accessToken": "string",
    "refreshToken": "string",
    "id": 0,
    "username": "string",
    "email": "string",
    "firstName": "string",
    "lastName": "string",
    "gender": "string",
    "image": "string"
}
Modified at 2025-05-19 14:41:26
Previous
Auth
Next
Get current auth user
Built with