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 '{"description":"ip policy creations","destination_ids":["ed_2k5okJhSakXN7oxZgi975BnFLQQ"],"metadata":"{\"environment\": \"staging\"}","sources":[{"type":"ip_policy_created.v0"}]}' \
https://api.ngrok.com/event_subscriptions
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
Response
Returns a 201 response on success
Example Response
{
"created_at": "2024-08-02T07:15:39Z",
"description": "ip policy creations",
"destinations": [
{
"id": "ed_2k5okJhSakXN7oxZgi975BnFLQQ",
"uri": "https://api.ngrok.com/event_destinations/ed_2k5okJhSakXN7oxZgi975BnFLQQ"
}
],
"id": "esb_2k5okFsXq5UDACoAWv6aYRTRj5D",
"metadata": "{\"environment\": \"staging\"}",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D/sources/ip_policy_created.v0"
}
],
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D"
}
Fields
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
Name | Type | Description |
---|---|---|
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_2k5okFsXq5UDACoAWv6aYRTRj5D
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_2k5okFsXq5UDACoAWv6aYRTRj5D
Response
Returns a 200 response on success
Example Response
{
"created_at": "2024-08-02T07:15:39Z",
"description": "IP Policy Creations",
"destinations": [
{
"id": "ed_2k5okJhSakXN7oxZgi975BnFLQQ",
"uri": "https://api.ngrok.com/event_destinations/ed_2k5okJhSakXN7oxZgi975BnFLQQ"
}
],
"id": "esb_2k5okFsXq5UDACoAWv6aYRTRj5D",
"metadata": "{\"environment\": \"staging\"}",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D/sources/ip_policy_created.v0"
}
],
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D"
}
Fields
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
Name | Type | Description |
---|---|---|
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": [
{
"created_at": "2024-08-02T07:15:39Z",
"description": "ip policy creations",
"destinations": [
{
"id": "ed_2k5okJhSakXN7oxZgi975BnFLQQ",
"uri": "https://api.ngrok.com/event_destinations/ed_2k5okJhSakXN7oxZgi975BnFLQQ"
}
],
"id": "esb_2k5okFsXq5UDACoAWv6aYRTRj5D",
"metadata": "{\"environment\": \"staging\"}",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D/sources/ip_policy_created.v0"
}
],
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D"
}
],
"next_page_uri": null,
"uri": "https://api.ngrok.com/event_subscriptions"
}
Fields
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
Name | Type | Description |
---|---|---|
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_2k5okFsXq5UDACoAWv6aYRTRj5D
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
Response
Returns a 200 response on success
Example Response
{
"created_at": "2024-08-02T07:15:39Z",
"description": "IP Policy Creations",
"destinations": [
{
"id": "ed_2k5okJhSakXN7oxZgi975BnFLQQ",
"uri": "https://api.ngrok.com/event_destinations/ed_2k5okJhSakXN7oxZgi975BnFLQQ"
}
],
"id": "esb_2k5okFsXq5UDACoAWv6aYRTRj5D",
"metadata": "{\"environment\": \"staging\"}",
"sources": [
{
"type": "ip_policy_created.v0",
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D/sources/ip_policy_created.v0"
}
],
"uri": "https://api.ngrok.com/event_subscriptions/esb_2k5okFsXq5UDACoAWv6aYRTRj5D"
}
Fields
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
type | string | Type of event for which an event subscription will trigger |
uri | string | URI of the Event Source API resource. |
Ref fields
Name | Type | Description |
---|---|---|
id | string | a resource identifier |
uri | string | a uri for locating a resource |