GET/api/v1/chargeback/export

Export chargeback report as CSV or HTML

Auditor / finance-team export of chargeback data scoped to a project, date range, and groupBy axis. CSV is RFC-4180 quoted with Excel formula-byte sanitization and an `attachment` Content-Disposition. HTML is a print-optimized auditor report (auditors print → "Save as PDF" — same pattern as DPIA / SOC 2 attestation exports). Org-scoped via the `projectId` parameter. Rate limit: 5/min. Audit-logged.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/api-keys.

Parameters

projectId in queryrequired

Project ID — caller must be a member of the project's organization.

string
format in query

Output format. csv = downloadable CSV with attachment disposition; html = printable inline HTML.

string
startDate in query

ISO 8601 date (YYYY-MM-DD). Defaults to 30 days ago. Inverted ranges (end < start) get swapped defensively rather than 400-ing.

string
endDate in query

ISO 8601 date (YYYY-MM-DD). Defaults to today. Future dates clamp to today.

string
groupBy in query

Aggregation axis. Whitelisted to prevent reflected SQL via dynamic column names.

string

Response

All status codes

200CSV or HTML body. Content-Type matches the requested format; Content-Disposition includes a date-stamped filename.
400(no description)
401(no description)
403Forbidden — caller is not a member of the project's organization.
429(no description)
500Internal DB error (with masked message — no RLS internals leaked).

Code samples

cURL

curl -X GET \
  https://evalguard.ai/api/v1/chargeback/export \
  -H "Authorization: Bearer $EVALGUARD_API_KEY" \

TypeScript

import { EvalGuard } from "@evalguard/sdk";

const client = new EvalGuard({ apiKey: process.env.EVALGUARD_API_KEY });

const response = await client.request({
  method: "GET",
  path: "/api/v1/chargeback/export",
});
console.log(response);

Python

from evalguard import EvalGuard
import os

client = EvalGuard(api_key=os.environ["EVALGUARD_API_KEY"])

response = client.request(method="GET", path="/api/v1/chargeback/export")
print(response)

Go

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/evalguard/evalguard-go"
)

func main() {
	client := evalguard.NewClient(os.Getenv("EVALGUARD_API_KEY"))
	resp, err := client.Request(context.Background(), "GET", "/api/v1/chargeback/export", nil)
	if err != nil { panic(err) }
	fmt.Println(resp)
}

Errors

400401403429500

Other Cost & FinOps endpoints