{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "const": "create"
    },
    "create_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "workout",
        "workout_version",
        "program",
        "program_run",
        "planned_workout",
        "session",
        "exercise",
        "exercise_override",
        "modifier_assignment",
        "modifier",
        "tag",
        "category",
        "chart",
        "training_preferences",
        "app_preferences",
        "device_preferences",
        "operation_log",
        "place",
        "event",
        "recipe",
        "note",
        "link",
        "media",
        "tab",
        "product",
        "guide",
        "meal",
        "grocery_list",
        "preferences",
        "send",
        "notice"
      ]
    },
    "schema": {
      "type": "string",
      "pattern": "^(workout|workout_version|program|program_run|planned_workout|session|exercise|exercise_override|modifier_assignment|modifier|tag|category|chart|training_preferences|app_preferences|device_preferences|operation_log|place|event|recipe|note|link|media|tab|product|guide|meal|grocery_list|preferences|send|notice)@1\\.0$"
    },
    "body": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema0"
      },
      "opaque": true
    },
    "state": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema0"
      },
      "opaque": true,
      "description": "Per-account state. A supplied map replaces caller-owned keys and preserves omitted server-owned keys. Omission leaves existing state untouched."
    },
    "external_ids": {
      "maxItems": 32,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ns": {
            "type": "string",
            "pattern": "^cnx:cnx_.+"
          },
          "value": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": ["ns", "value"],
        "additionalProperties": false
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "creator": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "handle": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false,
      "description": "Creator attribution for the new record."
    }
  },
  "required": ["action", "create_id", "kind", "schema", "body"],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  },
  "$id": "https://docs.sendtopigeon.com/schemas/record-create@1.schema.json"
}
