{
  "service": "control_d",
  "displayName": "Control D",
  "categories": [
    "Security",
    "Developer Tools"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "API Token",
      "placeholder": "ctrld_api_token",
      "description": "Control D API token used with the Authorization Bearer header. Create and manage it from the Control D dashboard API page: https://docs.controld.com/docs/org-api"
    }
  ],
  "homepageUrl": "https://controld.com",
  "actions": [
    {
      "id": "control_d.delete_profile_rule",
      "service": "control_d",
      "name": "delete_profile_rule",
      "description": "Delete one root-folder custom DNS rule from a Control D profile.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "profileId": {
            "type": "string",
            "minLength": 1,
            "description": "The Control D profile primary key."
          },
          "ruleId": {
            "type": "string",
            "minLength": 1,
            "description": "The Control D rule primary key, usually a hostname or wildcard pattern."
          },
          "forceOrgId": {
            "type": "string",
            "minLength": 1,
            "description": "Optional child organization ID forwarded as the X-Force-Org-Id header."
          }
        },
        "additionalProperties": false,
        "required": [
          "profileId",
          "ruleId"
        ],
        "description": "Input parameters for deleting one Control D custom rule."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "deleted": {
            "const": true,
            "type": "boolean",
            "description": "Whether the Control D rule delete request succeeded."
          },
          "profileId": {
            "type": "string",
            "minLength": 1,
            "description": "The Control D profile primary key."
          },
          "ruleId": {
            "type": "string",
            "minLength": 1,
            "description": "The rule primary key that was deleted."
          },
          "message": {
            "type": "string",
            "description": "The optional confirmation message returned by Control D."
          }
        },
        "additionalProperties": false,
        "required": [
          "deleted",
          "profileId",
          "ruleId"
        ]
      }
    },
    {
      "id": "control_d.get_current_ip",
      "service": "control_d",
      "name": "get_current_ip",
      "description": "Return the current IP address and datacenter seen by the Control D API for troubleshooting API token allowed-IP issues.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "No input parameters for retrieving the current Control D IP context."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "ip": {
            "type": "string",
            "description": "The current IP address seen by the Control D API."
          },
          "type": {
            "type": "string",
            "description": "The IP version label returned by Control D."
          },
          "org": {
            "type": "string",
            "description": "The organization or ISP associated with the current IP address."
          },
          "country": {
            "type": "string",
            "description": "The country code associated with the current IP address."
          },
          "handler": {
            "type": "string",
            "description": "The Control D datacenter that handled the request."
          }
        },
        "additionalProperties": false,
        "required": [
          "ip",
          "type",
          "org",
          "country",
          "handler"
        ]
      }
    },
    {
      "id": "control_d.get_profile",
      "service": "control_d",
      "name": "get_profile",
      "description": "Fetch one Control D profile by primary key.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "profileId": {
            "type": "string",
            "minLength": 1,
            "description": "The Control D profile primary key."
          },
          "forceOrgId": {
            "type": "string",
            "minLength": 1,
            "description": "Optional child organization ID forwarded as the X-Force-Org-Id header."
          }
        },
        "additionalProperties": false,
        "required": [
          "profileId"
        ],
        "description": "Input parameters for fetching one Control D profile."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "profile": {
            "type": "object",
            "properties": {
              "PK": {
                "type": "string",
                "description": "The Control D profile primary key."
              },
              "name": {
                "type": "string",
                "description": "The profile display name returned by Control D."
              },
              "stats": {
                "type": "integer",
                "description": "The analytics level configured for the profile."
              },
              "profile": {
                "type": "object",
                "properties": {
                  "da": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": "The default action configuration returned by Control D."
                  },
                  "flt": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "description": "The number of items reported by Control D for this area."
                      }
                    },
                    "additionalProperties": true,
                    "description": "A count summary returned by Control D."
                  },
                  "grp": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "description": "The number of items reported by Control D for this area."
                      }
                    },
                    "additionalProperties": true,
                    "description": "A count summary returned by Control D."
                  },
                  "svc": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "description": "The number of items reported by Control D for this area."
                      }
                    },
                    "additionalProperties": true,
                    "description": "A count summary returned by Control D."
                  },
                  "cflt": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "description": "The number of items reported by Control D for this area."
                      }
                    },
                    "additionalProperties": true,
                    "description": "A count summary returned by Control D."
                  },
                  "rule": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "description": "The number of items reported by Control D for this area."
                      }
                    },
                    "additionalProperties": true,
                    "description": "A count summary returned by Control D."
                  },
                  "ipflt": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "description": "The number of items reported by Control D for this area."
                      }
                    },
                    "additionalProperties": true,
                    "description": "A count summary returned by Control D."
                  }
                },
                "additionalProperties": true,
                "description": "The nested profile summary returned by Control D."
              },
              "updated": {
                "type": "integer",
                "description": "The Unix timestamp of the last profile update."
              }
            },
            "additionalProperties": true,
            "description": "A Control D profile returned by the API."
          }
        },
        "additionalProperties": false,
        "required": [
          "profile"
        ]
      }
    },
    {
      "id": "control_d.list_profile_rules",
      "service": "control_d",
      "name": "list_profile_rules",
      "description": "List the root-folder custom DNS rules configured on a Control D profile.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "profileId": {
            "type": "string",
            "minLength": 1,
            "description": "The Control D profile primary key."
          },
          "forceOrgId": {
            "type": "string",
            "minLength": 1,
            "description": "Optional child organization ID forwarded as the X-Force-Org-Id header."
          }
        },
        "additionalProperties": false,
        "required": [
          "profileId"
        ],
        "description": "Input parameters for listing custom DNS rules."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "PK": {
                  "type": "string",
                  "description": "The rule primary key, usually the hostname pattern."
                },
                "group": {
                  "type": "integer",
                  "description": "The numeric folder identifier that contains the rule."
                },
                "order": {
                  "type": "integer",
                  "description": "The evaluation order of the rule within the folder."
                },
                "action": {
                  "type": "object",
                  "properties": {
                    "do": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 3,
                      "description": "The Control D rule action code: 0=BLOCK, 1=BYPASS, 2=SPOOF, 3=REDIRECT."
                    },
                    "status": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1,
                      "description": "The Control D rule status code: 0=disabled, 1=enabled."
                    },
                    "via": {
                      "type": "string",
                      "description": "The spoof target or redirect location returned by Control D."
                    },
                    "via_v6": {
                      "type": "string",
                      "description": "The IPv6 spoof target returned by Control D."
                    }
                  },
                  "additionalProperties": true,
                  "description": "The action payload of a Control D custom rule."
                }
              },
              "additionalProperties": true,
              "description": "A Control D custom DNS rule."
            },
            "description": "The custom DNS rules returned by Control D."
          }
        },
        "additionalProperties": false,
        "required": [
          "rules"
        ]
      }
    },
    {
      "id": "control_d.list_profiles",
      "service": "control_d",
      "name": "list_profiles",
      "description": "List the Control D profiles available to the authenticated API token.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "forceOrgId": {
            "type": "string",
            "minLength": 1,
            "description": "Optional child organization ID forwarded as the X-Force-Org-Id header."
          }
        },
        "additionalProperties": false,
        "description": "Input parameters for listing profiles."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "profiles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "PK": {
                  "type": "string",
                  "description": "The Control D profile primary key."
                },
                "name": {
                  "type": "string",
                  "description": "The profile display name returned by Control D."
                },
                "stats": {
                  "type": "integer",
                  "description": "The analytics level configured for the profile."
                },
                "profile": {
                  "type": "object",
                  "properties": {
                    "da": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      },
                      "description": "The default action configuration returned by Control D."
                    },
                    "flt": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": "The number of items reported by Control D for this area."
                        }
                      },
                      "additionalProperties": true,
                      "description": "A count summary returned by Control D."
                    },
                    "grp": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": "The number of items reported by Control D for this area."
                        }
                      },
                      "additionalProperties": true,
                      "description": "A count summary returned by Control D."
                    },
                    "svc": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": "The number of items reported by Control D for this area."
                        }
                      },
                      "additionalProperties": true,
                      "description": "A count summary returned by Control D."
                    },
                    "cflt": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": "The number of items reported by Control D for this area."
                        }
                      },
                      "additionalProperties": true,
                      "description": "A count summary returned by Control D."
                    },
                    "rule": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": "The number of items reported by Control D for this area."
                        }
                      },
                      "additionalProperties": true,
                      "description": "A count summary returned by Control D."
                    },
                    "ipflt": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": "The number of items reported by Control D for this area."
                        }
                      },
                      "additionalProperties": true,
                      "description": "A count summary returned by Control D."
                    }
                  },
                  "additionalProperties": true,
                  "description": "The nested profile summary returned by Control D."
                },
                "updated": {
                  "type": "integer",
                  "description": "The Unix timestamp of the last profile update."
                }
              },
              "additionalProperties": true,
              "description": "A Control D profile returned by the API."
            },
            "description": "The profiles returned by Control D."
          }
        },
        "additionalProperties": false,
        "required": [
          "profiles"
        ]
      }
    },
    {
      "id": "control_d.list_service_categories",
      "service": "control_d",
      "name": "list_service_categories",
      "description": "List the Control D service categories that can be used for service discovery.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "No input parameters for listing Control D service categories."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "PK": {
                  "type": "string",
                  "description": "The service category primary key returned by Control D."
                },
                "name": {
                  "type": "string",
                  "description": "The display name of the service category."
                },
                "description": {
                  "type": "string",
                  "description": "The description of the service category."
                },
                "count": {
                  "type": "integer",
                  "description": "The number of services in the category."
                }
              },
              "additionalProperties": true,
              "description": "A Control D service category."
            },
            "description": "The service categories returned by Control D."
          }
        },
        "additionalProperties": false,
        "required": [
          "categories"
        ]
      }
    },
    {
      "id": "control_d.list_services_by_category",
      "service": "control_d",
      "name": "list_services_by_category",
      "description": "List the Control D services available in one service category.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "minLength": 1,
            "description": "The Control D service category primary key."
          }
        },
        "additionalProperties": false,
        "required": [
          "category"
        ]
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "PK": {
                  "type": "string",
                  "description": "The service primary key returned by Control D."
                },
                "name": {
                  "type": "string",
                  "description": "The display name of the service."
                },
                "category": {
                  "type": "string",
                  "description": "The category primary key that owns the service."
                },
                "unlock_location": {
                  "type": "string",
                  "description": "The default unlock or redirect location returned by Control D."
                },
                "warning": {
                  "type": "string",
                  "description": "An optional warning attached to the service."
                },
                "locations": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": "Alternative location codes supported by the service."
                }
              },
              "additionalProperties": true,
              "description": "A Control D service returned by the service catalog."
            },
            "description": "The services returned by Control D."
          }
        },
        "additionalProperties": false,
        "required": [
          "services"
        ]
      }
    },
    {
      "id": "control_d.upsert_profile_rule",
      "service": "control_d",
      "name": "upsert_profile_rule",
      "description": "Create or replace root-folder custom DNS rules on a Control D profile for one or more hostname patterns.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "profileId": {
            "type": "string",
            "minLength": 1,
            "description": "The Control D profile primary key."
          },
          "forceOrgId": {
            "type": "string",
            "minLength": 1,
            "description": "Optional child organization ID forwarded as the X-Force-Org-Id header."
          },
          "do": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3,
            "description": "The Control D rule action code: 0=BLOCK, 1=BYPASS, 2=SPOOF, 3=REDIRECT."
          },
          "status": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1,
            "description": "The Control D rule status code: 0=disabled, 1=enabled."
          },
          "hostnames": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "description": "One hostname or wildcard domain pattern."
            },
            "description": "The hostname patterns to create or update in Control D.",
            "minItems": 1
          },
          "via": {
            "type": "string",
            "minLength": 1,
            "description": "The spoof target or redirect location to send upstream."
          },
          "viaV6": {
            "type": "string",
            "minLength": 1,
            "description": "The IPv6 spoof target to send upstream when do=2."
          }
        },
        "additionalProperties": false,
        "required": [
          "profileId",
          "do",
          "hostnames"
        ],
        "description": "Input parameters for creating or replacing Control D custom rules."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "PK": {
                  "type": "string",
                  "description": "The rule primary key, usually the hostname pattern."
                },
                "group": {
                  "type": "integer",
                  "description": "The numeric folder identifier that contains the rule."
                },
                "order": {
                  "type": "integer",
                  "description": "The evaluation order of the rule within the folder."
                },
                "action": {
                  "type": "object",
                  "properties": {
                    "do": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 3,
                      "description": "The Control D rule action code: 0=BLOCK, 1=BYPASS, 2=SPOOF, 3=REDIRECT."
                    },
                    "status": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1,
                      "description": "The Control D rule status code: 0=disabled, 1=enabled."
                    },
                    "via": {
                      "type": "string",
                      "description": "The spoof target or redirect location returned by Control D."
                    },
                    "via_v6": {
                      "type": "string",
                      "description": "The IPv6 spoof target returned by Control D."
                    }
                  },
                  "additionalProperties": true,
                  "description": "The action payload of a Control D custom rule."
                }
              },
              "additionalProperties": true,
              "description": "A Control D custom DNS rule."
            },
            "description": "The rules that match the requested hostname patterns after the write."
          }
        },
        "additionalProperties": false,
        "required": [
          "rules"
        ]
      }
    }
  ]
}
