Skip to main content
GET
/
_history
System History
curl --request GET \
  --url http://localhost:8080/fhir/_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>"
              ]
            }
          ]
        }
      }
    }
  ]
}

System History

Retrieve the history of all resources in the system, showing changes across all resource types.

Endpoint

GET /fhir/_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/_history?_count=20&_since=2024-01-01T00:00:00Z"

Response

Success (200 OK)

Returns a Bundle containing history entries:
{
  "resourceType": "Bundle",
  "type": "history",
  "total": 150,
  "link": [
    {
      "relation": "self",
      "url": "https://your-server.com/fhir/_history?_count=20"
    },
    {
      "relation": "next",
      "url": "https://your-server.com/fhir/_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"
        },
        ...
      },
      "request": {
        "method": "PUT",
        "url": "Patient/123"
      }
    },
    {
      "fullUrl": "https://your-server.com/fhir/Observation/456/_history/1",
      "resource": {
        "resourceType": "Observation",
        "id": "456",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2024-01-01T12:30:00Z"
        },
        ...
      },
      "request": {
        "method": "POST",
        "url": "Observation"
      }
    }
  ]
}

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/_history?_since=2024-01-01T00:00:00Z

At Parameter

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

Pagination

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

Notes

  • System history can be very large - use _count and _since to limit results
  • 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
  • The total count may be an estimate for performance reasons

Authorizations

Authorization
string
header
required

Bearer token authentication

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