Create Integration
Create a new integration.
Request Body
Short identifier for the integration
Description of what the integration does
Type: COLLECTOR, FORWARDER, SCANNER, CLOUD, WEBHOOK, API
Whether integration is active
curl -X POST https://your-utmstack-instance.com/api/utm-integrations \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
-H "Content-Type: application/json" \
-d '{
"name": "Office 365 Logs",
"shortName": "office365",
"description": "Collects Office 365 audit logs",
"integrationType": "CLOUD",
"active": true
}'
{
"id": 15,
"name": "Office 365 Logs",
"shortName": "office365",
"description": "Collects Office 365 audit logs",
"integrationType": "CLOUD",
"active": true,
"module": null
}
Update Integration
Update an existing integration.
Request Body
curl -X PUT https://your-utmstack-instance.com/api/utm-integrations \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
-H "Content-Type: application/json" \
-d '{
"id": 15,
"name": "Microsoft 365 Audit Logs",
"shortName": "office365",
"description": "Collects Microsoft 365 audit and security logs",
"integrationType": "CLOUD",
"active": true
}'
{
"id": 15,
"name": "Microsoft 365 Audit Logs",
"shortName": "office365",
"description": "Collects Microsoft 365 audit and security logs",
"integrationType": "CLOUD",
"active": true
}
Delete Integration
Delete an integration.
Path Parameters
curl -X DELETE https://your-utmstack-instance.com/api/utm-integrations/15 \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..."
Create configuration parameters for an integration.
Request Body
Integration object with ID
Configuration parameter name
Configuration parameter value
Description of the parameter
curl -X POST https://your-utmstack-instance.com/api/utm-integration-confs \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
-H "Content-Type: application/json" \
-d '{
"integration": {"id": 15},
"confName": "tenant_id",
"confValue": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"confDescription": "Microsoft 365 Tenant ID"
}'
{
"id": 50,
"integration": {
"id": 15,
"name": "Office 365 Logs"
},
"confName": "tenant_id",
"confValue": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"confDescription": "Microsoft 365 Tenant ID"
}
Update Integration Configuration
Update an integration configuration parameter. This will mark the associated module as needing a restart.
Request Body
Configuration ID to update
Integration object with ID
curl -X PUT https://your-utmstack-instance.com/api/utm-integration-confs \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
-H "Content-Type: application/json" \
-d '{
"id": 50,
"integration": {"id": 15},
"confName": "tenant_id",
"confValue": "new-tenant-id",
"confDescription": "Updated Microsoft 365 Tenant ID"
}'
{
"id": 50,
"integration": {
"id": 15,
"name": "Office 365 Logs",
"module": {
"needsRestart": true
}
},
"confName": "tenant_id",
"confValue": "new-tenant-id",
"confDescription": "Updated Microsoft 365 Tenant ID"
}
Complete Integration Setup Example
import requests
def setup_integration(api_url, token, integration_data, configs):
"""
Create an integration and configure its parameters.
"""
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
# Step 1: Create integration
response = requests.post(
f"{api_url}/utm-integrations",
headers=headers,
json=integration_data
)
if response.status_code != 201:
return {"success": False, "error": "Failed to create integration"}
integration = response.json()
integration_id = integration["id"]
print(f"Created integration ID: {integration_id}")
# Step 2: Add configuration parameters
created_configs = []
for config in configs:
config_data = {
"integration": {"id": integration_id},
"confName": config["name"],
"confValue": config["value"],
"confDescription": config.get("description", "")
}
response = requests.post(
f"{api_url}/utm-integration-confs",
headers=headers,
json=config_data
)
if response.status_code == 201:
created_configs.append(response.json())
print(f" + Added config: {config['name']}")
else:
print(f" - Failed to add config: {config['name']}")
return {
"success": True,
"integration": integration,
"configs": created_configs
}
# Example: Setup Office 365 integration
integration_data = {
"name": "Office 365 Logs",
"shortName": "office365",
"description": "Collects Office 365 audit logs",
"integrationType": "CLOUD",
"active": True
}
configs = [
{
"name": "tenant_id",
"value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"description": "Microsoft 365 Tenant ID"
},
{
"name": "client_id",
"value": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
"description": "Application Client ID"
},
{
"name": "client_secret",
"value": "secret-value-here",
"description": "Application Client Secret"
}
]
result = setup_integration(
"https://your-utmstack-instance.com/api",
"YOUR_TOKEN",
integration_data,
configs
)
if result["success"]:
print(f"\nIntegration setup complete!")
print(f"Integration ID: {result['integration']['id']}")
print(f"Configs created: {len(result['configs'])}")