> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Export a gateway configuration

Gateway Manager 1.1.1+

Export a gateway cluster's configuration using the Gateway Manager UI or the Platform API. Exporting retrieves all services and resources from a running gateway instance and returns them as a configuration document you can store, version, or import into another environment.

## Before you begin

* The target gateway must be connected and active in Gateway Manager.
* You must have the `gateway:read` role to export configurations via the Platform API.

## Export via the UI

1. In Gateway Manager, go to the cluster list.
2. Locate the target cluster and select the three-dots overflow menu (**⋯**) on the cluster row.
3. Select **Export Configuration**.
4. In the dialog, select your preferred output format: **JSON** or **YAML**.
5. Select **Export** to download the configuration file.

## Export via the Platform API

The Platform API exposes export functionality through Gateway Manager. Call the export endpoint from your CI/CD pipeline or automation tooling to retrieve a configuration programmatically.

API-based exports only support JSON. To export in YAML, use the Gateway Manager UI.

### Endpoint

```
GET /v1/gateways/:clusterId/configuration/export
```

### Response

A successful export returns the full configuration for the specified cluster as a DSL document. You can pass this response directly as the `content` value in a future import request.

```json
{
  "decorators": [],
  "repositories": [],
  "services": []
}
```

### Error handling

The API returns error messages for the following conditions:

| Condition             | Description                                                                                                                                               |
| :-------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Gateway not active    | The target gateway isn't connected. Connect the gateway and retry the request.                                                                            |
| Method does not exist | The connected Itential Gateway version doesn't support this operation. Update Itential Gateway to a version compatible with your Gateway Manager version. |
| Permission error      | Your credentials don't have the `gateway:read` role. Contact your platform administrator.                                                                 |
| Network failure       | The gateway couldn't be reached during the export. Check connectivity and retry.                                                                          |

## Exported file format

The export returns all decorators, repositories, and services configured in the gateway cluster. The following example shows the structure of an exported configuration file.

```yaml
decorators:
  - name: ansible-xr
    schema:
      $id: https://example.com/device.schema.json
      $schema: https://json-schema.org/draft/2020-12/schema
      properties:
        device_type:
          description: The type of device
          enum:
            - ios
            - eos
            - nxos
          type: string
        host:
          description: The hostname or IP address of the device
          type: string
      title: Network Device
      type: object
repositories:
  - name: xr-resources
    description: XR Resources for testing
    url: git@gitlab.com:<org>/xr/resources.git
    reference: main
    tags:
      - cisco
      - xr
    private-key-name: xr-gitlab-private
services:
  - name: Ansible-Example
    type: ansible-playbook
    description: An ansible playbook to say hello-world
    playbooks:
      - hello-world.yml
    working-directory: ./
    repository: xr-resources
    decorator: ansible-xr
    tags:
      - xr
      - cisco
    runtime:
      check: true
      diff: true
      skip-tags: example-tag
      inventory:
        - ./inventory.ini
      verbose-level: 6
  - name: Hello-World
    type: python-script
    description: A simple hello-world script
    filename: hello-world.py
    working-directory: python-scripts
    repository: xr-resources
    decorator: my-special-decorator
```

## Related topics

* [Import a gateway configuration](./import-gateway-configuration)
* [Gateway configuration import and export](./import-export)