Skip to main content
GET
/
{resourceType}
/
_history
Type History
curl --request GET \
  --url http://localhost:8080/fhir/{resourceType}/_history \
  --header 'Authorization: Bearer <token>'
{
  "resourceType": "Bundle",
  "type": "document",
  "total": 123,
  "link": [
    {
      "relation": "<string>",
      "url": "<string>"
    }
  ],
  "entry": [
    {
      "fullUrl": "<string>",
      "resource": {
        "resourceType": "<string>",
        "id": "<string>",
        "meta": {
          "versionId": "<string>",
          "lastUpdated": "2023-11-07T05:31:56Z",
          "profile": [
            "<string>"
          ],
          "tag": [
            {
              "system": "<string>",
              "version": "<string>",
              "code": "<string>",
              "display": "<string>"
            }
          ],
          "security": [
            {
              "system": "<string>",
              "version": "<string>",
              "code": "<string>",
              "display": "<string>"
            }
          ]
        }
      },
      "request": {
        "method": "GET",
        "url": "<string>"
      },
      "response": {
        "status": "<string>",
        "location": "<string>",
        "etag": "<string>",
        "lastModified": "2023-11-07T05:31:56Z",
        "outcome": {
          "resourceType": "OperationOutcome",
          "issue": [
            {
              "severity": "fatal",
              "code": "invalid",
              "details": {
                "coding": [
                  {
                    "system": "<string>",
                    "version": "<string>",
                    "code": "<string>",
                    "display": "<string>"
                  }
                ],
                "text": "<string>"
              },
              "diagnostics": "<string>",
              "location": [
                "<string>"
              ]
            }
          ]
        }
      }
    }
  ]
}

Type History

Retrieve the history of all resources of a specific type, showing changes across all instances of that resource type.
resource_type
string
required
The FHIR resource type (e.g., Patient, Observation, Encounter)

Endpoint

GET /fhir/:resource_type/_history

Query Parameters

  • _count - Maximum number of results (default: 10)
  • _since - Only return resources modified since this date/time
  • _at - Return resources as they were at a specific point in time

Example Request

curl "https://your-server.com/fhir/Patient/_history?_count=20&_since=2024-01-01T00:00:00Z"

Response

Success (200 OK)

Returns a Bundle containing history entries for the resource type:
{
  "resourceType": "Bundle",
  "type": "history",
  "total": 50,
  "link": [
    {
      "relation": "self",
      "url": "https://your-server.com/fhir/Patient/_history?_count=20"
    },
    {
      "relation": "next",
      "url": "https://your-server.com/fhir/Patient/_history?_count=20&_offset=20"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://your-server.com/fhir/Patient/123/_history/2",
      "resource": {
        "resourceType": "Patient",
        "id": "123",
        "meta": {
          "versionId": "2",
          "lastUpdated": "2024-01-01T13:00:00Z"
        },
        "name": [{"family": "Doe", "given": ["Jane"]}],
        ...
      },
      "request": {
        "method": "PUT",
        "url": "Patient/123"
      }
    },
    {
      "fullUrl": "https://your-server.com/fhir/Patient/456/_history/1",
      "resource": {
        "resourceType": "Patient",
        "id": "456",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2024-01-01T12:00:00Z"
        },
        "name": [{"family": "Smith", "given": ["John"]}],
        ...
      },
      "request": {
        "method": "POST",
        "url": "Patient"
      }
    }
  ]
}

History Entry Structure

Each entry in the history bundle includes:
  • fullUrl - The versioned URL of the resource
  • resource - The resource at that point in time
  • request - Information about the request that created this version
    • method - HTTP method (POST, PUT, PATCH, DELETE)
    • url - Resource URL

Filtering by Date

Since Parameter

Get all changes since a specific date/time:
GET /fhir/Patient/_history?_since=2024-01-01T00:00:00Z

At Parameter

Get resources as they were at a specific point in time:
GET /fhir/Patient/_history?_at=2024-01-01T12:00:00Z

Pagination

Use _count and _offset for pagination:
GET /fhir/Patient/_history?_count=20&_offset=0
GET /fhir/Patient/_history?_count=20&_offset=20
The response includes next and previous links when available.

Notes

  • Type history shows changes across all instances of the resource type
  • History entries are ordered by lastUpdated timestamp (most recent first)
  • Deleted resources appear in history with their deletion timestamp
  • Use _since to get incremental updates for a resource type
  • The total count may be an estimate for performance reasons

Authorizations

Authorization
string
header
required

Bearer token authentication

Path Parameters

resourceType
string
required

The FHIR resource type (e.g., Patient, Observation, Encounter)

Query Parameters

_count
integer
default:10

Maximum number of results to return

Required range: x >= 0
_since
string<date-time>

Only return resources modified since this date/time

_at
string<date-time>

Return resources as they were at a specific point in time

Response

200 - application/fhir+json

History bundle

A container for a collection of resources

resourceType
enum<string>
required

Resource type

Available options:
Bundle
type
enum<string>
required

Indicates the purpose of this bundle

Available options:
document,
message,
transaction,
transaction-response,
batch,
batch-response,
history,
searchset,
collection
total
integer

If search, the total number of matches

Links related to this Bundle

entry
object[]

Entry in the bundle