Skip to content

Commit 59931a0

Browse files
Add plan approval endpoint with detailed request and response specifications
1 parent 83200f8 commit 59931a0

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/backend/v3/api/router.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,54 @@ async def run_orchestration_task():
337337

338338
@app_v3.post("/plan_approval")
339339
async def plan_approval(human_feedback: messages.PlanApprovalResponse, request: Request):
340+
"""
341+
Endpoint to receive plan approval or rejection from the user.
342+
---
343+
tags:
344+
- Plans
345+
parameters:
346+
- name: user_principal_id
347+
in: header
348+
type: string
349+
required: true
350+
description: User ID extracted from the authentication header
351+
requestBody:
352+
description: Plan approval payload
353+
required: true
354+
content:
355+
application/json:
356+
schema:
357+
type: object
358+
properties:
359+
m_plan_id:
360+
type: string
361+
description: The internal m_plan id for the plan (required)
362+
approved:
363+
type: boolean
364+
description: Whether the plan is approved (true) or rejected (false)
365+
feedback:
366+
type: string
367+
description: Optional feedback or comment from the user
368+
plan_id:
369+
type: string
370+
description: Optional user-facing plan_id
371+
responses:
372+
200:
373+
description: Approval recorded successfully
374+
content:
375+
application/json:
376+
schema:
377+
type: object
378+
properties:
379+
status:
380+
type: string
381+
401:
382+
description: Missing or invalid user information
383+
404:
384+
description: No active plan found for approval
385+
500:
386+
description: Internal server error
387+
"""
340388
authenticated_user = get_authenticated_user_details(request_headers=request.headers)
341389
user_id = authenticated_user["user_principal_id"]
342390
if not user_id:

0 commit comments

Comments
 (0)