Webhooks
Webhook endpoints receive events. Events are also available from the API for 30 days.
POST /webhook_endpoints
GET /webhook_endpoints
DELETE /webhook_endpoints/{webhook_endpoint_id}
GET /events
The webhook endpoint object
| Field | Type | Description |
|---|---|---|
id | string | |
object | string | Always webhook_endpoint. |
url | uri | |
events | array of enum | One of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended. |
status | enum | One of enabled, disabled. |
secret | string | Returned only when the endpoint is created. |
description | string or null | |
created_at | date-time |
The event object
| Field | Type | Description |
|---|---|---|
id | string | |
object | string | Always event. |
type | enum | One of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended. |
livemode | boolean | |
created_at | date-time | |
data | object | |
data.object | object | The application or guarantee as it was when the event happened, in the same shape the API returns. |
Create a webhook endpoint
POST/webhook_endpoints
Creates a webhook endpoint.
Request body
| Field | Type | Description |
|---|---|---|
urlrequired | uri | Must be HTTPS on port 443. |
events | array of enum | The event types to deliver. Omit to receive all of them. One of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended. |
description | string |
Example request
curl https://api.thestudentguarantor.com/v1/webhook_endpoints \
-X POST \
-H "Authorization: Bearer $TSG_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.example-platform.com/hooks/tsg",
"events": [
"application.requirements_updated",
"application.approved",
"application.declined",
"guarantee.issued"
]
}'
Returns
Returns the webhook endpoint object with its secret. The secret isn't returned again.
Example response
{
"id": "whk_2Bv5NmQ8wE1rT4yU",
"object": "webhook_endpoint",
"url": "https://api.example-platform.com/hooks/tsg",
"events": [
"application.requirements_updated",
"application.approved",
"application.declined",
"guarantee.issued"
],
"status": "enabled",
"secret": "whsec_Jx4mP9qLs2Vt7RzKc8Bn1WdY",
"created_at": "2026-11-19T08:02:11Z"
}
List webhook endpoints
GET/webhook_endpoints
Returns a list of your webhook endpoints.
Returns
Returns a list of webhook endpoint objects.
Delete a webhook endpoint
DELETE/webhook_endpoints/{webhook_endpoint_id}
Deletes a webhook endpoint.
Returns
Returns an empty response.
List events
GET/events
Returns a list of events from the last 30 days.
Parameters
| Name | In | Description |
|---|---|---|
type | query | One of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended. |
created_after | query |
Returns
Returns a list of event objects.