{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/highlevel/json-schema/highlevel-create-single-action-dto-schema.json",
  "title": "CreateSingleActionDTO",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/highlevel-actions-api-openapi.yml#/components/schemas/CreateSingleActionDTO",
  "type": "object",
  "properties": {
    "agentId": {
      "type": "string",
      "description": "Agent ID to attach the action to"
    },
    "locationId": {
      "type": "string",
      "description": "Location ID"
    },
    "actionType": {
      "type": "string",
      "description": "Type of action",
      "enum": [
        "CALL_TRANSFER",
        "DATA_EXTRACTION",
        "IN_CALL_DATA_EXTRACTION",
        "WORKFLOW_TRIGGER",
        "SMS",
        "APPOINTMENT_BOOKING",
        "CUSTOM_ACTION",
        "KNOWLEDGE_BASE"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for this action"
    },
    "actionParameters": {
      "description": "Action parameters - structure varies by actionType",
      "oneOf": [
        {
          "$ref": "#/$defs/CallTransferActionParameters"
        },
        {
          "$ref": "#/$defs/DataExtractionActionParameters"
        },
        {
          "$ref": "#/$defs/InCallDataExtractionActionParameters"
        },
        {
          "$ref": "#/$defs/WorkflowTriggerParameters"
        },
        {
          "$ref": "#/$defs/SMSParameters"
        },
        {
          "$ref": "#/$defs/AppointmentBookingActionParameters"
        },
        {
          "$ref": "#/$defs/CustomActionParameters"
        },
        {
          "$ref": "#/$defs/KnowledgeBaseParameters"
        }
      ]
    }
  },
  "required": [
    "agentId",
    "locationId",
    "actionType",
    "name",
    "actionParameters"
  ],
  "$defs": {
    "AppointmentBookingActionParameters": {
      "type": "object",
      "properties": {
        "calendarId": {
          "type": "string",
          "description": "Calendar ID to book appointments in"
        },
        "daysOfOfferingDates": {
          "type": "number",
          "description": "Number of days ahead to offer booking dates"
        },
        "slotsPerDay": {
          "type": "number",
          "description": "Number of available slots per day"
        },
        "hoursBetweenSlots": {
          "type": "number",
          "description": "Hours between available slots"
        }
      },
      "required": [
        "calendarId",
        "daysOfOfferingDates",
        "slotsPerDay",
        "hoursBetweenSlots"
      ]
    },
    "CallTransferActionParameters": {
      "type": "object",
      "properties": {
        "triggerPrompt": {
          "type": "string",
          "description": "When to trigger this action during the call"
        },
        "transferToType": {
          "type": "string",
          "description": "Type of transfer destination (currently only \"number\" is supported)",
          "enum": [
            "number"
          ]
        },
        "transferToValue": {
          "type": "string",
          "description": "Phone number to transfer to. Must start with +, include country code, contain only numbers, and be 11-16 characters long (e.g., +12345678901)."
        },
        "triggerMessage": {
          "type": "string",
          "description": "Message to tell the caller before transferring"
        },
        "hearWhisperMessage": {
          "type": "boolean",
          "description": "Whether to play whisper message to the receiving party"
        }
      },
      "required": [
        "triggerPrompt",
        "transferToType",
        "transferToValue",
        "triggerMessage"
      ]
    },
    "CustomActionApiDetailsDTO": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "API endpoint URL"
        },
        "method": {
          "type": "string",
          "description": "HTTP method",
          "enum": [
            "POST",
            "GET"
          ]
        },
        "authenticationRequired": {
          "type": "boolean",
          "description": "Whether authentication is required"
        },
        "authenticationValue": {
          "type": "string",
          "description": "Authentication token or API key (required if authenticationRequired is true)"
        },
        "headers": {
          "description": "HTTP headers to include",
          "type": "array",
          "items": {
            "$ref": "#/$defs/CustomActionHeaderDTO"
          }
        },
        "parameters": {
          "description": "API parameters to send",
          "type": "array",
          "items": {
            "$ref": "#/$defs/CustomActionParameterDTO"
          }
        }
      },
      "required": [
        "url",
        "method"
      ]
    },
    "CustomActionHeaderDTO": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "HTTP header name"
        },
        "value": {
          "type": "string",
          "description": "HTTP header value"
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "CustomActionParameterDTO": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Parameter name"
        },
        "description": {
          "type": "string",
          "description": "Parameter description"
        },
        "type": {
          "type": "string",
          "description": "Parameter type"
        }
      },
      "required": [
        "name"
      ]
    },
    "CustomActionParameters": {
      "type": "object",
      "properties": {
        "triggerPrompt": {
          "type": "string",
          "description": "When to call the custom API"
        },
        "triggerMessage": {
          "type": "string",
          "description": "Message to tell the caller"
        },
        "apiDetails": {
          "description": "API endpoint configuration",
          "allOf": [
            {
              "$ref": "#/$defs/CustomActionApiDetailsDTO"
            }
          ]
        },
        "selectedPaths": {
          "description": "Selected response paths to extract from API response. Required: at least 1 value if the method is GET. Should be empty if the method is POST.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "triggerPrompt",
        "triggerMessage",
        "apiDetails"
      ]
    },
    "DataExtractionActionParameters": {
      "type": "object",
      "properties": {
        "contactFieldId": {
          "type": "string",
          "description": "ID of the contact field to be updated with the extracted data"
        },
        "description": {
          "type": "string",
          "description": "Description of what data to extract"
        },
        "overwriteExistingValue": {
          "type": "boolean",
          "description": "Whether to overwrite existing field value if already set, default is false",
          "default": false
        }
      },
      "required": [
        "contactFieldId",
        "description",
        "examples"
      ]
    },
    "InCallDataExtractionActionParameters": {
      "type": "object",
      "properties": {
        "contactFieldId": {
          "type": "string",
          "description": "ID of the contact field to be updated with the extracted data"
        },
        "description": {
          "type": "string",
          "description": "Description of what data to extract"
        },
        "overwriteExistingValue": {
          "type": "boolean",
          "description": "Whether to overwrite existing field value if already set, default is false",
          "default": false
        }
      },
      "required": [
        "contactFieldId",
        "description",
        "examples"
      ]
    },
    "KnowledgeBaseParameters": {
      "type": "object",
      "properties": {
        "triggerPrompt": {
          "type": "string",
          "description": "When to query the knowledge base"
        },
        "knowledgeBaseId": {
          "type": "string",
          "description": "Knowledge base ID to query"
        }
      },
      "required": [
        "triggerPrompt",
        "knowledgeBaseId"
      ]
    },
    "SMSParameters": {
      "type": "object",
      "properties": {
        "triggerPrompt": {
          "type": "string",
          "description": "When to send the SMS"
        },
        "triggerMessage": {
          "type": "string",
          "description": "Message to tell the caller"
        },
        "messageBody": {
          "type": "string",
          "description": "SMS message content to send"
        }
      },
      "required": [
        "triggerPrompt",
        "triggerMessage",
        "messageBody"
      ]
    },
    "WorkflowTriggerParameters": {
      "type": "object",
      "properties": {
        "triggerPrompt": {
          "type": "string",
          "description": "When to trigger this workflow"
        },
        "triggerMessage": {
          "type": "string",
          "description": "Message to tell the caller"
        },
        "workflowId": {
          "type": "string",
          "description": "Workflow ID to trigger"
        }
      },
      "required": [
        "triggerPrompt",
        "triggerMessage",
        "workflowId"
      ]
    }
  }
}