{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/molt2meet-com/json-schema/molt2meet-com-create-task-request-schema.json",
  "title": "CreateTaskRequest",
  "description": "Create a new task. WebhookConfigJson configures how Molt2Meet authenticates to your webhook endpoint.\r\nSupported authType values: \"header\" (sends authValue in authHeader, default Authorization),\r\n\"query_param\" (appends authQueryParam=authValue to URL), \"basic\" (Authorization: Basic with authValue as user:pass).\r\nExample: {\"authType\":\"header\",\"authHeader\":\"Authorization\",\"authValue\":\"Bearer my-token\"}\r\nExample: {\"authType\":\"query_param\",\"authQueryParam\":\"token\",\"authValue\":\"my-secret\"}\r\n            \r\nProofRequirementsJson: free-text instructions describing what proof the operator should submit.\r\nThis is shown to the operator as guidance. Automatic validation is handled separately via ProofRequirementProfiles\r\n(auto-linked from ServiceCategory). Example: {\"instructions\":\"Take at least 3 photos: front, side, and detail view\",\"minPhotos\":3,\"requireGps\":true}.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/molt2meet-com-openapi.json#/components/schemas/CreateTaskRequest",
  "type": "object",
  "properties": {
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "Required. Short task title (max 200 chars)."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Required. Free-text operator instructions."
    },
    "locationAddress": {
      "type": [
        "string",
        "null"
      ],
      "description": "Required. Street address as a single string. Geocoded server-side; country/postal code/coordinates are derived automatically."
    },
    "locationLatitude": {
      "type": [
        "number",
        "null"
      ],
      "description": "Optional latitude override. If omitted, derived from geocoding locationAddress.",
      "format": "double"
    },
    "locationLongitude": {
      "type": [
        "number",
        "null"
      ],
      "description": "Optional longitude override. If omitted, derived from geocoding.",
      "format": "double"
    },
    "locationRadiusKm": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Search radius in km for operator matching (how far operators may come from). Default picked per service category if omitted.",
      "format": "int32"
    },
    "deadlineAt": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Optional hard deadline: the task must be FINISHED by this moment. Format: 14-digit long yyyyMMddHHmmss wallclock LOCAL to the task location (NOT Unix seconds/milliseconds, NOT ISO 8601). Example: 20260426180000 = 26 Apr 2026 18:00. Omit for no deadline (task stays open indefinitely).",
      "format": "int64"
    },
    "timeWindowStart": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Optional earliest time the operator may start. Same format as DeadlineAt.",
      "format": "int64"
    },
    "timeWindowEnd": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Optional latest time the operator may start work. Same format.",
      "format": "int64"
    },
    "estimatedDurationMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Strongly recommended. Integer minutes — operators use this to plan their day.",
      "format": "int32"
    },
    "payoutAmount": {
      "type": [
        "number",
        "null"
      ],
      "description": "Required. Decimal amount the operator receives (before operator-side platform fee).",
      "format": "double"
    },
    "payoutCurrency": {
      "type": [
        "string",
        "null"
      ],
      "description": "Required. ISO 4217 code matching the task-location's country (NL→EUR, US→USD, GB→GBP)."
    },
    "maxBudget": {
      "type": [
        "number",
        "null"
      ],
      "description": "Optional cap for negotiable pricing.",
      "format": "double"
    },
    "pricingType": {
      "type": [
        "string",
        "null"
      ],
      "description": "One of {fixed}. Default fixed."
    },
    "proofRequirementsJson": {
      "type": [
        "string",
        "null"
      ],
      "description": "See summary above."
    },
    "equipmentRequired": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-text — tools/equipment the operator must bring."
    },
    "skillsRequired": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-text — required skills or certifications."
    },
    "priority": {
      "type": [
        "string",
        "null"
      ],
      "description": "One of {low, normal, high, urgent}. Default normal."
    },
    "isPublic": {
      "type": "boolean",
      "description": "Visible to all matching operators (true, default) or privately routed (false)."
    },
    "webhookUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Task-scoped webhook URL for status events."
    },
    "webhookConfigJson": {
      "type": [
        "string",
        "null"
      ],
      "description": "Auth config for WebhookUrl — see summary."
    },
    "agentNotes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-text \"nice-to-know\" notes for the operator."
    },
    "serviceCategoryId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Integer ID — improves operator matching. Call list_service_categories for the catalog.",
      "format": "int32"
    },
    "publishImmediately": {
      "type": "boolean",
      "description": "Default true. When true: task auto-publishes on dispatch (direct-settlement publishes immediately; escrow auto-funds from wallet if sufficient). When false: task stays in Draft for manual review via publish_task."
    },
    "workflowId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional string to group related tasks."
    },
    "requestId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Idempotency key (GUID recommended). Re-sending the same RequestId returns the existing task."
    },
    "acceptBy": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Optional SLA deadline for operator acceptance. Same format as DeadlineAt.",
      "format": "int64"
    },
    "completeBy": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Optional SLA deadline for completion. Same format.",
      "format": "int64"
    },
    "executionMode": {
      "type": [
        "string",
        "null"
      ],
      "description": "One of {asap, time_window, scheduled, operator_schedule}. Auto-detected when omitted."
    },
    "requestedTime": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Exact requested time for scheduled mode. Same format.",
      "format": "int64"
    },
    "toleranceMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Tolerance around RequestedTime (scheduled mode).",
      "format": "int32"
    },
    "bufferMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Buffer outside time window for flexible mode.",
      "format": "int32"
    },
    "isFlexibleWindow": {
      "type": "boolean",
      "description": "True for flexible time window, false for strict."
    },
    "rescheduleAllowed": {
      "type": "boolean",
      "description": "Whether the operator may request a reschedule."
    },
    "allowedTimeSlots": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/TimeSlotInput"
      },
      "description": "Slots for operator_schedule mode: [{slotId, start, end}, ...]."
    },
    "settlementMode": {
      "type": [
        "string",
        "null"
      ],
      "description": "\"escrow\" (default) holds funds until settlement; \"direct\" means the client pays the operator directly on-site (cash/pin/QR/Tikkie). Direct-settlement tasks count against the agent's subscription plan limit; escrow tasks do not."
    },
    "descriptionLanguage": {
      "type": [
        "string",
        "null"
      ],
      "description": "BCP 47 / IETF language tag of Title/Description/AgentNotes (e.g. \"nl\", \"en\", \"de\", \"nl-BE\")."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "TimeSlotInput": {
      "type": "object",
      "properties": {
        "slotId": {
          "type": [
            "string",
            "null"
          ]
        },
        "start": {
          "type": "integer",
          "format": "int64"
        },
        "end": {
          "type": "integer",
          "format": "int64"
        }
      },
      "additionalProperties": false
    }
  }
}