api
Make an authenticated API request
sentry api <endpoint>
Section titled “sentry api <endpoint>”Make an authenticated API request
Arguments:
| Argument | Description |
|---|---|
<endpoint> |
API endpoint relative to /api/0/, or an absolute HTTP(S) URL |
Options:
| Option | Description |
|---|---|
-X, --method <method> |
The HTTP method for the request (default: "GET") |
-c, --cursor <cursor> |
Navigate pages: "next", "prev", "first" (or raw cursor string) |
-d, --data <data> |
Inline JSON body for the request (like curl -d) |
-F, --field <field>... |
Add a typed parameter (key=value, key[sub]=value, key[]=value) |
-f, --raw-field <raw-field>... |
Add a string parameter without JSON parsing |
-H, --header <header>... |
Add a HTTP request header in key:value format |
--input <input> |
The file to use as body for the HTTP request (use "-" to read from standard input) |
--silent |
Do not print the response body |
--verbose |
Include full HTTP request and response in the output |
-n, --dry-run |
Show the resolved request without sending it |
Examples:
# List organizationssentry api organizations/
# Read a page and its pagination metadatasentry api organizations/ -f per_page=2 --json
# Continue the same query using shared paginationsentry api organizations/ -f per_page=2 --cursor next --json
# Return to the previously visited pagesentry api organizations/ -f per_page=2 --cursor prev --json
# Get a specific issuesentry api issues/123456789/
# Create a releasesentry api organizations/my-org/releases/ -X POST -F version=1.0.0
# Update an issue statussentry api issues/123456789/ -X PUT -F status=resolved
# Send an inline JSON bodysentry api issues/123456789/ -X PUT -d '{"status":"resolved"}'
# Set a nested fieldsentry api projects/my-org/my-project/ -X PUT -F options[sampleRate]=0.5
# Assign an issuesentry api issues/123456789/ -X PUT --field assignedTo="user@example.com"
# Delete a projectsentry api projects/my-org/my-project/ -X DELETE
# Add custom headerssentry api organizations/ -H "X-Custom: value"
# Read the request body from a filesentry api projects/my-org/my-project/releases/ -X POST --input release.json
# Show the full HTTP request and responsesentry api organizations/ --verbose
# Preview the request without sending itsentry api organizations/ --dry-run
# Save a binary response, such as an event attachment, to a filesentry api "https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1" > screenshot.pngAll commands support --json for machine-readable output and --fields to select specific JSON fields.
Endpoints
Section titled “Endpoints”Endpoints are relative to /api/0/ — the prefix is added automatically. Absolute HTTP(S) Sentry URLs also work; their origin is validated against your authenticated host.
If a successful GET response is interrupted while downloading, the CLI retries within its existing limit of three attempts. This also applies to complete API responses read by other commands. The request timeout covers these response bodies; streaming responses such as SSE are excluded.
Dataset Names
Section titled “Dataset Names”When querying the Events API (/events/ endpoint), valid dataset values are: spans, logs, errors, tracemetrics, profile_functions, and uptime_results.
Pagination
Section titled “Pagination”Each invocation fetches one server page. Repeat the same GET endpoint and filters
with --cursor next (-c next) to continue, --cursor prev to revisit a page,
or --cursor first to start again. The shared history expires after five minutes
and is scoped to the request and authenticated identity. Keep the same query
parameters and headers when navigating. The endpoint remains required.
Raw server cursors and custom cursors from the CLI's shared paginator are also
accepted. Custom cursors preserve the page size and skip rows already returned,
including when navigating back to a bookmarked page. A cursor's encoded page
size takes precedence over per_page. Mid-page bookmarks support array bodies
and responses with a data array, such as the Events API; envelope metadata is
preserved. Other response bodies remain unchanged for ordinary cursors.
With --json, pagination.nextCursor is the CLI continuation and can retain a
custom bookmark; pass it back through --cursor to resume exactly.
pagination.prevCursor comes from the server, while pagination.hasPrev
indicates a previously visited page in local history. --fields filters only
the body and preserves this metadata.
The pagination object is omitted when no continuation or local previous page is
available. Its absence does not prove a complete or unsampled dataset.
--cursor replaces cursor parameters from the endpoint and request fields. It is
only supported for GET requests. --dry-run previews the resolved request;
dry-runs and failed requests do not advance the saved history.
Binary responses
Section titled “Binary responses”Endpoints that return binary data — image attachments, minidumps, debug files — are streamed to stdout as raw bytes, so you can redirect them straight to a file.
When the response is a PNG or JPEG image and you're on a graphics-capable terminal, the image is rendered inline instead of dumping raw bytes into your session. Terminals that speak the newer kitty graphics protocol (kitty, WezTerm, Ghostty, recent Konsole) are used in preference to sixel, which remains the fallback for older terminals. Redirecting or piping stdout always keeps the raw bytes. Set SENTRY_NO_GRAPHICS=1 (or run sentry cli defaults graphics off) to disable inline rendering; SENTRY_NO_SIXEL is still honored as a deprecated alias.
For full API documentation, see the Sentry API Reference.