> ## Documentation Index
> Fetch the complete documentation index at: https://developer.moneyone.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Consent Events

> Webhook notifications for consent lifecycle changes

## Overview

Consent events notify your application when a user's consent status changes. These events cover the full consent lifecycle — from approval through expiration or revocation.

All consent events have `eventType: "CONSENT"` and differ by `eventStatus`.

## Consent Lifecycle

```mermaid theme={null}
stateDiagram-v2
    [*] --> PENDING: Consent requested
    PENDING --> APPROVED: User approves
    PENDING --> REJECTED: User rejects
    APPROVED --> ACTIVE: Consent activated
    ACTIVE --> PAUSED: User/FIU pauses
    PAUSED --> RESUMED: User/FIU resumes
    RESUMED --> ACTIVE: Re-activated
    ACTIVE --> REVOKED: User/FIU revokes
    ACTIVE --> EXPIRED: Consent period ends
    PAUSED --> REVOKED: Revoked while paused
    PAUSED --> EXPIRED: Expires while paused
```

## Events

<AccordionGroup>
  <Accordion title="CONSENT_APPROVED">
    Sent when a user approves a consent request. This is typically the trigger to initiate an [FI Request](/api-reference/data/fi-request) to fetch the user's financial data.

    ### Basic Payload (Type 1)

    ```json theme={null}
    {
      "timestamp": "2022-03-08T12:21:43.616Z",
      "consentHandle": "c7f0d368-a05f-468d-8d6c-c75acc17f224",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_APPROVED",
      "consentId": "bf0cda0b-776c-4104-a4f8-5bcd69764125",
      "vua": "9999999999@onemoney",
      "eventMessage": "Consent approved for consent id bf0cda0b-776c-4104-a4f8-5bcd69764125"
    }
    ```

    ### Extended Payload (Type 2)

    ```json theme={null}
    {
      "timestamp": "2023-03-10T06:26:02.035Z",
      "consentHandle": "5eada97a-9852-4227-9558-45849b2800a3",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_APPROVED",
      "consentId": "3c92001e-57ea-4320-bbb8-66d524bfb435",
      "vua": "XXXXXXX773@onemoney",
      "eventMessage": "Consent approved for consent id 3c92001e-57ea-4320-bbb8-66d524bfb435",
      "productID": "AGENT",
      "accountID": "AGENT1678429501561",
      "fetchType": "ONETIME",
      "consentExpiry": "2023-03-11 06:25:13"
    }
    ```

    <Tip>
      On receiving `CONSENT_APPROVED`, trigger an [FI Request](/api-reference/data/fi-request) to begin fetching the user's financial data. You will then receive a `DATA_READY` or `DATA_DENIED` event once the fetch completes.
    </Tip>
  </Accordion>

  <Accordion title="CONSENT_REJECTED">
    Sent when a user rejects a consent request. The `consentId` may be empty or `<NULL>` since no consent artifact was created.

    ### Basic Payload (Type 1)

    ```json theme={null}
    {
      "timestamp": "2020-12-18T09:58:12.162Z",
      "consentHandle": "26a9b8a5-9396-47d5-a37e-b09b95740337",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_REJECTED",
      "consentId": "<NULL>",
      "eventMessage": "Consent rejected for consent id <NULL>"
    }
    ```

    ### Extended Payload (Type 2)

    ```json theme={null}
    {
      "timestamp": "2023-03-10T07:06:51.513Z",
      "consentHandle": "b3bf17ec-9431-4def-be7d-48cffe2ef491",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_REJECTED",
      "consentId": "",
      "vua": "7730808773@onemoney",
      "eventMessage": "Consent is rejected",
      "productID": "AGENT",
      "accountID": "AGENT1678431946347",
      "fetchType": "ONETIME",
      "consentExpiry": "2023-03-11 07:05:51"
    }
    ```

    <Note>
      When a consent is rejected, `consentId` will be empty or `<NULL>`. Use the `consentHandle` to correlate this event with the original consent request.
    </Note>
  </Accordion>

  <Accordion title="CONSENT_PAUSED">
    Sent when an active consent is paused. While paused, no data fetch operations can be performed against this consent.

    ### Basic Payload (Type 1)

    ```json theme={null}
    {
      "timestamp": "2022-03-08T12:24:40.836Z",
      "consentHandle": "c7f0d368-a05f-468d-8d6c-c75acc17f224",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_PAUSED",
      "consentId": "bf0cda0b-776c-4104-a4f8-5bcd69764125",
      "vua": "9999999999@onemoney",
      "eventMessage": "Consent paused for consent id bf0cda0b-776c-4104-a4f8-5bcd69764125"
    }
    ```

    ### Extended Payload (Type 2)

    ```json theme={null}
    {
      "timestamp": "2023-03-10T06:29:11.246Z",
      "consentHandle": "5eada97a-9852-4227-9558-45849b2800a3",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_PAUSED",
      "consentId": "3c92001e-57ea-4320-bbb8-66d524bfb435",
      "vua": "XXXXXXX773@onemoney",
      "eventMessage": "Consent paused for consent id 3c92001e-57ea-4320-bbb8-66d524bfb435",
      "productID": "AGENT",
      "accountID": "AGENT1678429501561",
      "fetchType": "ONETIME",
      "consentExpiry": "2023-03-11 06:25:13"
    }
    ```
  </Accordion>

  <Accordion title="CONSENT_RESUMED">
    Sent when a previously paused consent is reactivated. Data fetch operations can resume for this consent.

    ### Basic Payload (Type 1)

    ```json theme={null}
    {
      "timestamp": "2022-03-08T12:25:18.377Z",
      "consentHandle": "c7f0d368-a05f-468d-8d6c-c75acc17f224",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_RESUMED",
      "consentId": "bf0cda0b-776c-4104-a4f8-5bcd69764125",
      "vua": "9999999999@onemoney",
      "eventMessage": "Consent reactivated for consent id bf0cda0b-776c-4104-a4f8-5bcd69764125"
    }
    ```

    ### Extended Payload (Type 2)

    ```json theme={null}
    {
      "timestamp": "2023-03-10T06:29:49.212Z",
      "consentHandle": "5eada97a-9852-4227-9558-45849b2800a3",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_RESUMED",
      "consentId": "3c92001e-57ea-4320-bbb8-66d524bfb435",
      "vua": "XXXXXXX773@onemoney",
      "eventMessage": "Consent reactivated for consent id 3c92001e-57ea-4320-bbb8-66d524bfb435",
      "productID": "AGENT",
      "accountID": "AGENT1678429501561",
      "fetchType": "ONETIME",
      "consentExpiry": "2023-03-11 06:25:13"
    }
    ```
  </Accordion>

  <Accordion title="CONSENT_REVOKED">
    Sent when an active or paused consent is revoked by the user or FIU. After revocation, no further data fetch operations are possible for this consent. Any previously fetched data should be handled according to your data retention policies.

    ### Basic Payload (Type 1)

    ```json theme={null}
    {
      "timestamp": "2022-03-08T12:25:55.476Z",
      "consentHandle": "c7f0d368-a05f-468d-8d6c-c75acc17f224",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_REVOKED",
      "consentId": "bf0cda0b-776c-4104-a4f8-5bcd69764125",
      "vua": "9999999999@onemoney",
      "eventMessage": "Consent revoked for consent id bf0cda0b-776c-4104-a4f8-5bcd69764125"
    }
    ```

    ### Extended Payload (Type 2)

    ```json theme={null}
    {
      "timestamp": "2023-03-10T06:31:49.092Z",
      "consentHandle": "5eada97a-9852-4227-9558-45849b2800a3",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_REVOKED",
      "consentId": "3c92001e-57ea-4320-bbb8-66d524bfb435",
      "vua": "XXXXXX773@onemoney",
      "eventMessage": "Consent revoked for consent id 3c92001e-57ea-4320-bbb8-66d524bfb435",
      "productID": "AGENT",
      "accountID": "AGENT1678429501561",
      "fetchType": "ONETIME",
      "consentExpiry": "2023-03-11 06:25:13"
    }
    ```
  </Accordion>

  <Accordion title="CONSENT_EXPIRED">
    Sent when a consent reaches its expiry date. Like revocation, no further data fetch operations are possible. For periodic consents, you may need to request a new consent from the user.

    ### Basic Payload (Type 1)

    ```json theme={null}
    {
      "timestamp": "2022-03-31T04:38:22.720Z",
      "consentHandle": "b600d92b-36ba-45d3-a42a-5fac53fabe87",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_EXPIRED",
      "consentId": "6d867fc2-24bd-4b89-b9fe-fefbb076cbd2",
      "vua": "9999999999@onemoney",
      "eventMessage": "Consent expired for consent id 6d867fc2-24bd-4b89-b9fe-fefbb076cbd2"
    }
    ```

    ### Extended Payload (Type 2)

    ```json theme={null}
    {
      "timestamp": "2023-03-11 07:09:51",
      "consentHandle": "3b14393a-ccb7-4df9-aad4-01634c909e45",
      "eventType": "CONSENT",
      "eventStatus": "CONSENT_EXPIRED",
      "consentId": "37c176a2-85a2-49df-924f-69ebb74df7a2",
      "vua": "XXXXXX499@onemoney",
      "eventMessage": "Consent expired for consent id 37c176a2-85a2-49df-924f-69ebb74df7a2",
      "productID": "RGS0002",
      "accountID": "888",
      "fetchType": "ONETIME",
      "consentExpiry": "2023-03-11 07:09:51"
    }
    ```
  </Accordion>
</AccordionGroup>

## Integration Guidance

| Event              | Recommended Action                                                                                                                     |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| `CONSENT_APPROVED` | Trigger an [FI Request](/api-reference/data/fi-request) to begin data fetch                                                            |
| `CONSENT_REJECTED` | Update UI to inform the user; optionally retry consent request                                                                         |
| `CONSENT_PAUSED`   | Suspend any scheduled data fetches for this consent                                                                                    |
| `CONSENT_RESUMED`  | Resume scheduled data fetches; trigger a new [FI Request](/api-reference/data/fi-request) if needed                                    |
| `CONSENT_REVOKED`  | Stop all data operations; clean up stored data per retention policies                                                                  |
| `CONSENT_EXPIRED`  | Stop all data operations; prompt user to create a new [consent request](/api-reference/consent/request-v2) if ongoing access is needed |
