Filament Accounts API Documentation
Introduction
This API provides authentication, user profile management, location handling, and request management functionalities for Filament Accounts.
API Endpoints
1. Authentication
Login
Endpoint:
POST /api/login
Description:
Authenticates a user and returns an access token.
Response Example:
{
"token": "your-access-token",
"user": {
"id": 1,
"name": "John Doe",
"email": "john@example.com"
}
}
Register
Endpoint:
POST /api/register
Description:
Registers a new user.
Reset Password
Endpoint:
POST /api/reset
Description:
Sends a password reset request.
Resend OTP
Endpoint:
POST /api/resend
Description:
Resends an OTP to the user.
OTP Verification
Endpoint:
POST /api/otp-check
Description:
Verifies the OTP provided by the user.
2. User Profile
Get Profile
Endpoint:
GET /api/profile
Description:
Retrieves the authenticated user's profile.
Update Profile
Endpoint:
POST /api/profile
Description:
Updates user profile details.
Change Password
Endpoint:
POST /api/profile/password
Description:
Updates the user's password.
Delete Profile
Endpoint:
DELETE /api/profile/destroy
Description:
Deletes the user's account.
Logout
Endpoint:
POST /api/profile/logout
Description:
Logs out the user and invalidates the access token.
3. Contacts
Send Contact Request
Endpoint:
POST /api/profile/contact
Description:
Sends a contact request.
4. Locations Management
Get Locations
Endpoint:
GET /api/profile/locations
Description:
Retrieves all locations associated with the user.
Create Location
Endpoint:
POST /api/profile/locations
Description:
Creates a new location.
View Location Details
Endpoint:
GET /api/profile/locations/{location}
Description:
Retrieves details of a specific location.
Update Location
Endpoint:
POST /api/profile/locations/{location}
Description:
Updates details of a specific location.
Delete Location
Endpoint:
DELETE /api/profile/locations/{location}
Description:
Deletes a specific location.
5. Request Management
Get Requests
Endpoint:
GET /api/profile/requests
Description:
Retrieves all user-related requests.
Create Request
Endpoint:
POST /api/profile/requests
Description:
Creates a new request.
View Specific Request
Endpoint:
GET /api/profile/requests/{accountRequest}
Description:
Retrieves details of a specific request.
Update Request
Endpoint:
POST /api/profile/requests/{accountRequest}
Description:
Updates a specific request.
Delete Request
Endpoint:
DELETE /api/profile/requests/{accountRequest}
Description:
Deletes a specific request.
Authentication
All API routes require authentication using Laravel Sanctum. Ensure the frontend includes a Bearer token in the request headers.
Authorization: Bearer YOUR_ACCESS_TOKEN
Conclusion
This documentation provides an overview of the Filament Accounts API, including authentication, profile management, location handling, and request management.
Would you like any modifications or additional details? 🚀