/api/v1/traces/{traceId}/attachments/{attachmentId}Get a trace attachment
Returns one span attachment. `?projectId` is REQUIRED (400 MISSING_PROJECT_ID) and the lookup is scoped to project + trace + attachment id (404 NOT_FOUND otherwise). By default the stored bytes are returned with the row's mime_type so the trace UI can render them directly; only the safe-inline set (bitmap images, audio, video, PDF) is served `Content-Disposition: inline` — anything else is forced to `application/octet-stream` as a download, with `X-Content-Type-Options: nosniff` and a `default-src 'none'; sandbox` CSP. Attachments held in object storage answer 302 to their storage URL instead. Add `?json=1` to get the attachment metadata plus the inline base64 payload as JSON.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
traceId in pathrequiredstringattachmentId in pathrequiredstringResponse
All status codes
Code samples
cURL
# {traceId}, {attachmentId} are shown with EXAMPLE values — replace them with real values.
curl -X GET \
https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000/attachments/00000000-0000-0000-0000-000000000000 \
-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:
// {traceId}, {attachmentId} are shown with EXAMPLE values — replace them with real values.
const res = await fetch("https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000/attachments/00000000-0000-0000-0000-000000000000", {
method: "GET",
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:
# {traceId}, {attachmentId} are shown with EXAMPLE values — replace them with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("GET", "https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000/attachments/00000000-0000-0000-0000-000000000000", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
// {traceId}, {attachmentId} are shown with EXAMPLE values — replace them with real values.
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "GET", "https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000/attachments/00000000-0000-0000-0000-000000000000", 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)
}