Registers a new user.
Request Body:
email(string, required): The user's email address.password(string, required): The user's password (must be at least 8 characters long).role(string, optional): The user's role. Can be either "admin" or "user". Defaults to "user".
Example Request:
{
"email": "[email protected]",
"password": "password123",
"role": "user"
}Logs in a user.
Request Body:
email(string, required): The user's email address.password(string, required): The user's password.
Example Request:
{
"email": "[email protected]",
"password": "password123"
}Response:
- Sets
accessTokenandrefreshTokenas cookies.
Refreshes an access token.
Request:
- Requires a valid
refreshTokento be sent as a cookie.
Response:
- Sets a new
accessTokenas a cookie.
Logs out a user.
Request:
- Requires a valid
accessTokento be sent as a cookie.
Gets the currently logged-in user's information.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminanduserroles.
Updates the currently logged-in user's information.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminanduserroles.
Request Body:
username(string, optional): The user's new username.email(string, optional): The user's new email address.password(string, optional): The user's new password (must be at least 8 characters long).first_name(string, optional): The user's first name.last_name(string, optional): The user's last name.website(string, optional): The user's website URL.facebook(string, optional): The user's Facebook profile URL.instagram(string, optional): The user's Instagram profile URL.linkedin(string, optional): The user's LinkedIn profile URL.x(string, optional): The user's X (formerly Twitter) profile URL.youtube(string, optional): The user's YouTube channel URL.
Deletes the currently logged-in user's account.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminanduserroles.
Gets a list of all users.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminrole only.
Query Parameters:
limit(integer, optional): The maximum number of users to return (1-50).offset(integer, optional): The number of users to skip.
Gets a specific user by their ID.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminrole only.
URL Parameters:
userId(string, required): The ID of the user to retrieve.
Deletes a specific user by their ID.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminrole only.
URL Parameters:
userId(string, required): The ID of the user to delete.
Creates a new blog post.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminrole only.
Request:
Content-Type:multipart/form-data
Form Data:
title(string, required): The title of the blog post.content(string, required): The content of the blog post.status(string, optional): The status of the blog post. Can be "draft" or "published". Defaults to "draft".banner_image(file, required): The banner image for the blog post.
Gets a list of all blog posts.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminanduserroles.
Query Parameters:
limit(integer, optional): The maximum number of blog posts to return (1-50).offset(integer, optional): The number of blog posts to skip.
Gets a list of all blog posts by a specific user.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminanduserroles.
URL Parameters:
userId(string, required): The ID of the user.
Query Parameters:
limit(integer, optional): The maximum number of blog posts to return (1-50).offset(integer, optional): The number of blog posts to skip.
Gets a single blog post by its slug.
Authentication:
- Requires a valid
accessTokento be sent as a cookie. - Accessible by
adminanduserroles.
URL Parameters:
slug(string, required): The slug of the blog post.