Obtain legal documents
GET/company/settings/legal
Returns the available legal documents in the specified language.
Purpose:
- Provide centralized access to the platform's legal documents
- Support for multiple languages (Spanish and English)
- Ensure users access the correct version of the documents
Use Cases:
- Display terms and conditions during registration
- Display privacy policy in the settings area
- Centralized update of legal documents
- Compliance with transparency regulations
Typical Flow:
- The client calls the endpoint specifying the preferred language
- The server validates the JWT token
- Searches for the legal documents in the requested language
- Returns the active documents (visible=true)
- The client displays the documents to the user
Considerations:
- By default returns documents in Spanish (es)
- Only returns documents marked as visible (visible=true)
- Documents include:
- Terms and Conditions
- Privacy Policy
- Cookie Policy
- Requires valid JWT authentication
Implementation Example:
// Example consumption from frontend
async function getLegalDocuments(lang = 'es') {
try {
const response = await fetch(`/company/settings/legal?lang=${lang}`, {
headers: {
'Authorization': `Bearer ${userToken}`
}
});
const documents = await response.json();
renderLegalDocuments(documents);
} catch (error) {
console.error('Error fetching legal documents:', error);
}
}
Request
Responses
- 200
- 401
- 404
- 500
Legal documents obtained
Unauthorized - Invalid or missing JWT token
No legal documents were found for the specified language.
Internal Server Error