Skip to main content
GET
/
v1
/
traces
/
export
Export Traces
curl --request GET \
  --url https://api.agentmark.co/v1/traces/export \
  --header 'Authorization: <api-key>' \
  --header 'X-Agentmark-App-Id: <x-agentmark-app-id>'
"<string>"

Authorizations

Authorization
string
header
required

Your AgentMark API key. Create one in the dashboard under Settings > API Keys.

Example: Authorization: Bearer am_live_abc123

Headers

X-Agentmark-App-Id
string
required

Your application ID. Found in the dashboard under Settings > General.

Example:

"app_abc123"

Query Parameters

format
enum<string>
default:jsonl

Export format.

Available options:
jsonl,
csv,
openai
limit
integer
default:500

Maximum rows per page.

Required range: 1 <= x <= 2000
lightweight
boolean
default:false

If true, excludes Input, Output, OutputObject, and ToolCalls fields for smaller payloads.

startDate
string<date-time>

Filter from this date (ISO 8601). Defaults to 30 days ago.

endDate
string<date-time>

Filter to this date (ISO 8601). Defaults to now.

type
enum<string>
default:all

Filter by span type.

Available options:
GENERATION,
SPAN,
EVENT,
all
model
string

Exact match on model name.

status
enum<string>

Filter by status code.

Available options:
STATUS_CODE_UNSET,
STATUS_CODE_OK,
STATUS_CODE_ERROR
name
string

Partial match on span name.

minScore
number

Filter traces where any score is greater than or equal to this value.

maxScore
number

Filter traces where any score is less than or equal to this value.

userId
string

Exact match on user ID.

tag
string

Filter traces that contain this tag.

metadata_key
string

Metadata filter key. Must be used with metadata_value.

metadata_value
string

Metadata filter value. Must be used with metadata_key.

cursor
string<date-time>

Cursor for pagination. Use the next_cursor value from the previous response's _export_meta.

Response

Exported trace data. Format depends on the format parameter:

  • jsonl: Newline-delimited JSON with a trailing _export_meta object
  • csv: CSV with headers
  • openai: OpenAI fine-tuning JSONL format

Newline-delimited JSON. Each line is an ExportRow object. The last line is an ExportMeta object with pagination info.

See the ExportRow and ExportMeta schemas below for the exact structure.