Event Sources
Create Event Source
Add an additional type for which this event subscription will trigger
Request
POST /event_subscriptions/{subscription_id}/sources
Example Request
curl \
-X POST \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"type":"ip_policy_updated.v0"}' \
https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources
Parameters
Name | Type | Description |
---|---|---|
subscription_id | string | The unique identifier for the Event Subscription that this Event Source is attached to. |
type | string | Type of event for which an event subscription will trigger |
Response
Returns a 201 response on success
Example Response
{
"type": "ip_policy_updated.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_updated.v0"
}
Fields
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Delete Event Source
Remove a type for which this event subscription will trigger
Request
DELETE /event_subscriptions/{subscription_id}/sources/{type}
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_updated.v0
Response
Returns a 204 response with no body on success
Get Event Source
Get the details for a given type that triggers for the given event subscription
Request
GET /event_subscriptions/{subscription_id}/sources/{type}
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_updated.v0
Response
Returns a 200 response on success
Example Response
{
"type": "ip_policy_updated.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_updated.v0"
}
Fields
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
List Event Sources
List the types for which this event subscription will trigger
Request
GET /event_subscriptions/{subscription_id}/sources
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources
Response
Returns a 200 response on success
Example Response
{
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_created.v0"
},
{
"type": "ip_policy_updated.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_updated.v0"
}
],
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources"
}
Fields
Name | Type | Description |
---|---|---|
sources | EventSource | The list of all Event Sources for an Event Subscription |
uri | string | URI of the next page, or null if there is no next page. |
EventSource fields
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Update Event Source
Update the type for which this event subscription will trigger
Request
PATCH /event_subscriptions/{subscription_id}/sources/{type}
Example Request
curl \
-X PATCH \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{}' \
https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_updated.v0
Parameters
Name | Type | Description |
---|---|---|
subscription_id | string | The unique identifier for the Event Subscription that this Event Source is attached to. |
type | string | Type of event for which an event subscription will trigger |
Response
Returns a 200 response on success
Example Response
{
"type": "ip_policy_updated.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okHPXR62Cvmgc1PqntBONiYk/sources/ip_policy_updated.v0"
}
Fields
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |