Skip to main content

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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources

Parameters

NameTypeDescription
subscription_idstringThe unique identifier for the Event Subscription that this Event Source is attached to.
typestringType 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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources/ip_policy_updated.v0"
}

Fields

NameTypeDescription
typestringType of event for which an event subscription will trigger
uristringURI 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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources/ip_policy_updated.v0"
}

Fields

NameTypeDescription
typestringType of event for which an event subscription will trigger
uristringURI 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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources

Response

Returns a 200 response on success

Example Response

{
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources/ip_policy_created.v0"
},
{
"type": "ip_policy_updated.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources/ip_policy_updated.v0"
}
],
"uri": "https://api.ngrok.com/event_subscriptions/esb_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources"
}

Fields

NameTypeDescription
sourcesEventSourceThe list of all Event Sources for an Event Subscription
uristringURI of the next page, or null if there is no next page.

EventSource fields

NameTypeDescription
typestringType of event for which an event subscription will trigger
uristringURI 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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources/ip_policy_updated.v0

Parameters

NameTypeDescription
subscription_idstringThe unique identifier for the Event Subscription that this Event Source is attached to.
typestringType 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_2fKmcdQllA2kWgBHMHFHSuJ6gl7/sources/ip_policy_updated.v0"
}

Fields

NameTypeDescription
typestringType of event for which an event subscription will trigger
uristringURI of the Event Source API resource.