Skip to content

Commit fc15cd5

Browse files
committed
Add schema hint to /resend and reorder endpoints
Enhance GET /resend to return a helpful hint and a request schema for POST (fields: to, subject, html) and update the success message. Also reorder the root endpoints to list the prospects group first, then docs/resend/health/llm, improving discoverability of grouped endpoints.
1 parent 098ff63 commit fc15cd5

2 files changed

Lines changed: 30 additions & 7 deletions

File tree

‎app/api/resend/resend.py‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,31 @@ def root() -> dict:
1717
if not RESEND_API_KEY:
1818
meta = make_meta("error", "RESEND_API_KEY is missing from environment. Please set it in your .env file.")
1919
return {"meta": meta}
20-
meta = make_meta("success", "Resend endpoint")
21-
return {"meta": meta}
20+
meta = make_meta("success", "GET /resend endpoint")
21+
return {
22+
"meta": meta,
23+
"data": {
24+
"hint": "Use POST /resend to send an email via Resend API.",
25+
"type": {
26+
"to": {
27+
"type": "string",
28+
"format": "email",
29+
"required": True,
30+
"description": "Recipient email address."
31+
},
32+
"subject": {
33+
"type": "string",
34+
"required": True,
35+
"description": "Subject of the email."
36+
},
37+
"html": {
38+
"type": "string",
39+
"required": True,
40+
"description": "HTML content of the email."
41+
}
42+
}
43+
}
44+
}
2245

2346

2447
# POST endpoint to send email

‎app/api/root.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ def root() -> dict:
2020
"time": epoch,
2121
}
2222
endpoints = [
23-
{"name": "docs", "url": f"{base_url}/docs"},
24-
{"name": "resend", "url": f"{base_url}/resend"},
25-
{"name": "health", "url": f"{base_url}/health"},
26-
{"name": "llm", "url": f"{base_url}/llm"},
2723
{
2824
"name": "prospects",
2925
"endpoints": [
3026
{"name": "list", "url": f"{base_url}/prospects"},
3127
{"name": "flagged", "url": f"{base_url}/prospects/flagged"},
3228
]
33-
}
29+
},
30+
{"name": "docs", "url": f"{base_url}/docs"},
31+
{"name": "resend", "url": f"{base_url}/resend"},
32+
{"name": "health", "url": f"{base_url}/health"},
33+
{"name": "llm", "url": f"{base_url}/llm"},
3434
]
3535
return {"meta": meta, "data": endpoints}

0 commit comments

Comments
 (0)