Skip to main content
Templates

Clone a template

Clone an existing Forward template.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
Content-TypeYesapplication/json
Idempotency-KeyNoOptional idempotency key for unsafe requests.

Path parameters

ParameterTypeRequiredDescription
template_idstringYesSource Forward Template ID.

Request body

ParameterTypeRequiredDescription
namestringNoNew template name. If omitted, the source name plus Copy is used.
descriptionstringNoNew template description. If omitted, the source description is used.

Example request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/templates/tmpl_support/clone' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support assistant copy",
    "description": "Cloned from Support assistant"
  }'

Example response

HTTP 201 Created
{
  "type": "template",
  "id": "tmpl_019eYYYY",
  "name": "Support assistant copy",
  "description": "Cloned from Support assistant",
  "status": "active",
  "model": "ultimate",
  "system": "You are a helpful support assistant.",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "multiagent": null,
  "environment_id": "env_support",
  "vault_ids": ["vault_crm"],
  "files": {},
  "environment_variables": {
    "BASE_MODE": "support"
  },
  "metadata": {},
  "created_at": "2026-06-18T10:31:00Z",
  "updated_at": "2026-06-18T10:31:00Z"
}

Response fields

Returns the newly created Template object.

Errors

HTTPTypeTrigger
400invalid_request_errorInvalid clone request.
401TOKEN_INVALIDMissing or invalid PAT. Returns {"code":"TOKEN_INVALID","message":"missing authorization token"} when the Authorization header is absent, or {"code":"TOKEN_INVALID","message":"invalid pt-token"} when the PAT is invalid or expired.
404not_found_errorSource template does not exist.
409conflict_errorNew template name already exists.

Notes

  • Clone generates a new Template ID.
  • Cloning does not copy Identity Config records.
Guides
Tutorials
API Reference