Skip to main content

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:

  1. The client calls the endpoint specifying the preferred language
  2. The server validates the JWT token
  3. Searches for the legal documents in the requested language
  4. Returns the active documents (visible=true)
  5. 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

Legal documents obtained