{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vcita/json-schema/vcita-create-app-assignment-request-dto-schema.json",
  "title": "CreateAppAssignmentRequestDto",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apps.json#/components/schemas/CreateAppAssignmentRequestDto",
  "type": "object",
  "properties": {
    "assignee_type": {
      "type": "string",
      "description": "The type of entity this app is assigned to",
      "enum": [
        "business",
        "package",
        "directory"
      ]
    },
    "assignee_uid": {
      "type": "string",
      "description": "The uid of the entity this app is assigned to"
    },
    "app_code_name": {
      "type": "string",
      "description": "The unique identifier of the app. Must use alphanumeric characters only (no spaces or special characters). The app must exist and belong to the authenticated directory.",
      "pattern": "^[a-zA-Z0-9]+$"
    },
    "directory_uid": {
      "type": "string",
      "description": "The uid of the directory this app is assigned to. **Optional when using Directory Token** - will be auto-determined from the token if omitted. If provided, must match the directory associated with your authentication token. For **package** assignments with an **Internal Token**, it may be omitted to create a global (direct) assignment that applies across all directories."
    },
    "settings": {
      "type": "object",
      "description": "Optional settings for the app assignment",
      "properties": {
        "assignment_mode": {
          "type": "string",
          "description": "App setting: 'internal' - App does not show in the app market but still available to use in all relevant integration points; 'pre_installed' - Define the app as pre-installed for all new accounts, app shows in app market as installed on first appearance. The user will be able to uninstall it later if they wish to. This is relevant only to account with platform app market",
          "enum": [
            "internal",
            "pre_installed"
          ]
        }
      },
      "required": [
        "assignment_mode"
      ]
    }
  },
  "required": [
    "assignee_type",
    "assignee_uid",
    "app_code_name",
    "settings"
  ]
}