Create Harbor Saved Query Draft
Creates a stable Harbor saved query with its initial mutable draft.
Saved queries are supported only for Polytomic-managed Harbors whose backing
Connection type is polytomic_harbor. Customer-managed Harbor backings return
an unsupported-backing error.
The saved query receives a stable ID, but it remains absent from published saved-query reads until an administrator publishes its initial draft.
Use {{parameter_name}} references in sql_template. Each reference must have
one scalar declaration. Validation values and defaults must match the declared
string, number, boolean, date, timestamp, or uuid type.
Unknown JSON fields, including fields inside parameter declarations, return
400 Bad Request before the draft is saved. Use default_value, not default,
for parameter defaults.
When you omit a parameter during execution, Polytomic uses its published
default_value, never its draft validation value. An omitted optional parameter
without a default binds SQL NULL. A required parameter allows omission when a
default exists, but rejects explicit null even with a default.
For a report window, use a required parameter with a default so omission selects
a useful window and explicit null is rejected:
Authentication
Basic organization-scoped API key
Path parameters
Headers
Request
Human-readable saved-query name. Maximum 200 characters.
DuckDB SQL template using {{name}} references for bound parameters.
Human-readable owner label. Maximum 200 characters.
Author-supplied JSON scalar values used only to validate this draft.
