{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/karbonhq/json-schema/karbonhq-request-create-work-item-schema.json",
  "title": "RequestCreateWorkItem",
  "description": "A single work item",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/karbonhq-work-items-api-openapi.yml#/components/schemas/RequestCreateWorkItem",
  "allOf": [
    {
      "$ref": "#/$defs/WorkItemUpdate"
    },
    {
      "$ref": "#/$defs/WorkFeeSettings"
    },
    {
      "$ref": "#/$defs/WorkItemUserRoleAssignments"
    }
  ],
  "$defs": {
    "WorkFeeSettings": {
      "description": "The Fee Settings for a Work Item",
      "properties": {
        "FeeSettings": {
          "description": "The Fee Settings describe how the work will be billed, for FixedFee work the Fee Settings can include the value to be billed",
          "type": "object",
          "properties": {
            "FeeType": {
              "type": "string",
              "description": "The way the fee is calculated for the Work Item",
              "enum": [
                "FixedFee",
                "TimeAndMaterials",
                "NonBillable"
              ]
            },
            "FeeValue": {
              "type": [
                "number",
                "null"
              ],
              "description": "The value of the fee in the currency of the Karbon account, this value must be null if FeeType is not FixedFee"
            }
          }
        }
      }
    },
    "WorkItemUpdate": {
      "type": "object",
      "description": "The core parameters when updating a Work Item",
      "required": [
        "AssigneeEmailAddress",
        "Title",
        "ClientKey",
        "ClientType",
        "StartDate"
      ],
      "properties": {
        "AssigneeEmailAddress": {
          "type": "string",
          "description": "The email address of the user to whom the Work Item has been assigned"
        },
        "Title": {
          "type": "string",
          "description": "The title of the Work Item"
        },
        "ClientKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Client for whom the Work Item is prepared"
        },
        "ClientType": {
          "type": "string",
          "enum": [
            "Contact",
            "Organization",
            "ClientGroup"
          ],
          "description": "The type of the Client"
        },
        "RelatedClientGroupKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Client Group of the Client"
        },
        "StartDate": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time at which the Work Item should start"
        },
        "DueDate": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time by which the Work Item should be complete"
        },
        "DeadlineDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The date and time by which an external party has specified that the Work Item should be complete"
        },
        "WorkType": {
          "type": "string",
          "description": "The type of work related to the Work Item. Enter an existing Work Type."
        },
        "WorkStatus": {
          "type": "string",
          "description": "The current status of the Work Item"
        },
        "PrimaryStatus": {
          "type": "string",
          "enum": [
            "Planned",
            "ReadyToStart",
            "InProgress",
            "Waiting",
            "Completed"
          ],
          "description": "The current parent-level Status of the Work Item. If `WorkStatus` and `PrimaryStatus` have different values, `PrimaryStatus` will be the source of truth for Work Item status.\n"
        },
        "SecondaryStatus": {
          "type": "string",
          "description": "The current child-level Status of the Work Item"
        },
        "WorkTemplateKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Template that will be used to generate this Work Item"
        },
        "WorkScheduleKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Work Schedule for this Work Item"
        },
        "EstimatedBudget": {
          "deprecated": true,
          "type": "number",
          "format": "decimal",
          "description": "The estimated budget for the Work Item"
        },
        "Description": {
          "type": "string",
          "description": "A free form text field to add more information about the Work Item"
        },
        "ClientTaskRecipient": {
          "type": "object",
          "required": [
            "RecipientKey",
            "LinkType"
          ],
          "description": "The details about the recipient of the Client Tasks related to this Work Item.",
          "properties": {
            "RecipientKey": {
              "type": "string",
              "description": "A Karbon-generated value used to identify the Client"
            },
            "LinkType": {
              "type": "string",
              "enum": [
                "Contact",
                "Organization"
              ],
              "description": "The Karbon entity, from which to pull the email address in case the email address of the Client Task recipient is empty."
            },
            "EmailAddress": {
              "type": "string",
              "description": "The email address of the recipient."
            }
          }
        }
      }
    },
    "WorkItemUserRoleAssignments": {
      "description": "The User assignments for specific Roles on a Work Item",
      "properties": {
        "UserRoleAssignments": {
          "type": "array",
          "description": "The array that describes the roles of the users associated with this Work Item.",
          "items": {
            "type": "object",
            "required": [
              "RoleKey",
              "UserProfileKey"
            ],
            "properties": {
              "RoleKey": {
                "type": "string",
                "description": "A Karbon-generated value used to identify the role of the user"
              },
              "UserProfileKey": {
                "type": "string",
                "description": "A Karbon-generated value used to identify the user"
              }
            }
          }
        }
      }
    }
  }
}