> For the complete documentation index, see [llms.txt](https://specs.govstack.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://specs.govstack.global/consent/8-service-apis.md).

# 8 Service APIs

This section provides a reference for APIs that should be implemented by this Building Block.

## 8 Service APIs

This section provides a reference for APIs that should be implemented by this Building Block. The APIs defined here establish a blueprint for how the Building Block will interact with other Building Blocks. Additional APIs may be implemented by the Building Block, but the listed APIs define a minimal set of functionality that should be provided by any implementation of this Building Block.

The [GovStack non-functional requirements document](https://govstack.gitbook.io/specification/v/1.0/architecture-and-nonfunctional-requirements/6-onboarding) provides additional information on how 'adaptors' may be used to translate an existing API to the patterns described here. This section also provides guidance on how candidate products are tested and how GovStack validates a product's API against the API specifications defined here.

The tests for the Consent Building Block can be found in [this GitHub repository](https://github.com/GovStackWorkingGroup/bb-consent/tree/main/test).

## 8.1 API specification

The following is an automated rendition of the [OpenAPI YAML specification contained in this release](https://github.com/GovStackWorkingGroup/bb-consent/tree/v23Q4/api/consent-openapi.yaml).

You can see the latest unreleased version of the OpenAPI specification in [the main branch of our GitHub repository](https://github.com/GovStackWorkingGroup/bb-consent/blob/main/api/consent-openapi.yaml).

### 8.1.1 Config APIs

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/policy/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/policy/{policyId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/policy/{policyId}/" method="put" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/policy/{policyId}/" method="delete" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/policy/{policyId}/revisions/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/policies/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/data-agreement/{dataAgreementId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/data-agreement/{dataAgreementId}/" method="put" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/data-agreement/{dataAgreementId}/" method="delete" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/data-agreement/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/data-agreements/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/individual/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/individual/{individualId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/individuals/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/webhook/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/webhook/{webhookId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/webhook/{webhookId}/" method="put" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/webhook/{webhookId}/" method="delete" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/config/webhooks/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

### 8.1.2 Service APIs

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/{individualId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/{individualId}/" method="put" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individuals/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/data-agreement/{dataAgreementId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/policy/{policyId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/verification/data-agreements/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/verification/consent-records/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/verification/consent-record/{consentRecordId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/data-agreement/{dataAgreementId}/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/data-agreement/{dataAgreementId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/consent-record/draft/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/consent-record/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/consent-record/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/consent-record/{consentRecordId}/" method="put" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/consent-record/{consentRecordId}/signature/" method="post" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/consent-record/{consentRecordId}/signature/" method="put" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/data-agreement/{dataAgreementId}/all/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/service/individual/record/" method="delete" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

### 8.1.3 Audit APIs

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/audit/consent-records/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/audit/consent-record/{consentRecordId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/audit/data-agreements/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}

{% openapi src="<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>" path="/audit/data-agreement/{dataAgreementId}/" method="get" %}
<https://raw.githubusercontent.com/GovStackWorkingGroup/bb-consent/v23Q4/api/consent-openapi.yaml>
{% endopenapi %}


---

# 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://specs.govstack.global/consent/8-service-apis.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.
