holydocs api
Make authenticated requests to the HolyDocs management API from the command line.
Usage
bashholydocs 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:
bashholydocs api get /projects
maps to:
bashGET https://api.holydocs.com/api/v1/projects
If you pass a path that already starts with /api/, the CLI uses it as-is.
Options
| Option | Description | Default |
|---|---|---|
--json <json> | Inline JSON request body, or @path/to/body.json | None |
-H, --header <header...> | Extra headers in KEY:VALUE format | None |
--raw | Print the raw response body instead of pretty JSON | Pretty JSON when response is JSON |
Examples
List Projects
bashholydocs api get /projects
Set a Custom Domain
bashholydocs api put /domains/proj_abc123 \ --json '{"customDomain":"docs.example.com"}'
Verify a Custom Domain
bashholydocs api post /domains/proj_abc123/verify
Remove a Custom Domain
bashholydocs api delete /domains/proj_abc123
Send a Body from a File
bashholydocs api patch /projects/proj_abc123 \ --json @./project-update.json
Add Extra Headers
bashholydocs api get /projects \ -H "X-Debug-Trace:true"
Authentication
holydocs api requires the same authentication as other API-backed CLI commands:
- Run
holydocs loginonce - Or set
HOLYDOCS_API_KEY
bashHOLYDOCS_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
--rawto print the raw body without formatting