All plans have 30% OFF For this week

Claim Discount

API Reference: Actions Endpoint

The Actions API lets you manage automation actions in AnswerPal. Use these endpoints to list, create, update, and delete actions that drive your automation workflows.

Overview

Actions represent predefined operations that can be triggered at specific events in the AnswerPal workflow (such as after topic detection or when a ticket is escalated). The Actions API allows you to programmatically manage these actions, enabling flexible automation for customer service, internal support, and more.

Authentication

All Actions API endpoints require authentication. Include a valid access token in the `Authorization` header of your requests.

Endpoints

GET /api/Actions

Retrieve a paginated list of actions for the authenticated customer. Query Parameters:
  • pageNumber (integer, default: 1)  — Page number for pagination.
  • pageSize (integer, default: 10) — Number of items per page.
  • sortBy (string, default: “Name”) — Field to sort by.
  • sortOrder (string, default: “asc”) — Sort order (“asc” or “desc”).
GET /api/Actions?pageNumber=1&pageSize=10&sortBy=Name&sortOrder=asc
Authorization: Bearer <token>

Response Example

{
  "items": [
    {
      "actionID": 1,
      "name": "Auto Close",
      "description": "Automatically close resolved tickets",
      "priority": 90,
      "isActive": true
    },
    ...
  ],
  "totalCount": 20,
  "totalPages": 2
}

 GET /api/Actions/{id}

Retrieve a single action by its unique ID.

Path Parameters:

  • id (integer, required) — The ID of the action.
GET /api/Actions/1
Authorization: Bearer <token>

Response Example

{
  "actionID": 1,
  "name": "Auto Close",
  "description": "Automatically close resolved tickets",
  "priority": 90,
  "isActive": true
}

POST /api/Actions

Create a new action.

Request Body (JSON):

  • name (string, required)
  • description (string, optional)
  • priority (integer, required)
  • isActive (boolean, required)
POST /api/Actions
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Forward to Supervisor",
  "description": "Forward urgent tickets to supervisor",
  "priority": 100,
  "isActive": true
}

Response Example

{
  "actionID": 2,
  "name": "Forward to Supervisor",
  "description": "Forward urgent tickets to supervisor",
  "priority": 100,
  "isActive": true
}

PUT /api/Actions/{id}

Update an existing action.

Path Parameters:

  • id (integer, required)

Request Body (JSON):

  • actionID (integer, required, must match path)
  • name (string, required)
  • description (string, optional)
  • priority (integer, required)
  • isActive (boolean, required)
PUT /api/Actions/2
Authorization: Bearer <token>
Content-Type: application/json

{
  "actionID": 2,
  "name": "Forward to Supervisor",
  "description": "Forward urgent tickets to supervisor (updated)",
  "priority": 100,
  "isActive": true
}

Response Example

HTTP/1.1 204 No Content

DELETE /api/Actions/{id}

Delete an action by its ID.

Path Parameters:

  • id (integer, required)
DELETE /api/Actions/2
Authorization: Bearer <token>

Response Example

HTTP/1.1 204 No Content

Error Codes

  • 400 Bad Request: Invalid input or ID mismatch.
  • 401 Unauthorized: Authentication failed or missing.
  • 404 Not Found: Action does not exist.
  • 409 Conflict: Duplicate action or conflicting data (on create).
  • 201 Created: Action successfully created.
  • 204 No Content: Update or delete successful.

Best Practices

  • Always check for `204 No Content` on update/delete—no body will be returned.
  • Use pagination and sorting for large action lists.
  • Use clear, descriptive names and priorities for actions.
  • Deactivate (rather than delete) actions you may need to restore.

FAQ

You must be authenticated; access is restricted to your organization's data.

The action will be removed and will not be executed in future workflows.

Yes, use the Update endpoint and supply the new priority.

Name, priority, and isActive are required.

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