> For the complete documentation index, see [llms.txt](https://docs.zwapgrid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zwapgrid.com/client-portal/consents/consent-lifecycle.md).

# Consent Lifecycle

This section describes how consent is managed over its lifecycle: staying active, becoming inactive, and when Zwapgrid purges consent records.

### Keeping consent active (30-day rule)

A Consent in **Accepted** status remains active only if it is **used at least once every 30 days**. Usage means calling the Accounting API (API.1) with that Consent ID. If a Consent is not used for 30 consecutive days, it becomes **Inactive**. An Inactive Consent cannot be re-activated; to restore access, you must create a new Consent and Your Customer must complete the Onboarding Flow again.

Use the Consent regularly in Your Platform (e.g. when syncing or fetching Your Customer's data) so it stays Active. If you do not need the data for a period, the Consent will lapse and Your Customer will need to reconnect.

### When consent is removed (purging policy)

Zwapgrid removes consent records according to our retention rules so we do not keep data longer than necessary:

* **Created** – A Consent that is never accepted (Your Customer never completes the Onboarding Flow) is removed after **30 days**.
* **Inactive** – A Consent that has become Inactive (e.g. unused for 30 days, or Your Customer removed access) is removed after **180 days**.
* **Revoked** – A Consent that you or the system has revoked is removed after **180 days**.
* **Deleted** – A Consent that you delete is removed **immediately** and is no longer visible.

Until a Consent is removed, you can still see it in the Client Portal (where applicable) and use it only if it is still in Accepted status. For more about the various consent statuses, see [Consent Status](/client-portal/consents/consent-status.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zwapgrid.com/client-portal/consents/consent-lifecycle.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
