# IAC Files - Integration as Code

The definition of modules can be done through IAC files. These are JSON format files that follow a pre-defined **schema** and allow you to define your modules programmatically.&#x20;

***

### **Definitions**

An IAC file contains all the specifications of a module in a structured format. You can create your own module definitions and import them into Skyone Studio.

Below is an example of a module in the IAC format. The initial parameters belong to the module, and all operations are defined within the **operations** array. Each operation definition also includes basic properties such as name and description. Other properties are grouped into specific blocks like **parameters** and **request**.

<details>

<summary>Example REST IAC File</summary>

```
{
    "name": "Test Module 001",
    "id": "",
    "description": "Test Module 001",
    "type": "REST",
    "settings": {
        "authentication_type": "Basic"
    },
    "operations": [
        {
            "name": "Operation 001",
            "id": "",
            "description": "Test Operation 001",
            "parameters": [
                {
                    "name": "key-value1",
                    "type": "string",
                    "description": "Description parameter 001",
                    "required": true,
                    "sensitive": true,
                    "sample": "XXXXXXXXXXXXXXXX"
                },
                {
                    "name": "header-value1",
                    "type": "string",
                    "description": "Description header-parameter",
                    "required": true,
                    "sensitive": true,
                    "sample": "YYYYYYYYYYYYYYYYY"
                }
            ],
            "request": {
                "method": "GET",
                "url": {
                    "path": [
                        "segment01",
                        "segment02"
                    ],
                    "query": [
                        {
                            "key": "key1",
                            "value": "<>key-value1</>"
                        },
                        {
                            "key": "key-static",
                            "value": "static-value"
                        }
                    ]
                },
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "Authorization",
                        "value": "<>header-value1</>"
                    }
                ]
            }
        }
    ]
}
```

</details>

The complete definition of **schema** can be seen below.

<details>

<summary>Schema IAC</summary>

```
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "http://example.com/example.json",
  "type": "object",
  "default": {},
  "title": "Module Name",
  "required": ["name", "id", "type", "settings", "operations"],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 30,
      "default": "New Module",
      "title": "Module Name",
      "examples": ["Test Module 001"]
    },
    "id": {
      "type": "string",
      "default": "",
      "title": "Module Id - Integra.Sky supplied",
      "examples": ["XXXXXXXXXXXXXXXX"]
    },
    "description": {
      "type": "string | null",
      "default": "New Module Description",
      "title": "Module Description (300 chars)",
      "examples": ["Test Module 001 description"]
    },
    "type": {
      "type": "string",
      "default": "",
      "title": "Type of the Module",
      "enum": ["REST", "SOAP", "database", "file", "email"]
    },
    "settings": {
      "type": "object",
      "default": {},
      "title": "Basic Module Settings",
      "required": ["authentication_type"],
      "properties": {
        "authentication_type": {
          "type": "string",
          "default": "",
          "title": "REST Authentication Type",
          "enum": [
            "No auth",
            "Basic",
            "Bearer Token",
            "OAauth",
            "Cookie",
            "AWS",
            "OAuth2 JWT"
          ]
        }
      },
      "database_type": {
        "type": "string",
        "default": "",
        "title": "Database Type",
        "enum": [
          "mysql",
          "postgresql",
          "mssql",
          "firebird",
          "firebird3+",
          "oracle"
        ]
      },
      "storage_type": {
        "type": "string",
        "default": "",
        "title": "Storage Type",
        "examples": ["ftp", "sftp"]
      },
      "service": {
        "type": "string",
        "default": "",
        "title": "Service Type",
        "enum": ["smtp", "aws-ses"]
      },
      "wsld": {
        "type": "string",
        "default": "",
        "title": "Wsld file",
        "examples": ["http://domain.com/file"]
      },
      "account": {
        "type": "string",
        "default": "",
        "title": "Integra.Sky access account",
        "examples": ["XXXXXXXXXXXXXXXX"]
      },
      "examples": [
        {
          "authentication_type": "Basic"
        }
      ]
    },
    "operations": {
      "type": "array",
      "default": [],
      "title": "List of Operations",
      "items": {
        "type": "object",
        "default": {},
        "title": "Operation Definition",
        "required": ["name", "request"],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "default": "",
            "title": "Operation Name",
            "examples": ["Operation 0001"]
          },
          "id": {
            "type": "string",
            "default": "",
            "title": "Integra.Sky Operation Id",
            "examples": ["XXXXXXXXXXXXXXXX"]
          },
          "description": {
            "type": "string | null",
            "default": "",
            "title": "Operation Description",
            "examples": ["Test Operation 001"]
          },
          "parameters": {
            "type": "array",
            "default": [],
            "title": "List of parameters",
            "items": {
              "type": "object",
              "default": {},
              "title": "Parameter Definition",
              "required": ["name", "type", "required", "sensitive", "sample"],
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 50,
                  "default": "",
                  "title": "Parameter Name",
                  "examples": ["ops_body"]
                },
                "type": {
                  "type": "string",
                  "default": "",
                  "title": "Parameter Type",
                  "enum": ["object", "string", "number", "array"]
                },
                "description": {
                  "type": "string | null",
                  "default": "",
                  "title": "Parameter Description",
                  "examples": ["Description parameter 001"]
                },
                "required": {
                  "type": "boolean",
                  "default": false,
                  "title": "Is mandatory",
                  "examples": [true]
                },
                "sensitive": {
                  "type": "boolean",
                  "default": false,
                  "title": "Is sensitive (clear when sharing)",
                  "examples": [true]
                },
                "sample": {
                  "type": "string",
                  "default": "",
                  "title": "Sample for the parameter",
                  "examples": ["{}"]
                }
              },
              "examples": [
                {
                  "name": "ops_body",
                  "type": "object",
                  "description": "Body for the REST call",
                  "required": true,
                  "sensitive": true,
                  "sample": "{ \"parm1\":\"value1\" }"
                }
              ]
            }
          },
          "request": {
            "type": "object",
            "default": {},
            "title": "Request Definition",
            "required": ["method", "url"],
            "properties": {
              "method": {
                "type": "string",
                "default": "",
                "title": "Request Method",
                "enum": ["GET", "POST", "PUT", "DELETE", "PATCH"]
              },
              "url": {
                "type": "object",
                "default": {},
                "title": "URL description",
                "required": ["path"],
                "properties": {
                  "path": {
                    "type": "array",
                    "default": [],
                    "title": "List of path segments",
                    "items": {
                      "type": "string",
                      "title": "Path segments",
                      "examples": ["segment01", "segment02"]
                    }
                  },
                  "query": {
                    "type": "array",
                    "default": [],
                    "title": "Query Strings Definition",
                    "items": {
                      "type": "object",
                      "default": {},
                      "title": "Key/Value Pairs",
                      "required": ["key", "value"],
                      "properties": {
                        "key": {
                          "type": "string",
                          "default": "",
                          "title": "Query string key",
                          "examples": ["key"]
                        },
                        "value": {
                          "type": "string",
                          "default": "",
                          "title": "Query string value",
                          "examples": ["<>value</>"]
                        }
                      },
                      "examples": [
                        {
                          "key": "key",
                          "value": "<>value</>"
                        }
                      ]
                    }
                  }
                }
              },
              "header": {
                "type": "array",
                "default": [],
                "title": "Header Definition",
                "items": {
                  "type": "object",
                  "default": {},
                  "title": "Key/Value Pairs",
                  "required": ["key", "value"],
                  "properties": {
                    "key": {
                      "type": "string",
                      "default": "",
                      "title": "Header Key",
                      "examples": ["Content-Type"]
                    },
                    "value": {
                      "type": "string",
                      "default": "",
                      "title": "Header Value",
                      "examples": ["application/json"]
                    }
                  }
                }
              },
              "body": {
                "type": "object",
                "default": {},
                "title": "Body Definition",
                "required": ["mode"],
                "properties": {
                  "mode": {
                    "type": "string",
                    "default": "",
                    "title": "Body Mode",
                    "enum": ["raw"]
                  },
                  "raw": {
                    "type": "string",
                    "default": "",
                    "title": "Body content",
                    "examples": ["<>ops_body</>"]
                  },
                  "options": {
                    "type": "object",
                    "default": {},
                    "title": "Body Options",
                    "required": ["raw"],
                    "properties": {
                      "raw": {
                        "type": "object",
                        "default": {},
                        "title": "Raw options",
                        "required": ["language"],
                        "properties": {
                          "language": {
                            "type": "string",
                            "default": "",
                            "title": "Language Type",
                            "enum": ["json"]
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "examples": [
              {
                "method": "GET",
                "url": {
                  "path": ["leaf01", "leaf02"],
                  "query": [
                    {
                      "key": "key",
                      "value": "<>value</>"
                    }
                  ]
                },
                "header": [
                  {
                    "key": "exemplo-key",
                    "value": "<>exemplo</>"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "<>ops_body</>",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              }
            ]
          }
        }
      }
    }
  },
  "examples": [
    {
      "name": "Test Module REST 001",
      "id": "",
      "description": "Test Module 001",
      "type": "REST",
      "settings": {
        "authentication_type": "Basic"
      },
      "operations": [
        {
          "name": "Operation 0001",
          "id": "",
          "description": "Test Operation 001",
          "parameters": [
            {
              "name": "ops_body",
              "type": "object",
              "description": "Description parameter 001",
              "required": true,
              "sensitive": true,
              "sample": "{}"
            },
            {
              "name": "key-value",
              "type": "string",
              "description": "Description parameter 002",
              "required": true,
              "sensitive": true,
              "sample": "XXXXXXXXXXXXXXXX"
            }
          ],
          "request": {
            "method": "GET",
            "url": {
              "path": ["segment01", "segment02"],
              "query": [
                {
                  "key": "key",
                  "value": "<>key-value</>"
                }
              ]
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "<>ops_body</>",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Test Module Database 001",
      "id": "",
      "description": "Test Module 001",
      "type": "DATABASE",
      "settings": {
        "database_type": "ORACLE"
      },
      "operations": [
        {
          "name": "Operation 0001",
          "id": "",
          "description": "Test Operation 001",
          "parameters": [
            {
              "name": "ops_body",
              "type": "object",
              "description": "Description parameter 001",
              "required": true,
              "sensitive": true,
              "sample": "{}"
            }
          ],
          "query": {
            "query_string": "EXAMPLE   \n  WITH   \n(\nroot_ent_sai varchar(200)"
          }
        }
      ]
    },
    {
      "name": "Test Module RFC 001",
      "id": "",
      "description": "Test Module 001",
      "type": "RFC",
      "settings": {
        "type": "RFC"
      },
      "operations": [
        {
          "name": "Operation 0001",
          "id": "",
          "description": "Test Operation 001",
          "parameters": [
            {
              "name": "IN_ITEM",
              "type": "object",
              "description": "Description parameter 001",
              "required": true,
              "sensitive": true,
              "sample": "{}"
            }
          ],
          "rfc": {
            "function": "FUNCTION_NAME_LISTA",
            "parameter": "{\n    \"IN_OPERACAO\": \"I\",\n    \"IN_ITEM\":  \n            <>IN_ITEM</>\n}"
          }
        }
      ]
    }
  ]
}
```

</details>

The table below describes the main fields of an IAC file structure:

<table><thead><tr><th>Property</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>name</td><td>Connector module name</td><td> </td></tr><tr><td>id</td><td><p>Module ID. This ID is provided by Skyone Studio during export. To create a new module, use an empty ID.</p><p>Skyone Studio will create a new module if it does not recognize the provided ID.</p></td><td> </td></tr><tr><td>description</td><td>Module description</td><td> </td></tr><tr><td>type</td><td><p>Module type. Supported types:</p><ul><li>REST</li><li>RFC</li><li>Database</li></ul></td><td> </td></tr><tr><td>settings.authentication_type</td><td>Authentication mechanism used by the module.</td><td> </td></tr><tr><td>operations.[].name</td><td>Operation Name</td><td> </td></tr><tr><td>operations.[].id</td><td><p>Operation ID. This ID is provided by Skyone Studio during export. To create a new operation, use an empty ID.</p><p>Skyone Studio will create a new operation if it does not recognize the provided ID.</p></td><td> </td></tr><tr><td>description</td><td>Operation description</td><td> </td></tr><tr><td>operations.[].parameters.[].name</td><td>Parameters Name</td><td> </td></tr><tr><td>operations.[].parameters.[].type</td><td><p>Type of data that you pass as a parameter:</p><ul><li>object</li><li>string</li></ul></td><td> </td></tr><tr><td>operations.[].parameters.[].description</td><td>Parameter description</td><td> </td></tr><tr><td>operations.[].parameters.[].required</td><td><p>Definition if it is a mandatory parameter.</p><ul><li>true</li><li>false</li></ul></td><td> </td></tr><tr><td>operations.[].parameters.[].sensitive</td><td><p>Definition if it is a sensitive parameters</p><ul><li>true</li><li>false</li></ul></td><td> </td></tr><tr><td>operations.[].parameters.[].sample</td><td><p>(optional) Parameter example. <strong>It can come as an empty object or an empty string.</strong></p><p><mark style="background-color:blue;">JSON objects must be send as JSON strings</mark></p></td><td> </td></tr><tr><td>operations.[].request.method</td><td><p>Method used by the operation:</p><ul><li>GET</li><li>POST</li><li>PUT</li><li>PATCH</li><li>DELETE</li></ul></td><td> </td></tr><tr><td>operations.[].request.url.path</td><td>The <strong>path</strong> is sent as a list that contains its components.</td><td> </td></tr><tr><td>operations.[].request.url.query</td><td>List of key/value pairs containing the query string definitions.</td><td> </td></tr><tr><td>operations.[].request.header</td><td>List of key/value pairs containing the definitions of the header entries.</td><td> </td></tr><tr><td>operations.[].request.body</td><td><p>Body definition for POST or PATCH requests.</p><p>e.g.</p><p>"body": { </p><p>       "mode": "raw", </p><p>        "raw": "{ "key1":"value1",\n\t"key2":&#x3C;>body_parm1&#x3C;/>\n\t}", </p><p>       "options": { "raw": { "language": "json" </p><p>               } </p><p>        } </p><p>}</p></td><td> </td></tr></tbody></table>

\
The properties change according to the type chosen. See below for more examples:

<details>

<summary>Example DATABASE IAC File</summary>

```json
{
    "name": "Test Database Module 001",
    "id": "",
    "description": "Test Database Module 001",
    "type": "DATABASE",
    "settings": {
        "database_type": "ORACLE"
    },
    "operations": [
        {
            "name": "Operation 0001",
            "id": "",
            "description": "Test Operation 001",
            "parameters": [
                {
                    "name": "array_regras",
                    "type": "array",
                    "description": "Description parameter 001",
                    "required": true,
                    "sensitive": true,
                    "sample": "[\n  {\n    \"root_ent_sai\": \"3\",\n    \"root_id_cenario\": \"1111427\"\n  }\n]"
                }
            ],
            "query": {
                "query_string": "DECLARE @json NVARCHAR(max)  = N'<>array_regras</>' \n INSERT INTO Systax_Retorno_Produtos\n   SELECT *   \n  FROM OPENJSON(@json)  \n  WITH   \n(\nroot_ent_sai varchar(200), \nroot_id_cenario varchar(200)\n)"
            }
        }
    ]
}
```

</details>

<details>

<summary>Example RFC IAC File</summary>

```json
{
    "name": "Test RFC Module 001",
    "id": "",
    "description": "Test RFC Module 001",
    "type": "RFC",
    "settings": {
        "type": "RFC"
    },
    "operations": [
        {
            "name": "Operation 0001",
            "id": "",
            "description": "Test Operation 001",
            "parameters": [
                {
                    "name": "IN_ITEM",
                    "type": "object",
                    "description": "Description parameter 001",
                    "required": true,
                    "sensitive": true,
                    "sample": "{\n\t\t\t\"SEQ_CARREGAMENTO\": 1,\n\t\t\t\"NOM_MANGA\": \"HPT\",\n\t\t\t\"NUM_VAGAO\": \"844661-0\",\n\t\t\t\"VAL_PESO_LIQUIDO\": 96.648,\n\t\t\t\"VAL_PESO_BRUTO\": 125.5,\n\t\t\t\"DATA_CADASTRO\": \"20220630\",\n\t\t\t\"HORA_CADASTRO\": \"150340\"\n}"
                }
            ],
            "rfc": {
                "function": "Z_SDF_CADASTRO_LISTA_TU",
                "parameter": "{\n    \"IN_OPERACAO\": \"I\",\n    \"IN_ITEM\":  \n            <>IN_ITEM</>\n}"
            }
        }
    ]
}
```

</details>

#### Next steps&#x20;

You can create new modules by providing an IAC file. Additionally, Skyone Studio allows you to export the specification of an existing IAC file so that you can make updates via an UPDATE.&#x20;

Read also: [Creating a module with an IAC file](/english/skyone-studio/modules/module-management/importing-a-module.md#iac)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.skyone.cloud/english/skyone-studio/modules/module-management/importing-a-module/iac-files-integration-as-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
