This document provides comprehensive documentation for making HTTP GET and PUT requests to the GNHR API endpoints. All endpoints support HTTPS and require proper authentication where applicable.
Base URL:
https://registry.mogcsp.gov.gh
Replace with your actual domain name
Accessing Personal Identifiable Information (PII):
All requests for PII on households/members will require a Bearer Token Auth type with a base64 encoded GHNR assigned authId and authSecret
/api/v2/households
Description
Retrieves household data with associated members from the registry. This endpoint
supports filtering by location,
categorization, optional creation-time lower bound (startDate), optional
free-text search on household head and contact fields (search), and
pagination. Data can be retrieved from either the current
registry or legacy consolidated tables.
Authentication: every request must include an
Authorization: Bearer header; the token must be valid for the
partnerCode query parameter (see the Introduction and Headers below).
Parameters
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
partnerCode |
string | Required | - | Partner code (e.g. 'LEAP', 'NHIA'); must match the partner
associated with the Authorization Bearer token |
LEAP |
source |
string | Optional | - | Location type filter: 'R' (Region), 'D' (District), 'C' (Community), 'H' (Household UUID) | R |
sourceCode |
string | Optional | - | Location code corresponding to the source type | 01 |
offset |
integer | Optional | 0 | Number of records to skip for pagination | 0 |
limit |
integer | Optional | 100 | Maximum number of records to return | 100 |
readyToShareOnly |
string | Optional | yes | Filter by ready to share status: 'yes' or 'no'. Not applied when
fromLegacy=yes |
yes |
categorization |
string | Optional | - | Poverty categorization filter. Can be single value or comma-separated list | EXTREMELY_POOR or EXTREMELY_POOR,POOR |
startDate |
string | Optional | - | Only households with created_ts on or after this
instant. Use YYYY-MM-DD or
YYYY-MM-DD HH:mm:ss or with fractional seconds
YYYY-MM-DD HH:mm:ss.ms. Values that do not match this pattern are ignored (no date filter). Echoed in the response as startDate when provided. |
2025-03-20 or 2025-03-20 20:01:59.517 |
search |
string | Optional | - | Substring match on the whole string; ignored if
longer than 50 characters. Matches any of: household head last name, first name, other names, popular name; household address; household phone; main and other phone numbers; Ezwich card number and card name. Applied in the household uuid filter. Echoed in the response as search when provided. |
0244123456 or Main St |
fromLegacy |
string | Optional | no | Retrieve data from legacy consolidated tables: 'yes' or 'no' | no |
Headers
| Header | Required | Description |
|---|---|---|
Authorization |
Required | Bearer token (GNHR-issued); validated against
partnerCode |
Content-Type |
Optional | Typically application/json for GET requests |
cURL Examples
Each example includes the required
Authorization header. Replace <your_token> with your
active Bearer token.
Example 1: Basic Request
Example 2: Filter by Region with Pagination
Example 3: Filter by Categorization
Example 4: Get Specific Household
Example 5: From Legacy Tables
Example 6: Created on or after a date
Example 7: Free-text search on household fields
Sample Response
Success Response (200 OK)
Error Response (400 Bad Request)
/api/v2/households
Description
Submits a registry case for GNHR review. The request does
not update household or member registry directly; it creates a case for investigation.
Authentication: requires
Authorization: Bearer validated against
partnerCode.
Important: send the request over HTTPS.
For location/community investigations (including communityCode), use
POST /api/registry-cases instead.
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
partnerCode |
string | Required | Partner code; must match the Bearer token. May also be sent in the JSON body. | LEAP |
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
action |
string | Required | One of: CASE_MANAGEMENT, HOUSEHOLD_UPDATE, MEMBER_UPDATE. |
householdUUID |
string | Conditional | Required for HOUSEHOLD_UPDATE. At least one of householdUUID or memberUUID required. |
memberUUID |
string | Conditional | Required for MEMBER_UPDATE. |
data |
object | Required | Must include at least one non-null field. |
Headers
| Header | Required | Description |
|---|---|---|
Authorization |
Required | Bearer token validated against partnerCode |
Content-Type |
Required | application/json |
cURL Examples
Example 1: Case management
Example 2: Household update case
Example 3: Member update case
Sample Responses
Success (201 Created)
Validation (400)
Unauthorized (401)
HTTP Status Codes
| Code | Meaning |
|---|---|
| 201 | Case created; caseReference |
| 400 | Validation failed (missing fields, invalid action, etc.) |
| 401 | Invalid Bearer token for partnerCode |
| 422 | Failed to insert into registry_cases |
/api/registry-cases
Description
Creates a row in GNHR_DATA.dbo.registry_cases for GNHR review. The
request body matches the case-creation contract used by
PUT /api/v2/households, with
an additional communityCode field persisted to the
community_code column (required for
LOCATION_CASE).
Authentication: requires
Authorization: Bearer validated against
partnerCode (partner firm credentials).
Admin UI: the portal cases page uses GET/PUT on the same path with
session token header for list and status updates only.
Important: send partner integrations over HTTPS.
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
partnerCode |
string | Required | Partner code; must match the Bearer token. May also be sent in the JSON body. | GNHR |
communityCode |
string | Conditional | GNHR community code. Required when action is LOCATION_CASE. May also be sent in the body as community_code. |
03-02-072 |
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
action |
string | Required | One of: CASE_MANAGEMENT, HOUSEHOLD_UPDATE, MEMBER_UPDATE, LOCATION_CASE. Stored in type. |
householdUUID |
string | Conditional | Required for HOUSEHOLD_UPDATE. For other actions (except LOCATION_CASE), at least one of householdUUID or memberUUID is required. Stored in household_uuid. |
memberUUID |
string | Conditional | Required for MEMBER_UPDATE. Stored in member_uuid. |
communityCode |
string | Conditional | Required for LOCATION_CASE. GNHR communityCode from Communities. Stored in community_code. |
data |
object | Required | Case details. Must include purpose (string). For HOUSEHOLD_UPDATE and MEMBER_UPDATE, must contain at least one additional non-null field. Serialized into case_payload with the request metadata. |
data.purpose |
string | Required | Human-readable reason for the case. Also stored in the purpose column. |
Headers
| Header | Required | Description |
|---|---|---|
Authorization |
Required | Bearer token validated against partnerCode |
Content-Type |
Required | application/json |
cURL Examples
Example 1: Case management
Example 2: Household update case
Example 3: Member update case
Example 4: Location / community investigation
Sample Responses
Success (201 Created)
caseReference is the new registry_cases.id.
Validation (400)
Invalid action (400)
Unauthorized (401)
HTTP Status Codes
| Code | Meaning |
|---|---|
| 201 | Case created; response includes caseReference |
| 400 | Validation failed (missing fields, invalid action, missing purpose, etc.) |
| 401 | Invalid Bearer token for partnerCode |
| 422 | Failed to insert into registry_cases |
| 405 | Unsupported HTTP method |
Database columns populated
| Column | Source |
|---|---|
type | action |
firm_code | partnerCode |
purpose | data.purpose |
case_payload | JSON snapshot of action, UUIDs, communityCode, purpose, assigned_to, and data |
status | status (default P) |
assigned_to | assigned_to / assignedTo |
household_uuid | householdUUID |
member_uuid | memberUUID |
community_code | communityCode / community_code |
created_ts | Server default (UTC) |
/api/v2/members
Description
Retrieves household member data from the registry. This endpoint returns individual
member records
with associated household categorization. Supports filtering by location,
categorization, optional free-text search across member fields, and pagination.
Authentication: every request must include an
Authorization: Bearer header; the token must be valid for the
partnerCode query parameter (see the Introduction and Headers below).
Parameters
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
partnerCode |
string | Required | - | Partner code (e.g. 'LEAP', 'NHIA'); must match the partner
associated with the Authorization Bearer token |
LEAP |
source |
string | Optional | - | Location type filter: 'R' (Region), 'D' (District), 'C' (Community) | D |
sourceCode |
string | Optional | - | Location code corresponding to the source type | 0101 |
offset |
integer | Optional | 0 | Number of records to skip for pagination | 0 |
limit |
integer | Optional | 200 | Maximum number of records to return | 200 |
categorization |
string | Optional | - | Poverty categorization filter. Can be single value or comma-separated list | EXTREMELY_POOR or EXTREMELY_POOR,POOR |
search |
string | Optional | - | Substring match on the whole string; ignored if
longer than 50 characters. Matches any of: member last name, first name, other name, popular name, date of birth (as text), main phone, NHIS card number, NHIS full name, Ghana Card number, Ghana Card full name. Returned JSON echoes the submitted value in search
when provided. |
0244123456 |
fromLegacy |
string | Optional | false | Retrieve data from legacy consolidated tables: 'yes' or 'no' | no |
Headers
| Header | Required | Description |
|---|---|---|
Authorization |
Required | Bearer token (GNHR-issued); validated against
partnerCode |
cURL Examples
Each example includes the required
Authorization header. Replace <your_token> with your
active Bearer token.
Example 1: Basic Request
Example 2: Filter by District
Example 3: Filter by Categorization with Pagination
Example 4: Multiple Categorizations
Example 5: NHIA Partner Code
Example 6: Free-text search
Sample Response
Success Response (200 OK)
Error Response (400 Bad Request)
/api/locations or /api/v2/locations
Description
Retrieves location data including regions, districts, communities, enumeration areas, and LEAP communities. Supports various location types and filtering options for hierarchical location data.
Parameters
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Required | - | Location type (see Location Type Reference table below) | R |
source |
string | Optional | - | Source filter for LEAP communities: 'R' (Region), 'D' (District), 'ID' (Community ID) | R |
parent_code |
string | Optional | - | Parent location code (required for districts, communities, EAs, etc.) | 01 |
offset |
integer | Optional | 0 | Number of records to skip (currently not fully implemented) | 0 |
limit |
integer | Optional | 0 | Maximum number of records to return (currently not fully implemented) | 0 |
Location Type Reference
| Type Code | Description | Requires parent_code |
|---|---|---|
R |
All Regions | No |
D |
Districts by Region | Yes (Region Code) |
C |
Communities by District | Yes (District Code) |
cURL Examples
Example 1: Get All Regions
Example 2: Get Districts by Region
Example 3: Get Communities by District
Example 4: Get LEAP Communities Mapped
Example 5: Get Regions with Targets
Example 6: Get Enumeration Areas
Sample Response
Success Response - Regions (200 OK)
Success Response - Districts (200 OK)
Success Response - Communities (200 OK)
Error Response (400 Bad Request)
/api/v2/sp_memis
Description
Returns aggregated registry member counts by region and district, with age band and
sex breakdown (indicator HR13.1).
Requires the same Bearer token validation as other partner APIs: the token must be
valid for the supplied partnerCode.
Parameters
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
partnerCode |
string | Required | - | Partner code; must match the credentials carried in the
Authorization Bearer token |
LEAP |
Headers
| Header | Required | Description |
|---|---|---|
Authorization |
Required | Bearer token (GNHR-issued); validated for partnerCode
|
cURL Example
Sample Response
Success Response (200 OK)
Error Response (400 Bad Request)
Error Response (401 Unauthorized)
| Endpoint | Method | Required Parameters | Primary Use Case |
|---|---|---|---|
/api/v2/households |
GET | partnerCode + Authorization: Bearer |
Retrieve households with members data |
/api/v2/households |
PUT | partnerCode + Bearer; JSON body (action, UUIDs, data.purpose) |
Create registry case (legacy path; same body as POST cases) |
/api/registry-cases |
POST | partnerCode + Bearer; JSON body (action, UUIDs, data.purpose; communityCode for LOCATION_CASE) |
Create registry case with community_code support |
/api/registry-cases |
GET | Session token header (GNHR admin UI) |
List cases; filter by action/type or search |
/api/registry-cases |
PUT | Session token + id; body status and/or assigned_to |
Update case status or assignment (admin) |
/api/v2/members |
GET | partnerCode + Authorization: Bearer |
Retrieve individual member records |
/api/locations/api/v2/locations |
GET | type | Retrieve location hierarchy data |
/api/v2/sp_memis |
GET | partnerCode + Bearer token | HR13.1 age/sex statistics by region and district (SP MEMIS) |
- HTTPS Required: All endpoints should be accessed via HTTPS. HTTP requests will be redirected to HTTPS.
- Authentication: Some endpoints may require authentication. Check with your system administrator for API keys or tokens.
- Rate Limiting: Be mindful of rate limits when making multiple requests. Implement appropriate delays between requests.
- Pagination: Use offset and limit parameters to paginate through large result sets.
-
Data Sharing: The
partnerCodeparameter determines which data fields are shared based on partner agreements (PMT configuration). -
Legacy Data: Use
fromLegacy=yesto access data from consolidated legacy tables when needed. -
Error Handling: Always check the HTTP status code. 200
indicates success for GET requests; 201 indicates a case was created (POST
/api/registry-casesor PUT/api/v2/households). 400 indicates a bad request, 401 unauthorized, 422 database error, and 404 indicates not found. - Response Format: All successful responses return JSON format with a consistent structure.