---
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: eJzdWF9v2zgS/yoDvlwCyHLq/rs1FnuXNr2u0UW3l6T30g3QsTiSuJFIlaSc+AK/3Se5j3af5DCkLNmys0ifDrg8OILIGc78ZuY3Qz0ISS6zqvHKaDEX16VyQFo2RmkPykHrSII3UJAHBKd0URFkRjvSHixlxkpYrmFxAUoDajC2QK0csj6QlCtNkpd8OYgtW1VJpQtYVia7TUUiTEM2iCykmAtspfJv4+bLcMQloRSJaNBiTZ6sE/MvDyPTP2v1rSW2xOTBkuXvlHmRCMWrDfpSJEJjTWIusl3lC1Zt6VurLEkx97alRLispBrF/EH4dcMizlulC7HZ3PBm17AGx+uzszP+lxntSXt+xKapVBb8mf7u2LiHHX2NZW+9itJ7luwc11vvla/4xR4eIhk5fz6OCd03lpwj1y+coNsPiHKjSPzJgWsoU3ln/CkHvg/6BXo8LyxRTdqncF2SJahb52FJgPD54+Lvn9+F07xFzh6j4USiR8CtFFhaKaeMTkBpqVZKtlidikTcT7TxE6UnvH+JjsQ8x8rRbly+CMV+98ouO10/o+PIOo+exE0ywlfJwxgmIje2Ri/mQiSC7rFuAsSvXr54/Ww2m9Gfs9fZ8+XyeTbLfvjh7NkB2r+G4Diocc3ON+i4SpaY3XItOFMTnH9a9HXk4E750rSe03JxASefPpwmIEkbz9j7Ej3XxxrQMpK/CWkx97+JBFRKKSDsxT7uVw608bAmD84bOxTZFkFALcHoag10r5wPyxa1Uz6FC9a/r9WBNEFjiSs24rKP1LL1oHJokMMAbROcAYQrVWj0raUEEFZYKdkLgStNW0nGpiDNpU0yFZtEyN0cWhwNzf0kv53URlIl5mIv5w7CcF2OspLz9a5UWdknfYkOlkQaCrUifWDC1uAnmLLdetSK3nGT90HYSfs/sgm8edSskNpPTl98tpxlz+ULepm/StP0wNC3pllvDdwWIhtThmIOT5xWvKx0VrVySCq3j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dUM1KsbStU1jrP9rj9/gv3o/vNoHfth8kKO9EJz851//PmV2Rri6I6lcGdmV7uMUFFp17NwRuxBmlTEkZqUk2TAXtS70lSqfOLMiS6rQoCQj7tfJbufPLIXXWDm+QElVKM+jLFYVf2rREpzh0akxEjxlpTaVKRS5BEjjMgCMoOkOKlpRxdHj+g4kgEtVKb8OSrD1psZwz8xM3VQKdUYxeME9S0UbZw0XvuBA6A4QKirYWaPWZPk2UamMtAuMsk25BrOSYJaeHWB+d3eXYlhOjS2mnayb/rJ4++7j1bsJy2yGrxtDHDhRpclabmjbVOaajfGanc1epM/TZyzbGOdr1Dv2vCc/nvtHAd8h4//Vt66umD3d+2lToQq30gDeQ0doX+IXMJGIfUoTiZiPv1zdJKI0zrPQwwO3/8+22mz49beWbGDSRKzQhqSLvKccP8t+dnsUoJPLrh+dwqMf1456s+UrzWQV2CXOcLdMZwcf3zY80XdsxgbGXedZRo3fkT9onZvdhvD+3TV/HGp9uU+Yt4EwuwfWftS2MXdGE/iXWf6oyI+cqB9o/VO/Pa48KtDzddzNSN1sNpv/AqXHgMY=
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>
      