Restore a revision into the draft
Loads a revision's stored snapshot back into the template's draft so it can be reviewed and then published. The live (active) revision does not change and no revision is created: publish (POST /V2/export-templates/{id}/publish) makes the restored content live. The template state becomes DRAFT and draftVersion is incremented, exactly as for PUT /V2/export-templates/{id}. The operation runs asynchronously and returns 202 Accepted with a Content-Location header pointing to the operation resource. **What is restored.** Template settings, tags, attributes (incl. conditions and tags), analyzer tests, custom form fields, marketing and metadata. Attributes are matched by name, so an attribute deleted since the revision comes back with a new id. Analyzer tests are recreated. A test migrated from V1 keeps its stored mandatory setting only if it still exists. **What is not restored.** The owner, `global`, `accountId`, `projectId`, `siteId`, the logo, the context and the `exportType` keep their current values, and so do platform-controlled tags: capabilities (`export_feedback_compatible`, `channel_health_compatible`), billing (`non_billable_channel_type`), export type (`main_channel_type_id`, `category_specific_export_is_parent`) and the category-specific links (`category_specific_export`, `classification_value`). These are platform settings, not template content. **Optimistic locking.** Send the current `draft_version` in the `If-Match` header. A stale value returns 409 Conflict. A revision without stored content (created by the V1 commit) cannot be restored and returns 400; so does a revision whose content no longer passes the current validation rules. The draft is left untouched in both cases. Admin and internal users may restore any template; external users only templates they own.
Authorization
bearerAuth Path Parameters
Export template ID
Public id (UUID) of the revision to restore, as returned by the revisions list.
uuidHeader Parameters
Current draft_version of the export template (optimistic locking). Send the value from GET draftVersion or the ETag response header. Mismatch returns 409 Conflict.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://export-template-api.productsup.com/V2/export-templates/0/revisions/01980f10-5b04-7845-b0d5-66861c6cabb0/restore" \ -H "If-Match: 1"{
"operationId": "01980f10-5b04-7845-b0d5-66861c6cabb0",
"status": "queued"
}{
"errors": {
"message": "Resource access denied."
}
}{
"errors": {
"message": "Resource access denied."
}
}{
"errors": {
"message": "Resource access denied."
}
}{
"errors": {
"message": "Resource access denied."
}
}How is this guide?