Skip to content
Docs GitHub

api

Make an authenticated API request

Usage

sentry api <endpoint>

Make an authenticated API request

Arguments:

ArgumentDescription
<endpoint>API endpoint relative to /api/0/ (e.g., organizations/)

Options:

OptionDescription
-X, --method <method>The HTTP method for the request (default: "GET")
-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)
--silentDo not print the response body
--verboseInclude full HTTP request and response in the output
-n, --dry-runShow the resolved request without sending it

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

Examples

Endpoints are relative to /api/0/ — the prefix is added automatically.

GET requests

Terminal window
# List organizations
sentry api organizations/
# Get a specific issue
sentry api issues/123456789/

POST requests

Terminal window
# Create a release
sentry api organizations/my-org/releases/ \
-X POST -F version=1.0.0
# With inline JSON body
sentry api issues/123456789/ \
-X POST -d '{"status": "resolved"}'

PUT requests

Terminal window
# Update an issue status
sentry api issues/123456789/ \
-X PUT -F status=resolved
# Assign an issue
sentry api issues/123456789/ \
-X PUT --field assignedTo="user@example.com"

DELETE requests

Terminal window
sentry api projects/my-org/my-project/ -X DELETE

Advanced usage

Terminal window
# Add custom headers
sentry api organizations/ -H "X-Custom: value"
# Read body from a file
sentry api projects/my-org/my-project/releases/ -X POST --input release.json
# Verbose mode (shows full HTTP request/response)
sentry api organizations/ --verbose
# Preview the request without sending
sentry api organizations/ --dry-run

For full API documentation, see the Sentry API Reference.