Free setup on annual plans

Sign up today!

API Reference: Actions endpoints

An action is one step AnswerPal can carry out on a message or ticket: generate or send an answer, close, mark as spam, call an external API, call an AI model, send a notification, forward, wait, and more. An action definition holds what the step does. When it runs is decided by its links: a link to a topic runs it after topic detection, a link to a hook runs it at that event. The order comes from the priority of the link, not from the action.

Endpoints

Action definitions

  • GET /api/Actions
    Access: Bearer JWT (Configurator or Administrator)
    List the action definitions, paged. Query: pageNumber (default 1), pageSize (default 10), sortBy (default Name; any field of the definition, an unknown field gives 400) and sortOrder (asc or desc). The answer has items, totalCount and totalPages.
  • POST /api/Actions
    Access: Bearer JWT (Configurator or Administrator)
    Create an action definition. Answers 201 Created with the definition.
  • GET /api/Actions/available
    Access: Bearer JWT (all roles except Analyst, or phone token)
    A short list of all action definitions of the customer (active and inactive), sorted by name: actionID, customerID, name, description, actionType and isActive. Meant for choosing an action to run by hand on a message.
  • GET /api/Actions/{id}
    Access: Bearer JWT (Configurator or Administrator)
    Return one definition, with the customer’s message custom fields in customFieldDefinitions.
  • PUT /api/Actions/{id}
    Access: Bearer JWT (Configurator or Administrator)
    Replace a definition. actionID in the body must equal the ID in the path. Answers 204 No Content.
  • DELETE /api/Actions/{id}
    Access: Bearer JWT (Configurator or Administrator)
    Delete a definition together with its topic and hook links. Answers 204 No Content.

Topic links

  • GET /api/TopicActions
    Access: Bearer JWT
    List links, paged. Query: topicId, actionId, hookName, channelId (links for that channel, for its channel type and for All), isActive (filters on the linked action), pageNumber (default 1), pageSize (default 10), sortBy (actionName by default, or topicName, hookName, channelName, priority) and sortOrder.
  • POST /api/TopicActions
    Access: Bearer JWT
    Link an action to a topic for a channel or channel type. Answers 201 Created with the link.
  • POST /api/TopicActions/bulk
    Access: Bearer JWT
    Create several links in one call. Body: an array of link objects. Combinations that already exist are skipped; the answer (200 OK) lists only the links that were created.
  • GET /api/TopicActions/{id}
    Access: Bearer JWT
    Return one link.
  • PUT /api/TopicActions/{id}
    Access: Bearer JWT
    Change the priority of a link; nothing else changes. Answers 204 No Content.
  • DELETE /api/TopicActions/{id}
    Access: Bearer JWT
    Delete a link. The action itself stays. Answers 204 No Content.

Template placeholders

  • GET /api/TemplatePlaceholders
    Access: Bearer JWT (Configurator or Administrator)
    The placeholders that templates can use, grouped, with the account’s own custom fields.
  • POST /api/TemplatePlaceholders/preview
    Access: Bearer JWT (Configurator or Administrator)
    Fill in up to 10 templates with the data of a ticket, as an action would. Nothing is sent or stored.
  • GET /api/TemplatePlaceholders/email
    Access: Bearer JWT (all roles except Analyst)
    The same list, for writing e-mail texts and signatures.
  • POST /api/TemplatePlaceholders/email/preview
    Access: Bearer JWT (all roles except Analyst)
    Fill in e-mail texts or a signature with the data of a ticket you may open, as when the e-mail is sent. Nothing is sent or stored.

Links to events such as PreSpam or OnPhoneCallEnded are managed on the Hooks page. To run an action by hand on one message, use the execute routes on the Ticket Messages page.

Action types

actionType decides what the action does. The value is compared without regard to case; a value that is not in this list is stored but does nothing when the action runs.

  • Reply
    Generates an AI answer for the message without sending it.
  • Send
    Sends the answer that is already prepared (e-mail, chat and the WhatsApp and SMS channels).
  • ReplySend
    Generates the answer and sends it.
  • Close
    Closes the ticket.
  • Spam, MarkSpam
    Marks the message and the ticket as spam. MarkSpamClose also closes the ticket.
  • NotSpam
    Marks the message and the ticket as not spam.
  • Delete
    Deletes the message. On the PreSpam event the incoming e-mail is skipped instead.
  • DeleteCleanup
    Marks the message for deletion by the cleanup, which only removes messages of closed tickets. DeleteCleanupClose also closes the ticket.
  • DetectTopics
    Detects the topics of the message and then runs the actions linked to those topics and to PostTopicDetection.
  • ApiCall
    Calls an external HTTP API with the settings under “Outbound API call” and can write values from the answer back to the ticket, the message or custom fields.
  • AICall
    Sends a prompt to an AI model and can write the result back the same way.
  • SendNotification
    Sends an e-mail or SMS notification through one of the customer’s channels.
  • ScheduleAppointment
    Lets the AI propose and book appointments of one appointment type. It does nothing in an action chain itself.
  • Wait
    Pauses the chain for waitSeconds (at most 300 seconds).
  • Forward
    Forwards an e-mail to forwardRecipients, or transfers a phone call to forwardPhoneNumber.

Linked actions run in ascending priority order; an action linked twice runs once, with its lowest priority. Close, Delete, the spam types and the cleanup types end the chain, and so does an action that fails.

Fields

Core

  • name (string, required, max 100)
  • description (string or null, max 4000)
  • actionType (string, max 50)
    One of the types above.
  • isActive (boolean)
    Inactive actions are not run from topic or hook links. A new action is always saved as active, whatever you send; switch it off with an update.

The update replaces the whole definition: send every field, a field you leave out is cleared. Only the stored password and token follow other rules, see below.

Outbound API call

Used by ApiCall actions and by actions offered to the AI as a function tool.

  • apiEndpoint (string, max 2048)
    An absolute URL, or a path that is added to overrideApiBaseUrl or else to the customer’s API base URL. Placeholders such as {{Message.Subject}}, {{Ticket.TicketID}} or {{CustomFields.orderNumber}} are filled in and URL-encoded.
  • apiMethod (string, max 50)
    GET (also when empty), POST, PUT, PATCH, DELETE, HEAD or OPTIONS. Another value makes the action fail when it runs.
  • apiHeaders (string or null)
    A JSON object of header names and values. Authorization, Proxy-Authorization and Host are ignored; set authentication below.
  • apiBodyTemplate (string or null)
    A JSON template for the request body, with placeholders. For GET and HEAD it must be a flat JSON object and is sent as query parameters.
  • overrideApiBaseUrl (string, max 2048)
    Base URL for this action instead of the customer’s.
  • responseFieldMapping (string or null)
    A JSON array of { "apiParameterName", "fieldType", "fieldName" }. apiParameterName is a dotted path in the JSON answer ($ is the whole answer). fieldType is Ticket (fields Subject, Preview, Summary, SummaryDate, FollowUpDate, IsImportant), Message (for example Message, Subject, AdditionalInfo, AI_GeneratedResponse, Lang) or CustomFields (any custom field name). Invalid JSON or another target gives 400 on save.
  • fieldMapping (string or null)
    Stored as sent; not read when the action runs.

Outbound authentication

These are the credentials AnswerPal sends to the external API, not credentials for calling AnswerPal. Empty fields fall back to the API settings of the customer.

  • overrideApiAuthenticationType (string, max 50)
    Basic (username and password), Bearer (token) or RawAuthorization (the token is the complete Authorization header value, printable ASCII without spaces around it).
  • overrideApiUsername (string, max 255)
  • overrideApiPassword (string, max 255, write only)
  • overrideApiToken (string, max 1024, write only)
  • clearOverrideApiPassword, clearOverrideApiToken (boolean, write only)
    Remove the stored value.

The password and token are never returned. An empty value keeps the stored secret, a new value replaces it, and only the clear flag removes it. When a secret is kept, changing the destination (apiEndpoint host or overrideApiBaseUrl) gives 400: enter the secret again or clear it. Switching to or from RawAuthorization also needs the token again, and a RawAuthorization or Bearer action can only take over the customer’s token when the customer uses a matching type.

Runtime controls

  • conditionalRules (string or null)
    JSON conditions (field, operator, value, grouped with and or or) on message, ticket and custom field values. The action only runs when they match. An unknown field or operator gives 400 on save. The rule fields and the conversion from plain text are on the Topics page.
  • actionSchedule (string or null)
    When the action may run, as segments separated by ;: days and a time range such as Mon-Fri 08:00-18:00 (ranges past midnight are allowed), and exclusions such as !25/12 or !24/12-26/12. Empty means always. Outside the schedule the action is skipped.
  • actionScheduleTimeZoneId (string, max 100)
    Time zone of the schedule, for example Europe/Brussels. An empty or unknown value becomes the time zone of the signed-in user, else UTC.
  • waitSeconds (integer or null)
    For Wait; values above 300 wait 300 seconds.

Type settings

AICall

  • aiModelID (integer, required)
    An active text model of the customer or a shared model.
  • aiInstructionsTemplate (string or null), aiInputTemplate (string, required)
    Instructions and input, with placeholders.
  • aiOutputMode (string)
    Text (also when empty), JsonObject or JsonSchema. JsonSchema needs valid JSON in aiJsonSchema.
  • aiTemperature (number or null)
    0 to 2.
  • aiIncludeMessageAttachments (boolean), aiImageRefsTemplate (string or null)
    Send images with the prompt; the model must accept images.

SendNotification

  • notificationSettings (string, required)
    JSON with channelID, to, cc, bcc, subjectTemplate and messageTemplate. The channel must belong to the customer and be active while the action is active. An e-mail channel needs at least one to address, a subject and a message; an SMS channel needs exactly one number in E.164 format and a message, without cc, bcc or subject. Other channel types are refused. A schedule is not used for this type and is cleared.

ScheduleAppointment

  • appointmentSettings (string, required)
    JSON with appointmentTypeID (an appointment type of the customer), maxSlots (1 to 3, default 3), earliestFirst (default true; false spreads the proposals over days) and mode (Confirm, the default: the AI books; ProposeOnly: a representative confirms).

Forward

  • forwardRecipients (string, max 1024)
    E-mail addresses separated by ;.
  • forwardPhoneNumber (string, max 50)
    Number a phone call is transferred to.

notificationSettings and appointmentSettings are cleared when the action has another type.

Function tool

  • isFunctionTool (boolean)
    Offer this action to the AI as a tool. An active tool action is named after its name and described by its description; when the AI calls it, AnswerPal runs the outbound API call with the parameters the AI passes.
  • functionParametersSchema (string or null)
    JSON schema of the tool’s parameters. Empty means no parameters.
  • toolCallTimeoutSeconds (integer or null)
    How long a tool call may take.

A ScheduleAppointment action is never offered as a tool of its own: it configures the appointment tools instead. How the phone service lists and calls tools is on the Voice and Transcription page.

Response only

  • actionID, customerID (integer)
  • hasOverrideApiPassword, hasOverrideApiToken (boolean)
    Whether a secret is stored.
  • customFieldDefinitions (array)
    The customer’s message custom fields, as on the Customer Custom Fields page, for building placeholders. Filled by GET /api/Actions/{id}; empty in lists and in the create answer.

Topic link

  • actionID (integer, required)
  • priority (integer, required)
    Lower numbers run first.
  • topicID (integer or null)
    The topic.
  • specialTopic (string or null, max 20)
    A hook name instead of a topic. OnTranscribe takes documents only and gives 400 with code HookDoesNotSupportActions.
  • channelID (integer or null)
    One channel.
  • specialChannel (string or null)
    A channel type instead: Email, Chat, Phone, WhatsApp, SMS, Teams or All.
  • In the response also topicActionID, topicName, actionName and channelName (the channel name, or the channel type). documentID is always 0.

A link matches a message when its channel is the message’s channel, its channel type is the channel’s type, or it is All.

POST /api/Actions
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Look up order status",
  "description": "Reads the order status from the shop system.",
  "actionType": "ApiCall",
  "isActive": true,
  "apiEndpoint": "/orders/{{CustomFields.orderNumber}}",
  "apiMethod": "GET",
  "apiHeaders": "{\"Accept\":\"application/json\"}",
  "overrideApiBaseUrl": "https://shop.example.com/api",
  "overrideApiAuthenticationType": "Bearer",
  "overrideApiToken": "example-token-value",
  "responseFieldMapping": "[{\"apiParameterName\":\"status\",\"fieldType\":\"CustomFields\",\"fieldName\":\"orderStatus\"}]",
  "actionSchedule": "Mon-Fri 08:00-18:00",
  "actionScheduleTimeZoneId": "Europe/Brussels"
}
201 Created
Location: /api/Actions/58

{
  "actionID": 58,
  "customerID": 12,
  "name": "Look up order status",
  "description": "Reads the order status from the shop system.",
  "actionType": "ApiCall",
  "isActive": true,
  "apiEndpoint": "/orders/{{CustomFields.orderNumber}}",
  "apiMethod": "GET",
  "apiHeaders": "{\"Accept\":\"application/json\"}",
  "apiBodyTemplate": null,
  "overrideApiBaseUrl": "https://shop.example.com/api",
  "overrideApiUsername": null,
  "overrideApiAuthenticationType": "Bearer",
  "hasOverrideApiPassword": false,
  "hasOverrideApiToken": true,
  "fieldMapping": null,
  "responseFieldMapping": "[{\"apiParameterName\":\"status\",\"fieldType\":\"CustomFields\",\"fieldName\":\"orderStatus\"}]",
  "isFunctionTool": false,
  "functionParametersSchema": null,
  "toolCallTimeoutSeconds": null,
  "aiModelID": null,
  "aiInstructionsTemplate": null,
  "aiInputTemplate": null,
  "aiOutputMode": null,
  "aiJsonSchema": null,
  "aiTemperature": null,
  "aiIncludeMessageAttachments": false,
  "aiImageRefsTemplate": null,
  "conditionalRules": null,
  "notificationSettings": null,
  "appointmentSettings": null,
  "forwardRecipients": null,
  "waitSeconds": null,
  "forwardPhoneNumber": null,
  "actionSchedule": "Mon-Fri 08:00-18:00",
  "actionScheduleTimeZoneId": "Europe/Brussels",
  "customFieldDefinitions": []
}
POST /api/Actions
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Notify sales team",
  "actionType": "SendNotification",
  "isActive": true,
  "notificationSettings": "{\"channelID\":4,\"to\":[\"sales@example.com\"],\"cc\":[],\"bcc\":[],\"subjectTemplate\":\"New request: {{Message.Subject}}\",\"messageTemplate\":\"A new request arrived on ticket {{Ticket.TicketID}}.\"}"
}
POST /api/TopicActions
Authorization: Bearer <token>
Content-Type: application/json

{
  "topicID": 31,
  "actionID": 58,
  "specialChannel": "Email",
  "priority": 10
}

201 Created
{
  "topicActionID": 904,
  "topicID": 31,
  "specialTopic": null,
  "documentID": 0,
  "channelID": null,
  "specialChannel": "Email",
  "topicName": "Order status",
  "actionID": 58,
  "actionName": "Look up order status",
  "channelName": "Email",
  "priority": 10
}

Template placeholders

Placeholders are filled in with the data of the message, the ticket and the end user when a template is used: in the URL and body of an API call, in notification texts, in the instructions and input of an AI call, in prompt documents, in appointment notification texts, and in e-mail replies and signatures.

  • Syntax
    {{Family.Field}}, for example {{Message.Subject}}, {{Ticket.TicketID}}, {{EndUser.Firstname}} or {{CustomFields.orderNumber}}; names are not case-sensitive. Families: Message, Ticket, Appointment, EndUser, EndUsers, CustomFields, EndUserCustomFields, Parameters (the values the AI passes to a function tool) and, without a family, {{now}}, {{today}}, {{next_week}}, {{now_plus_2_days}} or {{now_minus_3_hours}} (units minute, hour, day, week, month, year) and {{TopicList}}. The families starting with Json, such as {{JsonEndUser.Email}}, write a JSON value (quoted and escaped, or null) for use in a JSON body. In the URL of an API call, of the date forms only {{now_plus_…}} and {{now_minus_…}} are filled in.

Placeholder list (response)

{ "groups": [...], "families": [...] }. Each group (message, ticket, appointment, endUser, endUsers, customFields, endUserCustomFields, dateTime, parameters, special) has id, label, description and placeholders. Each placeholder has placeholder (the text to paste, with braces), family, field, label, description, format (Text or Json), example, canBeEmpty, isCommon, isPattern (a pattern such as {{Parameters.<name>}}), isDeprecated, requires (FunctionTool or null), aliases and valueType (Text, Number, Boolean or Date). Each family has name, aliases, format, requires, isBare and resolvesWithoutTicket. The account’s message and end user custom fields are included when their name only has letters, digits and _.

Preview (body)

  • ticketID (integer, optional)
    The ticket whose latest message is used. Without it, the latest message of the account (for the e-mail preview: the latest one you may open).
  • templates (array, required, at most 10)
    Per template: field (your own name, returned as is), template (at most 20,000 characters) and context: text for a text such as a notification or an AI input, json for an API body (the template must be valid JSON; placeholders are filled in inside string values). The e-mail preview only takes text.
  • audience (optional)
    internal (default) or participant: as for a text the end user sees, without internal notifications and ticket summaries. The e-mail preview always uses participant.
  • asCustomerRepID (integer, e-mail preview only)
    Preview a signature as that representative. An Agent or Restricted user may only give their own ID.

The answer has ticketID, messageID, subject, messageDate, channelType and results: per template field, rendered and error (for example for a JSON template that is not valid JSON; rendered is then null). The e-mail preview encodes the values as HTML, as in a sent e-mail. Without a ticket with a message the answer is 404.

POST /api/TemplatePlaceholders/preview
Authorization: Bearer <token>
Content-Type: application/json

{
  "ticketID": 4521,
  "templates": [
    { "field": "subject", "template": "New request: {{Message.Subject}}", "context": "text" },
    { "field": "body", "template": "{ \"ticket\": \"{{Ticket.TicketID}}\", \"email\": {{JsonEndUser.Email}} }", "context": "json" }
  ]
}

200 OK
{
  "ticketID": 4521,
  "messageID": 98812,
  "subject": "Question about invoice 2026-0147",
  "messageDate": "2026-11-20T09:14:02Z",
  "channelType": "Email",
  "results": [
    { "field": "subject", "rendered": "New request: Question about invoice 2026-0147", "error": null },
    { "field": "body", "rendered": "{ \"ticket\": \"4521\", \"email\": \"an.janssens@example.com\" }", "error": null }
  ]
}
GET /api/TemplatePlaceholders
Authorization: Bearer <token>

200 OK
{
  "groups": [
    {
      "id": "message",
      "label": "Message",
      "description": "...",
      "placeholders": [
        { "placeholder": "{{Message.Subject}}", "family": "Message", "field": "Subject", "format": "Text", "valueType": "Text", "isCommon": true, ... }
      ]
    },
    ...
  ],
  "families": [
    { "name": "Message", "aliases": ["TicketMessage"], "format": "Text", "requires": null, "isBare": false, "resolvesWithoutTicket": false },
    ...
  ]
}

Access and status codes

Action definitions need Configurator or Administrator; the short list of GET /api/Actions/available is open to every user role and to the phone token. The topic link endpoints work for every signed-in user of the customer. The placeholder list and preview need Configurator or Administrator; their e-mail versions are open to every role except Analyst. The access line of each endpoint above is the reference.

  • 200 OK, 201 Created, 204 No Content
    Success.
  • 400 Bad Request
    A list of field errors for a missing or too long name, description or time zone; ID mismatch. on an update; { "message": "..." } for invalid type settings (AI model, output mode, temperature, notification or appointment settings, conditional rules, response mapping); a text message for authentication problems or a destination change with a kept secret; { "code": "HookDoesNotSupportActions", "message": "..." } for a link to OnTranscribe; an unknown sort field gives { "code", "message", "traceId" }.
  • 404 Not Found
    No action or link with that ID for this customer.
  • 409 Conflict
    A link update that the database refuses.
  • 500 Internal Server Error
    Values longer than the stored limits (for example apiEndpoint, actionType, specialChannel), a link to an action, topic or channel that does not exist, a link that already exists, or a specialChannel outside the list. These are not validated up front.

FAQ

On the link. Every topic or hook link has a priority; lower numbers run first. The same action can have a different priority on each link.

A new action is always saved as active. Send an update with isActive set to false to switch it off.

Leave overrideApiToken empty and clearOverrideApiToken false. To remove it, set clearOverrideApiToken to true. If you change the API destination at the same time, send the token again.

Its topic and hook links are deleted with it.

Need more help?

Table of Contents

AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.

Contact

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