MCPcopy
hub / github.com/cursor/cookbook / POST

Function POST

sdk/agent-kanban/src/app/api/session/route.ts:17–30  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

15}
16
17export async function POST(request: Request) {
18 try {
19 const body = (await request.json().catch(() => ({}))) as SessionRequest
20 const apiKey = body.apiKey?.trim()
21
22 if (apiKey) {
23 return jsonSession(await createSession(apiKey, Boolean(body.remember)), request)
24 }
25
26 return jsonSession(await restoreSession(body.sessionId?.trim()), request)
27 } catch (error) {
28 return jsonError(error, "Failed to create an Agent Kanban session.")
29 }
30}
31
32export async function DELETE(request: Request) {
33 try {

Callers

nothing calls this directly

Calls 4

createSessionFunction · 0.90
restoreSessionFunction · 0.90
jsonErrorFunction · 0.90
jsonSessionFunction · 0.85

Tested by

no test coverage detected