Action Types Service
Overview
Action Types define categories for actions, allowing consistent classification and filtering.
They provide:
- categorization for actions
- icon support for UI display
- filtering and reporting capabilities
Action types are referenced by actions but are managed independently.
All action type operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/ActionTypes
Returns all action types.
Behavior:
- Returns all action types for the tenant
- Returns
404if no action types exist
Authorization:
- Anonymous access allowed (requires valid domain in request headers)
POST
/api/v1/ActionTypes
Creates a new action type.
Request body:
Title(string, required) - action type display nameIcon(string, optional) - icon identifier
Behavior:
- Validation is handled in the service layer
CreatedAtis set automatically- Successful creation writes an audit log entry
Errors:
- Returns
400if validation fails
Authorization:
- Requires Bearer Token
PUT
/api/v1/ActionTypes/{id}
Updates an existing action type.
Request:
- Action type ID is taken from the route
- Body must include:
Title(string, required)
- Optional:
Icon(string)
Behavior:
- Successful update writes an audit log entry
Errors:
- Returns
400if validation fails or action type does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/ActionTypes/{id}
Deletes an action type 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 type does not exist or is in use
Authorization:
- Requires Bearer Token
Notes
- Action types provide categorization for actions
- Deleting an action type may fail if it is referenced by existing actions
- Validation is enforced in the service layer
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients