> 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.

# Manage decorations

> API reference for exporting, importing, and removing JSON schemas used to decorate Itential Gateway modules, roles, playbooks, and scripts.

Itential Gateway aggregates all of your Ansible modules, roles, playbooks, and scripts. Along with this attribute is the ability to decorate or enhance each module, role, playbook, and script. With decoration, you have the flexibility to edit JSON schemas for identifying and modifying metadata such as input parameters, descriptions, or types. Decoration is currently stored in the database.

Use the following set of APIs to export, import, and remove JSON schemas.

## Export

Retrieve the schema from a module, role, playbook, or script. The response from this call can be saved and used as direct input for importing a schema to another Itential Gateway server.

### API

```text
GET hostname:port/modules/{module_name}/schema
GET hostname:port/roles/{role_name}/schema
GET hostname:port/playbooks/{playbook_name}/schema
GET hostname:port/scripts/{script_name}/schema
GET hostname:port/nornir/{nornir_name}/schema
GET hostname:port/terraforms/{terraform_name}/schema
```

### Sample response

```json
{
    "schema": {
        "properties": {
            "command": {
                "type": "string",
                "description": "CLI command to execute on network device"
            }
        },
        "required": [
            "command"
        ],
        "title": "sample_playbook",
        "type": "object"
    }
}
```

## Import

Add or update the schema for a module, role, playbook, or script.

### API

```text
PUT hostname:port/modules/{module_name}/schema
PUT hostname:port/roles/{role_name}/schema
PUT hostname:port/playbooks/{playbook_name}/schema
PUT hostname:port/scripts/{script_name}/schema
PUT hostname:port/nornir/{nornir_name}/schema
PUT hostname:port/terraforms/{terraform_name}/schema
```

### Sample request

```json
{
    "schema": {
        "properties": {
            "command": {
                "type": "string",
                "description": "CLI command to execute on a network device"
            }
        },
        "required": [
            "command"
        ],
        "title": "sample_playbook_1",
        "type": "object"
    }
}
```

### Sample response

```json
{
    "type": "playbook",
    "name": "sample_playbook_1",
    "schema": {
        "properties": {
            "command": {
                "type": "string",
                "description": "CLI command to execute on a network device"
            }
        },
        "required": [
            "command"
        ],
        "title": "sample_playbook_1",
        "type": "object"
    }
}
```

## Removal

Delete the user decorated schema for a module, role, playbook, or script.

This call only removes a user decorated schema. It does not apply to the certified schemas provided by Itential for roles and modules, nor to a module's native schema that is automatically created at discovery time by the AG server.

### API

```text
DELETE hostname:port/modules/{module_name}/schema
DELETE hostname:port/roles/{role_name}/schema
DELETE hostname:port/playbooks/{playbook_name}/schema
DELETE hostname:port/scripts/{script_name}/schema
DELETE hostname:port/nornir/{nornir_name}/schema
DELETE hostname:port/terraforms/{terraform_name}/schema
```

### Sample response

```json
{
    "code": 200,
    "message": "deleted"
}
```