Event Subscriptions
Create Event Subscription
Create an Event Subscription.
Request
POST /event_subscriptions
Example Request
curl \
-X POST \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"metadata":"{\"environment\": \"staging\"}","description":"ip policy creations","sources":[{"type":"ip_policy_created.v0"}],"destination_ids":["ed_2NTVHNH46kJT5TzzV7gowqhVwRW"]}' \
https://api.ngrok.com/event_subscriptions
Parameters
metadata | string | Arbitrary customer supplied information intended to be machine readable. Optional, max 4096 chars. |
description | string | Arbitrary customer supplied information intended to be human readable. Optional, max 255 chars. |
sources | EventSourceReplace | Sources containing the types for which this event subscription will trigger |
destination_ids | List<string> | A list of Event Destination IDs which should be used for this Event Subscription. |
EventSourceReplace parameters
type | string | Type of event for which an event subscription will trigger |
Response
Returns a 201 response on success
Example Response
{
"id": "esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"created_at": "2023-03-24T19:59:30Z",
"metadata": "{\"environment\": \"staging\"}",
"description": "ip policy creations",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar/sources/ip_policy_created.v0"
}
],
"destinations": [
{
"id": "ed_2NTVHNH46kJT5TzzV7gowqhVwRW",
"uri": "https://api.ngrok.com/event_destinations/ed_2NTVHNH46kJT5TzzV7gowqhVwRW"
}
]
}
Fields
id | string | Unique identifier for this Event Subscription. |
uri | string | URI of the Event Subscription API resource. |
created_at | string | When the Event Subscription was created (RFC 3339 format). |
metadata | string | Arbitrary customer supplied information intended to be machine readable. Optional, max 4096 chars. |
description | string | Arbitrary customer supplied information intended to be human readable. Optional, max 255 chars. |
sources | EventSource | Sources containing the types for which this event subscription will trigger |
destinations | Ref | Destinations to which these events will be sent |
EventSource fields
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
id | string | a resource identifier |
uri | string | a uri for locating a resource |
Delete Event Subscription
Delete an Event Subscription.
Request
DELETE /event_subscriptions/{id}
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar
Response
Returns a 204 response with no body on success
Get Event Subscription
Get an Event Subscription by ID.
Request
GET /event_subscriptions/{id}
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar
Response
Returns a 200 response on success
Example Response
{
"id": "esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"created_at": "2023-03-24T19:59:30Z",
"metadata": "{\"environment\": \"staging\"}",
"description": "IP Policy Creations",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar/sources/ip_policy_created.v0"
}
],
"destinations": [
{
"id": "ed_2NTVHNH46kJT5TzzV7gowqhVwRW",
"uri": "https://api.ngrok.com/event_destinations/ed_2NTVHNH46kJT5TzzV7gowqhVwRW"
}
]
}
Fields
id | string | Unique identifier for this Event Subscription. |
uri | string | URI of the Event Subscription API resource. |
created_at | string | When the Event Subscription was created (RFC 3339 format). |
metadata | string | Arbitrary customer supplied information intended to be machine readable. Optional, max 4096 chars. |
description | string | Arbitrary customer supplied information intended to be human readable. Optional, max 255 chars. |
sources | EventSource | Sources containing the types for which this event subscription will trigger |
destinations | Ref | Destinations to which these events will be sent |
EventSource fields
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
id | string | a resource identifier |
uri | string | a uri for locating a resource |
List Event Subscriptions
List this Account's Event Subscriptions.
Request
GET /event_subscriptions
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/event_subscriptions
Response
Returns a 200 response on success
Example Response
{
"event_subscriptions": [
{
"id": "esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"created_at": "2023-03-24T19:59:30Z",
"metadata": "{\"environment\": \"staging\"}",
"description": "ip policy creations",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar/sources/ip_policy_created.v0"
}
],
"destinations": [
{
"id": "ed_2NTVHNH46kJT5TzzV7gowqhVwRW",
"uri": "https://api.ngrok.com/event_destinations/ed_2NTVHNH46kJT5TzzV7gowqhVwRW"
}
]
}
],
"uri": "https://api.ngrok.com/event_subscriptions",
"next_page_uri": null
}
Fields
event_subscriptions | EventSubscription | The list of all Event Subscriptions on this account. |
uri | string | URI of the Event Subscriptions list API resource. |
next_page_uri | string | URI of next page, or null if there is no next page. |
EventSubscription fields
id | string | Unique identifier for this Event Subscription. |
uri | string | URI of the Event Subscription API resource. |
created_at | string | When the Event Subscription was created (RFC 3339 format). |
metadata | string | Arbitrary customer supplied information intended to be machine readable. Optional, max 4096 chars. |
description | string | Arbitrary customer supplied information intended to be human readable. Optional, max 255 chars. |
sources | EventSource | Sources containing the types for which this event subscription will trigger |
destinations | Ref | Destinations to which these events will be sent |
EventSource fields
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
id | string | a resource identifier |
uri | string | a uri for locating a resource |
Update Event Subscription
Update an Event Subscription.
Request
PATCH /event_subscriptions/{id}
Example Request
curl \
-X PATCH \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"description":"IP Policy Creations"}' \
https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar
Parameters
id | string | Unique identifier for this Event Subscription. |
metadata | string | Arbitrary customer supplied information intended to be machine readable. Optional, max 4096 chars. |
description | string | Arbitrary customer supplied information intended to be human readable. Optional, max 255 chars. |
sources | EventSourceReplace | Sources containing the types for which this event subscription will trigger |
destination_ids | List<string> | A list of Event Destination IDs which should be used for this Event Subscription. |
EventSourceReplace parameters
type | string | Type of event for which an event subscription will trigger |
Response
Returns a 200 response on success
Example Response
{
"id": "esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar",
"created_at": "2023-03-24T19:59:30Z",
"metadata": "{\"environment\": \"staging\"}",
"description": "IP Policy Creations",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2NTVHQCVS4evvT6MHg5Kc0UB6Ar/sources/ip_policy_created.v0"
}
],
"destinations": [
{
"id": "ed_2NTVHNH46kJT5TzzV7gowqhVwRW",
"uri": "https://api.ngrok.com/event_destinations/ed_2NTVHNH46kJT5TzzV7gowqhVwRW"
}
]
}
Fields
id | string | Unique identifier for this Event Subscription. |
uri | string | URI of the Event Subscription API resource. |
created_at | string | When the Event Subscription was created (RFC 3339 format). |
metadata | string | Arbitrary customer supplied information intended to be machine readable. Optional, max 4096 chars. |
description | string | Arbitrary customer supplied information intended to be human readable. Optional, max 255 chars. |
sources | EventSource | Sources containing the types for which this event subscription will trigger |
destinations | Ref | Destinations to which these events will be sent |
EventSource fields
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
id | string | a resource identifier |
uri | string | a uri for locating a resource |