AUTEURLABB

FRONTEND GUIDE FOR AI CODING AGENTS - PART 8 - MessagingCenter Service

This document is a part of a REST API guide for the auteurlabb 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 messagingCenter

Service Access

MessagingCenter service management is handled through service specific base urls.

MessagingCenter 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 messagingCenter service, the base URLs are:

Scope

MessagingCenter Service Description

Facilitates secure messaging between filmmakers, studios, and investors, enabling message threads, moderation, and notifications for industry collaborations.

MessagingCenter service provides apis and business logic for following data objects in auteurlabb 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.

messageThread Data Object: A thread (private or group) representing a conversation among platform users, optionally linked to a film project

message Data Object: A message sent in a thread between platform users, with moderation and delivery tracking.

MessagingCenter Service Frontend Description By The Backend Architect

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:

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:

{
  "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": []
}

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:

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

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

MessageThread Data Object

A thread (private or group) representing a conversation among platform users, optionally linked to a film project

MessageThread Data Object Frontend Description By The Backend Architect

Represents the context for a conversation (one-on-one or group) among users. Subject is displayed for group/archived/flagged threads; threads can be listed by participant for chat list UI; relatedProjectId links the thread to a film project for context. Threads can be archived, flagged, or active.

MessageThread Data Object Properties

MessageThread 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
participantIds ID true Yes No IDs of all participants in the thread (must be 2+ for group, exactly 2 for 1-1)
subject String false No No Optional subject for the thread, required for group or flagged; for 1-on-1 may be null/empty.
relatedProjectId ID false No No (Optional) The project this thread is about.
isGroup Boolean false Yes No True if thread is a group chat, false if private 1-to-1 message.
createdBy ID false Yes No User who created the thread.
lastMessageAt Date false Yes No Timestamp of the last message in this thread (used for sorting).
threadStatus Enum false Yes No Status of the thread: active, archived, flagged.

Array Properties

participantIds

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.

Relation Properties

participantIds relatedProjectId createdBy

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.

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

Required: Yes

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

Required: No

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

Required: Yes

Filter Properties

participantIds relatedProjectId threadStatus

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.

Message Data Object

A message sent in a thread between platform users, with moderation and delivery tracking.

Message Data Object Frontend Description By The Backend Architect

Represents a participant’s sent message in a conversation. Each message is linked to a thread, contains sender/recipient data, the message content, sent and read dates, and moderation status (normal, flagged, removed). Only the sender can edit (if not flagged/removed and within a grace period), only admin can set moderation actions (for platform safety). Used for chat/message UIs, moderation/inbox displays.

Message Data Object Properties

Message 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
threadId ID false Yes No The parent thread of this message.
senderId ID false Yes No User ID of the sender.
content Text false Yes No The actual message content (body).
sentAt Date false Yes No When the message was sent.
readByIds ID true No No User IDs who have read the message (for read receipts).
moderationStatus Enum false Yes No Moderation status: normal (default), flagged (pending review), or removed by admin/moderation.
flaggedReason String false No No Reason for message being flagged (set by admin or reporting workflow).
adminAction String false No No Admin/moderator action/note taken regarding this message (set only by admin).

Array Properties

readByIds

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.

Relation Properties

threadId senderId readByIds

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.

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

Required: Yes

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

Required: Yes

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

Required: No

Filter Properties

threadId moderationStatus

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.

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.

MessageThread Default APIs

Operation API Name Route Explicitly Set
Create createMessageThread /v1/messagethreads Yes
Update updateMessageThread /v1/messagethreads/:messageThreadId Yes
Delete none - Auto
Get getMessageThread /v1/messagethreads/:messageThreadId Yes
List listMessageThreads /v1/messagethreads Yes

Message Default APIs

Operation API Name Route Explicitly Set
Create createMessage /v1/messages Yes
Update updateMessage /v1/messages/:messageId Yes
Delete deleteMessage /v1/messages/:messageId Yes
Get getMessage /v1/messages/:messageId Yes
List listMessages /v1/messages 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 Messagethread API

[Default create API] — This is the designated default create API for the messageThread data object. Frontend generators and AI agents should use this API for standard CRUD operations. Create a new message thread (private or group). Can optionally link to a film project. Enforces participants count and role access.

API Frontend Description By The Backend Architect

For users to start a new conversation (private or group chat) with one or more participants (including themselves); optionally link the thread to a project, set subject (required for group/flagged threads only), subject can be empty for 1-to-1; lastMessageAt auto-set to creation time.

Rest Route

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

/v1/messagethreads

Rest Request Parameters

The createMessageThread api has got 6 regular request parameters

Parameter Type Required Population
participantIds ID true request.body?.[“participantIds”]
subject String false request.body?.[“subject”]
relatedProjectId ID false request.body?.[“relatedProjectId”]
isGroup Boolean true request.body?.[“isGroup”]
lastMessageAt Date true request.body?.[“lastMessageAt”]
threadStatus Enum true request.body?.[“threadStatus”]
participantIds : IDs of all participants in the thread (must be 2+ for group, exactly 2 for 1-1)
subject : Optional subject for the thread, required for group or flagged; for 1-on-1 may be null/empty.
relatedProjectId : (Optional) The project this thread is about.
isGroup : True if thread is a group chat, false if private 1-to-1 message.
lastMessageAt : Timestamp of the last message in this thread (used for sorting).
threadStatus : Status of the thread: active, archived, flagged.

REST Request To access the api you can use the REST controller with the path POST /v1/messagethreads

  axios({
    method: 'POST',
    url: '/v1/messagethreads',
    data: {
            participantIds:"ID",  
            subject:"String",  
            relatedProjectId:"ID",  
            isGroup:"Boolean",  
            lastMessageAt:"Date",  
            threadStatus:"Enum",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThread",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"messageThread": {
		"id": "ID",
		"participantIds": "ID",
		"subject": "String",
		"relatedProjectId": "ID",
		"isGroup": "Boolean",
		"createdBy": "ID",
		"lastMessageAt": "Date",
		"threadStatus": "Enum",
		"threadStatus_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"lastMessage": [
			{
				"senderId": "ID",
				"content": "Text",
				"sentAt": "Date",
				"moderationStatus": "Enum",
				"moderationStatus_idx": "Integer"
			},
			{},
			{}
		],
		"relatedProject": {
			"title": "String",
			"projectType": "Enum",
			"projectType_idx": "Integer",
			"ownerUserId": "ID",
			"isPublic": "Boolean",
			"approvalStatus": "Enum",
			"approvalStatus_idx": "Integer"
		}
	}
}

Get Messagethread API

[Default get API] — This is the designated default get API for the messageThread data object. Frontend generators and AI agents should use this API for standard CRUD operations. Fetch a message thread and last message; only participants or admin may retrieve.

API Frontend Description By The Backend Architect

For thread detail/conversation load: returns thread and its related context (last message, project info). Enforces access: only participants and admins.

Rest Route

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

/v1/messagethreads/:messageThreadId

Rest Request Parameters

The getMessageThread api has got 1 regular request parameter

Parameter Type Required Population
messageThreadId ID true request.params?.[“messageThreadId”]
messageThreadId : 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/messagethreads/:messageThreadId

  axios({
    method: 'GET',
    url: `/v1/messagethreads/${messageThreadId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThread",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"messageThread": {
		"id": "ID",
		"participantIds": "ID",
		"subject": "String",
		"relatedProjectId": "ID",
		"isGroup": "Boolean",
		"createdBy": "ID",
		"lastMessageAt": "Date",
		"threadStatus": "Enum",
		"threadStatus_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"lastMessage": [
			{
				"senderId": "ID",
				"content": "Text",
				"sentAt": "Date",
				"moderationStatus": "Enum",
				"moderationStatus_idx": "Integer"
			},
			{},
			{}
		],
		"relatedProject": {
			"title": "String",
			"projectType": "Enum",
			"projectType_idx": "Integer",
			"ownerUserId": "ID",
			"isPublic": "Boolean",
			"approvalStatus": "Enum",
			"approvalStatus_idx": "Integer"
		}
	}
}

List Messagethreads API

[Default list API] — This is the designated default list API for the messageThread data object. Frontend generators and AI agents should use this API for standard CRUD operations. List threads for current user (participantIds contains session userId), or all threads for admin. Filters: by project, thread status, participant, search by subject. Sorted by lastMessageAt desc.

API Frontend Description By The Backend Architect

Returns conversation list for chat inbox. By default lists threads where session user is a participant, with last message for display. Admins can filter/status for moderation, filter by related project for context. Supports pagination.

Rest Route

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

/v1/messagethreads

Rest Request Parameters

Filter Parameters

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

participantId (ID array): IDs of all participants in the thread (must be 2+ for group, exactly 2 for 1-1)

participantId_op (String): Operator for filtering array property “participantIds”. Use “contains” to check if array contains the value, or “overlap” to check if arrays have common elements.

relatedProjectId (ID): (Optional) The project this thread is about.

threadStatus (Enum): Status of the thread: active, archived, flagged.

REST Request To access the api you can use the REST controller with the path GET /v1/messagethreads

  axios({
    method: 'GET',
    url: '/v1/messagethreads',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // participantId: '<value>' // Filter by participantId
        // participantId_op: '<value>' // Filter by participantId_op
        // relatedProjectId: '<value>' // Filter by relatedProjectId
        // threadStatus: '<value>' // Filter by threadStatus
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThreads",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"messageThreads": [
		{
			"id": "ID",
			"participantIds": "ID",
			"subject": "String",
			"relatedProjectId": "ID",
			"isGroup": "Boolean",
			"createdBy": "ID",
			"lastMessageAt": "Date",
			"threadStatus": "Enum",
			"threadStatus_idx": "Integer",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"lastMessage": [
				{
					"senderId": "ID",
					"content": "Text",
					"sentAt": "Date",
					"moderationStatus": "Enum",
					"moderationStatus_idx": "Integer"
				},
				{},
				{}
			],
			"relatedProject": [
				{
					"title": "String",
					"projectType": "Enum",
					"projectType_idx": "Integer",
					"ownerUserId": "ID",
					"isPublic": "Boolean",
					"approvalStatus": "Enum",
					"approvalStatus_idx": "Integer"
				},
				{},
				{}
			]
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Messagethread API

[Default update API] — This is the designated default update API for the messageThread data object. Frontend generators and AI agents should use this API for standard CRUD operations. Update thread (subject, status, participants for group). Only thread creator, participants (for subject/archival), or admin can update. Only admin can set status=flagged.

API Frontend Description By The Backend Architect

Allows editing of thread subject, status (archival/flag for moderation), or for admin actions; participants cannot update thread participants unless admin/group owner. All updates are logged for audit. Only admin may set flagged status.

Rest Route

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

/v1/messagethreads/:messageThreadId

Rest Request Parameters

The updateMessageThread api has got 7 regular request parameters

Parameter Type Required Population
messageThreadId ID true request.params?.[“messageThreadId”]
participantIds ID false request.body?.[“participantIds”]
subject String false request.body?.[“subject”]
relatedProjectId ID false request.body?.[“relatedProjectId”]
isGroup Boolean false request.body?.[“isGroup”]
lastMessageAt Date false request.body?.[“lastMessageAt”]
threadStatus Enum false request.body?.[“threadStatus”]
messageThreadId : This id paremeter is used to select the required data object that will be updated
participantIds : IDs of all participants in the thread (must be 2+ for group, exactly 2 for 1-1)
subject : Optional subject for the thread, required for group or flagged; for 1-on-1 may be null/empty.
relatedProjectId : (Optional) The project this thread is about.
isGroup : True if thread is a group chat, false if private 1-to-1 message.
lastMessageAt : Timestamp of the last message in this thread (used for sorting).
threadStatus : Status of the thread: active, archived, flagged.

REST Request To access the api you can use the REST controller with the path PATCH /v1/messagethreads/:messageThreadId

  axios({
    method: 'PATCH',
    url: `/v1/messagethreads/${messageThreadId}`,
    data: {
            participantIds:"ID",  
            subject:"String",  
            relatedProjectId:"ID",  
            isGroup:"Boolean",  
            lastMessageAt:"Date",  
            threadStatus:"Enum",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThread",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"messageThread": {
		"id": "ID",
		"participantIds": "ID",
		"subject": "String",
		"relatedProjectId": "ID",
		"isGroup": "Boolean",
		"createdBy": "ID",
		"lastMessageAt": "Date",
		"threadStatus": "Enum",
		"threadStatus_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Message API

[Default create API] — This is the designated default create API for the message data object. Frontend generators and AI agents should use this API for standard CRUD operations. Send a message (post) in a thread. Only thread participants allowed. Thread lastMessageAt is updated.

API Frontend Description By The Backend Architect

Sends a message in an existing conversation (thread). Access check: only participants may send. Sets senderId, sentAt. Notifies via events. Supports message content, moderation default = normal. Marks thread lastMessageAt for inbox sort.

Rest Route

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

/v1/messages

Rest Request Parameters

The createMessage api has got 6 regular request parameters

Parameter Type Required Population
threadId ID true request.body?.[“threadId”]
content Text true request.body?.[“content”]
readByIds ID false request.body?.[“readByIds”]
moderationStatus Enum true request.body?.[“moderationStatus”]
flaggedReason String false request.body?.[“flaggedReason”]
adminAction String false request.body?.[“adminAction”]
threadId : The parent thread of this message.
content : The actual message content (body).
readByIds : User IDs who have read the message (for read receipts).
moderationStatus : Moderation status: normal (default), flagged (pending review), or removed by admin/moderation.
flaggedReason : Reason for message being flagged (set by admin or reporting workflow).
adminAction : Admin/moderator action/note taken regarding this message (set only by admin).

REST Request To access the api you can use the REST controller with the path POST /v1/messages

  axios({
    method: 'POST',
    url: '/v1/messages',
    data: {
            threadId:"ID",  
            content:"Text",  
            readByIds:"ID",  
            moderationStatus:"Enum",  
            flaggedReason:"String",  
            adminAction:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"senderId": "ID",
		"content": "Text",
		"sentAt": "Date",
		"readByIds": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"flaggedReason": "String",
		"adminAction": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Message API

[Default get API] — This is the designated default get API for the message data object. Frontend generators and AI agents should use this API for standard CRUD operations. Fetch a single message, thread participant or admin only.

API Frontend Description By The Backend Architect

Load message (for thread/conversation display or moderation). Only allowed for participant or admin/superAdmin.

Rest Route

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

/v1/messages/:messageId

Rest Request Parameters

The getMessage api has got 1 regular request parameter

Parameter Type Required Population
messageId ID true request.params?.[“messageId”]
messageId : 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/messages/:messageId

  axios({
    method: 'GET',
    url: `/v1/messages/${messageId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"senderId": "ID",
		"content": "Text",
		"sentAt": "Date",
		"readByIds": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"flaggedReason": "String",
		"adminAction": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"thread": {
			"participantIds": "ID",
			"subject": "String",
			"relatedProjectId": "ID",
			"threadStatus": "Enum",
			"threadStatus_idx": "Integer"
		}
	}
}

List Messages API

[Default list API] — This is the designated default list API for the message data object. Frontend generators and AI agents should use this API for standard CRUD operations. List messages for a thread (or per filter by participant/project/moderation). Participant or admin only.

API Frontend Description By The Backend Architect

Conversation message list for a given thread, or admin-moderated message audit. Enables filter/sort/paginate (newest last). Only participant of the thread or admin can list.

Rest Route

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

/v1/messages

Rest Request Parameters

Filter Parameters

The listMessages api supports 2 optional filter parameters for filtering list results:

threadId (ID): The parent thread of this message.

moderationStatus (Enum): Moderation status: normal (default), flagged (pending review), or removed by admin/moderation.

REST Request To access the api you can use the REST controller with the path GET /v1/messages

  axios({
    method: 'GET',
    url: '/v1/messages',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // threadId: '<value>' // Filter by threadId
        // moderationStatus: '<value>' // Filter by moderationStatus
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messages",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"messages": [
		{
			"id": "ID",
			"threadId": "ID",
			"senderId": "ID",
			"content": "Text",
			"sentAt": "Date",
			"readByIds": "ID",
			"moderationStatus": "Enum",
			"moderationStatus_idx": "Integer",
			"flaggedReason": "String",
			"adminAction": "String",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"thread": [
				{
					"participantIds": "ID",
					"subject": "String",
					"relatedProjectId": "ID",
					"threadStatus": "Enum",
					"threadStatus_idx": "Integer"
				},
				{},
				{}
			]
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Message API

[Default update API] — This is the designated default update API for the message data object. Frontend generators and AI agents should use this API for standard CRUD operations. Update a message’s content (by sender & only before flagged/removed) or moderation fields (admin only).

API Frontend Description By The Backend Architect

Sender may edit own message content if not yet flagged/removed and within allowed time window (if desired). Only admin may set moderationStatus, flaggedReason, adminAction fields.

Rest Route

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

/v1/messages/:messageId

Rest Request Parameters

The updateMessage api has got 6 regular request parameters

Parameter Type Required Population
messageId ID true request.params?.[“messageId”]
content Text false request.body?.[“content”]
readByIds ID false request.body?.[“readByIds”]
moderationStatus Enum false request.body?.[“moderationStatus”]
flaggedReason String false request.body?.[“flaggedReason”]
adminAction String false request.body?.[“adminAction”]
messageId : This id paremeter is used to select the required data object that will be updated
content : The actual message content (body).
readByIds : User IDs who have read the message (for read receipts).
moderationStatus : Moderation status: normal (default), flagged (pending review), or removed by admin/moderation.
flaggedReason : Reason for message being flagged (set by admin or reporting workflow).
adminAction : Admin/moderator action/note taken regarding this message (set only by admin).

REST Request To access the api you can use the REST controller with the path PATCH /v1/messages/:messageId

  axios({
    method: 'PATCH',
    url: `/v1/messages/${messageId}`,
    data: {
            content:"Text",  
            readByIds:"ID",  
            moderationStatus:"Enum",  
            flaggedReason:"String",  
            adminAction:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"senderId": "ID",
		"content": "Text",
		"sentAt": "Date",
		"readByIds": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"flaggedReason": "String",
		"adminAction": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Message API

[Default delete API] — This is the designated default delete API for the message data object. Frontend generators and AI agents should use this API for standard CRUD operations. Delete message (by sender - if unflagged, or admin at any time).

API Frontend Description By The Backend Architect

Sender may remove their own unflagged/unmoderated message; admin may remove (hard/soft) any message (for moderation cleanup). All deletes are soft by default (isActive=false).

Rest Route

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

/v1/messages/:messageId

Rest Request Parameters

The deleteMessage api has got 1 regular request parameter

Parameter Type Required Population
messageId ID true request.params?.[“messageId”]
messageId : 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/messages/:messageId

  axios({
    method: 'DELETE',
    url: `/v1/messages/${messageId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"senderId": "ID",
		"content": "Text",
		"sentAt": "Date",
		"readByIds": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"flaggedReason": "String",
		"adminAction": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

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