/api/v1/debug-agent/{sessionId}/applyApply debug-agent change
Marks a debug-agent session's suggested fix as applied: sets `debug_sessions.status='applied'` with `applied_at`/`applied_by` and records the optional `newPromptVersionId` and `note` into the session's context. It does NOT itself modify a prompt, model config or tool set — perform that through the prompt-versioning route and reference the resulting version id here. Requires `projectId` (query, body or API-key context) and editor role; 409 unless the session is in status `ready`; re-calling an already-applied session returns 200 with `alreadyApplied:true`. Audit-logged (action `debug_agent_apply`).
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
sessionId in pathrequiredstringResponse
200 example
{
"success": true
}All status codes
Code samples
cURL
# {sessionId} is shown with an EXAMPLE value — replace it with real values.
curl -X POST \
https://evalguard.ai/api/v1/debug-agent/00000000-0000-0000-0000-000000000000/apply \
-H "Authorization: Bearer $EVALGUARD_API_KEY"TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {sessionId} is shown with an EXAMPLE value — replace it with real values.
const res = await fetch("https://evalguard.ai/api/v1/debug-agent/00000000-0000-0000-0000-000000000000/apply", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {sessionId} is shown with an EXAMPLE value — replace it with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("POST", "https://evalguard.ai/api/v1/debug-agent/00000000-0000-0000-0000-000000000000/apply", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
// {sessionId} is shown with an EXAMPLE value — replace it with real values.
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/debug-agent/00000000-0000-0000-0000-000000000000/apply", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}