Skip to main content
Templates

Create a template

Create a Forward Template baseline.

Request Headers

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

Request Body Parameters

Parameter

Type

Required

Description

name

string

Yes

Template name, 1-256 characters, unique within the tenant.

model

string

Yes

Model identifier, e.g. ultimate.

environment_id

string

Yes

Default Environment ID used when creating Sessions.

description

string

No

Template description, up to 2048 characters.

system

string

No

System Prompt, up to 100,000 characters.

tools

array

No

Tool configuration list, up to 128 items.

mcp_servers

array

No

MCP Server configuration list, up to 20 items.

skills

array

No

Skill binding list, up to 20 items.

multiagent

object

No

Managed Agents configuration.

vault_ids

array

No

Default Vault ID list.

files

object

No

Default file resource configuration, keyed by file ID.

environment_variables

object|string

No

Default Session environment variables.

metadata

object

No

Custom metadata.

Nested Configuration Objects

File Resources

files is a map keyed by File ID. Do not include file_id, id, or resource_id inside each entry. Forward automatically injects mount_path when creating a Session.
FieldTypeRequiredDescription
enabledbooleanNoOmitting the field is equivalent to true. In an Identity Config, set false to disable an inherited file.

tools array items

Each tools[] item selects its shape via type.
FieldTypeApplies toDescription
typestringAllRequired. One of agent_toolset_20260401, mcp_toolset, or custom.
enabled_toolsarrayagent_toolset_20260401Convenience allowlist; a non-empty array enables only these built-in tools.
disallowed_toolsarrayagent_toolset_20260401Convenience denylist; compiled into disabled tool config.
configsarrayagent_toolset_20260401, mcp_toolsetPer-tool enable state and permission policy.
mcp_server_namestringmcp_toolsetRequired. Must match one of the mcp_servers[].name values.
namestringcustomRequired. Custom tool name; must not collide with a built-in tool name.
descriptionstringcustomRequired. Custom tool description.
input_schemaobjectcustomRequired JSON Schema; input_schema.type must be object.
Built-in tool names include Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch, and DeliverArtifacts.

Tool config

Each entry in tools[].configs[] uses the following shape.
FieldTypeRequiredDescription
namestringYesTool name; use the built-in tool name for a built-in toolset, or the MCP tool name for an MCP toolset.
enabledbooleanNofalse hides and denies the tool; true enables it explicitly.
permission_policyobjectNoRuntime permission behavior.

Permission policy

FieldTypeRequiredDescription
typestringYesOne of always_allow, always_ask, or always_deny.

MCP servers

FieldTypeRequiredDescription
typestringNoOnly http is currently supported; when omitted, the Effective Config treats the entry as an HTTP MCP server.
namestringYesMCP server name, unique within the Template, referenced by tools[].mcp_server_name.
urlstringYesStreamable HTTP MCP endpoint URL.

skills array items

FieldTypeRequiredDescription
typestringYescustom or qoder.
skill_idstringYesSkill ID.
versionstringNoSkill version; omit to use the latest version.
enabledbooleanNoOmitting the field is equivalent to true; false excludes it from the compiled Agent config.

Example Request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/templates' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Support assistant",
  "description": "Handles customer support requests",
  "model": "ultimate",
  "system": "You are a helpful support assistant.",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "environment_id": "env_support",
  "vault_ids": [
    "vault_crm"
  ],
  "files": {},
  "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",
  "model": "ultimate",
  "system": "You are a helpful support assistant.",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "environment_id": "env_support",
  "vault_ids": [
    "vault_crm"
  ],
  "files": {},
  "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.
environment_idstringDefault Environment ID.
vault_idsarrayDefault Vault ID list.
filesobjectDefault file resource configuration.

Errors

HTTPTypeCodeTrigger
400invalid_request_error-Request body or field value is invalid.
404not_found_error-A referenced Environment, Skill, Vault, or File does not exist.
409conflict_error-Template name already exists.
401authentication_errorTOKEN_INVALIDPAT is invalid or has expired.

Notes

  • Do not pass a template_id when creating; the ID is generated by Forward.
  • files uses file ID as the map key; do not repeat file_id, id, or resource_id inside each entry.
  • Forward automatically supplies file mount paths when creating a Session.
Guides
Tutorials
API Reference