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

Resource History

Retrieve the complete history of a specific resource instance, showing all versions and changes.
resource_type
string
required
The FHIR resource type (e.g., Patient, Observation, Encounter)
id
string
required
The logical ID of the resource

Endpoint

GET /fhir/:resource_type/:id/_history

Query Parameters

  • _count - Maximum number of results (default: 10)
  • _since - Only return versions created since this date/time
  • _at - Return the version that existed at a specific point in time

Example Request

curl "https://your-server.com/fhir/Patient/123/_history?_count=10"

Response

Success (200 OK)

Returns a Bundle containing all versions of the resource:
{
  "resourceType": "Bundle",
  "type": "history",
  "total": 3,
  "entry": [
    {
      "fullUrl": "https://your-server.com/fhir/Patient/123/_history/3",
      "resource": {
        "resourceType": "Patient",
        "id": "123",
        "meta": {
          "versionId": "3",
          "lastUpdated": "2024-01-01T14:00:00Z"
        },
        "name": [{"family": "Doe", "given": ["Jane", "Marie"]}],
        ...
      },
      "request": {
        "method": "PUT",
        "url": "Patient/123"
      }
    },
    {
      "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/123/_history/1",
      "resource": {
        "resourceType": "Patient",
        "id": "123",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2024-01-01T12:00:00Z"
        },
        "name": [{"family": "Doe", "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 version
  • 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 versions created since a specific date/time:
GET /fhir/Patient/123/_history?_since=2024-01-01T13:00:00Z

At Parameter

Get the version that existed at a specific point in time:
GET /fhir/Patient/123/_history?_at=2024-01-01T13:30:00Z

Deleted Resources

If a resource was deleted, the history includes the deletion:
{
  "fullUrl": "https://your-server.com/fhir/Patient/123/_history/4",
  "resource": {
    "resourceType": "Patient",
    "id": "123",
    "meta": {
      "versionId": "4",
      "lastUpdated": "2024-01-01T15:00:00Z"
    }
  },
  "request": {
    "method": "DELETE",
    "url": "Patient/123"
  }
}

Pagination

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

Notes

  • Resource history shows all versions of a specific resource
  • History entries are ordered by version ID (most recent first)
  • Deleted resources remain in history
  • Use _since to get incremental updates for a resource
  • The first entry is the original creation (version 1)

Authorizations

Authorization
string
header
required

Bearer token authentication

Path Parameters

resourceType
string
required

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

id
string
required

The logical ID of the resource

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