Skip to main content

Validate a resource

Send a FHIR resource to $validate to check its structure and constraints without creating or updating it. The route is resource-type level: the type in the URL must match resourceType in the request body.

MethodPath
POST/fhir/R4/:type/$validate

Request​

The request body is the resource to validate. This example validates a Patient. Replace the illustrative fields with a valid resource for your project.

curl --request POST \
--url 'https://api.sandbox.ovok.com/fhir/R4/Patient/$validate' \
--header "Authorization: Bearer ${OVOK_TOKEN}" \
--header 'Content-Type: application/fhir+json' \
--data '{"resourceType":"Patient","active":true}'
Request partDescription
:typeFHIR resource type, such as Patient or Observation.
BodyThe resource being checked. It is not persisted by this operation.

Response​

On success the operation returns 200 OK with no resource body. If validation fails, the server returns a FHIR OperationOutcome whose issue entries describe the errors or warnings.

OperationOutcome fieldDescription
issue[].severityWhether an issue is fatal, an error, a warning, or informational.
issue[].codeMachine-readable category for the issue.
issue[].detailsOptional coded or human-readable explanation.
issue[].expressionOptional location in the resource that caused the issue.

See the FHIR R4 $validate operation for the standard operation definition.