Event

Events are changes occurring in Crunchy Bridge which are captured when certain actions are performed which are considered to be worth auditing. For example, when an account creates a cluster, an event is captured with a kind of cluster.created. In general, actions which cause mutable changes are captured as events whereas read-only actions are not.

Events apply to another type of API resource (like a cluster or network), and a representation of that API resource at the time an event occurred on it is captured in an event's data field. This means that to a certain degree, events on a resource can be walked back to see historical representations of a captured resource, although no API compatibility is guaranteed on captured data.

Events are retained for 90 days, after which they are deleted automatically.

Part of the API reference collection

This page is part of the Crunchy Bridge API reference, and primarily meant to act as an exhaustive guide for technical integrations which are already in progress. To understand the basics of using the API, see API concepts and getting started.

List events

List events for an account, cluster, or team.

With no query parameters, events for which the authenticated account is the "actor" are returned, meaning events which were captured due to actions taken by the account. When cluster_id is specified, events pertaining to any actions that occurred on that cluster are returned instead. When team_id is specified, events taken by any member of that team are returned instead. Only one of these filters can be specified.

This endpoint's pagination may be ordered through the order_field parameter by id only.

GET /events

Request

Query parameters

NameRequiredTypeDescription
cluster_idstring
cursorstring
limitinteger
orderenum string

Enum asc, or desc.

order_fieldstring
team_idstring

cURL example

curl -X GET https://api.crunchybridge.com/events
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Response for listing events.

Content type: application/json

NameNullableTypeDescription
eventsarray of array

List of events for this page.

has_moreboolean

Indicates whether or not there are more resources to page through in the collection.

next_cursorstring in EID format in UUID format

A cursor value to pass to the endpoint to get the next page.

Example

{
    "events": [
        {
            "actor_email": null,
            "actor_id": "qvcw4hylovgyzbwzp53bmmlhga",
            "actor_ip": "73.70.33.3",
            "cluster_id": "rvf73a77ozfsvcttryebfrnlem",
            "created_at": "2021-07-11T01:02:03Z",
            "data": {
                "cidr4": "1.2.3.4/24",
                "id": "p56biajnfvgjhftvqs7lqymspe",
                "name": "crunchy-production-network",
                "provider_id": "aws",
                "region_id": "us-west-2",
                "team_id": "eaevtjiudzeq7bsqbbpiscund4"
            },
            "description": "[email protected] updated network `p56biajnfvgjhftvqs7lqymspe`.",
            "id": "klkvpx5enfdilaehwhvnmcfoiy",
            "kind": "network.created",
            "object_id": "p56biajnfvgjhftvqs7lqymspe",
            "object_kind": "network",
            "previous_properties": null,
            "request_id": "27a532f4-5bc8-4810-b602-88475a93167c",
            "team_id": "eaevtjiudzeq7bsqbbpiscund4"
        }
    ],
    "has_more": false,
    "next_cursor": null
}

Get event

Get a specific event.

GET /events/{event_id}

Request

Path parameters

  • event_id: The ID of the event to be retrieved.

cURL example

curl -X GET https://api.crunchybridge.com/events/{event_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

An event represents an operation that occurred in the system. It contains a kind like cluster.created, a primary object associated with the event, and may also be associated with a cluster or team.

Content type: application/json

NameNullableTypeDescription
idstring in EID format in UUID format

The primary ID of the event. IDs for events are generated in ascending order.

actor_emailstring

The email of the actor who initiated the event, if there was one.

actor_idstring in EID format in UUID format

The ID of the actor who initiated the event, if there was one. Actor IDs are always the identifier of an account.

actor_ipstring

The IP from which the actor initiated the event, if there was an actor.

cluster_idstring in EID format in UUID format

The ID of the cluster associated with the event, if there was one.

created_atstring of date/time formatted as RFC 3339 in EID format in UUID format

The time when the event occurred.

datastring

Data captured at the time of the event. When an event is captured for another API resource, that API resource is rendered and stored in the data field. Note that no API compatibility is guaranteed on this previously rendered version and it's therefore possible to have events whose data objects aren't fully compliant with the current version of that API resource.

descriptionstring

A human-readable description of the event. Note that this format is not guaranteed to be stable (it may change), so don't compare against it programmatically. Use other fields instead.

kindstring

The event's kind. Looks something like cluster.created. Kinds are mostly common of the form *.created, *.updated, or *.destroyed, but other types of operations are possible depending on the action. For example, cluster.suspended is generated when a cluster is suspended.

object_idstring in EID format in UUID format

The ID of the primary object associated with the event. For example, for a cluster.created, this will be the cluster's ID.

object_kindenum string

The kind of the primary object associated with the event. For example, for a cluster.created this will be cluster.

Enum access_token, account, account_notification, api_key, azure_marketplace_subscription, backup_token, changelog, cluster, cluster_upgrade, configuration_parameter, credit, customer, discount, email_change, email_verification, encryption_key, event, firewall_rule, health_check, invoice, logger, marketplace, marketplace_resource, metric_view, multi_factor, network, notification, notification_setting, operator_installation, organization, password_reset, plan, postgres_server, postgres_version, private_link, private_link_connection, provider, query, recovery_code_set, region, role, saved_query, saved_query_folder, saved_query_link, session, session_intent, subscription, support_plan, support_ticket_draft, tailscale_oauth_client, team, team_invite, team_member, tempkey, or ticket.

previous_propertiesstring

Contains the previous values of properties that may have changed during the operation which produced this event, taken by comparing a new API resource to how it rendered before the change. Usually only present on *.updated events.

request_idstring in UUID format

The ID of the request that instigated the action which caused this event to be captured, if there was one.

team_idstring in EID format in UUID format

The team associated with the event, if there was one. For example, for a cluster.created event, this would be the ID of team which owns the cluster.

Example

{
    "actor_email": null,
    "actor_id": "qvcw4hylovgyzbwzp53bmmlhga",
    "actor_ip": "73.70.33.3",
    "cluster_id": "rvf73a77ozfsvcttryebfrnlem",
    "created_at": "2021-07-11T01:02:03Z",
    "data": {
        "cidr4": "1.2.3.4/24",
        "id": "p56biajnfvgjhftvqs7lqymspe",
        "name": "crunchy-production-network",
        "provider_id": "aws",
        "region_id": "us-west-2",
        "team_id": "eaevtjiudzeq7bsqbbpiscund4"
    },
    "description": "[email protected] updated network `p56biajnfvgjhftvqs7lqymspe`.",
    "id": "klkvpx5enfdilaehwhvnmcfoiy",
    "kind": "network.created",
    "object_id": "p56biajnfvgjhftvqs7lqymspe",
    "object_kind": "network",
    "previous_properties": null,
    "request_id": "27a532f4-5bc8-4810-b602-88475a93167c",
    "team_id": "eaevtjiudzeq7bsqbbpiscund4"
}