{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/standards-new/json-schema/standards-new-create-custom-object-input-schema.json",
  "title": "CreateCustomObjectInput",
  "description": "Definition of a new custom object.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/standards-new-openapi.json#/components/schemas/CreateCustomObjectInput",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Unique machine name (snake_case)."
    },
    "label": {
      "type": "string",
      "description": "Human-readable singular label."
    },
    "pluralLabel": {
      "type": "string"
    },
    "labelExpression": {
      "type": "string",
      "description": "Expression that computes a record's display label (e.g. \"{first_name} {last_name}\")."
    },
    "embeddingExpression": {
      "type": "string",
      "description": "Expression that builds the text embedded for semantic search."
    },
    "description": {
      "type": "string"
    },
    "icon": {
      "type": "string",
      "description": "Icon name."
    },
    "attributes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AddAttributeInput"
      },
      "description": "Initial attributes to create with the object."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "required": [
    "name",
    "label",
    "labelExpression"
  ],
  "$defs": {
    "AddAttributeInput": {
      "type": "object",
      "additionalProperties": true,
      "description": "Definition of a new attribute. Type-specific configuration (e.g. options for select, decimals for number, target object for relation) is passed as additional top-level keys.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique machine name within the object."
        },
        "label": {
          "type": "string",
          "description": "Human-readable label."
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "richtext",
            "number",
            "checkbox",
            "date",
            "phone",
            "currency",
            "status",
            "location",
            "select",
            "multiselect",
            "file",
            "user",
            "relation",
            "formula",
            "rollup",
            "document"
          ],
          "description": "Attribute type."
        },
        "required": {
          "type": "boolean"
        },
        "unique": {
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "placeholder": {
          "type": "string"
        },
        "icon": {
          "type": "string",
          "description": "Icon name."
        },
        "defaultValue": {
          "description": "Default value; the shape depends on the attribute type."
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "required": [
        "name",
        "label",
        "type"
      ]
    }
  }
}