Hook configuration is customer-scoped. A hook action links a reusable action definition to a hook name and optional channel target. A hook document links a document to the same hook name so prompts can include event-specific instructions. At runtime, TicketMessages endpoints can resolve hook prompt documents or execute the configured action chain for a message.
GET /api/HookActions – Bearer JWTPOST /api/HookActions – Bearer JWTPOST /api/HookActions/bulk – Bearer JWTGET /api/HookActions/{id} – Bearer JWTPUT /api/HookActions/{id} – Bearer JWTDELETE /api/HookActions/{id} – Bearer JWTGET /api/HookActions/wait-seconds – Bearer JWTGET /api/HookDocuments/promptDocuments – TicketAccessOrPhoneAuthPOST /api/HookDocuments – Bearer JWTGET /api/TicketMessages/{id}/promptDocuments – TicketAccessOrPhoneAuthPOST /api/TicketMessages/{id}/execute-hook – TicketAccessOrPhoneAuthGET /api/TicketMessages/{id}/execute-single-action – TicketAccessCurrent HookName enum values:
PreSpam, PostSpam, PostTopicDetectionOnEscalate, PostEscalate, OnEscalateFailedOnClose, UserTriggeredOnEndUserAdd, OnEndUserUpdate, OnEndUserDeleteOnPhonePickup, OnPhonePickupSayGET /api/HookDocuments/promptDocuments, GET /api/TicketMessages/{id}/promptDocuments and POST /api/TicketMessages/{id}/execute-hook accept phone-auth context where configured. Phone-auth calls are rejected with 403 when the requested or message channel differs from the token channel.GET /api/HookActions requires hookName or actionId. Ticket-message prompt documents can also return 400 when historical data is requested and the customer OpenAI API key is missing.hookActionIDhookNameactionID, actionNamechannelID, channelNamespecialChannelprioritypageNumber, pageSize, sortBy, sortOrderitems, totalCount, totalPagestotalWaitSeconds/api/HookActions/wait-seconds.topicDocumentID, customerIDtopicID, specialTopicdocumentID, documentNamechannelID, channelName, specialChanneldocumentID, name, content, contentTypeincludeInRealtimeInstructions, imageUrlspromptDocumentsendUsers, ticketsonlyPromptDocumentsmessagefinishedstageGET /api/HookActions?hookName=PreSpam&pageNumber=1&pageSize=10&sortBy=Priority&sortOrder=asc
Authorization: Bearer <token>POST /api/HookActions
Authorization: Bearer <token>
Content-Type: application/json
{
"hookName": "OnEscalate",
"actionID": 123,
"channelID": 5,
"specialChannel": null,
"priority": 10
}POST /api/HookDocuments
Authorization: Bearer <token>
Content-Type: application/json
{
"topicID": null,
"specialTopic": "OnPhonePickup",
"documentID": 501,
"channelID": 5,
"specialChannel": null
}GET /api/TicketMessages/987/promptDocuments?hookName=OnPhonePickup&onlyPromptDocuments=true
Authorization: Bearer <token>
POST /api/TicketMessages/987/execute-hook?hookName=OnPhonePickup
Authorization: Bearer <token>GET /api/HookActions/wait-seconds?channelId=5&hookName=OnPhonePickup
Authorization: Bearer <token>HookName enum values exactly. Do not invent hook names outside the enum.channelID for a specific channel and specialChannel for broad targeting such as All or a channel type. Avoid setting both unless the intended precedence is clear.PostTopicDetection, runtime action lookup combines hook actions with actions attached to detected message topics./api/HookActions/wait-seconds before phone pickup/say flows when UI or telephony timing needs the total Wait duration.GET /api/HookActions requires hookName or actionId. The endpoint returns only hook records with active actions and excludes specialTopic=All.
POST /api/HookActions and POST /api/HookActions/bulk map hookName to the hook special topic and set customer scope server-side.
PUT /api/HookActions/{id} updates only priority. GET /api/HookActions/wait-seconds sums active Wait actions after channel and hook matching.
GET /api/HookDocuments/promptDocuments returns hook prompt documents. POST /api/HookDocuments creates a hook document link from the TopicDocumentCreateDTO shape.
Use /api/TicketMessages/{id}/promptDocuments and /api/TicketMessages/{id}/execute-hook when a specific message is the runtime context for the hook.
Current HookName enum values:
PreSpam, PostSpam, PostTopicDetectionOnEscalate, PostEscalate, OnEscalateFailedOnClose, UserTriggeredOnEndUserAdd, OnEndUserUpdate, OnEndUserDeleteOnPhonePickup, OnPhonePickupSayA hook is a named workflow event such as PreSpam, PostTopicDetection, OnEscalate or OnPhonePickup. Hook actions and hook documents attach automation and prompt context to that event.
The reusable action definition lives in /api/Actions. /api/HookActions links that action to a hook name, channel target and priority.
They use the same topic-document link shape, but for hooks topicID is null and specialTopic contains the hook name.
Yes for endpoints that allow TicketAccessOrPhoneAuth, but the token channel must match the requested or message channel. Mismatches return 403 Forbidden.
AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.
For all support, sales, and partnership inquiries, email us at info@answerpal.eu
AnswerPal
Bisschoppenhoflaan 380
2100 Antwerp
Belgium
+32.36416685
BE 0862.692.858