Webhook objects on Pathwright represents webhook subscriptions for your school to external services. Individual webhook objects can either fire on one event or all events from your school, depending on your needs.

Attributes

  • id: The unique ID for this webhook.
  • school: Your school’s unique ID.
  • event: The event to fire the webhook on. Either all or one of the identifiers (e.g. student.member.created) available below.
{
    "id": 4431,
    "school": 13,
    "event": "all",
    "target_url": "https://example.com/webhooks/pathwright",
    "created_time": "2017-11-02T21:12:40.707776Z"
}

Webhook Event Types

  • all: all events

API Endpoints

Pathwright’s public API provides endpoints to manage webhook subscriptions for your school.

List webhook subscriptions

Endpoint: https://yourschool.pathwright.com/api/public/webhook/

Method: GET

Lists all active webhook subscriptions in the school.

Returns

Returns a collection of Webhook objects.

Create webhook subscription

Endpoint: https://yourschool.pathwright.com/api/public/webhook/

Method: POST

Creates a webhook subscription in the authenticated school to a target URL.

Arguments

  • event: The event identifier for the event to subscribe to, or all for all events.
  • target_url: The URL where events should be sent.

Returns

Returns the newly created Webhook object.

Example Output

{
    "id": 4431,
    "school": 13,
    "event": "all",
    "target_url": "https://example.com/webhooks/pathwright",
    "created_time": "2017-11-02T21:12:40.707776Z"
}

Delete webhook subscription

Endpoint: https://yourschool.pathwright.com/api/public/webhook/{webhook_id}/

Method: DELETE

Deletes a webhook subscription, suspending outgoing events to the given target URL.

URL Parameters

  • webhook_id: The ID of the webhook subscription to delete.

Result

204 No Content