Task Manager
This endpoint group provides functionalities for managing task instances, which act as containers for tasks (e.g., project boards, to-do lists). It allows for creating, updating, retrieving, and deleting task instances.
Endpoints
POST /api/rpc (Method: TaskManagerRpc.create)
Description: Creates a new task instance (e.g., a project task board).
Request Body:
{ "method": "TaskManagerRpc.create", "params": { "name": "My New Project Board", "description": "A board for tracking project tasks.", "contextId": "projectId123", "contextType": "project", "accessControl": { "viewers": [], "editors": [] }, "metadata": {} } }Parameters:
Name Type Required Description nameStringYes Instance name is required. descriptionStringNo Optional description for the task instance. contextIdStringYes The primary ID for scoping (e.g., projectId, userId, agentInstanceId). contextTypeEnum<project, user, agent, workflow, tool>Yes The type of context. accessControlObjectNo Defines who can view, edit, or comment on tasks within this instance. accessControl.viewersArray<String>No Arrays of MessagingContact IDs or Role names. accessControl.editorsArray<String>No Arrays of MessagingContact IDs or Role names. accessControl.commentersArray<String>No Arrays of MessagingContact IDs or Role names. metadataObjectNo Flexible key-value metadata for additional context (e.g., { browserSessionId: 'xyz' }). isArchivedBooleanNo Whether this entire task instance is archived. Defaults to false.Response:
{ "success": true, "data": { "_id": "654321098765432109876543", "name": "My New Project Board", "description": "A board for tracking project tasks.", "contextId": "projectId123", "contextType": "project", "ownerId": "user123", "accessControl": { "viewers": [], "editors": [], "commenters": [] }, "metadata": {}, "isArchived": false, "createdAt": "2023-10-27T10:00:00.000Z", "updatedAt": "2023-10-27T10:00:00.000Z" } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "TaskManagerRpc.create", "params": { "name": "My New Project Board", "description": "A board for tracking project tasks.", "contextId": "projectId123", "contextType": "project" } }'
POST /api/rpc (Method: TaskManagerRpc.update)
Description: Updates an existing task instance's name or description.
Request Body:
{ "method": "TaskManagerRpc.update", "params": { "_id": "654321098765432109876543", "name": "Updated Project Board Name", "description": "New description for the project board.", "isArchived": true, "accessControl": { "viewers": ["contactId1"] } } }Parameters:
Name Type Required Description _idStringYes MongoDB ObjectId of the task instance. nameStringNo The new name for the task instance. descriptionStringNo The new description for the task instance. isArchivedBooleanNo Whether this entire task instance is archived. accessControlObjectNo Defines who can view, edit, or comment on tasks within this instance. accessControl.viewersArray<String>No Arrays of MessagingContact IDs or Role names. accessControl.editorsArray<String>No Arrays of MessagingContact IDs or Role names. accessControl.commentersArray<String>No Arrays of MessagingContact IDs or Role names. Response:
{ "success": true, "data": { "_id": "654321098765432109876543", "name": "Updated Project Board Name", "description": "New description for the project board.", "contextId": "projectId123", "contextType": "project", "ownerId": "user123", "accessControl": { "viewers": ["contactId1"], "editors": [], "commenters": [] }, "metadata": {}, "isArchived": true, "createdAt": "2023-10-27T10:00:00.000Z", "updatedAt": "2023-10-27T10:05:00.000Z" } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "TaskManagerRpc.update", "params": { "_id": "654321098765432109876543", "name": "Updated Project Board Name" } }'
POST /api/rpc (Method: TaskManagerRpc.delete)
Description: Deletes a task instance and all of its associated tasks.
Request Body:
{ "method": "TaskManagerRpc.delete", "params": { "_id": "654321098765432109876543" } }Parameters:
Name Type Required Description _idStringYes The ID of the task instance to delete. Response:
{ "success": true, "data": { "success": true, "deletedTaskCount": 5 } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "TaskManagerRpc.delete", "params": { "_id": "654321098765432109876543" } }'
POST /api/rpc (Method: TaskManagerRpc.listForContext)
Description: Retrieves a list of task instances for a given context.
Request Body:
{ "method": "TaskManagerRpc.listForContext", "params": { "contextId": "projectId123", "contextType": "project" } }Parameters:
Name Type Required Description contextIdStringYes The primary ID for scoping (e.g., projectId, userId, agentInstanceId). contextTypeEnum<project, user, agent, workflow, tool>Yes The type of context. Response:
{ "success": true, "data": [ { "_id": "654321098765432109876543", "name": "Project Board Alpha", "contextId": "projectId123", "contextType": "project", "ownerId": "user123", "isArchived": false, "createdAt": "2023-10-27T09:00:00.000Z", "updatedAt": "2023-10-27T09:00:00.000Z" }, { "_id": "654321098765432109876544", "name": "Project Board Beta", "contextId": "projectId123", "contextType": "project", "ownerId": "user123", "isArchived": false, "createdAt": "2023-10-27T09:30:00.000Z", "updatedAt": "2023-10-27T09:30:00.000Z" } ] }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "TaskManagerRpc.listForContext", "params": { "contextId": "projectId123", "contextType": "project" } }'
POST /api/rpc (Method: TaskManagerRpc.findById)
Description: Retrieves a single task instance by its ID.
Request Body:
{ "method": "TaskManagerRpc.findById", "params": { "_id": "654321098765432109876543" } }Parameters:
Name Type Required Description _idStringYes The ID of the task instance to retrieve. Response:
{ "success": true, "data": { "_id": "654321098765432109876543", "name": "Project Board Alpha", "description": "Description for Alpha board.", "contextId": "projectId123", "contextType": "project", "ownerId": "user123", "accessControl": { "viewers": [], "editors": [], "commenters": [] }, "metadata": {}, "isArchived": false, "createdAt": "2023-10-27T09:00:00.000Z", "updatedAt": "2023-10-27T09:00:00.000Z" } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "TaskManagerRpc.findById", "params": { "_id": "654321098765432109876543" } }'
POST /api/rpc (Method: TaskManagerRpc.listAll)
Description: Retrieves a list of ALL task instances across all projects, with optional filtering. Requires admin-level permissions.
Request Body:
{ "method": "TaskManagerRpc.listAll", "params": { "filter": { "name": "Project", "contextId": "projectId456", "ownerId": "adminUser" }, "sort": { "createdAt": -1 }, "page": 1, "pageSize": 20 } }Parameters:
Name Type Required Description filterObjectNo Optional filters to apply to the task instances. filter.nameStringNo Filters by task instance name (partial match). filter.contextIdStringNo Filters by a specific context ID (e.g., a projectId). filter.ownerIdStringNo Filters by the owner's ID. sortObjectNo Optional sort criteria (e.g., { "createdAt": -1 }for descending creation date).pageNumberNo The page number for pagination. Defaults to 1.pageSizeNumberNo The number of results per page. Defaults to 50.Response:
{ "success": true, "data": { "data": [ { "_id": "654321098765432109876545", "name": "Global Project A", "contextId": "projectABC", "contextType": "project", "ownerId": "adminUser", "isArchived": false, "createdAt": "2023-10-26T14:00:00.000Z", "updatedAt": "2023-10-26T14:00:00.000Z" }, { "_id": "654321098765432109876546", "name": "Global Project B", "contextId": "projectDEF", "contextType": "project", "ownerId": "anotherAdmin", "isArchived": false, "createdAt": "2023-10-26T15:00:00.000Z", "updatedAt": "2023-10-26T15:00:00.000Z" } ], "totalCount": 2 } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "TaskManagerRpc.listAll", "params": { "filter": { "ownerId": "adminUser" }, "page": 1, "pageSize": 10 } }'