---
id: audit-data-agreement-records-list
title: "Fetch all consent records"
description: "This endpoint is used to fetch all consent records with pagination for individuals in an organisation defined in the consent building block."
sidebar_label: "Fetch all consent records"
hide_title: true
hide_table_of_contents: true
api: eJzlWd1yG7cVfpUzuIk0syQl2U4aTiatbDkJG9dRYzu9cDTx4e4hFxEW2ABYSqyGd32SPlqfpHOA/SelyJ5edFpdSKtdnB+c3w8HdyIjl1pZemm0mIu3uXRAOiuN1B6kg8pRBt7AinyaAyoFqdGOtAdLqbGZgxvpcyhxLTUyE1gZC1JnciOzCpUDqQE1GLtGLV1cktFKasr4k8+p5bispMqkXsNSmfR6KhJhSrKBZJGJucAqk/4CPZ6vLVFB2v8YdXglnReJKNFiQZ6sE/P3d6Odva6KJVkwq1Zxb8BdyzIo3OnPYiUT/FaR3YpEaCxIzIVZrRyxFEu/VdJSJuYrVI4S4dKcChTzO+G3JS+V2tOarNjtkruGXMlC+jHroYZ/wVtZVAXoQ5pa8pXVUFLQlaYfpQhLWmGlvJifngSthpLfaflbRbC4YKHsrOWvlO5p2+wEb1aVeo5OOnFApvNW6vXe5l4FKlgyGUthv2PjRpi0MTADRWtUv5ilkusYLTP+6C2m/HUjPapfeGOWHL8oq6WS6S8e3XUkll4W6KldIxJBuirE/L2ohYhEjIWIRDRCRCKGQjiyOiGReE/I1QGzLi6C5ii162UELC4SyNBjb/9seTvKLFhc3OMBmT1g+AN6OEq9sY3VH3RuXPog+yuOPFeyro6/n52c8B/eKdt2fiewLJVMg11nvzpW4a7Hr7Sc1V5G6nrPdSLzG+mpCA+o1A+rkMm1Cq3mXnrFL170ifdC7nxsULotLTlHrv1whG5YjKQbVaHPHLiSUrmqN3TMyYjgpF4rgkExmsLbnCxBUTkPSwKEd68Xf333MkjzFrmiGg1HI99b2kgnjU56MXIsEnE70cZPpJ7w+iU6avO8S/z3MRawq4eR13focnaiR0/iKhnZXGaH8nVlbIFezAUnzC0WZTDx58+efnF6dnZGf0i/SJ8sl0/Ss/TLL09O96z9Q3COg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jcOM9L7u4YnLyzarfj1/GGIFRi6div3YXTvYb5mMu2g1pfc0Ht7txC5ePTTijmj1bjY2/UHlClQcifqMm9N2wPiRxctH2i4P/EHdQDOobrh09U7Z5rqQektVOUTuIV/2NDXYxwpOm3HLCRittO2ffdHrrb9RHKty+5c2Hd1rqWfh1aev3Qu5VCve3xHnf3qAL/7s0zhiRfcd36nrZft8vjl3sJ2n5Y+4A3sNvt/g0JbBmH
sidebar_class_name: "get api-method"
info_path: docs/consent-management-admin-api/igrant-io-api-documentation
custom_edit_url: null
---

> **Build this with an AI coding agent.** Install the iGrant.io Agent Skills, then ask your agent to build the integration:
>
> ```bash
> npx skills add L3-iGrant/skills
> ```


import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import Markdown from "@theme/Markdown";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";

<h1 className={"openapi__heading"}>Fetch all consent records</h1>

<MethodEndpoint method={"get"} path={"/audit/consent-records"}></MethodEndpoint>



This endpoint is used to fetch all consent records with pagination for individuals in an organisation defined in the consent building block.

## Request

<details style={{"marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{}}><h3 className={"openapi-markdown__details-summary-header-params"}>Query Parameters</h3></summary><div><ul><ParamsItem className={"paramsItem"} param={{"description":"Number of records to skip for pagination.","in":"query","name":"offset","required":false,"schema":{"type":"integer"}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"name":"limit","in":"query","description":"Maximum number of records to return per page.","required":false,"schema":{"type":"integer","default":10}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"description":"Unique ID of an object","in":"query","name":"lawfulBasis","schema":{"type":"string","description":"Lawful basis of the agreement - consent / legal_obligation / contract / vital_interest / public_task / legitimate_interest","enum":["consent","legal_obligation","contract","vital_interest","public_task","legitimate_interest"]}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"description":"ID contains individual ID, data agreement ID or consent record ID","in":"query","name":"id","schema":{"type":"string"}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"description":"sector of the object","in":"query","name":"sector","schema":{"type":"string"}}}></ParamsItem></ul></div></details><div><div><ApiTabs label={undefined} id={undefined}><TabItem label={"200"} value={"200"}><div>

Consent records for data agreements (based on ISO 27560) listed successfully

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}></ul></details><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"consentRecords"} required={false} schemaName={"object[]"} qualifierMessage={undefined} schema={{"items":{"allOf":[{"type":"object","title":"ConsentRecord","description":"A consent record expresses consent (as defined in this building block's specification) to a single DataAgreement. There must be a UNIQUE constraint on (data agreement revision, individual)","x-not-in-database":false,"required":["id","agreementRevisionHash","state"],"properties":{"id":{"type":"string","format":"","example":"65471222e8c7c3bb3c2c9901","description":"Objects may be passed back by some API endpoints without an ID (PK), denoting that they are a \"draft\", i.e. a ConsentRecord that is not yet stored in the database and only exist in transit. Draft ConsentRecords do not have a Revision, but if paired up with a Signature, a valid Revision should be generated."},"dataAgreementId":{"type":"string","x-fk-model":"DataAgreement","description":"The DataAgreement to which consent has been given"},"dataAgreementRevisionId":{"type":"string","x-fk-model":"Revision","description":"The Revision of the data agreement which consent has been given to"},"dataAgreementRevisionHash":{"type":"string","format":"","example":"a1b2c3d4e5f6...","description":"Copy of the revision hash. The hash is the included in the signature and ensures against tampering with the original agreement."},"individualId":{"type":"string","x-fk-model":"Individual","description":"The Individual who has signed this consent record"},"optIn":{"type":"boolean","format":"","example":true,"description":"True: The individual has positively opted in. False: The individual has explicitly said no (or withdrawn a previous consent)."},"state":{"type":"string","format":"","example":"signed","description":"The state field is used to record state changes after-the-fact. It is maintained by the Consent BB itself. Valid states: unsigned/pending more signatures/signed","enum":["unsigned","signed"]},"signatureId":{"type":"string","x-fk-model":"Signature","description":"A signature that hashes all the values of the consent record and has signed it with the key of the Invidiual, making it verifiable and tamper-proof. TBD: Relation to a Signature schema?"},"sectorPreferences":{"type":"array","items":{"type":"object","description":"specifies the preferred sector details","x-not-in-database":false,"required":["sector","location"],"properties":{"sector":{"type":"string","format":"","example":"","description":"Name of the sector"},"optIn":{"type":"boolean","description":"Defines sector is opted in or not"},"isLastUpdated":{"type":"boolean","description":"Defines consent record for this sector is last updated"}}}}}},{"type":"object","properties":{"timestamp":{"type":"string"},"dataAgreement":{"type":"object","properties":{"version":{"type":"string","description":"Version of data agreement"},"purpose":{"type":"string","description":"Name of purpose"},"lawfulBasis":{"type":"string","format":"","example":"","description":"Lawful basis of the agreement - consent / legal_obligation / contract / vital_interest / public_task / legitimate_interest","enum":["consent","legal_obligation","contract","vital_interest","public_task","legitimate_interest"]}}}}}]},"type":"array"}}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><span className={"openapi-schema__container"}><strong className={"openapi-schema__property"}>pagination</strong><span className={"openapi-schema__name"}> object</span></span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"currentPage"} required={false} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","description":"Current page number","example":1}}></SchemaItem><SchemaItem collapsible={false} name={"totalItems"} required={false} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","description":"Total number of items available","example":25}}></SchemaItem><SchemaItem collapsible={false} name={"totalPages"} required={false} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","description":"Total number of pages based on limit","example":3}}></SchemaItem><SchemaItem collapsible={false} name={"limit"} required={false} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","description":"Number of items per page","example":10}}></SchemaItem><SchemaItem collapsible={false} name={"hasPrevious"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean","description":"Indicates if there's a previous page","example":false}}></SchemaItem><SchemaItem collapsible={false} name={"hasNext"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean","description":"Indicates if there's a next page","example":true}}></SchemaItem></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"consentRecords\": [\n    {\n      \"id\": \"65471222e8c7c3bb3c2c9901\",\n      \"dataAgreementId\": \"string\",\n      \"dataAgreementRevisionId\": \"string\",\n      \"dataAgreementRevisionHash\": \"a1b2c3d4e5f6...\",\n      \"individualId\": \"string\",\n      \"optIn\": true,\n      \"state\": \"signed\",\n      \"signatureId\": \"string\",\n      \"sectorPreferences\": [\n        {\n          \"sector\": \"\",\n          \"optIn\": true,\n          \"isLastUpdated\": true\n        }\n      ],\n      \"timestamp\": \"string\",\n      \"dataAgreement\": {\n        \"version\": \"string\",\n        \"purpose\": \"string\",\n        \"lawfulBasis\": \"\"\n      }\n    }\n  ],\n  \"pagination\": {\n    \"currentPage\": 1,\n    \"totalItems\": 25,\n    \"totalPages\": 3,\n    \"limit\": 10,\n    \"hasPrevious\": false,\n    \"hasNext\": true\n  }\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>

bad input parameter

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}></ul></details><div></div></TabItem><TabItem label={"401"} value={"401"}><div>

Unauthorized

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}></ul></details><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"errorCode"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","example":400}}></SchemaItem><SchemaItem collapsible={false} name={"errorDescription"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Bad input parameter"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"errorCode\": 400,\n  \"errorDescription\": \"Bad input parameter\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"500"} value={"500"}><div>

Internal server error

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}></ul></details><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"errorCode"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","example":400}}></SchemaItem><SchemaItem collapsible={false} name={"errorDescription"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Bad input parameter"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"errorCode\": 400,\n  \"errorDescription\": \"Bad input parameter\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem></ApiTabs></div></div>
      