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 account.
modelstring|objectYesModel identifier, or an object with the model ID and optional tuning fields.
environment_idstringYesDefault environment used by sessions created from this template.
descriptionstringNoTemplate description. Maximum 2048 characters.
systemstringNoSystem prompt. Maximum 100,000 characters.
toolsarrayNoTool configuration list. Maximum 128 items.
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.

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.
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.

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 and declares the Agents to which it can delegate.
FieldTypeRequiredDescription
typestringYesMust be coordinator.
agentsarrayYesDelegable Agent roster. Must contain 1-20 items.
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.
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 multiagent is used, tools must include agent_toolset_20260401. Forward adds this toolset automatically when creating a Template.

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",
  "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",
        "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 201 Created
{
  "type": "template",
  "id": "tmpl_support",
  "name": "Support assistant",
  "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",
        "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.
multiagentobject|nullMulti-agent configuration. null when not configured.
environment_idstringDefault Environment ID used by sessions.
vault_idsarrayDefault Vault IDs.
filesobjectDefault file resource configuration keyed by file ID.
created_atstringCreation timestamp.
updated_atstringUpdate timestamp.

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_errorReferenced environment, skill, vault, or file does not exist.
409conflict_errorTemplate name already exists.
401authentication_errorauthentication_required

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.
Create a template - Qoder