Authentication

Login user

AuthPublic
GroupAuthentication
Rate limitSee Rate Limits
POST/api/auth/login

SDK setup

Create a client instance. No authentication is required for this endpoint.

import { Configuration, AuthenticationApi } from 'mudbase-sdk';

const configuration = new Configuration({
  basePath: 'https://cloud.mudbase.dev',
});

const authentication = new AuthenticationApi(configuration);
import { Configuration, AuthenticationApi } from 'mudbase-sdk';

const configuration = new Configuration({
  basePath: 'https://cloud.mudbase.dev',
});

const authentication = new AuthenticationApi(configuration);

Example request

Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.

const { data: result } = await authentication.loginUser(
  {
    email: "esperanza37@northwind.dev",
    password: "Str0ng_Sample_Pass!w0rd"
  }
);
const { data: result } = await authentication.loginUser(
  {
    email: "esperanza37@northwind.dev",
    password: "Str0ng_Sample_Pass!w0rd"
  }
);

Playground

live

Test this endpoint with your own credentials. Your requests will be sent to the live API.

No Request Yet

Send a request to see the full inspector

Authentication

Public — No Auth Required

Request Body

json
{
  "email": "john.doe@mudbase.dev",
  "password": "SecurePass123!"
}
{
  "email": "john.doe@mudbase.dev",
  "password": "SecurePass123!"
}

Responses

200Login successful
json
{
  "message": "Login successful",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 1800,
  "user": {
    "_id": "685acbe0e129932fbb7a0fc2",
    "email": "john.doe@mudbase.dev",
    "firstName": "John",
    "lastName": "Doe",
    "role": "owner",
    "emailVerified": true,
    "twoFactorEnabled": false,
    "org": {
      "_id": "685acbe0e129932fbb7a0fc3",
      "name": "Mudbase",
      "slug": "mudbase"
    }
  }
}
{
  "message": "Login successful",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 1800,
  "user": {
    "_id": "685acbe0e129932fbb7a0fc2",
    "email": "john.doe@mudbase.dev",
    "firstName": "John",
    "lastName": "Doe",
    "role": "owner",
    "emailVerified": true,
    "twoFactorEnabled": false,
    "org": {
      "_id": "685acbe0e129932fbb7a0fc3",
      "name": "Mudbase",
      "slug": "mudbase"
    }
  }
}
401

Errors

CodeMeaning
401
Edit this page on GitHub