Resolve an identity when evidence is sufficient#
POST /v1/resolve accepts a required query string of 1–512 characters. It identifies a canonical MedicationVariant; it does not select medication for a patient. The response preserves the original query.
curl --fail-with-body "$IABULA_API_BASE/v1/resolve" \
--header "X-API-Key: $IABULA_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"query":"NATULAXE CAPSULA"}'Verified positive example#
NATULAXE CAPSULA was confirmed as resolved in the RapidAPI Hub. Confirmed facts are product_name = NATULAXE, entity_type = medication_variant and dosage_form = cápsula. These facts are documented without inventing a UUID or additional response values.
When status is resolved, resolved contains id, entity_type, product_name, brand_name, dosage_form and active_ingredient_text. brand_name and active_ingredient_text may be null. Ingredient text does not guarantee a canonical link to an ingredient entity.
Abstention is a valid outcome#
When evidence is insufficient for a safe identity, status is unresolved and resolved is null. Both outcomes use HTTP 200. Short, ambiguous or misspelled queries are not guaranteed to resolve. Scores, candidates and internal gate diagnostics are not public fields.
const response = await fetch(`${process.env.IABULA_API_BASE}/v1/resolve`, {
method: "POST",
headers: {
"X-API-Key": process.env.IABULA_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ query: "NATULAXE CAPSULA" }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.code}`);
if (result.status === "unresolved") {
// Ask for more source information or route to manual review.
} else {
console.log(result.resolved.product_name, result.resolved.dosage_form);
}Distinguish no match from failure#
HTTP 503 indicates temporary unavailability, not unresolved. Do not translate authentication, quota or service errors into absence of identity. Applications should allow manual review or request more source information after abstention.
POST /v1/resolve#
| JSON field | Type and bounds | Required |
|---|---|---|
| query | string; minLength=1, maxLength=512 | yes |
| HTTP | Content-Type | Schema |
|---|---|---|
| 200 | application/json | ResolveSuccess | ResolveUnresolved |
| 400 | application/problem+json | Problem |
| 401 | application/problem+json | Problem |
| 403 | application/problem+json | Problem |
| 500 | application/problem+json | Problem |
| 503 | application/problem+json | Problem |
| 429 | application/problem+json | Problem |
| 422 | application/json | HTTPValidationError |
OpenAPI contract fields#
| Schema.field | Type and bounds | Required |
|---|---|---|
| HTTPValidationError.detail | array<ValidationError> | no |
| Problem.type | string | yes |
| Problem.title | string | yes |
| Problem.status | integer | yes |
| Problem.code | string | yes |
| Problem.detail | string | null | no |
| Problem.request_id | string | yes |
| ResolveRequest.query | string; minLength=1, maxLength=512 | yes |
| ResolveSuccess.status | string: resolved | yes |
| ResolveSuccess.query | string | yes |
| ResolveSuccess.resolved | ResolvedMedicationVariant | yes |
| ResolveUnresolved.status | string: unresolved | yes |
| ResolveUnresolved.query | string | yes |
| ResolveUnresolved.resolved | null | yes |
| ResolvedMedicationVariant.id | string (uuid) | yes |
| ResolvedMedicationVariant.entity_type | string: medication_variant | yes |
| ResolvedMedicationVariant.product_name | string | yes |
| ResolvedMedicationVariant.brand_name | string | null | yes |
| ResolvedMedicationVariant.dosage_form | string | yes |
| ResolvedMedicationVariant.active_ingredient_text | string | null | yes |
| ValidationError.loc | array<string | integer> | yes |
| ValidationError.msg | string | yes |
| ValidationError.type | string | yes |
| ValidationError.input | object | no |
| ValidationError.ctx | object | no |