This directory contains comprehensive documentation for all @frappe.whitelist decorated functions in the Frappe Framework. These functions form the public API surface that can be called from client-side JavaScript or external systems.
The Frappe Framework uses the @frappe.whitelist decorator to expose Python functions as API endpoints. These functions handle various business operations, from basic CRUD operations to complex workflows.
The documentation is organized by functional areas:
- Core Framework Functions - Authentication, sessions, real-time updates
- Document Management - Document operations, sharing, workflows
- Printing System - Print formats, PDF generation, network printing
- File Management - File uploads, downloads, attachments
- User Interface - Search, global search, user settings
- Contact Management - Contacts, addresses, vCard operations
- Utilities - CSV operations, backups, change logs
- System Administration - Permissions, modules, imports
- Social Features - Energy points, reviews, gamification
- Communication - SMS, push notifications, translations
All whitelist functions follow these security patterns:
- Authentication: Functions require login by default unless
allow_guest=True - Permission Validation: Most functions validate user permissions before execution
- Input Sanitization: Parameters are validated and sanitized
- HTTP Method Restrictions: Some functions restrict allowed HTTP methods
@frappe.whitelist()- Requires authenticated user@frappe.whitelist(allow_guest=True)- Allows unauthenticated access@frappe.whitelist(methods=["POST"])- Restricts to specific HTTP methods@frappe.validate_and_sanitize_search_inputs- Validates search parameters
Functions can be called from client-side JavaScript:
// Call a whitelist function
frappe.call({
method: 'frappe.share.add',
args: {
doctype: 'Task',
name: 'TASK-001',
user: '[email protected]',
read: 1,
write: 1
}
});Or via REST API:
curl -X POST "https://yoursite.com/api/method/frappe.share.add" \
-H "Authorization: token api_key:api_secret" \
-d "doctype=Task&name=TASK-001&[email protected]&read=1"Total whitelist functions found: 150+ across 46 files
- Document Management: ~40 functions
- Printing System: ~25 functions
- User Interface: ~20 functions
- File Management: ~15 functions
- Core Framework: ~15 functions
- Contact Management: ~10 functions
- System Administration: ~10 functions
- Social Features: ~8 functions
- Utilities: ~5 functions
- Communication: ~5 functions
See individual documentation files for detailed function specifications, parameters, return values, and usage examples.