Skip to main content
Templates

Create a template

Create a Forward template baseline for future sessions.

POST /api/v1/forward/templates Creates a template that defines the default agent configuration and session defaults used when Forward starts a session for an identity.

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 Browser Use is enabled.

Body parameters

ParameterTypeRequiredDescription
namestringYesTemplate name. Must be 1-256 characters and unique within the tenant.
modelstring|objectYesModel identifier, or an object with the model ID and optional effort, speed, and context_window fields.
environment_idstringYesDefault environment used by sessions created from this template.
descriptionstringNoTemplate description. Maximum 2048 characters.
systemstringNoSystem prompt. Maximum 100,000 characters.
max_tool_roundsinteger|nullNoMaximum tool-call rounds per Turn. Must be a positive integer. Omit or pass null to use the platform default; Forward does not set an additional default.
toolsarrayNoTool configuration list. Maximum 128 items.
managed_tool_configobject|nullNoForward managed-capability baseline. Use enabled_tools to declare the complete set of enabled capability selectors.
mcp_serversarrayNoMCP server configuration list. Maximum 20 items.
skillsarrayNoSkill binding list. Maximum 20 items.
multiagentobject|nullNoMulti-agent collaboration configuration. type must be coordinator. Omit or pass null to disable it.
vaultsobjectNoDefault Vault configuration keyed by Vault ID.
filesobjectNoDefault file resources keyed by file ID.
github_repositoriesobjectNoDefault GitHub repositories keyed by a caller-defined binding key. Maximum 20 bindings.
environment_variablesobject | stringNoDefault session environment variables.
metadataobjectNoCustom metadata.

Nested configuration objects

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. Do not repeat vault_id, id, or resource_id inside an entry.
{
  "vaults": {
    "vault_019f18f2761b": {
      "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 and mounts each file at /data/workspace/<file-name>.
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>.

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 is a top-level Template field for selecting managed capabilities provided and run by Forward. Forward provides the corresponding tool definitions. Specify Capability or Bundle selectors; you do not need to configure these tools again in tools.
{
  "managed_tool_config": {
    "enabled_tools": ["schedule"]
  }
}
FieldTypeRequiredDescription
enabled_toolsarrayNoComplete list of enabled selectors. An empty array enables no Forward managed capabilities.
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. drive represents the full Drive capability. Bundle/Capability selectors are used only for configuration. 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. Unknown or duplicate selectors are rejected.
Request shapeSemantics
Field omittedDoes not create a managed-capability baseline; no Forward managed capabilities are enabled by default.
null, {}, or { "enabled_tools": [] }Creates an explicit empty managed-capability baseline.
Non-empty enabled_tools arrayUses the array as the complete baseline.

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

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.
Each multiagent.agents[] item can use one of these forms:
FormExampleDescription
Template reference{"type":"agent","template_id":"tmpl_research"}References a Forward Template accessible to the current caller.
Coordinator itself{"type":"self"}Makes the current coordinator available as a delegable Agent.
Advisor object{"type":"advisor","model":"ultimate"}Configures an advisory model for the main thread. At most one per roster. See Advisor.
The following fields apply to ordinary Agent and self entries. Advisor uses a separate structure; see Advisor.
FieldTypeApplies toRequiredDescription
typestringAllYesagent references another Agent; self references the coordinator itself.
template_idstringagentYesReferenced Forward Template ID.
namestringagentNoDisplay name of the sub-Agent.
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. Forward adds this toolset automatically when creating a Template.

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' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Support assistant",
  "description": "Handles customer support requests",
  "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",
        "name": "Research Agent"
      },
      {
        "type": "self"
      }
    ]
  },
  "environment_id": "env_xxx",
  "vaults": {
    "vault_019f18f2761b": {
      "enabled": true
    }
  },
  "files": {},
  "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"
  },
  "metadata": {}
}'

Example response

HTTP 200 OK
{
  "type": "template",
  "id": "tmpl_support",
  "name": "Support assistant",
  "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",
        "name": "Research Agent"
      },
      {
        "type": "self"
      }
    ]
  },
  "environment_id": "env_xxx",
  "vaults": {
    "vault_019f18f2761b": {
      "enabled": true
    }
  },
  "files": {},
  "github_repositories": {
    "source": {
      "url": "https://github.com/acme/support-agent",
      "mount_path": "/data/workspace/support-agent"
    }
  },
  "environment_variables": {
    "BASE_MODE": "support"
  },
  "metadata": {},
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:00:00Z"
}

Response fields

FieldTypeDescription
typestringAlways template.
idstringTemplate ID.
statusstringactive or archived.
modelstring | objectReturned in the submitted form. Object form preserves id, effort, speed, and context_window.
max_tool_roundsintegerMaximum tool-call rounds per Turn. Omitted when unset or cleared; not returned as null.
managed_tool_configobjectForward managed-capability baseline. When configured, it is returned as an enabled_tools array.
multiagentobject|nullMulti-agent configuration. null when not configured.
environment_idstringDefault Environment ID used by sessions.
vaultsobjectDefault Vault configuration keyed by Vault ID.
filesobjectDefault file resource configuration keyed by file ID.
github_repositoriesobjectDefault GitHub repository configuration. Includes normalized url and final mount_path, but omits authorization_token.
created_atstringCreation timestamp.
updated_atstringUpdate timestamp.

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-Referenced environment, skill, vault, or file does not exist.
409conflict_error-The Template name already exists, or normalized GitHub repository URLs or mount paths are duplicated.
401authentication_errorauthentication_requiredThe PAT or SAT is invalid or expired.

Notes

  • The id is generated by Forward. Do not send a Template ID in the create request.
  • files is a map keyed by file ID. Do not include file_id, id, or resource_id inside each file item.
  • Forward injects file mount paths when creating sessions.
  • Omitting managed_tool_config leaves all Forward managed capabilities disabled by default.
  • Legacy requests using managed_tool_config.tools or schedule_creation_enabled remain compatible. New integrations should use managed_tool_config.enabled_tools.
  • github_repositories.*.authorization_token is write-only and is omitted from Template responses.