# PoweredBy API - Events, Notifications, and Alerts 2.7.2

API to expose events, notifications, and alerts to PoweredBy partners.

## Changelog

### v2.7.2
- Added `ChoreInstanceUncompleted` webhook event type
  - Added `gl.events.earn.chore_instance.uncompleted` event type, sent when a parent unchecks a completed or pending review chore instance
  - Added `ChoreInstanceUncompletedEvent` event schema

### v2.7.1
- Implementing savings goal events
  - added `gl.events.save.savings_goal.updated` event type
  - added savings goal event schema defintions
    - `SavingsGoalCreatedEvent`
    - `SavingsGoalRemovedEvent`
    - `SavingsGoalUpdatedEvent`
    - `SavingsGoalCompletedEvent`
- Updated parent paid interest events
  - Added `gl.events.save.ppi.updated` event type
  - Added `ParentInterestUpdatedEvent` event schema

### v2.7.0
- Change how funding request requestor concept works to support system requestor concept
  - enable ability to identify the user making the request (parent or childe) and the user impacted by the request (child)
  - Applies to `FundsMovedEvent` (gl.events.fund.funding_request.fulfilled) and `FundsDeclinedEvent` (gl.events.fund.funding_request.declined) events because they could occur for requests initiated by system actors
    - removed `requestor` attribute from these events
    - added `requestedBy` to track the user that initiated the funding request
    - added `requestedFor` to track the user for which the funding request applies
- Added separation between default and custom allocation account types in `FinancialInstrumentType` enum
  - added `GENERAL_SPENDING` default type
  - added `GENERAL_SAVINGS` default type
  - added `GENERAL_GIVING` default type 

### v2.6.1
- Added rule set evaluaion to the `ChargeAuthorizedEvent`
  - This was already added to the `ChargeDeclinedEvent`
  - This matches a change to the designs implemented for the activity history feature in the SDK

### v2.6.0
- Refactored `Event` object structure
  - Initial `Event` Defined a `allOf` structure with a base event type and a custom event detail types
    - this led to the top level `Event` object looking like the same object during code generation and validation
  - Changed the `Event` obect to be a `oneOf` collection where each webhook event was defined as separate schema object
    - this change avoided the need to duplicate the event type attribute at the top level and in the detail type payload
    - this change allowed successful execution of code generation and schema validation tools

### v2.5.0
- Added `AllowanceDeleted` webhook event type
- Added `AllowancePayoutFailed` webhook event type

### v2.4.0
- Experience URLs
  - Support the ability to pass a deeplink URL in a webhook payload that can be used to navigate a user to a specific experience within the GL SDK
  - Added optional `experienceURL` attribute to the `BaseEventDetail` schema object to make it available to all webhook payloads

### v2.3.3
- Update Overage Event Details
  - Removed information related to funding or spending request that caused the overage, in an effort to simplify the payload and support requirements for partner defined push notifications
  - Cleaned up examples related to `User` vs `UserReference` implementation for `OverageDetected` webhook
  - Changed account overage event type from `gl.events.fund.financial_account.overage_detected` to `gl.events.account.financial_account.overage_detected` to correctly align with account domain assignment

### v2.3.2
- Changed `FundsAllocated` and `FundsUnallocated` webhooks related to funding rules
  - Removed `destination` attribute as it always uses the inbound funds allocation account as an intermediary when funding rules are involved
  - Removed `ruleId` attribute for `FundsUnallocated` because no rule would apply
  - Added an `allocations` array to `FundsAllocated` to show the different allocations that were applied based on the matched rule

### v2.3.1
- Batch Events Update
  - Updated batch `ChoreInstanceCompleted` definition to only require the `detailType` attribute to be written at the top level of the event detail payload, and not repeated for each of the batch events
  - Updated documentation and examples to reflect the change 

### v2.3.0
- Batch Events
  - Support the ability to deliver some event types as batch events
  - The event detail payload of the single event will be wrapped in a `detailItems` array that provides all the detail types for the configured batch time window

### v2.2.0
- Funding Requests
  - Added `FundingRequestType` enum entity
  - Added request type to `FundsRequested`, `FundsApproved`, and `FundsMoved` event payloads to allow partner to apply logic when creating push notification
  - Remvoed `approver` attribute from `FundsCanceled` event payload, because it doesn't apply to this context.
- Spending Requests
  - Added `SpendingRequestType` enum entity
  - Added request type to `ChargeDeclined` and `ChargeAuthorized` event payloads to allow partner to apply logic when creating push notification
  - Added merchant location to `ChargeDeclined` and `ChargeAuthorized` event payloads
    - Moved `merchantName` into a merchant object with name and location fields
  - Added Spending Rule Evaluation Sets to `ChargeDeclined` event payload
    - Added `SpendingRuleEval` and `SpendingRule` entities
    - Added `ruleEvalSet` to the response for an auhtorization request

### v2.1.0
- Card Status
  - Added card status to `User` entity
  - Created `CardEnabled` event detail payload that aligns with `gl.events.account.user.card_enabled` event type
  - Created `CardDisabled` event detail payload that aligns with `gl.events.account.user.card_disabled` event type
- Nickname
  - Added nickname overrides to `User` entity
  - Created `NicknamesChanged` event detail payload that aligns with `gl.events.account.user.nicknames_changed` event type

### v2.0.0 
- Baseline v2
- Fixed invalid path param for webhook template
- Updated webhook attributes
  - Changed from `details` to `detail`
- Fixed some specification governance warnings
- Added new event and event detail types
- Added `Family` entity
- Updated `Event` entity to include the `Family` impacted by the event

## Terminology

### Event
Also referred to as a webhook.  An event represents the stage change of a resource on the Greenlight platform.  Events are purely informational, and mainly intended for system consumption.  Partner backend systems can use an event to derive logic.  Events could also be parsed, transformed, and enriched to send to users directly via configured and approved communication channels with the partner.

### Notification
A notification is a specific term that captures a superset of all information that Greenlight provides directly to a user within the Greenlight application context.  Notifications are curated messages that are triggered from other user or system behaviors, and are intended to be delivered to users directly.  In the Greenlight direct application context, Notifications are delivered into the application and to any configured communication channels (Push message, SMS, Email, etc).

### User Action
A user action is a subset of notifications that require a user to perform an action.  The most common use of a user action is for parent approvals.  If a parent approval is required, a user action is generated to prompt the user to view the notification and take the appropriate action (approve, decline, edit).

### ECI
External Customer Identifier.  An identifier, provided by GL partners, to uniquely identify parents and children that will participate in the GL platform.  This value should not change during the relationship of the user with the GL platform.

### EAI
External Account Identifier.  An identifier, provided by GL partners, to uniquely identify financial accounts owned by parents and children that will participate in the GL platform.  This value should not change during the relationship of the user with the GL platform.

### GLUID
Greenlight Unique Identifier, is a compound Id that is globally unique in the resource model exposed by the GL APIs. A GLUID is composed of a Resource Entity Type and a Resource Id. GlUIDs are constructed with the following format `{ResourceType}::{ResourceId}`.  

As an example, an External User is a GL resource entity type that relates to an External Customer Id (ECI) resource.  If an external user has an ECI of `abc123-xyz789`, this user can be represented as the GLUID `ExternalCustomer::abc123-xyz789`.

## Types

### DateTime
A DateTime object is represented as a String in the GL resource model.  DateTime strings should be compliant with the date-time format outlined in section 5.6 of the [RFC 3339 profile of the ISO 8601](https://tools.ietf.org/html/rfc3339) standard for representation of dates and times using the Gregorian calendar.  An example of a DateTime string representing a date and time in UTC is `2019-09-03T10:15:30Z`.

A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the date-time format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.

### Currency
Money amounts, or currency, is represented in the resource model as a Number (32.74).  The assumption is that this number represents US currency.

### String
Unless otherwise noted against the specific data type in the specification, the maximum length for all String data types is 255 characters.

## Servers

- https://{env}.{partner}.gl-tech.io/api/v2

## Authentication

- `OAuth`: OAuth 2.0

## Operations

### Notifications

- [GET /event/notifications](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/operations/listNotifications): List Notifications
- [POST /event/notifications](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/operations/createNotification): Create Notification
- [PATCH /event/notifications/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/operations/updateNotification): Update Notification
- [DELETE /event/notifications/{id}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/operations/deleteNotification): Delete Notification

### Webhook-Configs

- [GET /event/webhook-configs](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/operations/listWebhookConfigs): List Webhook Configs
- [GET /event/webhook-configs/{type}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/operations/getWebhookConfig): View Webhook Config
- [PATCH /event/webhook-configs/{type}](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/operations/updateWebhookConfig): Update Webhook Config

## Schemas

- [AllocationTarget](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllocationTarget)
- [AllocationTargetType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllocationTargetType)
- [AllowanceCreatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllowanceCreatedEvent)
- [AllowanceDeletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllowanceDeletedEvent)
- [AllowancePausedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllowancePausedEvent)
- [AllowancePayoutCompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllowancePayoutCompletedEvent)
- [AllowancePayoutFailedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllowancePayoutFailedEvent)
- [AllowanceResumedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllowanceResumedEvent)
- [AllowanceUpdatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/AllowanceUpdatedEvent)
- [BaseEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/BaseEvent)
- [BaseExceptionResponse](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/BaseExceptionResponse)
- [CardDisabledEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/CardDisabledEvent)
- [CardEnabledEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/CardEnabledEvent)
- [ChargeAuthorizedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChargeAuthorizedEvent)
- [ChargeDeclinedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChargeDeclinedEvent)
- [ChoreAssignmentClaimedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreAssignmentClaimedEvent)
- [ChoreAssignmentCreatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreAssignmentCreatedEvent)
- [ChoreCreatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreCreatedEvent)
- [ChoreInstanceCompletedBatch](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreInstanceCompletedBatch)
- [ChoreInstanceCompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreInstanceCompletedEvent)
- [ChoreInstanceCompletedSingle](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreInstanceCompletedSingle)
- [ChoreInstanceRejectedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreInstanceRejectedEvent)
- [ChoreInstanceUncompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChoreInstanceUncompletedEvent)
- [ChorePayoutCompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ChorePayoutCompletedEvent)
- [Event](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/Event)
- [EventType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/EventType)
- [Family](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/Family)
- [FinancialInstrument](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FinancialInstrument)
- [FinancialInstrumentType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FinancialInstrumentType)
- [FundingAllocations](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundingAllocations)
- [FundingRequestType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundingRequestType)
- [FundsAllocatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsAllocatedEvent)
- [FundsApprovedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsApprovedEvent)
- [FundsCanceledEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsCanceledEvent)
- [FundsDeclinedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsDeclinedEvent)
- [FundsMovedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsMovedEvent)
- [FundsRejectedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsRejectedEvent)
- [FundsRequestedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsRequestedEvent)
- [FundsUnallocatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/FundsUnallocatedEvent)
- [LessonCompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/LessonCompletedEvent)
- [Merchant](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/Merchant)
- [Nicknames](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/Nicknames)
- [NicknamesChangedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/NicknamesChangedEvent)
- [Notification](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/Notification)
- [NotificationType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/NotificationType)
- [OverageDetectedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/OverageDetectedEvent)
- [ParentInterestDisabledEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ParentInterestDisabledEvent)
- [ParentInterestEnabledEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ParentInterestEnabledEvent)
- [ParentInterestPayoutCompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ParentInterestPayoutCompletedEvent)
- [ParentInterestUpdatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ParentInterestUpdatedEvent)
- [PayoutAllocations](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/PayoutAllocations)
- [ProfileLevelChangedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/ProfileLevelChangedEvent)
- [RoundupDisabledEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/RoundupDisabledEvent)
- [RoundupEnabledEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/RoundupEnabledEvent)
- [RoundupPayoutCompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/RoundupPayoutCompletedEvent)
- [SavingsGoal](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SavingsGoal)
- [SavingsGoalCompletedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SavingsGoalCompletedEvent)
- [SavingsGoalCreatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SavingsGoalCreatedEvent)
- [SavingsGoalRemovedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SavingsGoalRemovedEvent)
- [SavingsGoalUpdatedEvent](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SavingsGoalUpdatedEvent)
- [SpendingRequestType](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SpendingRequestType)
- [SpendingRule](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SpendingRule)
- [SpendingRuleEval](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/SpendingRuleEval)
- [User](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/User)
- [UserReference](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/UserReference)
- [WebhookConfig](https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/md/v2/Event%20API.json/schemas/WebhookConfig)

Bundled OpenAPI file: https://apis.poweredby.partners.gl-tech.io/api/v1/published/Partnerships/GL-POWEREDBY-API/bundle/v2/Event%20API.json
