Hanzo
OpenapiPrompt

Create records a prompt for the caller's org and answers 201 with it.

Create records a prompt for the caller's org and answers 201 with it.

POST /v1/prompt

Addresshttps://api.hanzo.ai/v1/prompt
MethodPOST
Operationpost_prompt
AuthAuthorization: Bearer $HANZO_API_KEY

Create records a prompt for the caller's org and answers 201 with it. A name the org already uses is NOT an error and NOT an overwrite: it appends a new version, so the library keeps real, inspectable history and the response carries the whole version list. The name is also the URL segment the prompt is fetched by, which is why its shape is constrained and a handful of names are reserved.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
labelsbodystring[]Labels is free-form taxonomy, each up to 64 characters, capped at 32 entries.
namebodystringName is the org-unique handle AND the URL segment the prompt is addressed by: 1-64 characters matching ^[A-Za-z0-9][A-Za-z0-9._-]*$.
promptbodystringPrompt is the template body, capped at 64 KiB.
tagsbodystring[]Tags is free-form taxonomy under the same bounds as Labels.
typebodystringType labels the template's kind; defaults to "text".

Response

StatusBodyMeaning
201promptDetailcreated

201 body — 12 fields.

FieldInTypeAlwaysDescription
createdAtbodystringCreatedAt is when version 1 was written, RFC 3339 UTC.
labelsbodystring[]Labels is the current version's free-form taxonomy.
lastUpdatedAtbodystringUpdatedAt is when the current version was appended, RFC 3339 UTC.
namebodystringName is the prompt's org-unique handle and the URL segment it is addressed by.
promptbodystringPrompt is the CURRENT version's template body — the only content this service returns.
tagsbodystring[]Tags is the second free-form taxonomy, same rules as Labels.
typebodystringType labels the current version's kind; "text" unless the creator said otherwise.
versionbodyintegerVersion is the current version number, starting at 1 and incremented by one on every create against an existing name.
versionHistorybodyversionView[]Versions is the history METADATA, newest first, capped at the last 100 — no bodies, so a long history cannot inflate this response.
versionHistory[].createdAtbodystringCreatedAt is when this revision was appended, RFC 3339 UTC.
versionHistory[].typebodystringType is the kind this revision was written with, which may differ from the current one.
versionHistory[].versionbodyintegerVersion is this revision's number, 1 for the first.

Failure carries the platform error shape — see Errors.

Examples

hanzo prompts create

Prompt API · All Hanzo APIs · Interactive reference

How is this guide?

On this page