Skip to content
Docs GitHub

api

Make direct API calls to Sentry’s REST API.

Commands

sentry api

Execute an API request.

Terminal window
sentry api <endpoint> [options]

Arguments:

ArgumentDescription
<endpoint>API endpoint path (e.g., /organizations/)

Options:

OptionDescription
--method <method>HTTP method (GET, POST, PUT, DELETE). Default: GET
--field <key=value>Add a field to the request body (can be used multiple times)
--header <key:value>Add a custom header (can be used multiple times)
--includeInclude response headers in output
--paginateAutomatically paginate through all results

Examples

GET Request

Terminal window
# List organizations
sentry api /organizations/
# Get a specific organization
sentry api /organizations/my-org/
# Get project details
sentry api /projects/my-org/my-project/

POST Request

Terminal window
# Create a new project
sentry api /teams/my-org/my-team/projects/ \
--method POST \
--field name="New Project" \
--field platform=javascript

PUT Request

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

DELETE Request

Terminal window
# Delete a project
sentry api /projects/my-org/my-project/ \
--method DELETE

With Headers

Terminal window
sentry api /organizations/ \
--header "X-Custom-Header:value"

Show Response Headers

Terminal window
sentry api /organizations/ --include
HTTP/2 200
content-type: application/json
x-sentry-rate-limit-remaining: 95
[{"slug": "my-org", ...}]

Pagination

Terminal window
# Get all issues (automatically follows pagination)
sentry api /projects/my-org/my-project/issues/ --paginate

API Documentation

For full API documentation, see the Sentry API Reference.