Skip to content
DocsGitHub

event

View, list, and send Sentry events

sentry event view <org/project/event-id...>

Section titled “sentry event view <org/project/event-id...>”

View details of one or more events

Arguments:

Argument Description
<org/project/event-id...> [<org>/<project>] [<event-id>...] - Target (optional) and event IDs, or a selector (default: @latest)

Options:

Option Description
-w, --web Open in browser
--spans <spans> Span tree depth limit (number, "all" for unlimited, "no" to disable) (default: "3")
-f, --fresh Bypass cache, re-detect projects, and fetch fresh data

Examples:

Terminal window
# View an event
sentry event view abc123def456abc123def456abc12345
# View a specific event using an issue short ID
sentry event view PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac
# View a specific event with an explicit organization
sentry event view my-org/PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac
# View the latest event for an issue
sentry event view PROJ-ABC
# View the latest event of the most recent unresolved issue in a project
sentry event view my-org/my-project
# View the latest event of the most frequent issue
sentry event view @most_frequent
# Open in the browser
sentry event view abc123def456abc123def456abc12345 -w
# Download an attachment listed by --json (with sentry api)
sentry api 'https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1' > screenshot.png
# View an event in an explicit project
sentry event view my-org/my-project abc123def456abc123def456abc12345
# View several events, finding the project across organizations
sentry event view my-project abc123def456abc123def456abc12345 def456abc123def456abc123def45678

List events for an issue

Arguments:

Argument Description
<issue> Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix

Options:

Option Description
-n, --limit <limit> Number of events (1-1000) (default: "25")
-q, --query <query> Search query (Sentry search syntax)
--full Include full event body (stacktraces)
-t, --period <period> Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" (default: "7d")
-f, --fresh Bypass cache, re-detect projects, and fetch fresh data
-c, --cursor <cursor> Navigate pages: "next", "prev", "first" (or raw cursor string)

Examples:

Terminal window
# List events for an issue (short ID)
sentry event list PROJ-ABC
# List events for an issue (numeric ID)
sentry event list 123456789
# List events for the most recent issue
sentry event list @latest --limit 50
# Filter by search query
sentry event list PROJ-ABC --query "browser:Chrome"
# Include full event bodies (stacktraces)
sentry event list PROJ-ABC --full
# Limit results and time range
sentry event list PROJ-ABC --limit 50 --period 24h
# Fetch the next page
sentry event list PROJ-ABC -c next
# Fetch the previous page
sentry event list PROJ-ABC -c prev
# Output as JSON
sentry event list PROJ-ABC --json

Send a Sentry event

Arguments:

Argument Description
<target-or-file...> Optional DSN/project target followed by JSON event file path(s)

Options:

Option Description
-m, --message <message>... Event message (repeat for multi-line)
-a, --message-arg <message-arg>... Arguments for message template (repeat for multiple)
-l, --level <level> Event severity level (default: "error")
-r, --release <release> Release version
-d, --dist <dist> Distribution identifier
-E, --env <env> Environment name (e.g. production, staging)
-p, --platform <platform> Platform identifier (default: other)
-t, --tag <tag>... Tag as KEY:VALUE (repeat for multiple)
-e, --extra <extra>... Extra data as KEY:VALUE (repeat for multiple)
-u, --user <user>... User info as KEY:VALUE — id, email, username, ip_address, or custom
-f, --fingerprint <fingerprint>... Custom fingerprint part (repeat for multiple)
--timestamp <timestamp> Event timestamp (Unix epoch, ISO 8601, or RFC 2822)
--no-environ Do not include environment variables in the event
--logfile <logfile> Path to a log file — last 100 lines are attached as breadcrumbs
--with-categories Parse 'CATEGORY: message' prefixes from logfile breadcrumbs
--raw Send file contents as-is without parsing

Examples:

Terminal window
# Send an error event (default level)
sentry event send -m "Something went wrong"
# Specify level, release, and environment
sentry event send -m "Deploy check" -l info -r 1.0.0 -E production
# Add tags and extra data
sentry event send -m "Payment failed" --tag env:prod --tag region:us-east --extra amount:99.99
# Set user context
sentry event send -m "Login error" --user id:42 --user email:alice@example.com
# Custom fingerprint to group related events together
sentry event send -m "DB timeout" --fingerprint db-timeout --fingerprint {{ default }}
# Send a serialized Sentry Event object
sentry event send ./crash.json
# Send without re-parsing (raw mode)
sentry event send --raw ./crash.json
# Send a pre-built envelope
sentry event send --raw ./captured.envelope
# Send with an explicit DSN
sentry event send "https://key@o123.ingest.us.sentry.io/456" -m "Test"
# Send to a project (logged-in session; the CLI fetches its sole active DSN)
sentry event send my-project -m "Test"
# Send to an org/project target
sentry event send my-org/my-project -m "Test"

Analytics for events Sentry accepted and dropped

Arguments:

Argument Description
[<org/project>] <org>/<project> or <project> (search)

Options:

Option Description
-d, --dataset <dataset> Dropped-data type: errors, spans, logs, metrics (default: "errors")
-t, --period <period> Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" (default: "7d")

Examples:

Terminal window
# Accepted and dropped event analytics for a project
sentry event analytics my-org/my-project
# Analytics for a different dataset
sentry event analytics my-org/my-project --dataset spans
# Widen the time range
sentry event analytics my-org/my-project --period 7d
# Select specific JSON fields
sentry event analytics my-org/my-project --json --fields outcome,reason,events

All commands support --json for machine-readable output and --fields to select specific JSON fields.

Prefix relative file paths with ./ to distinguish them from a project target. --raw sends the file without re-parsing and also accepts pre-built envelopes.

sentry event send authenticates with ingest via a DSN, not a user token. An explicit DSN, SENTRY_DSN, and project auto-detection do not require login. Passing <project> or <org>/<project> does: the CLI uses your session to resolve the project and fetch its active DSN, then sends to ingest. If a project has multiple active DSNs, pass the desired DSN explicitly.

The DSN is resolved in priority order:

  1. A leading <dsn>, <project>, or <org>/<project> positional
  2. SENTRY_DSN environment variable
  3. Auto-detection from the current project (.env, source code, env files)

Copy a full event ID from sentry issue events PROJ-ABC and pass it after the issue short ID to open that event. The issue resolves the project; omitting the event ID selects the latest event. Invalid event IDs return an error instead of selecting the latest event.

sentry event view takes the issue selectors @latest (the most recent unresolved issue) and @most_frequent, and shows the selected issue's latest event. Without an event ID it uses @latest, so sentry event view and sentry event view my-org/my-project show the latest event of the most recent unresolved issue. A selector looks in the given org (my-org/@latest) or project (my-org/my-project/@most_frequent), otherwise in the auto-detected org, as it does for sentry issue view.

sentry event view --json lists an event's attachment metadata. Download an attachment with sentry api and the attachment's ?download=1 URL.

Event IDs can be found:

  1. In the Sentry UI when viewing an issue's events
  2. In the output of sentry issue view commands
  3. In error reports sent to Sentry (as event_id)

The old sentry-cli top-level command sentry send-event is available as a hidden alias for sentry event send.