Skip to content

Restore a template version

POST
/event-types/{name}/template/versions/{version}/restore
curl --request POST \
--url https://api.sendtruss.com/v1/event-types/example/template/versions/1/restore \
--header 'Authorization: Bearer <token>'

Saves the old version’s content as the next version, which every workspace sends from then on. The history keeps every version.

name
required
string
version
required
integer

DefaultTemplateVersionResource

Media typeapplication/json
object
data
required
DefaultTemplateVersionResource
object
id
required
string
version
required

The version number, counting from 1.

integer
subject
required
string
from_local_part
required
string
display_name
required
string
reply_to
required
string
locale
required
string
composition
required
Array
translations
required
object
variables
required

The variables the template reads, as event, contact and system lists.

object
event
required
Array<string>
contact
required
Array<string>
system
required
Array<string>
restored_from
required

The version this one restored, or null.

integer | null
created_at
required
string
Examplegenerated
{
"data": {
"id": "example",
"version": 1,
"subject": "example",
"from_local_part": "example",
"display_name": "example",
"reply_to": "example",
"locale": "example",
"composition": [
"example"
],
"translations": {},
"variables": {
"event": [
"example"
],
"contact": [
"example"
],
"system": [
"example"
]
},
"restored_from": 1,
"created_at": "example"
}
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

The API key is missing, malformed, revoked or expired.

Media typeapplication/json
object
message
required

What went wrong, for a person to read. It may change, so branch on code.

string
code
required

What went wrong, for your code to branch on. A new code is not a breaking change.

string
Allowed values: unauthenticated
doc_url
required

The entry on our errors page that explains this code.

string format: uri
request_id
required

This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.

string format: uuid
Example
{
"code": "unauthenticated"
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

Nothing is at this path for your key. Another platform’s or another workspace’s resource answers the same as one that doesn’t exist.

Media typeapplication/json
object
message
required

What went wrong, for a person to read. It may change, so branch on code.

string
code
required

What went wrong, for your code to branch on. A new code is not a breaking change.

string
Allowed values: not_found
doc_url
required

The entry on our errors page that explains this code.

string format: uri
request_id
required

This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.

string format: uuid
Example
{
"code": "not_found"
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

Too many requests. Wait for the seconds in Retry-After.

Media typeapplication/json
object
message
required

What went wrong, for a person to read. It may change, so branch on code.

string
code
required

What went wrong, for your code to branch on. A new code is not a breaking change.

string
Allowed values: rate_limited
doc_url
required

The entry on our errors page that explains this code.

string format: uri
request_id
required

This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.

string format: uuid
Example
{
"code": "rate_limited"
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

Retry-After
integer

Seconds to wait before trying again.