frappe-syntax-whitelisted
Installation
SKILL.md
Frappe Syntax: Whitelisted Methods
Whitelisted methods expose Python functions as HTTP API endpoints via /api/method/.
Quick Reference
import frappe
from frappe import _
# Authenticated endpoint (default)
@frappe.whitelist()
def get_customer_summary(customer):
frappe.has_permission("Customer", "read", throw=True)
return frappe.get_doc("Customer", customer).as_dict()
# Public endpoint — ALWAYS validate input thoroughly
@frappe.whitelist(allow_guest=True, methods=["POST"])
def submit_contact(name, email, message):
if not name or not email:
Related skills