Register a new Service Hook

POST /api/0/projects/{organization_slug}/{project_slug}/hooks/

Register a new service hook on a project.

Events include:

  • event.alert: An alert is generated for an event (via rules).
  • event.created: A new event has been processed.
Path Parameters:
  • organization_slug (string) – the slug of the organization the client keys belong to.
  • project_slug (string) – the slug of the project the client keys belong to.
Parameters:
  • url (string) – the url for the webhook
  • events (array[string]) – the events to subscribe to
Method:POST
Path:/api/0/projects/{organization_slug}/{project_slug}/hooks/

Example

POST /api/0/projects/the-interstellar-jurisdiction/pump-station/hooks/ HTTP/1.1
Authorization: Bearer {base64-encoded-key-here}
Host: sentry.io
Content-Type: application/json

{
  "url": "https://example.com/sentry-hook",
  "events": [
    "event.alert",
    "event.created"
  ]
}
HTTP/1.1 401 UNAUTHORIZED
Allow: GET, POST, HEAD, OPTIONS
Content-Language: en
Content-Length: 0
Vary: Accept-Language, Cookie
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block