> For the complete documentation index, see [llms.txt](https://apis.rightrev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apis.rightrev.com/rightrev-rest-api/policy-sets/configuration/revenue-policies/user-defined-events.md).

# User Defined Events

## Get Events Definition Policy

> Retrieves Events policies created by the user and system for Revenue and Cost. Also retrieves the inactive event policies.<br>

```json
{"openapi":"3.1.0","info":{"title":"RightRev API(s)","version":"1.0.0"},"servers":[{"description":"RightRev APP Server","url":"https://{realm}.{env}.rightrev.cloud/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}},{"description":"RightRev Auth Server","url":"https://authn.{env}.rightrev.cloud/auth/realms/{realm}/protocol/openid-connect/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}}],"security":[],"paths":{"/apis/policy-sets/v1/policy/events-definition":{"get":{"description":"Retrieves Events policies created by the user and system for Revenue and Cost. Also retrieves the inactive event policies.\n","responses":{"200":{"description":"Get events definition Policy","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"compliance_id":{"type":"string","description":"A system-generated compliance ID to retrieve the Event Policy"},"compliance_name":{"type":"string","description":"Name of the policy fetched by the system."},"compliance_spec":{"type":"array","items":{"type":"object","properties":{"active":{"type":"boolean","description":"A boolean field indicating whether the policy is Active or not. If set to True, the policy is Active; if false, it's Inactive."},"can_delete":{"type":"boolean","description":"A boolean field indicating whether the event policy can be deleted or not. If set to True, the user is allowed to delete the event policy; if False, deletion is not permitted."},"created_at":{"type":"integer","description":"Timestamp of the policy created by the user. This is a unix Epoch timestamp format."},"created_by":{"type":"string","description":"ID of the user who created the policy. Example: username@rightrev.com"},"cumulative":{"type":"boolean","description":"If this is a cumulative event,revenue is released in a cumulative manner"},"event_category":{"type":"string","description":"Is it a Revenue Event or Cost Event?"},"event_name":{"type":"string","description":"Name of the Event Policy"},"event_type":{"type":"string","description":"Whether it's a Percentage, Amount, Formula or Quantity based event"},"is_user_defined":{"type":"boolean","description":"A boolean field indicating whether the event policy is defined by the user or not. If set to True, the user is allowed to define the event policy; if False, defining the event policy is not permitted."},"last_modified_on":{"type":"integer","description":"ID of the user last modified by"},"source_identifier":{"type":"array","items":{"type":"string"},"description":"It will be by-default unique identifier - Order Financial ID"},"updated_at":{"type":"integer","description":"Timestamp of the policy updated by the user. This is a unix Epoch timestamp format"},"updated_by":{"type":"string","description":"ID of the user who updated the policy. Example: username@rightrev.com"},"event_formula":{"type":"string","description":"Formula values defined in the formula based event policy"},"follow_revenue":{"type":"boolean","description":"A boolean field indicating whether the event policy follow revenue release or not. If set to True, event policy will follow revenue; if False, event policy will not follow revenue"},"practical_expedient":{"type":"boolean","description":" This field will display value for Cost - Practical Expedient setup under Tenant Configuration. By default the value is 12 months. This field accepts only positive numbers greater than zero."}}},"description":"Defines the specific rules and standards where a system must process adhering to the compliant."},"created_by":{"type":"string","description":"ID of the user who created the policy. Example: username@rightrev.com"},"created_on":{"type":"integer","description":"Timestamp of the policy created by the user. This is a unix Epoch timestamp format"},"last_modified_by":{"type":"string","description":"ID of the user last modified by"},"last_modified_on":{"type":"integer","description":"Timestamp of the policy last modified on. This is a unix Epoch timestamp format"},"policy_type":{"type":"string","description":"Represents the type of policy"},"status":{"type":"string","description":"Represents the status of the policy"},"unique_key":{"type":"string","description":"Name of the Policy"},"version_id":{"type":"string","description":"Unique alpha-numeric number generated by the system"}}}}}}}},"tags":["Policy Sets"],"summary":"Get Events Definition Policy","operationId":"get_events_definition_policy_apis_policy_sets_v1_policy_events_definition_get"}}}}
```

## Update Events Definition Policy

> To create or edit the event policies in the system.<br>

```json
{"openapi":"3.1.0","info":{"title":"RightRev API(s)","version":"1.0.0"},"servers":[{"description":"RightRev APP Server","url":"https://{realm}.{env}.rightrev.cloud/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}},{"description":"RightRev Auth Server","url":"https://authn.{env}.rightrev.cloud/auth/realms/{realm}/protocol/openid-connect/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}}],"security":[],"paths":{"/apis/policy-sets/v1/policy/events-definition/{compliance_id}":{"patch":{"description":"To create or edit the event policies in the system.\n","parameters":[{"name":"compliance_id","in":"path","required":true,"schema":{"type":"string","title":"Compliance Id"},"description":"A system-generated compliance ID to edit the event policy.\n"}],"responses":{"200":{"description":"Update events definition Policy","content":{"application/json":{"schema":{"type":"object","properties":{"compliance_details":{"type":"array","items":{"type":"object","properties":{"error":{"type":"array","description":"Displays information about problems that occurred while handling the request. Commonly used to report validation errors, missing or invalid parameters, or other issues related to API processing."},"message":{"type":"string","description":"Displays the outcome of the action. It is commonly used to provide success confirmations, error details, or other informational responses from the API after the operation is executed."},"unique_key":{"type":"string","description":"Name of the Event policy created."}},"required":["error","message","unique_key"]},"description":"Displays the details of specific rules and standards processed by the system."},"compliance_id":{"type":"string","description":"A system-generated compliance ID to create or edit the event policy."},"error":{"type":"array","description":"Displays information about problems that occurred while handling the request. Commonly used to report validation errors, missing or invalid parameters, or other issues related to API processing."}},"required":["compliance_details","compliance_id","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_spec":{"type":"array","items":{"type":"object","properties":{"active":{"type":"boolean","description":"A boolean field indicating whether the policy is Active or not. If set to True, the policy is Active; if false, it's Inactive."},"can_delete":{"type":"boolean","description":"A boolean field indicating whether the period can be deleted or not. If set to True, the user is allowed to delete the period; if False, deletion is not permitted."},"cumulative":{"type":"boolean","description":"A boolean field indicating whether the revenue event should be treated cumulatively or not. If set to True revenue event computes cumulatively;if false, it won't. "},"event_category":{"type":"string","description":"The event category will always be Revenue."},"event_formula":{"type":"string","description":"If the Event is computed on formula basis, user need to provide the valid formula."},"event_name":{"type":"string","description":"Name of the Revenue event"},"event_type":{"type":"string","description":"Event type can be Formula, Amount, Percentage or Quantity based"},"is_user_defined":{"type":"boolean","description":"A boolean field indicating whether the policy is defined by the user or not. If set to True, the user has created the policy; if False, created by system and not by user."},"source_identifier":{"type":"array","items":{"type":"string"},"description":"This will always be Order Financial ID - A unique identifier."}},"required":["active","can_delete","cumulative","event_category","event_formula","event_name","event_type","is_user_defined","source_identifier"]},"description":"Defines the specific rules and standards where a system must process adhering to the compliant."},"format_type":{"type":"string","description":"Format type of the request code used to collect data - For e.g. JSON "},"compliance_name":{"type":"string","description":"Name of the Policy"},"unique_key":{"type":"string","description":"Name of the Event Policy."}},"required":["compliance_name","compliance_spec","format_type","unique_key"]}}},"required":true},"tags":["Policy Sets"],"summary":"Update Events Definition Policy","operationId":"update_events_definition_policy_apis_policy_sets_v1_policy_events_definition__compliance_id__patch"}}}}
```

## Delete Events Definition Policy

> To delete the event policies from system.<br>

```json
{"openapi":"3.1.0","info":{"title":"RightRev API(s)","version":"1.0.0"},"servers":[{"description":"RightRev APP Server","url":"https://{realm}.{env}.rightrev.cloud/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}},{"description":"RightRev Auth Server","url":"https://authn.{env}.rightrev.cloud/auth/realms/{realm}/protocol/openid-connect/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}}],"security":[],"paths":{"/apis/policy-sets/v1/policy/events-definition/{compliance_id}/{object_unique_value}":{"delete":{"description":"To delete the event policies from system.\n","parameters":[{"name":"compliance_id","in":"path","required":true,"schema":{"type":"string","title":"Compliance Id"},"description":"User has to provide compliance id to delete event policy.\n"},{"name":"object_unique_value","in":"path","required":true,"schema":{"type":"string","title":"Object Unique Value"},"description":"Name of the event policy to be deleted.\n"}],"responses":{"200":{"description":"Delete events definition Policy","content":{"application/json":{"schema":{"type":"object","properties":{"compliance_details":{"type":"array","description":"Displays the details of specific rules and standards processed by the system"},"compliance_id":{"type":"string","description":"Displays a system-generated compliance ID associated with event policy to be deleted"},"error":{"type":"array","description":"Displays information about problems that occurred while handling the request. Commonly used to report validation errors, missing or invalid parameters, or other issues related to API processing."}},"required":["compliance_details","compliance_id","error"]}}}}},"tags":["Policy Sets"],"summary":"Delete Events Definition Policy","operationId":"delete_events_definition_policy_apis_policy_sets_v1_policy_events_definition__compliance_id___object_unique_value__delete"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://apis.rightrev.com/rightrev-rest-api/policy-sets/configuration/revenue-policies/user-defined-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
