Usage

bash
holydocs api <get|post|put|patch|delete> <path> [options]

holydocs api is the scripting escape hatch for HolyDocs. It reuses your saved CLI authentication and sends requests to the HolyDocs API with Authorization: Bearer ... and your saved X-Organization-Id when available.

Paths are resolved relative to https://api.holydocs.com/api/v1 by default, so:

bash
holydocs api get /projects

maps to:

bash
GET https://api.holydocs.com/api/v1/projects

If you pass a path that already starts with /api/, the CLI uses it as-is.

Options

OptionDescriptionDefault
--json <json>Inline JSON request body, or @path/to/body.jsonNone
-H, --header <header...>Extra headers in KEY:VALUE formatNone
--rawPrint the raw response body instead of pretty JSONPretty JSON when response is JSON

Examples

List Projects

bash
holydocs api get /projects

Set a Custom Domain

bash
holydocs api put /domains/proj_abc123 \ --json '{"customDomain":"docs.example.com"}'

Verify a Custom Domain

bash
holydocs api post /domains/proj_abc123/verify

Remove a Custom Domain

bash
holydocs api delete /domains/proj_abc123

Send a Body from a File

bash
holydocs api patch /projects/proj_abc123 \ --json @./project-update.json

Add Extra Headers

bash
holydocs api get /projects \ -H "X-Debug-Trace:true"

Authentication

holydocs api requires the same authentication as other API-backed CLI commands:

  1. Run holydocs login once
  2. Or set HOLYDOCS_API_KEY
bash
HOLYDOCS_API_KEY=hd_a1b2c3d4e5f67890a1b2c3d4e5f67890 \holydocs api get /projects

If you authenticated with holydocs login, the command automatically reuses your saved apiUrl, apiKey, and orgId.

Output

  • JSON responses are pretty-printed by default
  • Non-JSON responses are printed as plain text
  • Use --raw to print the raw body without formatting
Ask a question... ⌘I