Skip to content

HighLevel: Attach Action to Agent

HighLevel conversationAi.createAction: arguments, response, policy and SDK examples.

← Conversation AI operations · Get started

Operation gohighlevel.conversation_ai_create_action

Provider route: POST /conversation-ai/agents/{agentId}/actions. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/gohighlevel with npm, or alter-sdk-gohighlevel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HighLevelIntegration } from "@alter-ai/gohighlevel";
async function execute(input: Parameters<HighLevelIntegration["conversationAi"]["createAction"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HighLevelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.conversationAi.createAction(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_gohighlevel import HighLevelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HighLevelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.conversation_ai.create_action(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.agentIdstringRequired within parent
bodyModelRequired within parentExpand Update Action — request body — body

Referenced models: Update Action — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Attach Action to Agent — response body

Referenced models: Attach Action to Agent — response body

15 more schemas are linked from the tables above, on the schema pages.

Update Action — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
detailsJSONRequired within parentAction-specific details. The structure depends on the action type. For TRIGGER_WORKFLOW use triggerWorkflowDto, for UPDATE_CONTACT_FIELD use updateContactFieldDto, for APPOINTMENT_BOOKING use appointmentBookingDto, for STOP_BOT use stopBotDto, for HUMAN_HAND_OVER use humanHandOverDto, for ADVANCED_FOLLOWUP use advancedFollowupDto, and for TRANSFER_BOT use transferBotDto.
details (oneOf 1)ModelAlternativeExpand Update Action — request body — body details trigger Condition, trigger Message, workflow Ids
details (oneOf 2)ModelAlternativeExpand Update Action — request body — body details contact Field Id, contact Update Examples, description
details (oneOf 3)ModelAlternativeExpand Update Action — request body — body / details / sleepTimeUnit: days, hours, minutes
details (oneOf 4)ModelAlternativeExpand Update Action — request body — body / details / sleepTimeUnit: days, hours, minutes, stop Bot Detection Type: Goodbye, Custom
details (oneOf 5)ModelAlternativeExpand Update Action — request body — body / details / handoverType: contact Request, lack Of Information, failed To Resolve Issue, custom, sleep Time Unit: days, hours, minutes
details (oneOf 6)ModelAlternativeExpand Update Action — request body — body / details / scenarioId: contact Stopped Replying, contact Is Busy, contact Requested
details (oneOf 7)ModelAlternativeExpand Update Action — request body — body / details / transferBotType: Default, Custom
namestringRequired within parent
typestringRequired within parentOne of: triggerWorkflow, updateContactField, appointmentBooking, stopBot, humanHandOver, advancedFollowup, transferBot

Referenced models: Update Action — request body — body details trigger Condition, trigger Message, workflow Ids, Update Action — request body — body details contact Field Id, contact Update Examples, description, Update Action — request body — body / details / scenarioId: contact Stopped Replying, contact Is Busy, contact Requested, Update Action — request body — body / details / sleepTimeUnit: days, hours, minutes, Update Action — request body — body / details / handoverType: contact Request, lack Of Information, failed To Resolve Issue, custom, sleep Time Unit: days, hours, minutes, Update Action — request body — body / details / sleepTimeUnit: days, hours, minutes, stop Bot Detection Type: Goodbye, Custom, Update Action — request body — body / details / transferBotType: Default, Custom

Attach Action to Agent — response body
FieldTypePresenceDescription and constraints
$objectRoot
dataJSONRequired within parentCreated action details
data (allOf 1)ModelAll variants applyExpand List Actions for an Agent — response body — data item
successbooleanRequired within parentSuccess status of the request

Referenced models: List Actions for an Agent — response body — data item

Update Action — request body — body details trigger Condition, trigger Message, workflow Ids
FieldTypePresenceDescription and constraints
$objectRoot
triggerConditionstringRequired within parentCondition that triggers the workflow
triggerMessagestringOptionalOptional message to send when triggering the workflow
workflowIdsarrayRequired within parentArray of workflow IDs to trigger
workflowIds[]stringEach item
Update Action — request body — body details contact Field Id, contact Update Examples, description
FieldTypePresenceDescription and constraints
$objectRoot
contactFieldIdstringRequired within parentID of the contact field in Contacts Table
contactUpdateExamplesarrayOptionalContact update examples in Contacts Table. Not required when using standard fields, Monetory or Date Custom fields.
Default: []
contactUpdateExamples[]stringEach item
descriptionstringRequired within parentDescription of the contact field in Contacts Table
Update Action — request body — body / details / scenarioId: contact Stopped Replying, contact Is Busy, contact Requested
FieldTypePresenceDescription and constraints
$objectRoot
enabledbooleanRequired within parentWhether advanced followup is enabled
followupSequencearrayRequired within parentSequence of followup actions to perform
followupSequence[]ModelEach itemExpand Update Action — request body — body / details / scenarioId: contact Stopped Replying, contact Is Busy, contact Requested followup Sequence item
followupSettingsJSONOptionalAdditional settings for followup behavior
followupSettings (allOf 1)ModelAll variants applyExpand Update Followup Settings — request body — body followup Settings
scenarioIdstringRequired within parentID of the followup scenario
One of: contactStoppedReplying, contactIsBusy, contactRequested

Referenced models: Update Action — request body — body / details / scenarioId: contact Stopped Replying, contact Is Busy, contact Requested followup Sequence item, Update Followup Settings — request body — body followup Settings

Update Action — request body — body / details / sleepTimeUnit: days, hours, minutes
FieldTypePresenceDescription and constraints
$objectRoot
actionIdstringOptionalOptional action ID reference
calendarIdstringRequired within parentCalendar ID for appointment booking
cancelEnabledbooleanRequired within parentWhether to allow appointment cancellation (cannot be true when onlySendLink is true)
Default: false
onlySendLinkbooleanRequired within parentIf true, only sends the appointment link without booking
rescheduleEnabledbooleanRequired within parentWhether to allow appointment rescheduling (cannot be true when onlySendLink is true)
Default: false
sleepAfterBookingbooleanRequired within parentWhether to put the agent to sleep after booking (cannot be true when onlySendLink is true)
sleepTimenumberOptionalSleep duration (required when sleepAfterBooking is true)
sleepTimeUnitstringOptionalUnit for sleep time (required when sleepAfterBooking is true)
One of: days, hours, minutes
transferAgentstringOptionalAgent ID to transfer to (required when transferBot is true)
transferBotbooleanRequired within parentWhether to transfer to another agent after booking (cannot be true when onlySendLink is true)
triggerWorkflowbooleanRequired within parentWhether to trigger a workflow after booking (cannot be true when onlySendLink is true)
workflowIdsarrayOptionalWorkflow IDs to trigger after booking (required when triggerWorkflow is true)
workflowIds[]stringEach item
Update Action — request body — body / details / handoverType: contact Request, lack Of Information, failed To Resolve Issue, custom, sleep Time Unit: days, hours, minutes
FieldTypePresenceDescription and constraints
$objectRoot
assignToUserIdstringOptionalID of the user to assign the conversation to
createTaskbooleanOptionalWhether to create a task when handing over
enabledbooleanRequired within parentWhether human handover action is enabled
examplesarrayOptionalExample phrases that trigger human handover (required when handoverType is custom or contactRequest)
examples[]stringEach item
finalMessagestringRequired within parentFinal message sent when handing over to human
handoverTypestringRequired within parentType of human handover detection
One of: contactRequest, lackOfInformation, failedToResolveIssue, custom
reactivateEnabledbooleanRequired within parentWhether the agent can be reactivated after handover
skipAssignToUserbooleanOptionalWhether to skip assigning to a specific user
sleepTimenumberOptionalTime duration before reactivation (required when reactivateEnabled is true)
sleepTimeUnitstringOptionalTime unit for reactivation delay (required when reactivateEnabled is true)
One of: days, hours, minutes
tagsarrayOptionalTags to apply during handover
tags[]stringEach item
triggerConditionstringRequired within parentCondition that triggers human handover
Update Followup Settings — request body — body followup Settings working Hours item intervals item
FieldTypePresenceDescription and constraints
$objectRoot
endHournumberRequired within parentEnd hour (24-hour format)
endMinutenumberRequired within parentEnd minute
startHournumberRequired within parentStart hour (24-hour format)
startMinutenumberRequired within parentStart minute

SDK function policy ID: gohighlevel.conversation_ai_create_action. Catalog operation: conversation-ai.create-action. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["conversation-ai.write"]

Pinned headers: {"Version": "v3"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.