Skip to content

GET /document

The GET /document endpoint returns the document payload associated with a Brookmimir identifier. Provide a valid API key and document ID to receive the canonical record. The call consumes one credit after the headers pass validation and falls back to a StatusMessage when the resource cannot be returned.

  • Method: GET
  • Path: /document
  • Authentication: Required (x-api-key header)
  • Headers:
    • x-api-key: Required 64-character hexadecimal token tied to your account.
    • bmm-doc-id: Required identifier for the document you want to retrieve.
    • Optional accept: application/json
Terminal window
curl -s "https://api.brookmimir.com/document" \
-H "x-api-key: 1234" \
-H "bmm-doc-id: 5678abc" | jq
HeaderTypeRequiredDescription
x-api-keystringYesGrants access to account-scoped resources.
bmm-doc-idstringYesUnique Brookmimir document identifier to retrieve.

Tip: Store bmm-doc-id values in your downstream systems to enable rapid retrieval via this route.

Calling /document deducts one credit after the headers pass validation. Requests with zero balance return HTTP 402 before the record is accessed.

  • HTTP status: 200 OK
  • Body schema: EsResponse or StatusMessage

When the document exists and is accessible, the response contains an EsResponse object with the raw payload in body.

If the document cannot be found or another informational condition occurs, you will receive a `StatusMessage` instead.
```json
{
"status": 404,
"message": "Document not found"
}
StatusScenarioResponse schemaGuidance
400Missing or malformed headers.StatusMessageEnsure x-api-key and bmm-doc-id are present and properly formatted.
401/403Authentication failure.StatusMessageVerify the key is active and applied to the request over HTTPS.
402Credit balance depleted.StatusMessageRefill credits or pause billable calls before retrying.
404Document or token not found.StatusMessageConfirm the identifier and regenerate credentials if necessary.
5xxTemporary platform issue.StatusMessageRetry with exponential backoff and capture request metadata.
{
"status": 400,
"message": "Header 'bmm-doc-id' is required."
}
  1. Cache identifiers: Persist bmm-doc-id values returned from /query to enable quick document retrieval later.
  2. Protect secrets: Mask API keys in logs and rotate them regularly.
  3. Watch credits: Call /credits before bulk /document requests to avoid unexpected 402 responses.
  4. Log context: Record status, message, and bmm-doc-id values to streamline support investigations.
  5. Alert on failures: Surface repeated 4xx/5xx responses so operators can intervene quickly.