Mechanic Setu

API Reference

Review Mechanic Setu route groups, auth requirements, and response conventions.

The documented Mechanic Setu APIs are mounted under versioned route groups. Authentication APIs expose public credential endpoints plus protected current user loading. User profile APIs require a valid Bearer access token.

Base Route Groups

ModuleBase URLAuth Required
Authentication/api/v1/authMixed
User Profile/api/v1/usersYes

Authentication Endpoints

MethodPathPurpose
POST/api/v1/auth/registerRegister a customer or mechanic.
POST/api/v1/auth/loginAuthenticate with phone number and password.
POST/api/v1/auth/refresh-tokenRotate a refresh token and issue a new token pair.
POST/api/v1/auth/logoutRevoke the current refresh token.
GET/api/v1/auth/meLoad the current user from a Bearer access token.

User Profile Endpoints

MethodPathPurpose
GET/api/v1/users/meReturn the authenticated user's profile.
PATCH/api/v1/users/meUpdate the authenticated user's own profile.

Response Conventions

Successful responses use a consistent envelope:

{
  "success": true,
  "message": "Operation completed.",
  "data": {}
}

Profile responses return the public profile directly under data. Authentication responses return either data.user, data.tokens, or both.

Authorization Header

Protected endpoints require:

Authorization: Bearer <accessToken>

The access token is verified, then the user is reloaded from PostgreSQL before the request proceeds. This ensures deleted, disabled, locked, or inactive users cannot continue using old access tokens.

On this page