Event Definitions

The EventDefinition resource

Represents an Webhook Event Definition.

Use List Event Definitions to obtain the all Scalr events available for use in webhooks. Then pass a number of the event IDs within webhook.event relationship in Create Webook or Update Webhook.

Key path

Description

type* (string)

Available values: event-definitions

id (string)

attributes.description (string)

The event details.

attributes.name* (string)

The name of the event.

links (object)

List Event Definitions

GET /api/iacp/v3/event-definitions

Example Request:

GET /api/iacp/v3/event-definitions HTTP/1.1
Host: my.scalr.io
Prefer: profile=preview
Status Codes
  • 200 OK

    Success.

    Example Respone:

    HTTP/1.1 200 OK
    Content-Type: application/vnd.api+json
    Preference-Applied: profile=preview
    
    {
      "data": [
        {
          "attributes": {
            "description": "Triggered when the run is successful.",
            "name": "run:completed"
          },
          "id": "run:completed",
          "links": {},
          "relationships": {},
          "type": "event-definitions"
        },
        {
          "attributes": {
            "description": "Triggered when a run stops due to an error in the code, manual cancellation, or a policy failure.",
            "name": "run:errored"
          },
          "id": "run:errored",
          "links": {},
          "relationships": {},
          "type": "event-definitions"
        },
        {
          "attributes": {
            "description": "When a human will need to review a plan based on the workspace not having auto-apply or if a policy override is required.",
            "name": "run:needs_attention"
          },
          "id": "run:needs_attention",
          "links": {},
          "relationships": {},
          "type": "event-definitions"
        }
      ],
      "included": null,
      "links": {
        "first": "https://my.scalr.io/api/iacp/v3/event-definitions?page%5Bnumber%5D=1&page%5Bsize%5D=20",
        "last": "https://my.scalr.io/api/iacp/v3/event-definitions?page%5Bnumber%5D=1&page%5Bsize%5D=20",
        "next": null,
        "prev": null,
        "self": "https://my.scalr.io/api/iacp/v3/event-definitions?page%5Bnumber%5D=1&page%5Bsize%5D=20"
      },
      "meta": {
        "pagination": {
          "current-page": 1,
          "next-page": null,
          "prev-page": null,
          "total-count": 0,
          "total-pages": 1
        }
      }
    }
    

  • 404 Not Found – User unauthorized to perform action.

  • 4XX – Client error.

  • 5XX – Server error.