{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/act-on/main/json-schema/act-on-create-schema-request-dto-schema.json",
  "title": "CreateSchemaRequestDTO",
  "description": "The schema creation details",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/act-on-custom-data-schema-api-api-openapi.yml#/components/schemas/CreateSchemaRequestDTO",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the custom object"
    },
    "description": {
      "type": "string",
      "description": "Description of the custom object"
    },
    "dataType": {
      "type": "string",
      "description": "Data type of the custom object"
    },
    "fields": {
      "type": "array",
      "description": "List of fields in the custom object",
      "items": {
        "$ref": "#/$defs/FieldDefinitionDTO"
      }
    },
    "requiredFields": {
      "type": "array",
      "description": "List of required fields in the custom object",
      "items": {
        "type": "string"
      }
    },
    "uniqueFieldSet": {
      "type": "array",
      "description": "List of unique fields in the custom object",
      "items": {
        "type": "string"
      }
    },
    "eventTimestampField": {
      "type": "string",
      "description": "Field name that contains the event timestamp"
    },
    "primaryEmailField": {
      "type": "string",
      "description": "Field name that contains the primary email"
    },
    "externalIdField": {
      "type": "string",
      "description": "Field name that contains the external id"
    },
    "objectTypeField": {
      "type": "string",
      "description": "Field name that contains the object type"
    },
    "relationships": {
      "type": "array",
      "description": "List of relationships of the custom object",
      "items": {
        "$ref": "#/$defs/RelationshipDefinitionDTO"
      }
    }
  },
  "$defs": {
    "FieldDefinitionDTO": {
      "type": "object",
      "description": "A custom object field definition",
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of the field"
        },
        "name": {
          "type": "string",
          "description": "Name of the field"
        },
        "type": {
          "type": "string",
          "description": "Data type of the field"
        },
        "description": {
          "type": "string",
          "description": "Description of the field"
        },
        "displayName": {
          "type": "string",
          "description": "Display name of the field"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Field specific set of properties. Supported properties vary by field type:\nJSON: 'format' (json|base64)\nENUM: 'enumName' (string), 'enumValues' (string), 'enumValuesCaseSensitive' (true|false)\nSTRING_ARRAY: 'CSVSeparator' (comma, semicolon, pipe, or tab)\nDATE: 'format' (date format pattern), 'formatHint' (hint string)\nDATETIME: 'format' (datetime format pattern), 'formatHint' (hint string), 'timezone' (timezone identifier)\nCURRENCY: 'currencyCode' (ISO currency code like USD, EUR, etc.)"
        },
        "extraData": {
          "type": "string",
          "description": "Extra data"
        }
      }
    },
    "RelationshipDefinitionDTO": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "fieldName": {
          "type": "string"
        },
        "fieldValue": {
          "type": "string"
        },
        "otherObject": {
          "type": "string"
        },
        "otherFieldName": {
          "type": "string"
        },
        "otherFieldValue": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    }
  }
}