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 tuning fields.
systemstringNoNew system prompt.
toolsarrayNoReplaces the tool configuration list.
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.

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.

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 and declares the Agents to which it can delegate.
FieldTypeRequiredDescription
typestringYesMust be coordinator.
agentsarrayYesDelegable Agent roster. Must contain 1-20 items.
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. The referenced Template must exist and be accessible to the current caller. When multiagent is used, tools must include agent_toolset_20260401. 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.

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",
  "model": {
    "id": "ultimate",
    "effort": "high",
    "context_window": 400000
  },
  "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",
  "model": {
    "id": "ultimate",
    "effort": "high",
    "context_window": 400000
  },
  "system": "You are a helpful support assistant.",
  "tools": [
    {
      "type": "agent_toolset_20260401"
    }
  ],
  "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.
multiagentobject|nullUpdated Multi-agent configuration. null when not configured.

Errors

HTTPTypeTrigger
400invalid_request_errorInvalid request body or unsupported field value.
400invalid_request_errorbrowser_toolset_20260714 is used without the required X-Qoder-Beta header.
400invalid_request_errorInvalid multiagent structure, an agents count outside 1-20, or an inaccessible referenced Forward Template.
401authentication_errorPAT or SAT invalid or expired.
404not_found_errorTemplate or referenced resource does not exist.
409conflict_errorTemplate name already exists.
401authentication_errorauthentication_required

Notes

  • Archived templates cannot be updated.
  • Updating session defaults does not mutate existing sessions.
Update a template - Qoder