---
id: audit-consent-record-read
title: "Get consent record"
description: "This endpoint is used to get a single consent record by ID in an organisation defined in the consent building block."
sidebar_label: "Get consent record"
hide_title: true
hide_table_of_contents: true
api: eJzdWF9z27gR/yo7eKk9Q1G28q+nubnWiXOpmptcaiftQ84zXhErEmcSYABQtqrR232S+2j9JJ0FKFKi5BvnqTP1g00T2MVi97e/3eVaSHKZVbVXRoup+FQoB6RlbZT2oBw0jiR4Azl5QHBK5yVBZrQj7cFSZqyE+Qpml6A0oAZjc9TKIesDSQulSfKSL3qxeaNKqXQO89Jkd6lIhKnJBpGZFFOBjVT+Tdx8FY64IpQiETVarMiTdWL6ZT0w/bNWXxtiS8wiWDL/lTIvEqF4tUZfiERorEhMRbarfMaqLX1tlCUppt42lAiXFVShmK6FX9Us4rxVOhebzQ1vdjVrcLw+OTvjP5nRnrTnR6zrUmXhPuNfHRu33tFXW76tV1F6z5Kd4zrrvfIlv9jzh0gGl78YxoQeakvOkesWTtDtB0S5QST+5MDVlKlFa/wpB74L+iV6vMgtUUXap/CpIEtQNc7DnADh84fZPz6/Dad5i4weo+FEokfArRRYWiqnjE5AaamWSjZYnopEPIy08SOlR7x/jo7EdIGlo924fBGK790pu2p1/Q0dR9Z59CRukoF/lTyMYSIWxlboxVSIRNADVnVw8csXz1+dTyYT+nP2Kns2nz/LJtl3352dH3j75xAcBxWu+PI1Os6SOWZ3nAvOVAQXH2ddHjm4V74wjWdYzi7h5OP70wQkaePZ975Az/mxArTsyV+EtLjwv4gEVEopIOzFPu5XDrTxsCIPzhvbJ9nWg4BagtHlCuhBOR+WLWqnfAqXrH9fqwNpgsYCl2zEVRepeeNBLaBGDgM0dbgMIFyrXKNvLCWAsMRSyU4IXGGaUrJvctKc2iRTsUmE3MXQ7GhoHkaLu1FlJJViKvYwdxCGT8UAlYzX+0JlRQf6Ah3MiTTkakn6wIStwU8wZbv1qBXdxc2iC8IO7P/IJvDmUbMCtJ8MXzyfT7Jn8jm9WLxM0/TA0DemXm0N3CYiG1OE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369MY9kjozta/XAbup5dHKzFPPz347ZQ/P1fnw7vFogOvLkjvR3PgnlRU2sz8/2eEdB5MORkYPsgILp849CJTWhlF2ab3JiF5KYKFYfXNXVtrP9rF9I+JOpd/2ofC/3mg0TqhODkP7/9fsolBOH6nqRyRSwB9BBbtdBPxPYihjMgT2UcJbNUkmxo3hoXil+5GDmzJEsq16Akg8Cvkt32JLMUXmPpeMqTKlee+20sS/4epCU4w/1dbSR4ygptSpMrcgmQxnmIOYKmeyhpSSUDikkoMBXOVan8KijBxpsKwzCcmaouFeqMYsDC9SzlTWyIXPjMBKGEQUjyYGeFWpPlkadUGWkXaG+bBTVmBcEkPTvw+f39fYphOTU2H7eybvzT7M3bD9dvRyyz6T/B9HHg3JEma7jqbrOLaSTGa3I2eZ4+S89ZtjbOV6h37HlHfjicDAK+UzH+Vx/kWrR7evDjukQVRufgvHXLsV/iZzqRiH2WFYmYDj+v3SSiMM6z0HrNPcpnW242/PprQzbQfSKWaAPoIhUrx8+yazAfddDJVVs0T+HRL4BHb7OlUM38GQgvNpp3zLAHXwg3PHa09MAGxl3MM7XfkT+o75vdGvXuLVMVtjzWc/hd4PD2gbUftW1I59EE/s2F56jI9wzU97T6odseVx4V6Agw7mZP3Ww2m/8Cf7K6Lg==
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"}>Get consent record</h1>

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



This endpoint is used to get a single consent record by ID 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"}>Path Parameters</h3></summary><div><ul><ParamsItem className={"paramsItem"} param={{"description":"Unique ID of an object","in":"path","name":"consentRecordId","required":true,"schema":{"type":"string"}}}></ParamsItem></ul></div></details><div><div><ApiTabs label={undefined} id={undefined}><TabItem label={"200"} value={"200"}><div>

Consent record for data agreement (based on ISO 27560) retrieved 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={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><span className={"openapi-schema__container"}><strong className={"openapi-schema__property"}>consentRecord</strong><span className={"openapi-schema__name"}> object</span></span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

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)

</div><SchemaItem collapsible={false} name={"id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"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."}}></SchemaItem><SchemaItem collapsible={false} name={"dataAgreementId"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","x-fk-model":"DataAgreement","description":"The DataAgreement to which consent has been given"}}></SchemaItem><SchemaItem collapsible={false} name={"dataAgreementRevisionId"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","x-fk-model":"Revision","description":"The Revision of the data agreement which consent has been given to"}}></SchemaItem><SchemaItem collapsible={false} name={"dataAgreementRevisionHash"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"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."}}></SchemaItem><SchemaItem collapsible={false} name={"individualId"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","x-fk-model":"Individual","description":"The Individual who has signed this consent record"}}></SchemaItem><SchemaItem collapsible={false} name={"optIn"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"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)."}}></SchemaItem><SchemaItem collapsible={false} name={"state"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** [`unsigned`, `signed`]"} schema={{"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"]}}></SchemaItem><SchemaItem collapsible={false} name={"signatureId"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"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?"}}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><span className={"openapi-schema__container"}><strong className={"openapi-schema__property"}>sectorPreferences</strong><span className={"openapi-schema__name"}> object[]</span></span></summary><div style={{"marginLeft":"1rem"}}><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"sector"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","format":"","example":"","description":"Name of the sector"}}></SchemaItem><SchemaItem collapsible={false} name={"optIn"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean","description":"Defines sector is opted in or not"}}></SchemaItem><SchemaItem collapsible={false} name={"isLastUpdated"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean","description":"Defines consent record for this sector is last updated"}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"consentRecord\": {\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  }\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>
      