---
title: "Read document header"
method: HEAD
path: "/_fabric/{fabric}/_api/document/{collection}/{key}"
tags: ["Documents"]
---

# Read document header

`HEAD /_fabric/{fabric}/_api/document/{collection}/{key}`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/document/:collection/:key/head.ts> (a function with typed inputs; its response is checked against the schema)

Like GET, but only fetch the header fields and not the body. You can use this call to get the current revision of a document or check if the document was deleted.

## Path parameters

- `fabric` string, string, required
- `collection` string, string, required
- `key` string, string, required

## Headers

- `If-None-Match` string
- `If-Match` string

## Response `200`

Successfully fetched headers.

- ExamplesIdKeyRevData
  - `_id` string: ID of the collection.
  - `_key` string: _key details of collection.
  - `_rev` string: _rev details of collection.
  - `data` string: data in record.

## Other responses

- `304`: Document has the same version if the *If-None-Match* header is given.
- `404`: Failed to find the specified collection or document.
- `412`: Document has different version if an *If-Match* header is given. The response contains the found document's current revision in the *_rev* attribute. Additionally, the attributes *_id* and *_key* are returned.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
