> 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/company-profile/legal-entity.md).

# Legal Entity

## Get Legal Entity Policy

> Retrieves all the legal entities associated with a specific tenant.<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/legal-entity":{"get":{"description":"Retrieves all the legal entities associated with a specific tenant.\n","responses":{"200":{"description":"Get legal entity Policy","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"compliance_id":{"type":"string","description":"A system-generated compliance ID to retrieve the legal entity."},"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 legal entity is active or not. If set to True, the legal entity is active; if False, the legal entity is inactive."},"can_delete":{"type":"boolean","description":"A boolean field indicating whether the legal entity can be deleted or not. If set to True, the user is allowed to delete the legal entity; if False, deletion is not permitted."},"code":{"type":"string","description":"Displays the name of the legal entity."},"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."},"description":{"type":"string","description":"Description of the legal entity."},"guid":{"type":"string","description":"Globally unique identifier generated by the system."},"is_user_defined":{"type":"boolean","description":"A boolean field indicating whether the legal entity is defined by the user or not. If set to True, the user is allowed to define the legal entity; if False, defining the legal entity is not permitted."},"name":{"type":"string","description":"Displays the name of the legal entity."},"transaction":{"type":"boolean","description":"A boolean field indicating transaction value is there or not "},"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"}}},"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."},"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":"Represents the name of the legal entity."},"version_id":{"type":"string","description":"Represents the latest version of the policy."}}}}}}}},"tags":["Policy Sets"],"summary":"Get Legal Entity Policy","operationId":"get_legal_entity_policy_apis_policy_sets_v1_policy_legal_entity_get"}}}}
```

## Patch Legal Entity Policy

> Add a new \*\*Legal Entity\*\*.<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/legal-entity/{compliance_id}":{"patch":{"description":"Add a new **Legal Entity**.\n","parameters":[{"name":"compliance_id","in":"path","required":true,"schema":{"type":"string","title":"Compliance Id"},"description":"User has to provide a compliance id to add a new legal entity. This compliance id can be fetched from the response of the **Legal Entity Policy - GET** API.\n"}],"responses":{"200":{"description":"Add New legal entity 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":"Displays the name of the legal entity."}}},"description":"A list of compliance-related entries, each providing detailed information about the outcome of a specific compliance check. This includes messages, associated errors, and a system-generated unique identifier for tracking."},"compliance_id":{"type":"string","description":"A system-generated compliance ID to add a new legal entity."},"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."}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_name":{"type":"string","description":"Name of the Policy."},"unique_key":{"type":"string","description":"Represents the name of the legal entity."},"format_type":{"type":"string","description":"It's a format of the data. For e.g. JSON"},"compliance_spec":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"Displays the name of Legal Entity."},"description":{"type":"string","description":"Description of the legal entity"},"guid":{"type":"string","description":"Globally unique identifier generated by the system."},"name":{"type":"string","description":"Name of the Legal Entity"},"active":{"type":"boolean","description":"A boolean field indicating whether the legal entity is active or not. If set to True, the legal entity is active; if False, the legal entity is inactive."},"transaction":{"type":"boolean","description":"A boolean field indicating transaction value is there or not"},"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 is allowed to define the policy; if False, defining the policy is not permitted."},"can_delete":{"type":"boolean","description":"A boolean field indicating whether the policy can be deleted or not. If set to True, the user is allowed to delete the policy; if False, deletion is not permitted."}},"required":["active","can_delete","code","description","guid","is_user_defined","name","transaction"]},"description":"Defines the specific rules and standards where a system must process adhering to the compliant."}},"required":["compliance_name","compliance_spec","format_type","unique_key"]}}},"required":true},"tags":["Policy Sets"],"summary":"Patch Legal Entity Policy","operationId":"patch_legal_entity_policy_apis_policy_sets_v1_policy_legal_entity__compliance_id__patch"}}}}
```

## Patch Legal Entity Policy

> Update the \*\*Legal Entity\*\* policy.<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/legal-entity/{compliance_id}":{"put":{"description":"Update the **Legal Entity** policy.\n","parameters":[{"name":"compliance_id","in":"path","required":true,"schema":{"type":"string","title":"Compliance Id"},"description":"User has to provide a compliance id to update a legal entity. This compliance id can be fetched from the response of the **Legal Entity Policy - GET** API.\n"}],"responses":{"200":{"description":"Update legal entity 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":"Displays the name of the legal entity."}}},"description":"A list of compliance-related entries, each providing detailed information about the outcome of a specific compliance check. This includes messages, associated errors, and a system-generated unique identifier for tracking."},"compliance_id":{"type":"string","description":"A system-generated compliance ID to update a legal entity."},"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."}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"format_type":{"type":"string","description":"Specifies the format (JSON) in which the data or file is processed."},"compliance_name":{"type":"string","description":"Name of the policy."},"unique_key":{"type":"string","description":"Unique key is code which is the name of the legal entity."},"compliance_spec":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"Name of the legal entity."},"active":{"type":"boolean","description":"A boolean field indicating whether the legal entity is active or not. If set to True, the legal entity is active; if False, the legal entity is inactive."},"name":{"type":"string","description":"Name of the legal entity"},"description":{"type":"string","description":"Description of the legal entity."},"transaction":{"type":"boolean","description":"A boolean field indication this is transaction field or not."},"is_user_defined":{"type":"boolean","description":"A boolean field indicating whether the legal entity is updated by the user or not. If set to True, the user is allowed to update the legal entity; if False, updating the legal entity is not permitted."},"can_delete":{"type":"boolean","description":"A boolean field indicating whether the legal entity can be updated or not. If set to True, the user is allowed to update the legal entity; if False, update is not permitted."}},"required":["active","can_delete","code","description","is_user_defined","name","transaction"]},"description":"Defines the specific rules and standards where a system must process adhering to the compliant."}},"required":["compliance_name","compliance_spec","format_type","unique_key"]}}},"required":true},"tags":["Policy Sets"],"summary":"Patch Legal Entity Policy","operationId":"patch_legal_entity_policy_apis_policy_sets_v1_policy_legal_entity__compliance_id__put"}}}}
```


---

# 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/company-profile/legal-entity.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.
