Runs examples for real against your account. Test keys only; kept in this tab, never stored on our side. Get a key
ZapSMTP / Docs / Templates

Restore a version

POST/v1/templates/{id}/versions/{vid}/restore

Copy a version back into the draft. Publishing stays a separate step.

Requires a full-access live key; test keys get 403 test_key_restricted.

Restores name, subject, html, text, from and design; alias and sample variables stay. The restore is recorded as a version of kind restored. Sends keep using the published version until you publish.

Path parameters

idstringrequired
Template id or alias.
vidstring (UUID)required
Version id from the list.

Errors

restricted_api_keyHTTP 403
test_key_restrictedHTTP 403
test-mode keys can send test email and read, not change the account: use a live key
not_foundHTTP 404
template not found | version not found
POST/v1/templates/{id}/versions/{vid}/restore
curl -X POST 'https://zapsmtp.xyz/v1/templates/welcome/versions/019a1f58-2b3c-7d4e-8f50-6a7b8c9d0e1f/restore' \
  -H "Authorization: Bearer $ZAP_API_KEY"
Set ZAP_API_KEY in your environment.
Response 200 OK
{
  "id": "019a1f50-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
  "name": "Welcome",
  "alias": "welcome",
  "subject": "Welcome, {{first_name}}",
  "html": "<p>Hi {{first_name}}, welcome to Acme.</p>",
  "text": "Hi {{first_name}}, welcome to Acme.",
  "from": "Acme <hello@acme.com>",
  "variables": {
    "first_name": "Ann"
  },
  "design": null,
  "created_at": "2026-10-20T12:30:00Z",
  "updated_at": "2026-10-22T15:20:00Z",
  "published": {
    "subject": "Welcome, {{first_name}}",
    "html": "<p>Hi {{first_name}}</p>",
    "text": "",
    "from": "",
    "design": null
  },
  "published_at": "2026-10-22T15:10:00Z",
  "object": "template",
  "status": "published",
  "has_unpublished_changes": true,
  "variable_names": [
    "first_name"
  ]
}