com.gigs.usageNotification.created

Triggered when a new usage notification is created.

The currently-supported types of usage notification are:

  • started, which is fired when the subscription is first used.
  • throttled, which is fired when the subscription has had its data usage throttled to a lower bandwidth.
  • thresholdExceeded, which is fired when the subscription has used 70%, 90% and 100% of its data, sms or voice allowance.
  • Name
    object
    Type
    string
    required
    Description

    Type of object is always event.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the event.

    Example: evt_0SNlurA049MEWV5gNTcQ5A07h3Ol
  • Name
    data
    Type
    object
    PREVIEW
    required
    Description
    • Name
      object
      Type
      string
      required
      Description

      Type of object is always usageNotification.

    • Name
      subscription
      Type
      string
      required
      Description

      Unique subscription identifier.

      Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi
    • Name
      thresholdExceeded
      Type
      nullable object
      Description
      Information about the exceeded threshold. Only present when `type` is `thresholdExceeded`. Currently this notification is fired when a subscription has exceeded either 70%, 90% or 100% of its data, sms or voice allowances.
    • Name
      throttled
      Type
      nullable object
      Description
      The throttling configuration for the subscription. Only present if `type` is `throttled`.
    • Name
      type
      Type
      string
      required
      Description

      The type of notification.

      Example: throttled
      Allowed values: started, thresholdExceeded, throttled
  • Name
    datacontenttype
    Type
    string
    required
    Description

    The RFC 2046 content-type.

    Example: application/json
    Default: application/json
  • Name
    project
    Type
    string
    required
    Description

    Unique identifier for the project where the event occurred.

    Example: gigs
  • Name
    source
    Type
    string
    required
    Description

    URI identifying the event source.

    Example: https://api.gigs.com
    Default: https://api.gigs.com
  • Name
    specversion
    Type
    string
    required
    Description

    The CloudEvents spec version.

    Example: 1.0
    Default: 1.0
  • Name
    time
    Type
    string
    required
    Description

    Time when the event occurred.

    Example: 2022-03-16T14:12:42Z
  • Name
    type
    Type
    string
    required
    Description

    Type is always com.gigs.usageNotification.created.

  • Name
    version
    Type
    string
    required
    Description

    API version used to serialize the data and the event itself.

    Default: 2024-08-29

Example

{
  "object": "event",
  "id": "evt_0SNlurA049MEWV5gNTcQ5A07h3Ol",
  "data": {
    "object": "usageNotification",
    "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
    "thresholdExceeded": {
      "type": "data",
      "at": "2024-02-29T14:01:12Z",
      "data": {
        "allowanceBytes": 10000000000,
        "usageBytes": 7000000000
      },
      "percentage": 75,
      "sms": {
        "allowanceMessages": 10000,
        "usageMessages": 7000
      },
      "subscriptionAddons": [
        "sad_0SNlurA049MEWV2UNWPbDfW5B40U"
      ],
      "voice": {
        "allowanceSeconds": 50000,
        "usageSeconds": 35000
      }
    },
    "throttled": {
      "thresholdBytes": 10000000000,
      "bandwidthBitsPerSecond": 512000,
      "until": "2021-02-20T19:38:34Z"
    },
    "type": "throttled"
  },
  "datacontenttype": "application/json",
  "project": "gigs",
  "source": "https://api.gigs.com",
  "specversion": "1.0",
  "time": "2022-03-16T14:12:42Z",
  "type": "com.gigs.usageNotification.created",
  "version": "2024-08-29"
}