> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convocore.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Export Agent Template

> Exports an agent template, this route must use the new V3 [endpoints](/api-reference/v3/intro).

## Example Response

```json theme={null}
{
  "agentTemplate": {
    "name": "My Agent - Exported 2024-01-15T10:30:00.000Z",
    "agentData": {
      "title": "My Agent",
      "description": "Customer support agent",
      "nodes": [...]
    },
    "tools": [...],
    "variables": [...],
    "nodes": [...],
    "workspaceId": "workspace_123"
  }
}
```

## Use Cases

* **Backup** your agent configuration before making changes
* **Duplicate** an agent by exporting then importing
* **Share** agent templates across workspaces

## Notes

* The exported template includes tools, variables, and nodes
* `SECRET_API_KEY` is excluded from exports for security
* Use `/agents/import-template` to restore or duplicate


## OpenAPI

````yaml GET /agents/{agentId}/export-template
openapi: 3.0.3
info:
  title: Convocore OpenAPI
  description: Full API reference for Convocore
  version: 1.0.4
servers:
  - url: https://eu-gcp-api.vg-stuff.com/v3
    description: EU Node.js API server
  - url: https://na-gcp-api.vg-stuff.com/v3
    description: NA Node.js API server
security: []
paths:
  /agents/{agentId}/export-template:
    get:
      summary: Export Agent Template
      operationId: exportAgentToJson
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  agentTemplate:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      nodes:
                        type: array
                      tools:
                        type: array
                      variables:
                        type: array
                      agentData: {}
                      workspaceId:
                        type: string
                    required:
                      - workspaceId
                    additionalProperties: false
                required:
                  - agentTemplate
                additionalProperties: false
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````