Convert a classic walk template to modern UI

POST /walk-creator/v1/templates/convert

Operation id: convertWalkTemplate

Description

Converts a classic walk template (IS_MODERN_UI=N) to a modern one (IS_MODERN_UI=Y).

Two conversion modes are supported via conversion_type:

CONVERT — In-place ID swap:

  • The classic template is archived as <MODEL_ID>-AR (status AR).
  • A modern copy takes the exact original MODEL_ID, so all historical reporting and walk-instance data continue to reference the correct template.
  • Status mapping: the modern template inherits the same status as the source.
  • Identity fields (formTraceId, formUniqueId, formAccessKey, mockTraceId, referenceKey, cycleNo, iterationTime, submittedTime, editTime) are transferred to the modern template. The archive receives only the newly generated formTraceId, formUniqueId, and formAccessKey to avoid unique-key collisions.
  • start_time is optional; when omitted the source template's start date is used.
  • A temporary -MD (modern draft) suffix is used internally during the swap; if the conversion fails mid-way the rollback restores the original template.
  • Not allowed when source status is ED (Edit) or WD (Withdrawn).

DUPLICATE_AS_MODERN — New modern template:

  • Creates a new template with an auto-generated MODEL_ID (status always D).
  • Historical reporting remains with the original classic template.
  • Optionally accepts model_name and model_description for the new copy.
  • Not allowed when source status is ED (Edit).

Data transformations applied in both modes:

  • QUESTION_TYPE='Y' (YES_NO) is converted to 'O' (PICK_ONE).
  • LOGIC_RULE documents are created from existing SKIP_DETAILS, WALK_VIOLATION_TASK, and MODEL_POST_ACT_DETAILS records.
  • allowScoring is set to Y in PERMISSION_ATTR when any question has TOTAL_POINTS > 0. allowFollowUpTask is set to Y when WALK_VIOLATION_PROJECT records exist for the template.

Authentication: X-reflexis-csrf-token-X required.


Success — CONVERT response

{
  "status": "OK",
  "response": {
    "modelList": [
      {
        "modelId": "FORM_123",
        "modelName": "My Walk Template",
        "status": "A",
        "isModernUi": "Y"
      }
    ]
  }
}

Success — DUPLICATE_AS_MODERN response

{
  "status": "OK",
  "response": {
    "modelList": [
      {
        "modelId": "FORM_9876",
        "modelName": "Copy of My Walk Template",
        "status": "D",
        "isModernUi": "Y"
      }
    ]
  }
}

Error Scenarios

ScenarioHTTP StatusMessage
Missing X-reflexis-csrf-token-X header400X-reflexis-csrf-token-X header is mandatory
Invalid or expired token401Invalid or expired token
Missing model_id400model_id is mandatory
Missing conversion_type400conversion_type is mandatory
Template not found200status: ER, business error string
Template already modern (IS_MODERN_UI=Y)200status: ER, business error string
Source status is ED (Edit) — both modes200status: ER, Template … is in Edit status and cannot be converted
Source status is WD (Withdrawn) — CONVERT only200status: ER, Template … is Withdrawn and cannot be converted in-place; use DUPLICATE_AS_MODERN instead
Conversion failure (partial rollback)500Unexpected server error.

Tags: WalkCreatorTemplateConversion

Security

  • ApiKeyHeader (apiKey)
    • APIGEE API key header validated by VerifyAPIKey policy.
  • AuthTokenHeader (apiKey)
    • Session authentication token validated server-side against the user session store. Required on every request. Absence returns HTTP 400; invalid/expired token returns HTTP 401.

Responses

200 — Success returns status: OK and response.modelList payload (same shape as duplicateTemplate API).

Application-level failures (validation, business rule) return HTTP 200 with status: ER.

Content type: application/json

400 — Invalid or missing required request parameter.

Content type: application/json

401 — Missing or invalid X-reflexis-csrf-token-X session token.

Content type: application/json

500 — Unexpected server-side error.

Content type: application/json

Request body

Required: Yes

application/x-www-form-urlencoded

Schema

PropertyTypeRequiredDescription
model_idstringYesMODEL_ID of the source classic walk template (IS_MODERN_UI=N). Allowed for most statuses; ED (Edit) is blocked for both modes, WD (Withdrawn) is blocked for CONVERT only.
conversion_typestringYesCONVERT — in-place ID swap; classic archived as <MODEL_ID>-AR, modern takes the original MODEL_ID (reporting continuity preserved). DUPLICATE_AS_MODERN — new template with auto-generated MODEL_ID (historical reporting stays on the old classic template).
start_timestringNoCONVERT only. Start date for the new modern template in yyyy-MM-dd format. Optional — when omitted the source template's own start date is used automatically.
end_timestringNoCONVERT only. End date for the new modern template in yyyy-MM-dd format. Optional — when omitted the source template's own end date is used automatically.
model_namestringNoDUPLICATE_AS_MODERN only. Name for the new modern template. Defaults to the source template name when omitted.
model_descriptionstringNoDUPLICATE_AS_MODERN only. Description for the new modern template. Defaults to the source template description when omitted.
{
  "type": "object",
  "required": [
    "model_id",
    "conversion_type"
  ],
  "properties": {
    "model_id": {
      "type": "string",
      "description": "`MODEL_ID` of the source classic walk template (`IS_MODERN_UI=N`).\nAllowed for most statuses; `ED` (Edit) is blocked for both modes,\n`WD` (Withdrawn) is blocked for `CONVERT` only.\n",
      "example": "FORM_123"
    },
    "conversion_type": {
      "type": "string",
      "description": "`CONVERT` — in-place ID swap; classic archived as `<MODEL_ID>-AR`,\nmodern takes the original `MODEL_ID` (reporting continuity preserved).\n`DUPLICATE_AS_MODERN` — new template with auto-generated `MODEL_ID`\n(historical reporting stays on the old classic template).\n",
      "enum": [
        "CONVERT",
        "DUPLICATE_AS_MODERN"
      ],
      "example": "CONVERT"
    },
    "start_time": {
      "type": "string",
      "description": "`CONVERT` only. Start date for the new modern template in `yyyy-MM-dd`\nformat. **Optional** — when omitted the source template's own start date\nis used automatically.\n",
      "example": "2026-07-15"
    },
    "end_time": {
      "type": "string",
      "description": "`CONVERT` only. End date for the new modern template in `yyyy-MM-dd`\nformat. Optional — when omitted the source template's own end date\nis used automatically.\n",
      "example": "2026-12-31"
    },
    "model_name": {
      "type": "string",
      "description": "`DUPLICATE_AS_MODERN` only. Name for the new modern template.\nDefaults to the source template name when omitted.\n"
    },
    "model_description": {
      "type": "string",
      "description": "`DUPLICATE_AS_MODERN` only. Description for the new modern template.\nDefaults to the source template description when omitted.\n"
    }
  }
}

Response models

200 — Success returns status: OK and response.modelList payload (same shape as duplicateTemplate API).

Application-level failures (validation, business rule) return HTTP 200 with status: ER.

Content type: application/json

Schema

{
  "oneOf": [
    {
      "type": "object",
      "description": "Follows the same envelope as the legacy `duplicateTemplate` API.\nThe converted/duplicated template appears in `response.modelList`.\n",
      "required": [
        "status",
        "response"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "OK"
          ]
        },
        "response": {
          "type": "object",
          "properties": {
            "modelList": {
              "type": "array",
              "items": {
                "type": "object",
                "description": "Template list entry returned under `response.modelList[]` after a successful\nclassic-to-modern walk template conversion. Shape is identical to the\n`duplicateTemplate` API response.\n"
              }
            }
          }
        }
      }
    },
    {
      "type": "object",
      "description": "Error envelope shape depends on how the error is produced:\n\n- **HTTP 200** — business or validation failure after the request is accepted:\n  `{ \"status\": \"ER\", \"error\": \"<string or JSON>\" }` (no `errorCode`).\n- **HTTP 4xx/5xx** — structured API error:\n  `{ \"status\": \"ER\", \"errorCode\": \"<code>\", \"response\": \"<localized message>\" }`.\n",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "ER"
          ]
        },
        "errorCode": {
          "type": "string",
          "description": "Structured error code for HTTP 4xx/5xx responses."
        },
        "response": {
          "type": "string",
          "description": "Human-readable message when `errorCode` is present (HTTP 4xx/5xx responses)."
        },
        "error": {
          "description": "Payload for HTTP 200 error bodies (string, array, or object).",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {}
            },
            {
              "type": "object"
            }
          ]
        }
      }
    }
  ]
}

400 — Invalid or missing required request parameter.

Content type: application/json

Schema

Error envelope shape depends on how the error is produced:

  • HTTP 200 — business or validation failure after the request is accepted: { "status": "ER", "error": "<string or JSON>" } (no errorCode).
  • HTTP 4xx/5xx — structured API error: { "status": "ER", "errorCode": "<code>", "response": "<localized message>" }.
PropertyTypeRequiredDescription
statusstringNo
errorCodestringNoStructured error code for HTTP 4xx/5xx responses.
responsestringNoHuman-readable message when errorCode is present (HTTP 4xx/5xx responses).
erroroneOfNoPayload for HTTP 200 error bodies (string, array, or object).
{
  "type": "object",
  "description": "Error envelope shape depends on how the error is produced:\n\n- **HTTP 200** — business or validation failure after the request is accepted:\n  `{ \"status\": \"ER\", \"error\": \"<string or JSON>\" }` (no `errorCode`).\n- **HTTP 4xx/5xx** — structured API error:\n  `{ \"status\": \"ER\", \"errorCode\": \"<code>\", \"response\": \"<localized message>\" }`.\n",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ER"
      ]
    },
    "errorCode": {
      "type": "string",
      "description": "Structured error code for HTTP 4xx/5xx responses."
    },
    "response": {
      "type": "string",
      "description": "Human-readable message when `errorCode` is present (HTTP 4xx/5xx responses)."
    },
    "error": {
      "description": "Payload for HTTP 200 error bodies (string, array, or object).",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {}
        },
        {
          "type": "object"
        }
      ]
    }
  }
}

Example:

{
  "status": "ER",
  "errorCode": "E110",
  "response": "model_id is mandatory"
}

401 — Missing or invalid X-reflexis-csrf-token-X session token.

Content type: application/json

Schema

Error envelope shape depends on how the error is produced:

  • HTTP 200 — business or validation failure after the request is accepted: { "status": "ER", "error": "<string or JSON>" } (no errorCode).
  • HTTP 4xx/5xx — structured API error: { "status": "ER", "errorCode": "<code>", "response": "<localized message>" }.
PropertyTypeRequiredDescription
statusstringNo
errorCodestringNoStructured error code for HTTP 4xx/5xx responses.
responsestringNoHuman-readable message when errorCode is present (HTTP 4xx/5xx responses).
erroroneOfNoPayload for HTTP 200 error bodies (string, array, or object).
{
  "type": "object",
  "description": "Error envelope shape depends on how the error is produced:\n\n- **HTTP 200** — business or validation failure after the request is accepted:\n  `{ \"status\": \"ER\", \"error\": \"<string or JSON>\" }` (no `errorCode`).\n- **HTTP 4xx/5xx** — structured API error:\n  `{ \"status\": \"ER\", \"errorCode\": \"<code>\", \"response\": \"<localized message>\" }`.\n",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ER"
      ]
    },
    "errorCode": {
      "type": "string",
      "description": "Structured error code for HTTP 4xx/5xx responses."
    },
    "response": {
      "type": "string",
      "description": "Human-readable message when `errorCode` is present (HTTP 4xx/5xx responses)."
    },
    "error": {
      "description": "Payload for HTTP 200 error bodies (string, array, or object).",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {}
        },
        {
          "type": "object"
        }
      ]
    }
  }
}

500 — Unexpected server-side error.

Content type: application/json

Schema

Error envelope shape depends on how the error is produced:

  • HTTP 200 — business or validation failure after the request is accepted: { "status": "ER", "error": "<string or JSON>" } (no errorCode).
  • HTTP 4xx/5xx — structured API error: { "status": "ER", "errorCode": "<code>", "response": "<localized message>" }.
PropertyTypeRequiredDescription
statusstringNo
errorCodestringNoStructured error code for HTTP 4xx/5xx responses.
responsestringNoHuman-readable message when errorCode is present (HTTP 4xx/5xx responses).
erroroneOfNoPayload for HTTP 200 error bodies (string, array, or object).
{
  "type": "object",
  "description": "Error envelope shape depends on how the error is produced:\n\n- **HTTP 200** — business or validation failure after the request is accepted:\n  `{ \"status\": \"ER\", \"error\": \"<string or JSON>\" }` (no `errorCode`).\n- **HTTP 4xx/5xx** — structured API error:\n  `{ \"status\": \"ER\", \"errorCode\": \"<code>\", \"response\": \"<localized message>\" }`.\n",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ER"
      ]
    },
    "errorCode": {
      "type": "string",
      "description": "Structured error code for HTTP 4xx/5xx responses."
    },
    "response": {
      "type": "string",
      "description": "Human-readable message when `errorCode` is present (HTTP 4xx/5xx responses)."
    },
    "error": {
      "description": "Payload for HTTP 200 error bodies (string, array, or object).",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {}
        },
        {
          "type": "object"
        }
      ]
    }
  }
}

Example:

{
  "status": "ER",
  "errorCode": "E500",
  "response": "Unexpected server error."
}