Skip to Content
NutriBack API
v1.0
The API endpoints and descriptions of the NutriBack API

Account

2
GET/account
Get current user account details
Retrieves the account information of the currently authenticated user

Responses

PATCH/account
Update current user account details
Updates the account information of the currently authenticated user

Request Body

$ref: #/components/schemas/UpdateAccountDto

Responses

Authentication

2
POST/auth/login
User Authentication
Authenticates user credentials and returns a JWT token upon successful login. The token should be included in subsequent requests as a Bearer token in the Authorization header.

Responses

POST/auth/register
User Registration
Creates a new user account after validating email and username uniqueness. The password must meet strong password requirements, and the username must follow specific constraints.

Request Body

$ref: #/components/schemas/RegisterDto

Responses

Dietary Plan

9
GET/dietary-plan/target
Get caloric target
Retrieves the user's daily caloric target and current progress

Responses

GET/dietary-plan/log
Get calorie logs
Retrieves all caloric intake logs for the current user

Responses

POST/dietary-plan/log
Log calories
Records a new caloric intake entry

Request Body

$ref: #/components/schemas/LogCaloriesDto

Responses

POST/dietary-plan/log/recipe/{id}
Log recipe calories
Records caloric intake from a specific recipe

Parameters

idpathrequired
Type: string

Responses

POST/dietary-plan
Create dietary plan
Creates a new dietary plan with specified caloric targets and preferences

Request Body

$ref: #/components/schemas/CreateDietaryPlanDto

Responses

GET/dietary-plan
Get all dietary plans
Retrieves all dietary plans for the current user

Responses

GET/dietary-plan/{id}
Get specific dietary plan
Retrieves a specific dietary plan by ID

Parameters

idpathrequired
Type: string

Responses

PATCH/dietary-plan/{id}
Update dietary plan
Updates an existing dietary plan

Parameters

idpathrequired
Type: string

Request Body

$ref: #/components/schemas/UpdateDietaryPlanDto

Responses

DELETE/dietary-plan/{id}
Delete dietary plan
Removes a dietary plan by ID

Parameters

idpathrequired
Type: string

Responses

Recipes

9
POST/recipe
Create a new recipe
Creates a new recipe with the provided details including ingredients, instructions, and nutritional information

Request Body

$ref: #/components/schemas/CreateRecipeDto

Responses

GET/recipe
Get all recipes
Retrieves a list of all available recipes

Responses

POST/recipe/search
Search recipes
Search recipes using various criteria with cursor-based pagination

Parameters

cursorquery

Pagination cursor

Type: string

Request Body

$ref: #/components/schemas/SearchRecipeDto

Responses

GET/recipe/recommend
Get recommended recipes
Retrieves personalized recipe recommendations based on user preferences and history

Responses

GET/recipe/liked
Get liked recipes
Retrieves all recipes liked by the current user with pagination

Parameters

cursorquery

Pagination cursor

Type: string

Responses

GET/recipe/featured
Get featured recipes
Retrieves a curated list of featured recipes

Responses

GET/recipe/{id}
Get recipe by ID
Retrieves detailed information about a specific recipe

Parameters

idpathrequired

Recipe ID

Type: string

Responses

PATCH/recipe/{id}
Update recipe
Updates an existing recipe with new information

Parameters

idpathrequired

Recipe ID

Type: string

Request Body

$ref: #/components/schemas/UpdateRecipeDto

Responses

DELETE/recipe/{id}
Delete recipe
Removes a recipe from the system

Parameters

idpathrequired

Recipe ID

Type: string

Responses

Posts

4
POST/post
Create a new post
Creates a new post with the provided content and associates it with a recipe

Request Body

$ref: #/components/schemas/CreatePostDto

Responses

GET/post
Get multiple posts
Retrieves a paginated list of posts using cursor-based pagination

Responses

PATCH/post/{id}
Update a post
Updates an existing post with the provided content

Parameters

idpathrequired
Type: string

Request Body

$ref: #/components/schemas/UpdatePostDto

Responses

DELETE/post/{id}
Delete a post
Removes a post by its ID

Parameters

idpathrequired
Type: string

Responses

Recipe Likes

2
POST/recipe/{id}/like
Like a recipe
Adds the current user to the list of users who liked the specified recipe

Parameters

idpathrequired

Recipe ID

Type: string

Responses

DELETE/recipe/{id}/like
Unlike a recipe
Removes the current user from the list of users who liked the specified recipe

Parameters

idpathrequired

Recipe ID

Type: string

Responses

Post Likes

2
POST/post/{id}/like
Like a post
Adds a like to the specified post for the currently authenticated user. If the user has already liked the post, the request will be ignored.

Parameters

idpathrequired

The ID of the post to like

Type: string

Responses

DELETE/post/{id}/like
Unlike a post
Removes the like from the specified post for the currently authenticated user. If the user has not liked the post, the request will be ignored.

Parameters

idpathrequired

The ID of the post to unlike

Type: string

Responses

Preferences

2
GET/preferences
Get user preferences
Retrieves the dietary restrictions, nutrition goals, and allergen information for the currently authenticated user

Responses

PATCH/preferences
Update user preferences
Updates the dietary restrictions, nutrition goals, and allergen information for the currently authenticated user

Request Body

$ref: #/components/schemas/UpdatePreferenceDto

Responses

User

1
GET/user/{id}
Get user by ID
Retrieves detailed user information based on the provided user ID. This endpoint returns user details including profile information and account status.

Parameters

idpathrequired

Unique identifier of the user

Type: string

Responses

User Following

2
POST/user/{id}/follow
Follow a user
Creates a following relationship between the authenticated user and the target user

Parameters

idpathrequired

ID of the user to follow

Type: string

Responses

DELETE/user/{id}/follow
Unfollow a user
Removes the following relationship between the authenticated user and the target user

Parameters

idpathrequired

ID of the user to unfollow

Type: string

Responses

Intelligence

3
POST/intelligence/scan-to-create
Generate recipe from food image
Analyzes a food image and generates a complete recipe including ingredients, instructions, and nutritional information

Request Body

$ref: #/components/schemas/ScanToCreateDto

Responses

POST/intelligence/scan-to-log
Log meal from food image
Analyzes a food image to estimate nutritional content and logs it as a meal

Request Body

$ref: #/components/schemas/ScanToLogDto

Responses

POST/intelligence/modify-recipe/{id}
Modify existing recipe
Modifies an existing recipe based on dietary preferences, restrictions, or portion size

Parameters

idpathrequired
Type: string

Request Body

$ref: #/components/schemas/ModifyRecipeDto

Responses

Chat

8
POST/intelligence/chat
No summary

Request Body

$ref: #/components/schemas/MessageDto

Responses

GET/intelligence/chat
No summary

Responses

POST/intelligence/chat/{id}
No summary

Parameters

idpathrequired
Type: string

Request Body

$ref: #/components/schemas/MessageDto

Responses

GET/intelligence/chat/{id}
No summary

Parameters

idpathrequired
Type: string

Responses

DELETE/intelligence/chat/{id}
No summary

Parameters

idpathrequired
Type: string

Responses

PATCH/intelligence/chat/regenerate/{id}
No summary

Parameters

idpathrequired
Type: string

Responses

PATCH/intelligence/chat/edit/{id}
No summary

Parameters

idpathrequired
Type: string

Request Body

$ref: #/components/schemas/MessageDto

Responses

PATCH/intelligence/chat/rename/{id}
No summary

Parameters

idpathrequired
Type: string

Request Body

$ref: #/components/schemas/RenameChatDto

Responses

Last updated on