> ## Documentation Index > Fetch the complete documentation index at: https://developers.torq.io/llms.txt > Use this file to discover all available pages before exploring further. # Import agent > Creates a new agent from a portable AgentExport snapshot, or updates the existing same-named agent when overwrite is set. ## OpenAPI ````json POST /v1alpha/agents/import { "openapi": "3.0.1", "info": { "contact": { "email": "support@torq.io", "name": "torq.io", "url": "https://torq.io" }, "title": "Torq Public API[production]", "version": "${DH_DEPLOY_VERSION}" }, "servers": [ { "url": "https://api.torq.io/public", "description": "US Environment" }, { "url": "https://api.eu.torq.io/public", "description": "European Enviornment" } ], "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "Files" }, { "name": "ActivityLogs" }, { "name": "AgentsHubService" }, { "name": "Users" }, { "name": "ApiKeys" }, { "name": "AuditLogs" }, { "name": "ContextGraph" }, { "name": "Executions" }, { "name": "ShareRequests" }, { "name": "StepRunners" }, { "name": "Integrations" }, { "name": "IPAccessService" }, { "name": "RolesService" }, { "name": "Secrets" }, { "name": "SecuritySettingsService" }, { "name": "ClaimMappings" }, { "name": "IdpSsoService" }, { "name": "Workflows" }, { "name": "Workspaces" }, { "name": "WorkspaceVariables" }, { "name": "Auto Triage Alerts" }, { "name": "Auto Triage Guidance" }, { "name": "Auto Triage Alert History" }, { "name": "Auto Triage Verdict Actions" }, { "name": "Cases" }, { "name": "Cases Custom Fields" }, { "name": "Cases Notes" }, { "name": "ExtendedCaseService" }, { "name": "Cases Attachments" }, { "name": "Observables" }, { "name": "Cases Observables" }, { "name": "CaseSearchService" }, { "name": "Cases Tasks" }, { "name": "Cases Task Templates" }, { "name": "Cases Links" }, { "name": "Cases Events" }, { "name": "Cases Runbooks" } ], "externalDocs": { "description": "Torq Documentation", "url": "https://learn.torq.io" }, "x-original-swagger-version": "2.0", "paths": { "/v1alpha/agents/import": { "post": { "description": "Creates a new agent from a portable AgentExport snapshot, or updates the existing same-named agent when overwrite is set.", "operationId": "importAgent", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/v1alphaImportAgentRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/v1alphaImportAgentResponse" } } }, "description": "A successful response." }, "401": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "Invalid bearer token. If you receive this message more than once try creating a new Client ID/Client Secret or generating a new bearer token." }, "403": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "You don't have permission to access this resource." } }, "summary": "Import agent", "tags": [ "AgentsHubService" ], "x-codegen-request-body-name": "body" } } }, "components": { "schemas": { "v1alphaImportAgentRequest": { "properties": { "agent": { "$ref": "#/components/schemas/v1alphaAgentExport" }, "publish": { "description": "Publish the imported agent immediately. Defaults to false, which imports it as a draft.", "type": "boolean" }, "overwrite": { "description": "When true and an agent with the same name already exists in the workspace, update that\nagent instead of failing. Defaults to false, which fails the import on a name conflict.", "type": "boolean" } }, "title": "ImportAgentRequest message", "type": "object" }, "v1alphaImportAgentResponse": { "properties": { "id": { "description": "ID of the imported agent: the newly created agent, or - when overwrite is true and a\nsame-named agent already existed - the existing agent that was updated in place.", "type": "string" } }, "title": "ImportAgentResponse message", "type": "object" }, "v1alphaAgentExport": { "description": "AgentExport is a portable, dependency-free subset of an agent's configuration, shared by\nExportAgent's response and ImportAgent's request. Carries no id, timestamps, or workspace-\nspecific provenance - only fields meaningful to reconstruct the agent elsewhere.", "properties": { "name": { "description": "The agent's name.", "type": "string" }, "description": { "description": "The agent's description.", "type": "string" }, "model_name": { "description": "The LLM model the agent uses.", "type": "string" }, "prompt": { "description": "The agent's system prompt.", "type": "string" }, "subscription": { "description": "The subscription tier the agent requires.", "type": "string" }, "integration_name": { "description": "The name of the integration the agent is bound to, if any.", "type": "string" }, "integration_additional_args": { "additionalProperties": { "type": "string" }, "description": "Additional configuration args for the bound integration.", "type": "object" }, "output_schema": { "description": "JSON schema describing the agent's output.", "properties": {}, "type": "object" }, "parameters": { "description": "The agent's runtime parameters.", "properties": {}, "type": "object" }, "tools": { "description": "The tools attached to the agent, in a portable representation.", "items": { "$ref": "#/components/schemas/v1alphaAgentExportTool" }, "type": "array" }, "availability": { "$ref": "#/components/schemas/v1alphaAgentAvailability" } }, "type": "object" }, "v1alphaAgentExportTool": { "description": "AgentExportTool is the portable projection of a tool attached to an exported agent. It\ncarries the full per-type body needed to reconstruct the internal\nagentic_tools.tools.v1.Tool on import (not just a type discriminator), minus OUTPUT_ONLY\nfields (id/created_at/updated_at/deleted_at/state/invalidated_at/warnings/errors/\nagents_hub_tool). predefined/omitted params are preserved for fidelity.\n\nPortability caveat: every tool body references its resource by an environment-specific id\n(workflow_id/revision_id, step_manifest_id, mcp tool_id, agent_id). Import recreates the\ntool pointing at that id, so a round-trip is lossless only within the same environment;\ncross-environment the referenced resource (workflow/step/mcp registration, or the\nsub-agent) must already exist in the destination or import fails. Builtin and internal\ntools cannot be recreated by import at all (the internal create-tool RPC's oneof only\nsupports workflow/step/mcp/agent) - they are exported for visibility only; import surfaces\nthe resulting internal error transparently, not silently.", "properties": { "name": { "description": "The tool's name.", "type": "string" }, "description": { "description": "The tool's description.", "type": "string" }, "schema": { "description": "The tool's schema.", "properties": {}, "type": "object" }, "tags": { "description": "The tool's tags.", "items": { "type": "string" }, "type": "array" }, "predefined_parameters": { "description": "Predefined parameter values configured for this tool on the agent.", "items": { "$ref": "#/components/schemas/v1alphaAgentExportPredefinedParameter" }, "type": "array" }, "omitted_parameters": { "description": "Names of parameters omitted from the tool on the agent.", "items": { "type": "string" }, "type": "array" }, "workflow": { "$ref": "#/components/schemas/v1alphaAgentExportWorkflowTool" }, "step": { "$ref": "#/components/schemas/v1alphaAgentExportStepTool" }, "builtin": { "$ref": "#/components/schemas/v1alphaAgentExportBuiltinTool" }, "mcp": { "$ref": "#/components/schemas/v1alphaAgentExportMcpTool" }, "internal": { "$ref": "#/components/schemas/v1alphaAgentExportInternalTool" }, "agent": { "$ref": "#/components/schemas/v1alphaAgentExportAgentTool" } }, "type": "object" }, "v1alphaAgentAvailability": { "description": "AgentAvailability holds which surfaces may offer an agent. Sent whole: an omitted field\nreads as false, so a partial message narrows the agent rather than leaving it unchanged.", "properties": { "workflows": { "description": "Whether the agent may be offered in the workflow builder.", "type": "boolean" }, "socrates": { "description": "Whether the agent may be offered in Socrates.", "type": "boolean" } }, "type": "object" }, "v1alphaAgentExportPredefinedParameter": { "description": "AgentExportPredefinedParameter mirrors agentic_tools.PredefinedParameter. possible_values\nis a singular nested message, not a repeated string.", "properties": { "name": { "type": "string" }, "possible_values": { "$ref": "#/components/schemas/v1alphaAgentExportPredefinedParameterValue" } }, "type": "object" }, "v1alphaAgentExportWorkflowTool": { "properties": { "workflow_id": { "description": "The workflow's ID.", "type": "string" }, "revision_id": { "description": "The workflow revision ID used by the tool, if pinned to a specific revision.", "type": "string" } }, "type": "object" }, "v1alphaAgentExportStepTool": { "properties": { "step_manifest_id": { "description": "The step manifest ID.", "type": "string" }, "step_image": { "description": "The step's container image.", "type": "string" }, "integration_name": { "description": "The name of the integration instance the step uses, if any.", "type": "string" }, "vendor": { "description": "The integration vendor.", "type": "string" }, "runner": { "description": "The runner the step executes on.", "type": "string" } }, "type": "object" }, "v1alphaAgentExportBuiltinTool": { "properties": { "name": { "description": "The built-in tool's name.", "type": "string" } }, "type": "object" }, "v1alphaAgentExportMcpTool": { "description": "AgentExportMcpTool mirrors the internal McpTool message. Note that integration_name/vendor\nare server-derived (OUTPUT_ONLY) on the internal message; export carries the real values\nfor visibility, but import should not assume the internal service accepts caller-supplied\nvalues for them.", "properties": { "tool_id": { "type": "string" }, "tool_name": { "type": "string" }, "description": { "type": "string" }, "tool_parameters": { "items": { "$ref": "#/components/schemas/v1alphaAgentExportMcpToolParameter" }, "type": "array" }, "integration_name": { "type": "string" }, "vendor": { "type": "string" } }, "type": "object" }, "v1alphaAgentExportInternalTool": { "properties": { "tool_name": { "description": "The internal tool's name.", "type": "string" } }, "type": "object" }, "v1alphaAgentExportAgentTool": { "properties": { "agent_id": { "description": "The ID of the sub-agent this tool references.", "type": "string" } }, "type": "object" }, "v1alphaAgentExportPredefinedParameterValue": { "properties": { "value": { "type": "string" }, "description": { "type": "string" } }, "type": "object" }, "v1alphaAgentExportMcpToolParameter": { "description": "AgentExportMcpToolParameter mirrors the internal McpToolParameter message field-for-field.", "properties": { "name": { "type": "string" }, "type": { "$ref": "#/components/schemas/v1alphaAgentExportMcpVariableType" }, "description": { "type": "string" }, "required": { "type": "boolean" }, "items_type": { "$ref": "#/components/schemas/v1alphaAgentExportMcpVariableType" } }, "type": "object" }, "v1alphaAgentExportMcpVariableType": { "default": "AGENT_EXPORT_MCP_VARIABLE_TYPE_UNSPECIFIED", "description": "AgentExportMcpVariableType mirrors the internal McpVariableType enum verbatim.", "enum": [ "AGENT_EXPORT_MCP_VARIABLE_TYPE_UNSPECIFIED", "AGENT_EXPORT_MCP_VARIABLE_TYPE_STRING", "AGENT_EXPORT_MCP_VARIABLE_TYPE_NUMBER", "AGENT_EXPORT_MCP_VARIABLE_TYPE_INTEGER", "AGENT_EXPORT_MCP_VARIABLE_TYPE_BOOLEAN", "AGENT_EXPORT_MCP_VARIABLE_TYPE_ARRAY", "AGENT_EXPORT_MCP_VARIABLE_TYPE_OBJECT" ], "type": "string" } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "64fb4b65-44d8-4304-881c-b1f8b6b3100a" } } } } ````