Using Webhooks to Keep External Applications Up-to-Date with SYNQ
Webhooks are a powerful way to receive real-time notifications from SYNQ when specific events occur. This integration allows external applications to stay updated without the need for constant polling, thus saving resources and ensuring timely updates.Introduction to SYNQ Webhooks
SYNQ uses webhooks to send HTTP POST requests to a predefined URL whenever certain events occur. These events include issue lifecycle changes, incident notifications, or a simple ping to confirm that the webhook endpoint is reachable. Webhooks in SYNQ are defined by a schema that ensures the correct data structure is maintained. Each event has a specific payload format, allowing external applications to process the event data accordingly. Latest schema definition is available as a JSON Schema and as HTML documentation.Key Concepts
- Event Types: SYNQ webhook events can represent different actions, such as
ping,issue_created,issue_updated,issue_status_updated,issue_closed,incident_open,incident_closed, andincident_cancelled. - Payload Structure: Each event payload adheres to a defined JSON schema, ensuring consistency and reliability in the data received.
- Callback Mechanisms: Webhooks can trigger specific commands or actions in the receiving application, making it possible to automate workflows based on incoming events.
Webhook Event Schema
The webhook event schema defines the structure of the payload sent for each event type:workspace: Identifies the workspace where the event occurred.event_id: A unique identifier for the event.event_time: The time when the event occurred, formatted as a date-time string.event_type: One of the specific event types (ping,issue_created,issue_updated,issue_status_updated,issue_closed,incident_open,incident_closed,incident_cancelled), each with its own structured payload.callbacks: An array of callbacks that can be invoked based on the event, containing details such asurl,action_name, and associatedissues_command.
Event Types
Issue Events
- Issue Created: Notifies that a new issue has been created. Contains an
IssueSummarywith details such asissue_id,title,description,status, trigger and affected entities. - Issue Updated: Indicates that an existing issue has been updated.
- Issue Status Updated: Signals that the status of an issue has changed (e.g., investigating, expected, fixed, no action needed).
- Issue Closed: Signals that an issue has been closed.
Incident Events
- Incident Open: Notifies that a new incident has been opened. Contains an
IncidentSummarywithincident_id,title,description, andincident_url. - Incident Closed: Indicates that an incident has been closed.
- Incident Cancelled: Signals that an incident has been cancelled.
Other Events
- Ping: A simple test event sent during webhook setup to confirm the endpoint is functional. Payload contains a
message.
Working with SYNQ Webhook Events
To start using SYNQ webhooks:- Register a Webhook Endpoint: Provide a URL endpoint where SYNQ can send webhook events. Use Settings > Integrations > Add integration > Webhook.
- Handle Incoming Events: Set up your server to process incoming POST requests from SYNQ. Ensure that your endpoint correctly interprets the payload format defined in the webhook event schema. Return 2xx status codes to confirm receipt.
- Automate Actions: Use the event data to trigger specific actions in your application, such as updating a database, notifying users, or calling other APIs.