> For the complete documentation index, see [llms.txt](https://docs.learncard.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.learncard.com/core-concepts/consent-and-permissions/consent-transactions.md).

# Consent Transactions

Explore the Consent Transaction system, which provides a reliable audit trail of all significant consent-related activities. Understand the different transaction types and how they transparently record the history of consent decisions and changes.

### Transaction System <a href="#transaction-system" id="transaction-system"></a>

Every action in the consent flow creates a transaction record, which provides an audit trail of all consent-related activities.

```mermaid
graph TD
    Terms["ConsentFlowTerms"] -->|has| Transactions["ConsentFlowTransaction[]"]

    Transactions -->|includes| ConsentTx["consent: initial consent"]
    Transactions -->|includes| UpdateTx["update: terms modified"]
    Transactions -->|includes| WithdrawTx["withdraw: consent revoked"]
    Transactions -->|includes| SyncTx["sync: credentials synced"]
    Transactions -->|includes| WriteTx["write: credential issued"]

    ConsentTx -->|records| ConsentDate["date"]
    ConsentTx -->|may record| ExpiresAt["expiresAt"]
    ConsentTx -->|may record| OneTime["oneTime"]

    SyncTx -->|records| SyncedCredentials["credentials by category"]

    WriteTx -->|may link to| IssuedCredential["credential"]
```

Transaction types:

* **consent**: Created when a user initially consents
* **update**: Created when a user updates their terms
* **withdraw**: Created when a user withdraws consent
* **sync**: Created when a user syncs credentials to the contract
* **write**: Created when a credential is issued through the contract

Transactions can be retrieved using `getConsentFlowTransactions` for a specific terms URI.


---

# 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://docs.learncard.com/core-concepts/consent-and-permissions/consent-transactions.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.
