{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/intely/main/json-schema/intely-app-instance-schema.json",
  "title": "AppInstance",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/intely-api-openapi.yml#/components/schemas/AppInstance",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string"
    },
    "interfaceId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fieldId": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          }
        },
        "required": [
          "fieldId",
          "value"
        ]
      }
    },
    "webhooks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AppInstanceWebhook"
      }
    },
    "appId": {
      "type": "string"
    },
    "instanceNameSortable": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedBy": {
      "type": "string"
    },
    "deletedAt": {
      "type": "string",
      "format": "date-time"
    },
    "deletedBy": {
      "type": "string"
    }
  },
  "required": [
    "_id",
    "interfaceId",
    "name",
    "fields",
    "createdAt",
    "createdBy",
    "updatedAt",
    "updatedBy"
  ],
  "$defs": {
    "AppInstanceWebhook": {
      "description": "A webhook definition contained within an app instance",
      "type": "object",
      "properties": {
        "webhookId": {
          "type": "string"
        },
        "integrationId": {
          "type": "string"
        },
        "requestBodyContentTypeOverride": {
          "type": "string"
        },
        "requestBodySchemaOverride": {
          "type": "string"
        },
        "requestBodySchemaIsArray": {
          "type": "boolean"
        },
        "responseBodyContentTypeOverride": {
          "type": "string"
        },
        "responseBodySchemaOverride": {
          "type": "string"
        },
        "responseBodySchemaIsArray": {
          "type": "boolean"
        },
        "_id": {
          "type": "string"
        }
      },
      "required": [
        "webhookId",
        "integrationId",
        "_id"
      ]
    }
  }
}