Skip to main content

Can I send errors to Sentry without using an SDK?

Issue

I want to send errors or events to Sentry without installing an SDK, for example with a direct HTTP request (curl) or from a script or tool that no SDK supports.

Applies To

  • All SaaS Customers and Self-Hosted Users

Resolution

Yes. An issue in Sentry is created by sending an event to your project, and you can send that event yourself in two ways.

Option 1: Send an event over HTTP (envelope endpoint)

Post the event as an envelope to your project's ingestion endpoint:

POST /api/{PROJECT_ID}/envelope/

An envelope is newline-delimited JSON: an envelope header, an item header, and the event payload. Here is a minimal example with curl:

curl "https://oORG_ID.ingest.us.sentry.io/api/PROJECT_ID/envelope/?sentry_key=PUBLIC_KEY" \
-H 'Content-Type: application/x-sentry-envelope' \
--data-raw $'{}\n{"type":"event"}\n{"message":"Hello from curl","level":"error"}\n'

Use the ingest host and public key from your project's DSN, don't hardcode sentry.io. If your organization is hosted in a non-US region (for example the EU), you must send to your region-specific ingest domain (such as oORG_ID.ingest.de.sentry.io), otherwise the request is rejected with a 403 event submission rejected with_reason: ProjectId. The envelope format and full event schema are documented in the envelope reference and the event payload reference.

The legacy /store/ endpoint is deprecated. Send new integrations to the envelope endpoint.

Option 2: Use Sentry CLI

sentry-cli can send simple events without any SDK. Set the SENTRY_DSN environment variable to your project's DSN, then send a message:

export SENTRY_DSN='https://PUBLIC_KEY@oORG_ID.ingest.us.sentry.io/PROJECT_ID'
sentry-cli send-event -m "Hello from Sentry CLI"

You can add tags with -t KEY:VALUE, extra data with -e KEY:VALUE, a log file as breadcrumbs with --logfile, or pass a JSON file matching the event schema. See the sentry-cli send-event documentation for all options.

Related articles

Did this answer your question?