Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

PUT/api/v1/projects/{project_id}/templates/{template_id}

Needs scope: writeMCP tool: update_template operationId update_template

Save a new version of a template

Saves the sources as the template’s next version (the latest version’s number plus one), checked as at creation. Every save is a version. The name and the kind stay. Needs scope write.

Parameters

NameInTypeDescription
project_idrequired path string · uuid The project’s id
template_idrequired path string · uuid The template’s id

Request body

application/json · required

  • UpdateTemplateRequest object
  • html_bodystringrequired

    The HTML body, as at creation.

  • subjectstring | null

    The subject, as at creation.

  • text_bodystring | null

    The text body; null or left out: made from the HTML.

Responses

200

The new version

  • Template object · all fields required
  • created_atstring · date-time

    When this version was saved.

  • The template engine.

    • minijinja
  • html_bodystring
  • idstring · uuid

    The template’s id, the same in every version.

    example 01900000-0000-7000-8000-000000000001

  • What a template is.

    • message
    • partial
  • namestring

    example Welcome

  • project_idstring · uuid
  • subjectstring | null

    null for a partial.

  • text_bodystring | null

    null: the text is made from the HTML when the message is sent.

  • versioninteger · int32

    From 1, one more at each save.

    ≥ 1 · example 2

403

A project key without scope write (forbidden)

Problem (application/problem+json)

404

No such project or template in it, or another project’s (not_found)

Problem (application/problem+json)

409

The project is deleted, or another save took the version number at the same moment (conflict)

Problem (application/problem+json)

422

Invalid fields or sources, every one in errors (validation_failed), as at creation

Problem (application/problem+json)

429

The key is over its rate limit, api.rate_limit_per_minute requests a minute on this node (rate_limited)

HeaderTypeDescription
Retry-AfterintegerSeconds until the key’s next request passes; rounded up.

Problem (application/problem+json)

504

Postwind’s storage did not answer within its time limit (storage_timeout). A change the request makes may still take effect: check before repeating it. A repeat with the same Idempotency-Key never runs it twice: it is 409 idempotency_key_in_progress until the key’s 24 h end

Problem (application/problem+json)