> 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/registries/8-service-apis.md).

# 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 Digital Registries Building Block can be found in [this GitHub repository](https://github.com/GovStackWorkingGroup/bb-digital-registries/tree/main/test/openAPI).

The Digital Registries Building Block may contain multiple registries/databases. The dynamic nature of the database structure requires a standard set of automatically generated APIs for all databases hosted on the platform. The system generates default API method endpoints automatically after each publication of the database schema. A new API service version is generated after each schema publish. Database schema version and API versions are in sync.

The naming convention and structure of the API endpoint are the following:

/{information type}/{registry acronym or code}/{version}/{API method as a name}.

Example 1: ​/api/data​/cr​/1.0​/create

Example 2: ​/api/v1/database/modify

Each registry contains a unique set of data and the Building Block enables an Analyst to change the data storage structure/schema on the fly. In the following example API descriptions are generated for one example dataset for the Postpartum Infant Care Program registry, where the Caretaker and infant child are registered and a registration ID is issued.

![Example registry database logical data model.](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/x4qHd6WAo9DeFFAoS8iY/Logical%20datamodel%20MCTS%20\(1\).JPG)

![Example registry database Json schema.](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/xZrvV3qBvfCgrfRQbSyM/image4%20\(1\)%20\(1\)%20\(1\).png)

Digital Registries Building Block is expected to host the following API services for each database hosted on the platform.

The API is built using a representational state transfer ([REST](https://restfulapi.net/)) software architectural style and described in [Open API 3 standard](https://swagger.io/specification/) using [YAML](https://yaml.org/) (a human-readable data-serialization language). Request and response body is in [JSON](https://www.json.org/json-en.html) (lightweight data-interchange format).

## 8.1 Administrative/Analyst Functions <a href="#docs-internal-guid-d85f59a4-7fff-1564-6ae2-86d67f36a258" id="docs-internal-guid-d85f59a4-7fff-1564-6ae2-86d67f36a258"></a>

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}" method="get" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/read" method="post" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/update" method="put" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/updateEntries" method="put" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/updateOrCreate" method="post" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

## 8.2 Applicant Functions <a href="#docs-internal-guid-d85f59a4-7fff-1564-6ae2-86d67f36a258" id="docs-internal-guid-d85f59a4-7fff-1564-6ae2-86d67f36a258"></a>

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/exists" method="post" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/{id}/delete" method="delete" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/{uuid}/readValue/{field}.{ext}" method="get" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/mypersonalDataUsage" method="get" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/gGI7TLJGcQMeTTLeTWPA" path="/database/{id}" method="get" %}
[GovStack\_Digital\_registries\_BB\_Database\_API\_template-1.3.0.yaml](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/wkFx2kCrTPZhC7bKZLj5/GovStack_Digital_registries_BB_Database_API_template-1.3.0.yaml)
{% endopenapi %}

{% openapi src="/files/gGI7TLJGcQMeTTLeTWPA" path="/database/{id}" method="delete" %}
[GovStack\_Digital\_registries\_BB\_Database\_API\_template-1.3.0.yaml](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/wkFx2kCrTPZhC7bKZLj5/GovStack_Digital_registries_BB_Database_API_template-1.3.0.yaml)
{% endopenapi %}

{% openapi src="/files/gGI7TLJGcQMeTTLeTWPA" path="/database/modify" method="post" %}
[GovStack\_Digital\_registries\_BB\_Database\_API\_template-1.3.0.yaml](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/wkFx2kCrTPZhC7bKZLj5/GovStack_Digital_registries_BB_Database_API_template-1.3.0.yaml)
{% endopenapi %}

{% openapi src="/files/gGI7TLJGcQMeTTLeTWPA" path="/databases" method="get" %}
[GovStack\_Digital\_registries\_BB\_Database\_API\_template-1.3.0.yaml](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/wkFx2kCrTPZhC7bKZLj5/GovStack_Digital_registries_BB_Database_API_template-1.3.0.yaml)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}" method="get" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/mcts/createEntries" method="post" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% endopenapi %}

{% openapi src="/files/av6R8ey9C4N5vxA4XRpa" path="/data/{registryName}/{versionNumber}/read" method="post" %}
[GovStack\_Digital\_registries\_BB\_Data\_API\_template-1.3.0.json](https://content.gitbook.com/content/CzwPeYV3yHAVFUTfVq5O/blobs/y2atDRWcLXmSKTUVAhUd/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json)
{% 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/registries/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.
