Actions Service
Overview
Actions represent tasks or activities assigned to entities (customers or suppliers). They support scheduling, tracking, and completion management.
Actions are used for:
- follow-up calls and reminders
- scheduled meetings
- task management
- activity tracking
All action operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/Actions/{id}
Returns a single action by its numeric identifier.
Route parameters:
id(long, required) - action identifier
Behavior:
- Looks up action by ID
- Returns
404if the action does not exist
Authorization:
- Requires Bearer Token
- Permission:
FullRead
GET
/api/v1/Actions/entity/{entityId}
Returns a paginated, filterable list of actions for a specific entity.
Route parameters:
entityId(long, required) - entity identifier
Query parameters (pagination):
page(int, default: 1) - page number (1-based)pageSize(int, default: 20, max: 100) - items per page. Pass0to receive onlytotalCountwith an emptyitemsarraysortBy(string, optional) - field to sort by:dueDate,chronologicalDatesortDesc(bool, default: false) - sort descending
Query parameters (filters):
search(string, optional) - search across subject and descriptionstatus(string, optional) - filter by computed status:scheduled,pending,overdue,completedshowComplete(bool, default: false) - whenfalseonly incomplete actions are returned; whentruecompleted actions are includedactionType(long, optional) - filter by action type IDaction(string, optional) - filter by exact action value
Behavior:
- Returns a
PagedResponse<ActionModel>for the entity - Returns
404if no actions exist for the entity
Authorization:
- Requires Bearer Token
- Permission:
FullRead
GET
/api/v1/Actions/due
Deprecated. Use
GET /api/v1/Actions/entity/{entityId}withshowComplete=falseinstead.
Returns all due actions (past due date and not completed).
Behavior:
- Returns actions where
DueAtis in the past andCompletedAtis null - Returns
404if no due actions exist
Authorization:
- Requires Bearer Token
- Permission:
FullRead
POST
/api/v1/Actions
Creates a new action.
Request body (CreateActionRequest):
EntityId(long, required) - associated entitySubject(string, required) - action titleActionType(long, required) - action type identifierDescription(string, optional) - detailed descriptionDueAt(DateTime, optional) - due dateAction(string, optional) - action notesActionTypeTitle(string, optional) - action type display title hint
Behavior:
CreatedAtis set automaticallyUserIdis resolved from the authenticated user's JWT- Successful creation writes an audit log entry
Errors:
- Returns
400if validation fails
Response:
201 Created-ActionModel
Authorization:
- Requires Bearer Token
- Permission:
FullManage
PUT
/api/v1/Actions/{id}
Partially updates an existing action. Fields not included in the request body retain their existing values.
Route parameters:
id(long, required) - action identifier
Request body (UpdateActionRequest):
Subject(string, optional) - falls back to existing value if not sentDescription(string, optional)DueAt(DateTime, optional)Action(string, optional)CompletedAt(DateTime, optional)ActionType(long, optional)
Behavior:
- Only supplied fields are written; omitted fields keep their current database values
UpdatedAtis set automatically- Successful update writes an audit log entry
Errors:
- Returns
400if action does not exist
Response:
200 OK-ActionModel
Authorization:
- Requires Bearer Token
- Permission:
FullManage
PATCH
/api/v1/Actions/{id}
Marks an action as completed (sets CompletedAt to the current UTC timestamp).
Route parameters:
id(long, required) - action identifier
Behavior:
- Sets
CompletedAttoDateTime.UtcNow - Successful operation writes an audit log entry
Errors:
- Returns
400if action does not exist
Response:
200 OK-ActionModel
Authorization:
- Requires Bearer Token
- Permission:
FullManage
DELETE
/api/v1/Actions/{id}
Deletes an action by its identifier.
Behavior:
- Performs a hard delete — record is permanently removed from the database
- Successful deletion writes an audit log entry
Errors:
- Returns
400if action does not exist
Response:
204 No Content
Authorization:
- Requires Bearer Token
- Permission:
FullManage
Notes
- Actions are linked to entities via
EntityId UserId,UserFirstName,UserLastNameare populated on responses when the action was created by a known user- The computed
Statusfield (read-only) reflects:Scheduled,Pending,Overdue, orCompleted - Validation is enforced in the service layer
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients