v1

latestOpenAPI 3.0.02026-08-04891301.4 MB

Export an agent as an AgentTemplate

Reconstructs an AgentTemplate config from a deployed agent and all of its sub-resources (tools, routines, skills, installations). Returns the template definition together with every dependent config file (scripts, workflows, skills, schemas) and their raw content, producing a fully self-contained export bundle.

Use this endpoint to snapshot an agent's current configuration for backup, migration, or to seed a new Solution template. Pass remove_identity: true to strip instance-specific fields (email, phone number) before export.

The authenticated caller must own the agent or hold sufficient permissions within its owning org or team. When called under a developer app scope, the caller must hold the app scope for the target app.

get/api/v1/agents/{agent}/export

Path parameters

agentstring required

ID (agi_...) or lookup_key of the agent to export.

Query parameters

remove_identityboolean

When true, strips instance-unique identity fields (email, phone_number) from the exported template so it can be reused as a generic blueprint.

Response

Successful response

templateobject required

The agent template definition as a structured map. Pass this directly to the import endpoint to recreate the agent.

Example response

{
  "configs": [
    {
      "agent": "agi_0aBcDeFgHiJkLmNoPqRsTu",
      "created_at": "2024-01-01T00:00:00Z",
      "current_version": {
        "change_description": "An example description.",
        "content_hash": "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
        "created_at": "2024-01-01T00:00:00Z",
        "data": {},
        "id": "cfv_0aBcDeFgHiJkLmNoPqRsTu",
        "org": "org_0aBcDeFgHiJkLmNoPqRsTu",
        "sandbox": "dsb_0aBcDeFgHiJkLmNoPqRsTu",
        "version_number": 1
      },
      "id": "cfg_0aBcDeFgHiJkLmNoPqRsTu",
      "is_archived": true,
      "kind": "Agent",
      "lookup_key": "string",
      "mime_type": "application/json",
      "org": "org_0aBcDeFgHiJkLmNoPqRsTu",
      "parent": "cfg_0aBcDeFgHiJkLmNoPqRsTu",
      "parent_solution": "cfg_0aBcDeFgHiJkLmNoPqRsTu",
      "raw_content": "string",
      "relative_path": "string",
      "sandbox": "string",
      "team": "tem_0aBcDeFgHiJkLmNoPqRsTu",
      "updated_at": "2024-01-01T00:00:00Z",
      "user": "usr_0aBcDeFgHiJkLmNoPqRsTu",
      "virtual_path": "agents/my-agent.yaml"
    }
  ],
  "template": {}
}