DCI partner search
DCI adapter for partner register search: envelopes, query types, synchronous responses, and asynchronous WebSub delivery.
The DCI adapter is the Partner API implementation of partner register search. It accepts a DCI search envelope, decodes each item into a core RegisterSearch, and returns a DCI response envelope. SQL, allowlists, and related-register loading are specified in Core register search.
POST /dci/registry/sync/search
Runs the search and returns the signed envelope.
POST /dci/registry/async/search
Validates the request, returns an acknowledgement, then publishes an on-search envelope.
Both endpoints use the same decoder, signature check, and consent check. OpenAPI is served at /docs and /openapi.json on a running Partner API.
What the operator must supply
There is no partner-facing discovery API for deployment metadata. Obtain:
Partner Management id and signing key
Partner API base URL
Register mnemonic and DCI
reg_record_typeAllowed search fields and identifier-type mappings
Consent requirements and data scopes, and the partner's access policy (a scope policy for this registry in Partner Management)
WebSub hub URL, topic name, and callback secret
Register models and outgoing templates come from the domain extension. The adapter does not embed a Farmer or Individual schema.
Request envelope
The envelope, search objects, and query shapes are defined by the DCI common API methods. Use synchronous search and asynchronous search for the object structure and the YAML definitions. This page describes the Registry adapter's behaviour where it narrows or extends that structure.
{
"signature": "<detached JWS>",
"header": {
"version": "1.0.0",
"message_id": "msg-001",
"message_ts": "2026-10-08T08:00:00Z",
"action": "search",
"sender_id": "programme-a",
"sender_uri": "https://programme.example/registry/on-search",
"receiver_id": "farmer-registry",
"is_msg_encrypted": false,
"meta": {}
},
"message": {
"transaction_id": "txn-001",
"search_request": [
{
"reference_id": "search-001",
"timestamp": "2026-10-08T08:00:00Z",
"locale": "eng",
"search_criteria": {
"version": "1.0.0",
"reg_type": "Farmer",
"reg_record_type": "spdci-extensions-dci:Farmer",
"query_type": "idtype-value",
"query": {
"type": "UIN",
"value": "4733616459"
},
"sort": [
{
"attribute_name": "last_name",
"sort_order": "asc"
}
],
"pagination": {
"page_size": 10,
"page_number": 1
}
}
}
]
}
}header.sender_id
Partner mnemonic for the signature, consent, and async topic lookup.
header.sender_uri
Logged on async search. Delivery uses the WebSub topic, not this URI.
message.transaction_id
Caller id copied into the search response. It is not on the async ACK.
search_request[].reference_id
Caller id copied into the matching response item.
search_criteria.reg_type
Register mnemonic, such as Farmer. This selects the table.
search_criteria.reg_record_type
DCI output label. It does not select the table. On an activity register it selects activities, current state or aggregates; see Activity Register Design.
search_criteria.query_type
Decoder name.
search_criteria.sort
Ordered sort keys. Core applies every entry.
search_criteria.pagination
Root-register page. Defaults to page 1 and size 10 when omitted.
One envelope may contain several search_request items. Each item is one core search and one search_response item. Preferred wire forms are shown below. Legacy wrapped forms are marked. Use the preferred form unless the deployed OpenAPI requires the older shape.
Response-item locale is emitted as en. The request locale does not select a translation.
Query types
Identifier
query_type selects this decoder. query.type is the identifier type, not the word idtype-value.
dci_id_type_columns maps the type to a register column. Defaults:
UIN
foundational_id
FID
functional_record_id
Type names match case-insensitively. Values use exact column equality. The column must also be on the allowlist.
This older shape is still accepted:
Expression
Operators: $eq, $ne, $neq, $gt, $gte, $lt, $lte, $in, $nin, $contains, $startsWith, $endsWith, $and, $or.
A scalar is shorthand for $eq. A field map without $and or $or is combined with AND. $and or $or must be the only key at its node.
An expression search returns each record with its linked records (a person's land, household…), as an identifier search does.
search_text uses the core text rules: $eq and $contains are substring matches. $in and $nin are rejected for that column.
Predicate
Items are ordered by seq_num and combined with AND. Inside one item, no condition uses expression1 only. and and or require expression2. not negates expression1 and rejects expression2.
Operators: eq, gt, lt, ge, le, in.
A wrapped { "type": "predicate", "value": [ ... ] } query is also accepted.
GraphQL
GraphQL here is a closed filter syntax, not a GraphQL server:
An identifier argument is also accepted:
The parser accepts one root field with scalar filters or an identifier object. The selection set is ignored and does not choose response fields. Mutations, subscriptions, fragments, directives, multiple roots, and nested filter expressions are rejected.
reg_type selects the register. The GraphQL root name does not.
Allowlist
dci_allowed_search_fields is the name list passed to core. The default is functional_record_id, first_name, middle_name, last_name, given_name, gender, birth_date, foundational_id, record_name, record_status, and search_text.
Invalid fields, operators, and values return rjct.search_criteria.invalid. A typical message is Field 'unknown_field' is not searchable.
Counts in the DCI response
Core returns a full root match count for each item. The adapter copies that into pagination.total_count. The response header total_count is the sum of those item counts. completed_count is the number of items with status = succ.
Synchronous response
The response swaps sender and receiver. reg_records contains the rendered template output. The sample above leaves that array empty.
Business rejection is HTTP 200 with header.status = rjct and an empty search_response. Schema errors raised by FastAPI before the controller are HTTP 422. Sync correlation ids are hexadecimal UUIDs without hyphens.
Asynchronous search
POST /dci/registry/async/search takes the same request. The HTTP body is only an acknowledgement:
The ACK is unsigned and has no transaction_id. The later on-search envelope is a signed DCI search response. It copies this correlation_id and the request transaction_id. Several search items in one request produce one ACK and one publish containing every response item. Async correlation ids include hyphens.
Acceptance failure:
Encrypted messages are rejected. sender_uri is not used as a callback URL.
The background work uses FastAPI BackgroundTasks in the Partner API process. It does not use Celery and it does not store a delivery job.
Keep the original query, time out the callback, and resubmit under an agreed operator policy. A resubmit is a new request and a new correlation id.
Partner topic
Async publish needs one active PARTNER row in outgoing_topics whose partner_id is the normalized sender:
Normalization upper-cases the sender, replaces - with _, and prefixes PARTNER_. The same id must exist in Partner Management. The topic must be PROCESSED and active. Register-change topics are a different row type and are not used here.
Staff create the topic. The payload shape and lifecycle are in the Outgestion Pipeline. A minimal create body is:
The Partner API then publishes hub.mode=publish to that topic. Subscription, the callback challenge, and X-Hub-Signature are hub behaviour: WebSub subscription.
Signature and consent
When signature validation is on, the adapter verifies a detached JWS over the raw {header, message} and resolves the key from Partner Management with PARTNER_<SENDER_ID>. Sign those two objects as compact JSON with sorted keys, and send protected-header..signature with an empty payload segment.
The registry signs synchronous responses and on-search envelopes. With validation disabled, the signature value is signature_validation_disabled. The async ACK stays unsigned either way.
When consent enforcement is on, each item carries search_criteria.authorize.consent_jws, or omits it and searches one subject by identifier (idtype-value): the registry then asks its Consent Manager to find the consent it holds for the partner and that subject. Any other search without a consent is rejected. Consent Manager is called before search. A missing or non-permit consent rejects the whole request: a rejected search envelope for sync, and an ERR acknowledgement with no publish for async. Each record is filtered to the effective scopes' fields before the template renders it (Data Scopes). Scopes do not change which rows match.
See Data Scopes, Consent-Aware Data Sharing, and Registry integration.
Configuration
REGISTRY_PARTNER_API_DCI_ALLOWED_SEARCH_FIELDS
JSON list of columns passed to the core allowlist.
REGISTRY_PARTNER_API_DCI_ID_TYPE_COLUMNS
JSON object of DCI identifier type to column.
REGISTRY_PARTNER_API_SIGNATURE_VALIDATION_ENABLED
Verify requests and sign search responses. Keep on in production.
REGISTRY_PARTNER_API_CONSENT_ENFORCEMENT_ENABLED
Validate consent and clamp rendered records. Keep on in production.
REGISTRY_PARTNER_API_PARTNER_MGMT_API_URL
Partner Management key API.
REGISTRY_PARTNER_API_CONSENT_MANAGER_URL
Consent validation API.
REGISTRY_PARTNER_API_CONSENT_SUBJECT_ID_TYPES
JSON object of search identifier type to consent subject ID type for the consent lookup, e.g. {"UIN": "FAYDA_FAN"}; a type not listed is sent as is (global.consentSubjectIdTypes).
REGISTRY_PARTNER_API_WEBSUB_BASE_URL
Hub root for async publish. Do not include /hub.
Hub install, securityOn, and the core websub_base_url setting are in WebSub deployment.
Troubleshooting
rjct.search_criteria.invalid
Query shape, operator, allowlist, column, and value type.
HTTP 422
Envelope shape against /openapi.json.
Search matches but the call fails internally
DCI outgoing template binding and the object-storage document.
Async ERR, no registered topic
Active PARTNER row for the normalized sender, status PROCESSED.
Topic stays PENDING or becomes FAILED
Celery Beat, the registration worker, and the worker hub URL. See outgestion.
ACK is ACK but no callback arrives
Process restart after the ACK, then hub subscription and delivery logs.
DCI adapter limitations
Predicate items are combined with
AND.GraphQL selection sets do not project fields.
Async search does not accept encrypted messages.
Async delivery has no durable queue, retry, or fetch-by-correlation-id API.
Result-size caps are not implemented.
Related
Partner APIsPartner APILast updated
Was this helpful?