# Runs post create event

`POST /$event/agents`



[Agents API guide](https://docs.contextual.io/tenants/tenant-apis/agents-api.md)

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Contextual Agents Api",
    "description": " "
  },
  "security": [
    {
      "jwt": []
    }
  ],
  "servers": [
    {
      "url": "https://agents.{tenantId}.my.contextual.io/api/v1",
      "variables": {
        "tenantId": {
          "default": "YOUR-TENANT-ID"
        }
      }
    }
  ],
  "paths": {
    "/$event/agents": {
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Runs post create event",
        "parameters": [
          {
            "name": "x-org-id",
            "in": "header",
            "required": false
          }
        ],
        "deprecated": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "envVars": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "size": {
                            "type": "string"
                          },
                          "configName": {
                            "type": "string"
                          },
                          "livenessTimeoutSeconds": {
                            "default": 50,
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 3600,
                            "multipleOf": 10
                          },
                          "customDomain": {
                            "type": "string",
                            "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"
                          },
                          "type": {
                            "type": "string",
                            "const": "worker"
                          },
                          "worker": {
                            "type": "string",
                            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                          },
                          "workerVersion": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "runtimeClassName": {
                            "type": "string",
                            "enum": [
                              "kata-xxsmall",
                              "kata-xsmall",
                              "kata-small",
                              "kata-medium",
                              "kata-large",
                              "kata-xlarge",
                              "kata-xxlarge"
                            ]
                          },
                          "schedule": {
                            "type": "string",
                            "pattern": "^((\\*(\\/\\d+)?|([0-5]?\\d)(-([0-5]?\\d)(\\/\\d+)?)?(,([0-5]?\\d)(-([0-5]?\\d)(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|([01]?\\d|2[0-3])(-([01]?\\d|2[0-3])(\\/\\d+)?)?(,([01]?\\d|2[0-3])(-([01]?\\d|2[0-3])(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01])(\\/\\d+)?)?(,(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01])(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|([1-9]|1[012])(-([1-9]|1[012])(\\/\\d+)?)?(,([1-9]|1[012])(-([1-9]|1[012])(\\/\\d+)?)?)*|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\s+(\\*(\\/\\d+)?|([0-6])(-([0-6])(\\/\\d+)?)?(,([0-6])(-([0-6])(\\/\\d+)?)?)*|mon|tue|wed|thu|fri|sat|sun)|(@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly))$"
                          },
                          "maxReplicas": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "scaleType": {
                            "default": "cpu",
                            "type": "string",
                            "const": "cpu"
                          },
                          "minReplicas": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "targetCpu": {
                            "type": "number",
                            "minimum": 1,
                            "maximum": 100
                          }
                        },
                        "required": [
                          "name",
                          "displayName",
                          "size",
                          "livenessTimeoutSeconds",
                          "type",
                          "worker",
                          "workerVersion",
                          "runtimeClassName",
                          "maxReplicas",
                          "scaleType",
                          "minReplicas",
                          "targetCpu"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "envVars": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "size": {
                            "type": "string"
                          },
                          "configName": {
                            "type": "string"
                          },
                          "livenessTimeoutSeconds": {
                            "default": 50,
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 3600,
                            "multipleOf": 10
                          },
                          "customDomain": {
                            "type": "string",
                            "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"
                          },
                          "type": {
                            "type": "string",
                            "const": "worker"
                          },
                          "worker": {
                            "type": "string",
                            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                          },
                          "workerVersion": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "runtimeClassName": {
                            "type": "string",
                            "enum": [
                              "kata-xxsmall",
                              "kata-xsmall",
                              "kata-small",
                              "kata-medium",
                              "kata-large",
                              "kata-xlarge",
                              "kata-xxlarge"
                            ]
                          },
                          "schedule": {
                            "type": "string",
                            "pattern": "^((\\*(\\/\\d+)?|([0-5]?\\d)(-([0-5]?\\d)(\\/\\d+)?)?(,([0-5]?\\d)(-([0-5]?\\d)(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|([01]?\\d|2[0-3])(-([01]?\\d|2[0-3])(\\/\\d+)?)?(,([01]?\\d|2[0-3])(-([01]?\\d|2[0-3])(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01])(\\/\\d+)?)?(,(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01])(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|([1-9]|1[012])(-([1-9]|1[012])(\\/\\d+)?)?(,([1-9]|1[012])(-([1-9]|1[012])(\\/\\d+)?)?)*|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\s+(\\*(\\/\\d+)?|([0-6])(-([0-6])(\\/\\d+)?)?(,([0-6])(-([0-6])(\\/\\d+)?)?)*|mon|tue|wed|thu|fri|sat|sun)|(@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly))$"
                          },
                          "maxReplicas": {
                            "default": 1,
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "pollingInterval": {
                            "default": 20,
                            "type": "integer",
                            "minimum": 5,
                            "maximum": 9007199254740991
                          },
                          "minReplicas": {
                            "default": 0,
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100
                          },
                          "cooldownPeriod": {
                            "default": 5,
                            "type": "number",
                            "minimum": 0
                          },
                          "lagThreshold": {
                            "default": 100,
                            "type": "number",
                            "minimum": 2
                          },
                          "scaleType": {
                            "type": "string",
                            "const": "lag"
                          }
                        },
                        "required": [
                          "name",
                          "displayName",
                          "size",
                          "livenessTimeoutSeconds",
                          "type",
                          "worker",
                          "workerVersion",
                          "runtimeClassName",
                          "maxReplicas",
                          "pollingInterval",
                          "minReplicas",
                          "cooldownPeriod",
                          "lagThreshold",
                          "scaleType"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string",
                            "pattern": "^\\d+\\.\\d+\\.\\d+"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "envVars": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "size": {
                            "type": "string"
                          },
                          "configName": {
                            "type": "string"
                          },
                          "livenessTimeoutSeconds": {
                            "default": 50,
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 3600,
                            "multipleOf": 10
                          },
                          "processingType": {
                            "default": "ordered",
                            "type": "string",
                            "enum": [
                              "ordered",
                              "unordered"
                            ]
                          },
                          "type": {
                            "type": "string",
                            "const": "nos-topic"
                          },
                          "ruleset": {
                            "type": "string"
                          },
                          "entryPoint": {
                            "default": "",
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "image",
                          "displayName",
                          "size",
                          "livenessTimeoutSeconds",
                          "processingType",
                          "type",
                          "ruleset",
                          "entryPoint"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "maxReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "scaleType": {
                                "type": "string",
                                "const": "cpu"
                              },
                              "minReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "targetCpu": {
                                "type": "number",
                                "minimum": 1,
                                "maximum": 100
                              }
                            },
                            "required": [
                              "maxReplicas",
                              "scaleType",
                              "minReplicas",
                              "targetCpu"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "maxReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "scaleType": {
                                "type": "string",
                                "const": "lag"
                              },
                              "pollingInterval": {
                                "default": 60,
                                "type": "number",
                                "minimum": 15
                              },
                              "minReplicas": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "cooldownPeriod": {
                                "default": 5,
                                "type": "number",
                                "minimum": 0
                              },
                              "lagThreshold": {
                                "default": 100,
                                "type": "number",
                                "minimum": 2
                              }
                            },
                            "required": [
                              "maxReplicas",
                              "scaleType",
                              "pollingInterval",
                              "minReplicas",
                              "cooldownPeriod",
                              "lagThreshold"
                            ],
                            "additionalProperties": false
                          }
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string",
                            "pattern": "^\\d+\\.\\d+\\.\\d+"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "envVars": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "size": {
                            "type": "string"
                          },
                          "configName": {
                            "type": "string"
                          },
                          "livenessTimeoutSeconds": {
                            "default": 50,
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 3600,
                            "multipleOf": 10
                          },
                          "processingType": {
                            "default": "ordered",
                            "type": "string",
                            "enum": [
                              "ordered",
                              "unordered"
                            ]
                          },
                          "type": {
                            "type": "string",
                            "const": "flow-topic"
                          },
                          "flow": {
                            "type": "string"
                          },
                          "entryPoint": {
                            "default": "",
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "image",
                          "displayName",
                          "size",
                          "livenessTimeoutSeconds",
                          "processingType",
                          "type",
                          "flow",
                          "entryPoint"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "maxReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "scaleType": {
                                "type": "string",
                                "const": "cpu"
                              },
                              "minReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "targetCpu": {
                                "type": "number",
                                "minimum": 1,
                                "maximum": 100
                              }
                            },
                            "required": [
                              "maxReplicas",
                              "scaleType",
                              "minReplicas",
                              "targetCpu"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "maxReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "scaleType": {
                                "type": "string",
                                "const": "lag"
                              },
                              "pollingInterval": {
                                "default": 60,
                                "type": "number",
                                "minimum": 15
                              },
                              "minReplicas": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "cooldownPeriod": {
                                "default": 5,
                                "type": "number",
                                "minimum": 0
                              },
                              "lagThreshold": {
                                "default": 100,
                                "type": "number",
                                "minimum": 2
                              }
                            },
                            "required": [
                              "maxReplicas",
                              "scaleType",
                              "pollingInterval",
                              "minReplicas",
                              "cooldownPeriod",
                              "lagThreshold"
                            ],
                            "additionalProperties": false
                          }
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "image": {
                        "type": "string",
                        "pattern": "^\\d+\\.\\d+\\.\\d+"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "envVars": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "size": {
                        "type": "string"
                      },
                      "configName": {
                        "type": "string"
                      },
                      "livenessTimeoutSeconds": {
                        "default": 50,
                        "type": "integer",
                        "minimum": 50,
                        "maximum": 3600,
                        "multipleOf": 10
                      },
                      "type": {
                        "type": "string",
                        "const": "flow-cron"
                      },
                      "flow": {
                        "type": "string"
                      },
                      "entryPoint": {
                        "type": "string"
                      },
                      "schedule": {
                        "type": "string",
                        "pattern": "^((\\*(\\/\\d+)?|([0-5]?\\d)(-([0-5]?\\d)(\\/\\d+)?)?(,([0-5]?\\d)(-([0-5]?\\d)(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|([01]?\\d|2[0-3])(-([01]?\\d|2[0-3])(\\/\\d+)?)?(,([01]?\\d|2[0-3])(-([01]?\\d|2[0-3])(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01])(\\/\\d+)?)?(,(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01])(\\/\\d+)?)?)*)\\s+(\\*(\\/\\d+)?|([1-9]|1[012])(-([1-9]|1[012])(\\/\\d+)?)?(,([1-9]|1[012])(-([1-9]|1[012])(\\/\\d+)?)?)*|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\s+(\\*(\\/\\d+)?|([0-6])(-([0-6])(\\/\\d+)?)?(,([0-6])(-([0-6])(\\/\\d+)?)?)*|mon|tue|wed|thu|fri|sat|sun)|(@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly))$"
                      }
                    },
                    "required": [
                      "name",
                      "image",
                      "displayName",
                      "size",
                      "livenessTimeoutSeconds",
                      "type",
                      "flow",
                      "entryPoint",
                      "schedule"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string",
                            "pattern": "^\\d+\\.\\d+\\.\\d+"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "envVars": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "size": {
                            "type": "string"
                          },
                          "configName": {
                            "type": "string"
                          },
                          "livenessTimeoutSeconds": {
                            "default": 50,
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 3600,
                            "multipleOf": 10
                          },
                          "type": {
                            "type": "string",
                            "const": "chat-topic"
                          },
                          "flow": {
                            "type": "string"
                          },
                          "entryPoint": {
                            "default": "",
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "image",
                          "displayName",
                          "size",
                          "livenessTimeoutSeconds",
                          "type",
                          "flow",
                          "entryPoint"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "maxReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "scaleType": {
                                "type": "string",
                                "const": "cpu"
                              },
                              "minReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "targetCpu": {
                                "type": "number",
                                "minimum": 1,
                                "maximum": 100
                              }
                            },
                            "required": [
                              "maxReplicas",
                              "scaleType",
                              "minReplicas",
                              "targetCpu"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "maxReplicas": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "scaleType": {
                                "type": "string",
                                "const": "lag"
                              },
                              "pollingInterval": {
                                "default": 60,
                                "type": "number",
                                "minimum": 15
                              },
                              "minReplicas": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "cooldownPeriod": {
                                "default": 5,
                                "type": "number",
                                "minimum": 0
                              },
                              "lagThreshold": {
                                "default": 100,
                                "type": "number",
                                "minimum": 2
                              }
                            },
                            "required": [
                              "maxReplicas",
                              "scaleType",
                              "pollingInterval",
                              "minReplicas",
                              "cooldownPeriod",
                              "lagThreshold"
                            ],
                            "additionalProperties": false
                          }
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "image": {
                        "type": "string",
                        "pattern": "^\\d+\\.\\d+\\.\\d+"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "envVars": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "size": {
                        "type": "string"
                      },
                      "configName": {
                        "type": "string"
                      },
                      "livenessTimeoutSeconds": {
                        "default": 50,
                        "type": "integer",
                        "minimum": 50,
                        "maximum": 3600,
                        "multipleOf": 10
                      },
                      "customDomain": {
                        "type": "string",
                        "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"
                      },
                      "type": {
                        "type": "string",
                        "const": "flow-http"
                      },
                      "flow": {
                        "type": "string"
                      },
                      "maxReplicas": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "scaleType": {
                        "default": "cpu",
                        "type": "string",
                        "const": "cpu"
                      },
                      "minReplicas": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "targetCpu": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 100
                      }
                    },
                    "required": [
                      "name",
                      "image",
                      "displayName",
                      "size",
                      "livenessTimeoutSeconds",
                      "type",
                      "flow",
                      "maxReplicas",
                      "scaleType",
                      "minReplicas",
                      "targetCpu"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "image": {
                        "type": "string",
                        "pattern": "^\\d+\\.\\d+\\.\\d+"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "envVars": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "size": {
                        "type": "string"
                      },
                      "configName": {
                        "type": "string"
                      },
                      "livenessTimeoutSeconds": {
                        "default": 50,
                        "type": "integer",
                        "minimum": 50,
                        "maximum": 3600,
                        "multipleOf": 10
                      },
                      "customDomain": {
                        "type": "string",
                        "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"
                      },
                      "type": {
                        "type": "string",
                        "const": "site-http"
                      },
                      "site": {
                        "type": "string"
                      },
                      "ref": {
                        "type": "string"
                      },
                      "maxReplicas": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "scaleType": {
                        "default": "cpu",
                        "type": "string",
                        "const": "cpu"
                      },
                      "minReplicas": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "targetCpu": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 100
                      }
                    },
                    "required": [
                      "name",
                      "image",
                      "displayName",
                      "size",
                      "livenessTimeoutSeconds",
                      "type",
                      "site",
                      "ref",
                      "maxReplicas",
                      "scaleType",
                      "minReplicas",
                      "targetCpu"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Event sent",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid authorization header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Invalid permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "$ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "number"
            ]
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    }
  }
}
```