

# **WORKFORCEOS**

**FRONTEND GUIDE FOR AI CODING AGENTS - PART 13 - AnnouncementManagement Service**

This document is a part of a REST API guide for the workforceos project.
It is designed for AI agents that will generate frontend code to consume the project’s backend.

This document provides extensive instruction for the usage of announcementManagement

## Service Access

AnnouncementManagement service management is handled through service specific base urls.

AnnouncementManagement  service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs.
The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.).

For the announcementManagement service, the base URLs are:

* **Preview:** `https://workforceos.prw.mindbricks.com/announcementmanagement-api`
* **Staging:** `https://workforceos-stage.mindbricks.co/announcementmanagement-api`
* **Production:** `https://workforceos.mindbricks.co/announcementmanagement-api`

### Tenant URL Prefix and Header Forwarding

Tenant context is resolved by frontend routing strategy:
- preview/test: URL prefix `/{tenantCodename}` (example: `/babil/products`)
- production: tenant subdomain (example: `babil.appname...`)

Then backend API calls must always claim target tenant with header:

```js
headers["mbx-company-codename"] = tenantCodenameFromUrl;
```

URL prefix/subdomain is frontend-only tenant selection. Use header forwarding for all tenant-scoped calls to `announcementManagement` service.

## Scope

**AnnouncementManagement Service Description**

Handles company-wide and department-specific announcements, supporting scheduled or immediate delivery. Enables admins/managers to create, edit, and manage rich-text announcements, assign audience (all/company/department/users), and triggers events for notification delivery. Employees see relevant announcements in history/detail. Fully tenant-scoped.

AnnouncementManagement service provides apis and business logic for following data objects in workforceos application. 
Each data object may be either a central domain of the application data structure or a related helper data object for a central concept.
Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows.  


**`announcement` Data Object**: A company announcement created by admin/manager for company- or department-wide communication. Supports scheduled (future) or immediate send, rich-text content, explicit audience assignment, and visibility expiry.


## AnnouncementManagement Service Frontend Description By The Backend Architect

## Announcement Management: UX Guide
- Announcements appear in a chronological feed; most recent and currently visible ones shown highest.
- Employee view: Only see announcements sent to your company, department, or user. Only active/visible announcements (status: sent, time within visibleUntil), oldest first by sendTime.
- Admin/manager view: Can view all, including scheduled/cancelled; can create, edit, and cancel announcements; UI for scheduling future announcements.
- Announcement details: Title, content (markdown/HTML rendered), target departments/users (display as readable lists), scheduled/delivery info, and creator. Render status badge: scheduled/sent/cancelled.
- Form supports rich text; on scheduling, select send time and visible until expiry if needed.
- Editing only allowed for scheduled/cancelled, not already sent announcements.
- Show recipients (departments/users) if set, otherwise say "All employees".
- Immediate delivery = sendTime now.


## API Structure

### Object Structure of a Successful Response

When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client.

**HTTP Status Codes:**

* **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully.
* **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully.

**Success Response Format:**

For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below:

```json
{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3,
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}
```
* **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation.

### Additional Data

Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature.

### Error Response

If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity:

* **400 Bad Request**: The request was improperly formatted or contained invalid parameters.
* **401 Unauthorized**: The request lacked a valid authentication token; login is required.
* **403 Forbidden**: The current token does not grant access to the requested resource.
* **404 Not Found**: The requested resource was not found on the server.
* **500 Internal Server Error**: The server encountered an unexpected condition.

Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution.

```js
{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}
```


## Announcement Data Object

A company announcement created by admin/manager for company- or department-wide communication. Supports scheduled (future) or immediate send, rich-text content, explicit audience assignment, and visibility expiry.

### Announcement  Data Object Frontend Description By The Backend Architect

- Rich-text content with support for HTML/markdown (render as message/policy/notification).
- Target audience: can be all, specific departments, or user list (null = all employees).
- Status: scheduled (if sendTime>now), sent (if sendTime<=now & delivered), cancelled (admin cancels or deletes).
- Announcements with sendTime in the future only visible to creators and admin/manager until sent.
- visibleUntil enables persistent/expiring announcements. Default to long expiry if not set.
- Recipients display as user/group names, or 'All employees' if neither array set.



### Announcement Data Object Properties

Announcement data object has got following properties that are represented as table fields in the database scheme. 
These properties don't stand just for data storage, but each may have different settings to manage the business logic. 

| Property | Type | IsArray | Required | Secret | Description |
|----------|------|---------|----------|--------|-------------|
| `creatorId` | ID | false | Yes | No | auth:user.id - Creator of the announcement |
| `title` | String | false | Yes | No | Announcement subject/title (short display name). |
| `body` | Text | false | Yes | No | Announcement content body (markdown/HTML string). |
| `targetDepartmentIds` | ID | true | No | No | Department userGroup IDs (auth:userGroup.id) to target recipients. Null/empty means all departments. Used for scoping announcements to groups. |
| `audienceUserIds` | ID | true | No | No | Explicit user IDs (auth:user.id) to target (optional, null=all applicable). Used for targeting specific individuals only if needed. Supercedes departments if set. |
| `sendTime` | Date | false | Yes | No | Scheduled send time for the announcement (UTC). Immediate if now/past, future means scheduled/pending delivery. Used for status logic. |
| `visibleUntil` | Date | false | No | No | Optional. Announcements are visible until this date (expiry). If null, visible for a platform-defined default duration (e.g., 30/90 days, or forever). |
| `status` | Enum | false | Yes | No | Announcement status: scheduled (future, unsent); sent (visible/delivered); cancelled (withdrawn by admin/manager); status changes control delivery/event publishing. |
| `companyId` | ID | false | Yes | No | An ID value to represent the tenant id of the company |
* Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set.


### Array Properties 

`targetDepartmentIds` `audienceUserIds`

Array properties can hold multiple values. 
Array properties should be respected according to their multiple structure in the frontend in any user input for them.
Please use multiple input components for the array proeprties when needed.


### Enum Properties
Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. 
The enum options value will be stored as strings in the database, 
but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option.
You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values.
In the frontend input components, enum type properties should only accept values from an option component that lists the enum options.

- **status**: [scheduled, sent, cancelled]


### Relation Properties

`creatorId` `targetDepartmentIds` `audienceUserIds`

Mindbricks supports relations between data objects, allowing you to define how objects are linked together.
The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search.
These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects.
If the relation points to another service, frontend should use the referenced service api in case it needs related data.
The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. 
In mmost cases the api response will provide the relational data as well as the main one.

In frontend, please ensure that, 

1- instaead of these relational ids you show the main human readable field of the related target data (like name),
2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field.


- **creatorId**: ID
Relation to `user`.id

The target object is a sibling object, meaning that the relation is a many-to-one or one-to-one relationship from this object to the target.

Required: Yes

- **targetDepartmentIds**: ID
Relation to `userGroup`.id

The target object is a sibling object, meaning that the relation is a many-to-one or one-to-one relationship from this object to the target.

Required: No

- **audienceUserIds**: ID
Relation to `user`.id

The target object is a sibling object, meaning that the relation is a many-to-one or one-to-one relationship from this object to the target.

Required: No


### Filter Properties

`creatorId` `title` `sendTime` `status` `companyId`

Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria.
These properties are automatically mapped as API parameters in the listing API's.

- **creatorId**: ID  has a filter named `creatorId`

- **title**: String  has a filter named `title`

- **sendTime**: Date  has a filter named `sendTime`

- **status**: Enum  has a filter named `status`

- **companyId**: ID  has a filter named `companyId`



## Default CRUD APIs

For each data object, the backend architect may designate **default APIs** for standard operations (create, update, delete, get, list). These are the APIs that frontend CRUD forms and AI agents should use for basic record management. If no default is explicitly set (`isDefaultApi`), the frontend generator auto-discovers the most general API for each operation.

### Announcement Default APIs

**Display Label Property:** `title` — Use this property as the human-readable label when displaying records of this data object (e.g., in dropdowns, references).
| Operation | API Name | Route | Explicitly Set |
|-----------|----------|-------|----------------|
| Create | `createAnnouncement` | `/v1/announcements` | Yes |
| Update | `updateAnnouncement` | `/v1/announcements/:announcementId` | Yes |
| Delete | `deleteAnnouncement` | `/v1/announcements/:announcementId` | Yes |
| Get | `getAnnouncement` | `/v1/announcements/:announcementId` | Yes |
| List | `listAnnouncements` | `/v1/announcements` | Yes |

When building CRUD forms for a data object, use the default create/update APIs listed above. The form fields should correspond to the API's body parameters. For relation fields, render a dropdown loaded from the related object's list API using the display label property.





## API Reference

### `Create Announcement` API
**[Default create API]** — This is the designated default `create` API for the `announcement` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Admins/managers create a new announcement for company or targeted audience. Supports scheduled and immediate announcements. Upon creation, if sendTime <= now and not cancelled, triggers event for notification delivery.

**API Frontend Description By The Backend Architect**

- Only admin/manager can create. Form includes: title, body (rich text), recipient selection (departments/users or all), sendTime (date/time), optional visibleUntil.
- Immediate = sendTime now. Scheduled = in future; shows in creator/admin list but not to employees until time.
- After creation, display confirmation and status: scheduled or sent. Cannot edit once sent.
- Employee audience calculated based on fields. All fields validated in backend.


**Rest Route**

The `createAnnouncement` API REST controller can be triggered via the following route:

`/v1/announcements`


**Rest Request Parameters**


The `createAnnouncement` api has got 6 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| title  | String  | true | request.body?.["title"] |
| body  | Text  | true | request.body?.["body"] |
| targetDepartmentIds  | ID  | false | request.body?.["targetDepartmentIds"] |
| audienceUserIds  | ID  | false | request.body?.["audienceUserIds"] |
| sendTime  | Date  | true | request.body?.["sendTime"] |
| visibleUntil  | Date  | false | request.body?.["visibleUntil"] |
**title** : Announcement subject/title (short display name).
**body** : Announcement content body (markdown/HTML string).
**targetDepartmentIds** : Department userGroup IDs (auth:userGroup.id) to target recipients. Null/empty means all departments. Used for scoping announcements to groups.
**audienceUserIds** : Explicit user IDs (auth:user.id) to target (optional, null=all applicable). Used for targeting specific individuals only if needed. Supercedes departments if set.
**sendTime** : Scheduled send time for the announcement (UTC). Immediate if now/past, future means scheduled/pending delivery. Used for status logic.
**visibleUntil** : Optional. Announcements are visible until this date (expiry). If null, visible for a platform-defined default duration (e.g., 30/90 days, or forever).



**REST Request**
To access the api you can use the **REST** controller with the path **POST  /v1/announcements**
```js
  axios({
    method: 'POST',
    url: '/v1/announcements',
    data: {
            title:"String",  
            body:"Text",  
            targetDepartmentIds:"ID",  
            audienceUserIds:"ID",  
            sendTime:"Date",  
            visibleUntil:"Date",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "announcement",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"announcement": {
		"id": "ID",
		"creatorId": "ID",
		"title": "String",
		"body": "Text",
		"targetDepartmentIds": "ID",
		"audienceUserIds": "ID",
		"sendTime": "Date",
		"visibleUntil": "Date",
		"status": "Enum",
		"status_idx": "Integer",
		"companyId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Update Announcement` API
**[Default update API]** — This is the designated default `update` API for the `announcement` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Admins/managers update a scheduled/cancelled announcement. Not allowed if already sent. If sendTime changes to now or past, triggers sent event and status update on save.

**API Frontend Description By The Backend Architect**

- Admin/manager may edit scheduled/cancelled announcement fields, not already sent ones.
- Any change in sendTime/visibleUntil modifies delivery schedule, triggers event if status becomes 'sent'.
- UI disables editing of sent announcements.


**Rest Route**

The `updateAnnouncement` API REST controller can be triggered via the following route:

`/v1/announcements/:announcementId`


**Rest Request Parameters**


The `updateAnnouncement` api has got 7 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| announcementId  | ID  | true | request.params?.["announcementId"] |
| title  | String  | false | request.body?.["title"] |
| body  | Text  | false | request.body?.["body"] |
| targetDepartmentIds  | ID  | false | request.body?.["targetDepartmentIds"] |
| audienceUserIds  | ID  | false | request.body?.["audienceUserIds"] |
| sendTime  | Date  | true | request.body?.["sendTime"] |
| visibleUntil  | Date  | false | request.body?.["visibleUntil"] |
**announcementId** : This id paremeter is used to select the required data object that will be updated
**title** : Announcement subject/title (short display name).
**body** : Announcement content body (markdown/HTML string).
**targetDepartmentIds** : Department userGroup IDs (auth:userGroup.id) to target recipients. Null/empty means all departments. Used for scoping announcements to groups.
**audienceUserIds** : Explicit user IDs (auth:user.id) to target (optional, null=all applicable). Used for targeting specific individuals only if needed. Supercedes departments if set.
**sendTime** : Scheduled send time for the announcement (UTC). Immediate if now/past, future means scheduled/pending delivery. Used for status logic.
**visibleUntil** : Optional. Announcements are visible until this date (expiry). If null, visible for a platform-defined default duration (e.g., 30/90 days, or forever).



**REST Request**
To access the api you can use the **REST** controller with the path **PATCH  /v1/announcements/:announcementId**
```js
  axios({
    method: 'PATCH',
    url: `/v1/announcements/${announcementId}`,
    data: {
            title:"String",  
            body:"Text",  
            targetDepartmentIds:"ID",  
            audienceUserIds:"ID",  
            sendTime:"Date",  
            visibleUntil:"Date",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "announcement",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"announcement": {
		"id": "ID",
		"creatorId": "ID",
		"title": "String",
		"body": "Text",
		"targetDepartmentIds": "ID",
		"audienceUserIds": "ID",
		"sendTime": "Date",
		"visibleUntil": "Date",
		"status": "Enum",
		"status_idx": "Integer",
		"companyId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Delete Announcement` API
**[Default delete API]** — This is the designated default `delete` API for the `announcement` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Soft delete (mark as cancelled) for scheduled/cancelled announcements. Sent announcements cannot be deleted.

**API Frontend Description By The Backend Architect**

Admins/managers can cancel (soft delete) announcements that have not been sent yet; sent announcements stay in history, cannot be deleted for auditability/accountability.

**Rest Route**

The `deleteAnnouncement` API REST controller can be triggered via the following route:

`/v1/announcements/:announcementId`


**Rest Request Parameters**


The `deleteAnnouncement` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| announcementId  | ID  | true | request.params?.["announcementId"] |
**announcementId** : This id paremeter is used to select the required data object that will be deleted



**REST Request**
To access the api you can use the **REST** controller with the path **DELETE  /v1/announcements/:announcementId**
```js
  axios({
    method: 'DELETE',
    url: `/v1/announcements/${announcementId}`,
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "announcement",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"announcement": {
		"id": "ID",
		"creatorId": "ID",
		"title": "String",
		"body": "Text",
		"targetDepartmentIds": "ID",
		"audienceUserIds": "ID",
		"sendTime": "Date",
		"visibleUntil": "Date",
		"status": "Enum",
		"status_idx": "Integer",
		"companyId": "ID",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Get Announcement` API
**[Default get API]** — This is the designated default `get` API for the `announcement` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Get details of a single announcement if user is within company and eligible audience. Employees see only those sent & visible; admins/managers see all for own company.

**API Frontend Description By The Backend Architect**

- Employees: Fetch detail for announcement if status is 'sent', now is after sendTime, current user is in audience or target department or (if both empty) all employees. Not allowed for other companies.
- Admin/manager: May see any in company (scheduled, sent, cancelled).
- Response enriches creator and department names via join.


**Rest Route**

The `getAnnouncement` API REST controller can be triggered via the following route:

`/v1/announcements/:announcementId`


**Rest Request Parameters**


The `getAnnouncement` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| announcementId  | ID  | true | request.params?.["announcementId"] |
**announcementId** : This id paremeter is used to query the required data object.



**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/announcements/:announcementId**
```js
  axios({
    method: 'GET',
    url: `/v1/announcements/${announcementId}`,
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**

This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "announcement",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"announcement": {
		"creator": {
			"email": "String",
			"fullname": "String",
			"avatar": "String"
		},
		"departments": [
			null,
			null,
			null
		],
		"isActive": true
	}
}
```


### `List Announcements` API
**[Default list API]** — This is the designated default `list` API for the `announcement` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
List announcements visible to user: employees get only those sent and addressed to their dept/user/all; admin/manager see all for their company; sorted by sendTime desc.

**API Frontend Description By The Backend Architect**

- Employee list: Only current and past ('sent', sendTime <= now), not cancelled, visible to you (company and audience/department match or all employees).
- Admin/manager list: See all announcements for company, including scheduled/cancelled/sent; use column filter to toggle status/audience; default sort is sendTime desc.
- Each entry shows: title, short preview, status, creator, send time, and expiry. Allow filter by status, sendTime, department, creator.


**Rest Route**

The `listAnnouncements` API REST controller can be triggered via the following route:

`/v1/announcements`


**Rest Request Parameters**
The `listAnnouncements` api has got no request parameters.    




**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/announcements**
```js
  axios({
    method: 'GET',
    url: '/v1/announcements',
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**

This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "announcements",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"announcements": [
		{
			"creator": [
				{
					"email": "String",
					"fullname": "String",
					"avatar": "String"
				},
				{},
				{}
			],
			"departments": [
				null,
				null,
				null
			],
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```


### `Process Scheduledannouncements` API
Background job that runs every minute to check for scheduled announcements whose sendTime has passed and updates their status to 'sent'. This triggers the announcement.sent event for notification delivery.

**API Frontend Description By The Backend Architect**

Internal cron job - no frontend endpoint. Runs automatically every minute to process scheduled announcements.

**Rest Route**

The `processScheduledAnnouncements` API REST controller can be triggered via the following route:

`/v1/processscheduledannouncements`


**Rest Request Parameters**



**Filter Parameters**

The `processScheduledAnnouncements` api supports 4 optional filter parameters for filtering list results:

**creatorId** (`ID`): auth:user.id - Creator of the announcement

- Single: `?creatorId=<value>`
- Multiple: `?creatorId=<value1>&creatorId=<value2>`
- Null: `?creatorId=null`


**title** (`String`): Announcement subject/title (short display name).

- Single (partial match, case-insensitive): `?title=<value>`
- Multiple: `?title=<value1>&title=<value2>`
- Null: `?title=null`


**sendTime** (`Date`): Scheduled send time for the announcement (UTC). Immediate if now/past, future means scheduled/pending delivery. Used for status logic.

- Single date: `?sendTime=2024-01-15`
- Multiple dates: `?sendTime=2024-01-15&sendTime=2024-01-20`
- Special: `$today`, `$ltoday`, `$week`, `$lweek`, `$month`, `$leq-<date>`, `$lin-<date>`
- Null: `?sendTime=null`


**status** (`Enum`): Announcement status: scheduled (future, unsent); sent (visible/delivered); cancelled (withdrawn by admin/manager); status changes control delivery/event publishing.

- Single: `?status=<value>` (case-insensitive)
- Multiple: `?status=<value1>&status=<value2>`
- Null: `?status=null`



**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/processscheduledannouncements**
```js
  axios({
    method: 'GET',
    url: '/v1/processscheduledannouncements',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // creatorId: '<value>' // Filter by creatorId
        // title: '<value>' // Filter by title
        // sendTime: '<value>' // Filter by sendTime
        // status: '<value>' // Filter by status
            }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "announcements",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"announcements": [
		{
			"id": "ID",
			"creatorId": "ID",
			"title": "String",
			"body": "Text",
			"targetDepartmentIds": "ID",
			"audienceUserIds": "ID",
			"sendTime": "Date",
			"visibleUntil": "Date",
			"status": "Enum",
			"status_idx": "Integer",
			"companyId": "ID",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```



**After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.**


