Skip to main content
Templates

Update a template

Update a Forward template by ID.

POST /api/v1/forward/templates/{template_id} Updates mutable template fields. Fields omitted from the request are left unchanged. Array fields such as tools, mcp_servers, and skills are replaced as a whole when provided.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>
Content-TypeYesapplication/json
Idempotency-KeyNoOptional idempotency key for unsafe requests.
X-Qoder-BetaRequired for Browser UseMust be browser-use-2026-07-14 when the updated tools contain the Browser Use toolset.

Path parameters

ParameterTypeRequiredDescription
template_idstringYesForward Template ID.

Body parameters

ParameterTypeRequiredDescription
namestringNoNew template name.
descriptionstringNoNew template description.
modelstring|objectNoNew model identifier, or an object with the model ID and optional effort, speed, and context_window fields.
systemstringNoNew system prompt.
max_tool_roundsinteger|nullNoMaximum tool-call rounds per Turn. Must be a positive integer. Omission preserves the current value; null clears the explicit limit and uses the platform default.
toolsarrayNoReplaces the tool configuration list.
managed_tool_configobject|nullNoReplaces the complete Forward managed-capability baseline. null, {}, or enabled_tools: [] clears it.
mcp_serversarrayNoReplaces the MCP server list.
skillsarrayNoReplaces the Skill binding list.
multiagentobject|nullNoReplaces the Multi-agent configuration. null clears it; omission preserves the current configuration.
environment_idstring|nullNoReplaces the default Environment ID. null or empty string clears it.
vaultsobject|nullNoReplaces the complete default Vault configuration. null clears it.
filesobject|nullNoReplaces default file resources. null clears the map.
github_repositoriesobject|nullNoReplaces default GitHub repositories. null or an empty object clears all bindings.
environment_variablesobject | string|nullNoReplaces default session environment variables. null clears them.
metadataobjectNoMerge updates custom metadata.

Nested configuration objects

tools, mcp_servers, and skills are array fields. When provided in an update request, each array replaces the previous array as a whole.

Model

model accepts either a model ID string or an object containing the model ID and optional tuning fields.
FieldTypeRequiredDescription
idstringYesModel identifier. Use the List models endpoint to discover available values.
effortstringNoReasoning effort: none, low, medium, high, xhigh, or max. Check the model's efforts list for supported values.
context_windowintegerNoRequested context window in tokens. Choose a positive integer from the model's available_context_windows.
speedstringNoInference speed: standard or high. Defaults to standard when omitted. See the speed array returned by List models for supported values.

Vaults

vaults is a map keyed by Vault ID. Each entry accepts an optional enabled boolean; omission is equivalent to true. Supplying vaults replaces the complete existing configuration, while null clears it.
{
  "vaults": {
    "vault_019f18f2761b": { "enabled": true },
    "vault_019f18f2762c": { "enabled": true }
  }
}
Responses always return vaults in object form.

File resources

files is a map keyed by File ID. Do not include file_id, id, or resource_id inside each item. Forward injects mount_path when creating Sessions.
FieldTypeRequiredDescription
enabledbooleanNoDefaults to true. false disables the inherited file in Identity Config.

GitHub repositories

github_repositories is a map keyed by a binding key. Each key must match [A-Za-z][A-Za-z0-9_-]{0,63}. At most 20 bindings are allowed, and normalized repository URLs and mount paths must be unique.
FieldTypeRequiredDescription
urlstringYesAbsolute HTTPS repository URL. Userinfo, query, fragment, percent encoding, and backslashes are rejected; a trailing .git is removed during normalization.
authorization_tokenstringYesWrite-only repository access token. It is never echoed in responses. Maximum 8192 bytes; only ASCII letters, digits, and underscores are allowed.
mount_pathstringNoNormalized absolute mount path inside the Session, other than /. Defaults to /data/workspace/<repository-name>. Omitting the entire github_repositories field preserves the existing configuration.
Request shapeSemantics
Field omittedPreserves the current repository configuration.
github_repositories: nullClears all bindings.
github_repositories: {}Clears all bindings.
Non-empty objectReplaces the complete repository configuration.

Tools array

Each tools[] item is selected by type.
FieldTypeApplies toDescription
typestringAllRequired. agent_toolset_20260401, browser_toolset_20260714, mcp_toolset, or custom.
enabled_toolsarrayagent_toolset_20260401Convenience allowlist. A non-empty list enables only these built-in tools.
disallowed_toolsarrayagent_toolset_20260401Convenience denylist. Compiles to disabled tool configs.
configsarrayagent_toolset_20260401, mcp_toolsetPer-tool enablement and permission policy.
mcp_server_namestringmcp_toolsetRequired. Must match an item in mcp_servers[].name.
namestringcustomRequired custom tool name. Must not conflict with a built-in tool.
descriptionstringcustomRequired custom tool description.
input_schemaobjectcustomRequired JSON Schema. input_schema.type must be object.
Built-in tool names are Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch, and DeliverArtifacts.

Forward managed capabilities

managed_tool_config.enabled_tools is the complete set of Forward managed capabilities enabled by the Template. Forward provides the corresponding tool definitions; callers do not need to configure them again in tools. Supported selectors are schedule, create_forward_schedule, list_forward_schedules, delete_forward_schedule, and drive. schedule is shorthand for the Schedule capability bundle, equivalent to enabling create_forward_schedule, list_forward_schedules, and delete_forward_schedule together:
{
  "managed_tool_config": {
    "enabled_tools": ["schedule"]
  }
}
Bundle/Capability selectors such as schedule are used only for configuration; drive represents the full Drive capability. At runtime, a Session receives the corresponding Forward managed tools, which can be called independently. Template responses preserve schedule or drive from the request without rewriting them as execution tool names.
Request shapeSemantics
Field omittedPreserves the current managed-capability baseline.
managed_tool_config: nullClears all Forward managed capabilities.
managed_tool_config: {}Clears all Forward managed capabilities.
{ "enabled_tools": [] }Clears all Forward managed capabilities.
Non-empty enabled_tools arrayReplaces the complete baseline with the array.
Unknown or duplicate selectors are rejected.

Browser Use (Beta)

Browser Use is currently a Beta feature. Its capabilities, limits, and API details may change. To enable browser capabilities for Sessions created from this Template, add the following toolset to tools:
{
  "type": "browser_toolset_20260714"
}
The request must also include this header:
X-Qoder-Beta: browser-use-2026-07-14
tools uses replacement semantics in the update API. To preserve existing toolsets, include them together with browser_toolset_20260714 in the new tools array.

Tool config

tools[].configs[] items use this shape.
FieldTypeRequiredDescription
namestringYesTool name. Built-in tool name for agent_toolset_20260401; MCP tool name for mcp_toolset.
enabledbooleanNofalse hides and denies the tool. true explicitly enables it.
permission_policyobjectNoRuntime permission behavior.

Permission policy

FieldTypeRequiredDescription
typestringYesalways_allow, always_ask, or always_deny.

MCP servers

FieldTypeRequiredDescription
typestringNoCurrently only http. Omitted values are treated as HTTP MCP servers in Effective Config.
namestringYesUnique MCP server name within the Template. Referenced by tools[].mcp_server_name.
urlstringYesStreamable HTTP MCP endpoint URL.

Skills

FieldTypeRequiredDescription
typestringYescustom or qoder.
skill_idstringYesSkill ID.
versionstringNoSkill version. Omitted values use the latest version.
enabledbooleanNoDefaults to true. false prevents the skill from being included in the compiled agent config.

Multiagent

multiagent configures the current Template as a coordinator, declaring its delegable Agent roster and an optional Advisor.
FieldTypeRequiredDescription
typestringYesMust be coordinator.
agentsarrayYesNon-empty roster with up to 20 ordinary Agent entries (including self), plus one optional Advisor.
multiagent.agents[] accepts Template references such as {"type":"agent","template_id":"tmpl_research"} and {"type":"self"} for the coordinator itself. A Template reference may also include an optional name.
FieldTypeApplies toRequiredDescription
typestringAllYesagent references another Agent; self references the coordinator itself.
template_idstringagentYesReferenced Forward Template ID.
namestringagentNoDisplay name of the sub-Agent.
Advisor entries use {"type":"advisor","model":"ultimate"}. At most one is allowed; see Advisor. The referenced Template must exist and be accessible to the current caller. When the roster contains ordinary Agent or self entries, tools must include agent_toolset_20260401. An Advisor-only roster does not require this toolset. If tools is also provided in the same update request, retain this toolset in the replacement array.
Request formMeaning
Field omittedPreserve the current multiagent configuration.
multiagent: nullClear the multiagent configuration.
Non-empty objectReplace the current configuration.

Advisor

Advisor gives the main Agent advice for tasks such as plan review and complex analysis. The main Agent decides when to consult it and whether to adopt its advice; you can specify consultation conditions in the system prompt. Advisor uses the main Agent's current conversation context and does not execute tools.
FieldTypeRequiredDescription
typestringYesMust be "advisor".
modelstringYesNon-empty available model name. See List models. Model objects are not supported.
An Advisor entry accepts only type and model. It can be configured alone or alongside ordinary entries. Each roster allows at most one Advisor, which does not count toward the 20 ordinary Agent limit. It does not need to be added to enabled_tools. Its fields match the Managed-layer Advisor object.
{
  "multiagent": {
    "type": "coordinator",
    "agents": [{"type": "advisor", "model": "ultimate"}]
  }
}
To change the Advisor model, update the model string in its multiagent.agents[] entry. The Template's top-level model controls the main Agent and does not change the Advisor model. Updating multiagent replaces the entire configuration, so include all ordinary Agent and self entries you want to keep. Remove the Advisor by deleting its entry; clear the entire roster with multiagent: null. Advisor configuration changes apply only to new Sessions.

Example request

curl -s -X POST 'https://api.qoder.com/api/v1/forward/templates/tmpl_support' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Support assistant v2",
  "max_tool_rounds": 40,
  "model": {
    "id": "ultimate",
    "effort": "high",
    "speed": "standard",
    "context_window": 400000
  },
  "managed_tool_config": {
    "enabled_tools": []
  },
  "multiagent": {
    "type": "coordinator",
    "agents": [
      {
        "type": "agent",
        "template_id": "tmpl_research_v2",
        "name": "Research Agent"
      },
      {
        "type": "self"
      }
    ]
  },
  "environment_id": "env_support_v2",
  "vaults": {
    "vault_019f18f2761b": {
      "enabled": true
    },
    "vault_019f18f2762c": {
      "enabled": true
    }
  },
  "github_repositories": {
    "source": {
      "url": "https://github.com/acme/support-agent.git",
      "authorization_token": "github_pat_xxx",
      "mount_path": "/data/workspace/support-agent"
    }
  },
  "environment_variables": {
    "BASE_MODE": "support_v2"
  }
}'

Example response

HTTP 200 OK
{
  "type": "template",
  "id": "tmpl_support",
  "name": "Support assistant v2",
  "description": "Handles customer support requests",
  "status": "active",
  "max_tool_rounds": 40,
  "model": {
    "id": "ultimate",
    "effort": "high",
    "speed": "standard",
    "context_window": 400000
  },
  "system": "You are a helpful support assistant.",
  "tools": [
    {
      "type": "agent_toolset_20260401"
    }
  ],
  "managed_tool_config": {
    "enabled_tools": []
  },
  "mcp_servers": [],
  "skills": [],
  "multiagent": {
    "type": "coordinator",
    "agents": [
      {
        "type": "agent",
        "template_id": "tmpl_research_v2",
        "name": "Research Agent"
      },
      {
        "type": "self"
      }
    ]
  },
  "environment_id": "env_support_v2",
  "vaults": {
    "vault_019f18f2761b": {
      "enabled": true
    },
    "vault_019f18f2762c": {
      "enabled": true
    }
  },
  "files": {},
  "github_repositories": {
    "source": {
      "url": "https://github.com/acme/support-agent",
      "mount_path": "/data/workspace/support-agent"
    }
  },
  "environment_variables": {
    "BASE_MODE": "support_v2"
  },
  "metadata": {},
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:30:00Z"
}

Response fields

FieldTypeDescription
Return valueobjectComplete updated Template object. If the request includes model, it is returned in the submitted form; otherwise, its existing form is preserved.
managed_tool_configobjectUpdated Forward managed-capability baseline, returned as an enabled_tools array.
max_tool_roundsintegerMaximum tool-call rounds per Turn. Omitted when unset or cleared; not returned as null.
multiagentobject|nullUpdated Multi-agent configuration. null when not configured.
github_repositoriesobjectUpdated GitHub repository configuration. Omits the write-only authorization_token.

Errors

HTTPTypeCodeTrigger
400invalid_request_error-Invalid request body or unsupported field value.
400invalid_request_error-browser_toolset_20260714 is used without the required X-Qoder-Beta header.
400invalid_request_error-Invalid multiagent structure: an empty roster, more than 20 ordinary Agents, more than one Advisor or invalid Advisor fields, or a referenced Forward Template that does not exist or is inaccessible.
404not_found_error-Template or referenced resource does not exist.
409conflict_error-The Template name already exists, the Template state conflicts, or normalized GitHub repository URLs or mount paths are duplicated.
401authentication_errorauthentication_requiredThe PAT or SAT is invalid or expired.

Notes

  • Archived templates cannot be updated.
  • Legacy requests using managed_tool_config.tools or schedule_creation_enabled remain compatible. New integrations should use managed_tool_config.enabled_tools.
  • Updating session defaults does not mutate existing sessions.
  • github_repositories.*.authorization_token is write-only and is omitted from Template responses.