Reference Data API
Countries, categories, and lookup values
1 min readStatic lookup data for building forms and filters. Retrieve lists of countries with codes and names, project categories and subcategories, industry classifications, and other enumerated values. Data is cached and rarely changes, suitable for client-side caching.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /api/user/data/categories | Get list of categories |
GET | /api/user/data/countries | Get list of countries |
Endpoints
GET
/api/user/data/categoriesGet list of categories
Retrieve the list of available project categories for form dropdowns.
None (public)
Request
curl -X GET "http://localhost:3030/api/user/data/categories" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/data/categories", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Response 200
Categories retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": [
{
"id": "507f1f77bcf86cd799439011",
"name": "Technology",
"slug": "technology",
"description": "Technology and software companies",
"icon": "laptop",
"parentId": null
}
]
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}GET
/api/user/data/countriesGet list of countries
Retrieve the list of available countries for form dropdowns.
None (public)
Request
curl -X GET "http://localhost:3030/api/user/data/countries" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"const response = await fetch("http://localhost:3030/api/user/data/countries", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);Response 200
Countries retrieved successfully
{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": [
{
"id": "507f1f77bcf86cd799439011",
"name": "United States",
"code": "US",
"slug": "united-states",
"flag": "https://flags.example.com/us.svg"
}
]
}Error Responses
401— Unauthorized - Invalid or missing authentication
{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}403— Forbidden - Insufficient permissions
{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}