Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(zoho-desk): add AI actions and output schemas (#16817)

Kishan Parmarcc700a6b0d2e
diff --git a/bun.lock b/bun.lock
index 390faaa9031..12b9bac22f2 100644
--- a/bun.lock
+++ b/bun.lock
@@ -10416,12 +10416,13 @@
},
"packages/pieces/community/zoho-desk": {
"name": "@activepieces/piece-zoho-desk",
- "version": "0.2.2",
+ "version": "0.3.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
"@activepieces/pieces-common": "workspace:*",
"@activepieces/pieces-framework": "workspace:*",
+ "form-data": "4.0.6",
},
"devDependencies": {
"tslib": "2.6.2",
diff --git a/packages/pieces/community/zoho-desk/package.json b/packages/pieces/community/zoho-desk/package.json
index 5d08d40e429..6d1020fe54e 100644
--- a/packages/pieces/community/zoho-desk/package.json
+++ b/packages/pieces/community/zoho-desk/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-zoho-desk",
- "version": "0.2.2",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
@@ -12,7 +12,8 @@
"@activepieces/pieces-common": "workspace:*",
"@activepieces/pieces-framework": "workspace:*",
"@activepieces/core-piece-types": "workspace:*",
- "@activepieces/core-utils": "workspace:*"
+ "@activepieces/core-utils": "workspace:*",
+ "form-data": "4.0.6"
},
"devDependencies": {
"tslib": "2.6.2"
diff --git a/packages/pieces/community/zoho-desk/src/index.ts b/packages/pieces/community/zoho-desk/src/index.ts
index 615416204f9..d1fb1b0f0b3 100644
--- a/packages/pieces/community/zoho-desk/src/index.ts
+++ b/packages/pieces/community/zoho-desk/src/index.ts
@@ -1,40 +1,34 @@
-import {
- OAuth2PropertyValue,
- createPiece,
- PiecePropValueSchema,
-} from '@activepieces/pieces-framework';
-import { PieceCategory } from '@activepieces/pieces-framework';
+import { createPiece, PieceCategory } from '@activepieces/pieces-framework';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
+import { zohoDeskAuth } from './lib/auth';
+import { zohoDeskClient } from './lib/common/client';
+import { zohoDeskProps } from './lib/common/props';
import { listTicketsAction } from './lib/actions/list-tickets';
import { createTicketAction } from './lib/actions/create-ticket';
-import { organizationId } from './lib/common/props';
import { findContactAction } from './lib/actions/find-contact';
-import { zohoDeskAuth } from './lib/common/auth';
+import { zohoDeskAiActions } from './lib/actions/ai';
export const piecesZohoDesk = createPiece({
displayName: 'Zoho Desk',
description: 'Helpdesk management software',
auth: zohoDeskAuth,
categories: [PieceCategory.CUSTOMER_SUPPORT],
- minimumSupportedRelease: '0.36.1',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/zoho-desk.png',
authors: ['volubile', 'kishanprmr'],
actions: [
listTicketsAction,
createTicketAction,
findContactAction,
+ ...zohoDeskAiActions,
createCustomApiCallAction({
- baseUrl: (auth) => {
- const authValue = auth as PiecePropValueSchema<typeof zohoDeskAuth>;
- const location = authValue.props?.['location'] ?? 'zoho.com';
- return `https://desk.${location}/api/v1`;
- },
+ baseUrl: (auth) => (auth ? zohoDeskClient.baseUrl({ auth }) : ''),
auth: zohoDeskAuth,
authMapping: async (auth) => ({
- Authorization: `Zoho-oauthtoken ${(auth as OAuth2PropertyValue).access_token}`,
+ Authorization: `Zoho-oauthtoken ${auth.access_token}`,
}),
extraProps: {
- orgId: organizationId({
+ orgId: zohoDeskProps.orgId({
displayName: 'Organization ID',
description: 'Select organization ID to include in auth headers.',
required: false,
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/add-account-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/add-account-followers.ts
new file mode 100644
index 00000000000..7bff647a394
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/add-account-followers.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAddAccountFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAddAccountFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_account_followers',
+ outputSchema: zohoDeskAddAccountFollowersOutputSchema,
+ displayName: 'Add Account Followers',
+ description: 'Adds agents as followers of a account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds agents (from List Agents) as followers of one account so they get its updates.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ followerIds: Property.Array({
+ displayName: 'Agent IDs',
+ description: 'Agent IDs to add as followers.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, followerIds } = context.propsValue;
+ await zohoDeskApi.addAccountFollowers({
+ auth: context.auth,
+ orgId,
+ accountId,
+ followerIds: zohoDeskUtils.requiredStringList({ value: followerIds, propName: 'Agent IDs' }),
+ });
+ return { success: true, accountId, followerIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/associate-account-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/associate-account-products.ts
new file mode 100644
index 00000000000..10af73c2eb9
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/associate-account-products.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAssociateAccountProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_associate_account_products',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Associate Account Products',
+ description: 'Links or unlinks products on an account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Links products (from List Products) to one account, or unlinks them when Associate is No.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ productIds: Property.Array({
+ displayName: 'Product IDs',
+ description: 'Product IDs to link or unlink.',
+ required: true,
+ }),
+ associate: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Associate',
+ description: 'Yes links the products, No unlinks them.',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, productIds, associate, departmentId } = context.propsValue;
+ return await zohoDeskApi.associateAccountProducts({
+ auth: context.auth,
+ orgId,
+ accountId,
+ productIds: zohoDeskUtils.requiredStringList({ value: productIds, propName: 'Product IDs' }),
+ associate,
+ departmentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/count-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/count-accounts.ts
new file mode 100644
index 00000000000..cd817da679e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/count-accounts.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_accounts',
+ outputSchema: zohoDeskCountAccountsOutputSchema,
+ displayName: 'Count Accounts',
+ description: 'Counts the accounts in a view.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Returns the number of accounts in one account view (from List Views, module accounts).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Account view ID (from List Views, module accounts).',
+ required: true,
+ }),
+ startsWith: Property.ShortText({
+ displayName: 'Starts With',
+ description: 'Only accounts whose name starts with this letter.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, viewId, startsWith } = context.propsValue;
+ return await zohoDeskApi.countAccounts({ auth: context.auth, orgId, viewId, startsWith });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/create-account-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/create-account-comment.ts
new file mode 100644
index 00000000000..e93a0bfa897
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/create-account-comment.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateAccountCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateAccountCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_account_comment',
+ outputSchema: zohoDeskCreateAccountCommentOutputSchema,
+ displayName: 'Create Account Comment',
+ description: 'Adds a comment to a account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an internal comment to one account. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Comment text. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.createAccountComment({
+ auth: context.auth,
+ orgId,
+ accountId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/create-account.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/create-account.ts
new file mode 100644
index 00000000000..d967b6c4889
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/create-account.ts
@@ -0,0 +1,123 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateAccountOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateAccountAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_account',
+ outputSchema: zohoDeskCreateAccountOutputSchema,
+ displayName: 'Create Account',
+ description: 'Creates an account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates an account (customer company); Account Name is required. Search Accounts first to avoid duplicates: this always creates a new account.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountName: Property.ShortText({
+ displayName: 'Account Name',
+ description: 'Account (company) name.',
+ required: true,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Account email.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Phone number.',
+ required: false,
+ }),
+ website: Property.ShortText({
+ displayName: 'Website',
+ description: 'Website URL.',
+ required: false,
+ }),
+ industry: Property.ShortText({
+ displayName: 'Industry',
+ description: 'Industry.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the account (from List Agents).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes about the account.',
+ required: false,
+ }),
+ street: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address.',
+ required: false,
+ }),
+ city: Property.ShortText({ displayName: 'City', description: 'City.', required: false }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region.',
+ required: false,
+ }),
+ code: Property.ShortText({
+ displayName: 'Postal Code',
+ description: 'Postal code.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module accounts).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createAccount({
+ auth: context.auth,
+ orgId,
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-account-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-account-attachment.ts
new file mode 100644
index 00000000000..bfdf740151c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-account-attachment.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteAccountAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteAccountAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_account_attachment',
+ outputSchema: zohoDeskDeleteAccountAttachmentOutputSchema,
+ displayName: 'Delete Account Attachment',
+ description: 'Deletes a file attached to a account.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes one file attached to a account.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Account Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, attachmentId } = context.propsValue;
+ await zohoDeskApi.deleteAccountAttachment({
+ auth: context.auth,
+ orgId,
+ accountId,
+ attachmentId,
+ });
+ return { success: true, accountId, attachmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-account-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-account-comment.ts
new file mode 100644
index 00000000000..c610836d992
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-account-comment.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteAccountCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteAccountCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_account_comment',
+ outputSchema: zohoDeskDeleteAccountCommentOutputSchema,
+ displayName: 'Delete Account Comment',
+ description: 'Deletes a comment from a account.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: { description: 'Permanently deletes one comment from a account.', idempotent: false },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Account Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, commentId } = context.propsValue;
+ await zohoDeskApi.deleteAccountComment({ auth: context.auth, orgId, accountId, commentId });
+ return { success: true, accountId, commentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-accounts.ts
new file mode 100644
index 00000000000..de426df3014
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/delete-accounts.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskDeleteAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_accounts',
+ outputSchema: zohoDeskDeleteAccountsOutputSchema,
+ displayName: 'Delete Accounts',
+ description: 'Moves accounts to the recycle bin.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Moves one or more accounts to the recycle bin, where an admin can restore them. Needs the Desk.contacts.DELETE scope.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountIds: Property.Array({
+ displayName: 'Account IDs',
+ description: 'Account IDs to delete.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, accountIds } = context.propsValue;
+ await zohoDeskApi.deleteAccounts({
+ auth: context.auth,
+ orgId,
+ accountIds: zohoDeskUtils.requiredStringList({ value: accountIds, propName: 'Account IDs' }),
+ });
+ return { success: true, accountIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account-comment.ts
new file mode 100644
index 00000000000..c55746f8c3f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account-comment.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateAccountCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetAccountCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_account_comment',
+ outputSchema: zohoDeskCreateAccountCommentOutputSchema,
+ displayName: 'Get Account Comment',
+ description: 'Gets one comment on a account.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one comment on a account, with its author and content.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Account Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, commentId } = context.propsValue;
+ return await zohoDeskApi.getAccountComment({ auth: context.auth, orgId, accountId, commentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account-statistics.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account-statistics.ts
new file mode 100644
index 00000000000..0c54ad76a13
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account-statistics.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountStatisticsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetAccountStatisticsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_account_statistics',
+ outputSchema: zohoDeskGetAccountStatisticsOutputSchema,
+ displayName: 'Get Account Statistics',
+ description: 'Gets ticket statistics for an account.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets one account's ticket statistics: open, closed and overdue counts, and response and satisfaction figures.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, departmentId } = context.propsValue;
+ return await zohoDeskApi.getAccountStatistics({
+ auth: context.auth,
+ orgId,
+ accountId,
+ departmentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account.ts
new file mode 100644
index 00000000000..678040653af
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/get-account.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetAccountAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_account',
+ outputSchema: zohoDeskGetAccountOutputSchema,
+ displayName: 'Get Account',
+ description: 'Gets an account by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one account by ID with all fields, including owner and custom fields (`cf`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, accountId } = context.propsValue;
+ return await zohoDeskApi.getAccount({ auth: context.auth, orgId, accountId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-attachments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-attachments.ts
new file mode 100644
index 00000000000..a4c3f74ebfd
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-attachments.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountAttachmentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountAttachmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_attachments',
+ outputSchema: zohoDeskListAccountAttachmentsOutputSchema,
+ displayName: 'List Account Attachments',
+ description: 'Lists the files attached to a account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the files attached to one account, with name, size and download link (`href`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, from, limit } = context.propsValue;
+ const attachments = await zohoDeskApi.listAccountAttachments({
+ auth: context.auth,
+ orgId,
+ accountId,
+ from,
+ limit,
+ });
+ return { attachments, count: attachments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-comments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-comments.ts
new file mode 100644
index 00000000000..da02521c4ce
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-comments.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountCommentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountCommentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_comments',
+ outputSchema: zohoDeskListAccountCommentsOutputSchema,
+ displayName: 'List Account Comments',
+ description: 'Lists the comments on a account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the comments on one account (internal notes).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, from, limit } = context.propsValue;
+ const comments = await zohoDeskApi.listAccountComments({
+ auth: context.auth,
+ orgId,
+ accountId,
+ from,
+ limit,
+ });
+ return { comments, count: comments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-contacts.ts
new file mode 100644
index 00000000000..eaff4aa3133
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-contacts.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountContactsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_contacts',
+ outputSchema: zohoDeskListAccountContactsOutputSchema,
+ displayName: 'List Account Contacts',
+ description: 'Lists the contacts of an account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the contacts linked to one account.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'firstName', value: 'firstName' },
+ { label: 'lastName', value: 'lastName' },
+ { label: 'fullName', value: 'fullName' },
+ { label: 'email', value: 'email' },
+ { label: 'phone', value: 'phone' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, sortBy, from, limit } = context.propsValue;
+ const contacts = await zohoDeskApi.listAccountContacts({
+ auth: context.auth,
+ orgId,
+ accountId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { contacts, count: contacts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-contracts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-contracts.ts
new file mode 100644
index 00000000000..d2ccec58f73
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-contracts.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountContractsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountContractsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_contracts',
+ outputSchema: zohoDeskListAccountContractsOutputSchema,
+ displayName: 'List Account Contracts',
+ description: 'Lists the support contracts of an account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the support contracts of one account, optionally only active, expired or future ones.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ contractStatus: Property.StaticDropdown({
+ displayName: 'Contract Status',
+ description: 'Only contracts with this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'EXPIRED', value: 'EXPIRED' },
+ { label: 'FUTURE', value: 'FUTURE' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, departmentId, contractStatus, from, limit } = context.propsValue;
+ const contracts = await zohoDeskApi.listAccountContracts({
+ auth: context.auth,
+ orgId,
+ accountId,
+ departmentId,
+ contractStatus,
+ from,
+ limit,
+ });
+ return { contracts, count: contracts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-followers.ts
new file mode 100644
index 00000000000..a07538cb8f6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-followers.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_followers',
+ outputSchema: zohoDeskListAccountFollowersOutputSchema,
+ displayName: 'List Account Followers',
+ description: 'Lists the agents following a account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the agents following one account.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, from, limit } = context.propsValue;
+ const followers = await zohoDeskApi.listAccountFollowers({
+ auth: context.auth,
+ orgId,
+ accountId,
+ from,
+ limit,
+ });
+ return { followers, count: followers.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-history.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-history.ts
new file mode 100644
index 00000000000..6e8232dcd3f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-history.ts
@@ -0,0 +1,48 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountHistoryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountHistoryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_history',
+ outputSchema: zohoDeskListAccountHistoryOutputSchema,
+ displayName: 'List Account History',
+ description: 'Lists the activity history of an account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the activity history of one account, optionally only for one contact, agent or department.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ agentId: zohoDeskAiProps.agentId({ required: false }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, contactId, agentId, departmentId, from, limit } = context.propsValue;
+ const history = await zohoDeskApi.listAccountHistory({
+ auth: context.auth,
+ orgId,
+ accountId,
+ contactId,
+ agentId,
+ departmentId,
+ from,
+ limit,
+ });
+ return { history, count: history.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-products.ts
new file mode 100644
index 00000000000..262252524b3
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-products.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_products',
+ outputSchema: zohoDeskListAccountProductsOutputSchema,
+ displayName: 'List Account Products',
+ description: 'Lists the products linked to an account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the products linked to one account.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, departmentId, from, limit } = context.propsValue;
+ const products = await zohoDeskApi.listAccountProducts({
+ auth: context.auth,
+ orgId,
+ accountId,
+ departmentId,
+ from,
+ limit,
+ });
+ return { products, count: products.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-slas.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-slas.ts
new file mode 100644
index 00000000000..491cff821e5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-slas.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountSlasOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountSlasAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_slas',
+ outputSchema: zohoDeskListAccountSlasOutputSchema,
+ displayName: 'List Account SLAs',
+ description: 'Lists the SLAs linked to an account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the SLA policies linked to one account. The SLA `id` feeds Set Account SLA.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only SLAs with this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'INACTIVE', value: 'INACTIVE' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, departmentId, status, from, limit } = context.propsValue;
+ const slas = await zohoDeskApi.listAccountSlas({
+ auth: context.auth,
+ orgId,
+ accountId,
+ departmentId,
+ status,
+ from,
+ limit,
+ });
+ return { slas, count: slas.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-tickets.ts
new file mode 100644
index 00000000000..21025d493fe
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-account-tickets.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_tickets',
+ outputSchema: zohoDeskListAccountTicketsOutputSchema,
+ displayName: 'List Account Tickets',
+ description: 'Lists the tickets of an account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the tickets raised by contacts of one account, optionally only in one department.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, departmentId, sortBy, from, limit } = context.propsValue;
+ const tickets = await zohoDeskApi.listAccountTickets({
+ auth: context.auth,
+ orgId,
+ accountId,
+ departmentId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { tickets, count: tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-accounts.ts
new file mode 100644
index 00000000000..6839767b9ac
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/list-accounts.ts
@@ -0,0 +1,63 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_accounts',
+ outputSchema: zohoDeskListAccountsOutputSchema,
+ displayName: 'List Accounts',
+ description: 'Lists accounts.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists accounts (customer companies) in an organization, optionally from a view. Use Search Accounts to find one by name. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Account view ID (from List Views, module accounts).',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'accountName', value: 'accountName' },
+ { label: 'email', value: 'email' },
+ { label: 'phone', value: 'phone' },
+ { label: 'website', value: 'website' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, viewId, sortBy, from, limit } = context.propsValue;
+ const accounts = await zohoDeskApi.listAccounts({
+ auth: context.auth,
+ orgId,
+ viewId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { accounts, count: accounts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/merge-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/merge-accounts.ts
new file mode 100644
index 00000000000..e7d1f077b8c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/merge-accounts.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskGetAccountOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMergeAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_merge_accounts',
+ outputSchema: zohoDeskGetAccountOutputSchema,
+ displayName: 'Merge Accounts',
+ description: 'Merges other accounts into one account.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Merges the listed accounts into the target account, moving their contacts and tickets to it; the merged accounts are removed. This cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: Property.ShortText({
+ displayName: 'Target Account ID',
+ description: 'ID of the account the others are merged into.',
+ required: true,
+ }),
+ accountIds: Property.Array({
+ displayName: 'Account IDs',
+ description: 'IDs of the accounts to merge into the target account.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, accountIds } = context.propsValue;
+ return await zohoDeskApi.mergeAccounts({
+ auth: context.auth,
+ orgId,
+ accountId,
+ accountIds: zohoDeskUtils.requiredStringList({ value: accountIds, propName: 'Account IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/remove-account-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/remove-account-followers.ts
new file mode 100644
index 00000000000..1473cc82279
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/remove-account-followers.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAddAccountFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskRemoveAccountFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_remove_account_followers',
+ outputSchema: zohoDeskAddAccountFollowersOutputSchema,
+ displayName: 'Remove Account Followers',
+ description: 'Removes followers from a account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Removes agents from the followers of one account.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ followerIds: Property.Array({
+ displayName: 'Agent IDs',
+ description: 'Agent IDs to remove.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, followerIds } = context.propsValue;
+ await zohoDeskApi.removeAccountFollowers({
+ auth: context.auth,
+ orgId,
+ accountId,
+ followerIds: zohoDeskUtils.requiredStringList({ value: followerIds, propName: 'Agent IDs' }),
+ });
+ return { success: true, accountId, followerIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/search-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/search-accounts.ts
new file mode 100644
index 00000000000..7181ceade6a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/search-accounts.ts
@@ -0,0 +1,90 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_accounts',
+ outputSchema: zohoDeskSearchAccountsOutputSchema,
+ displayName: 'Search Accounts',
+ description: 'Searches accounts by text or name.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches accounts by free text (supports a trailing * wildcard), account name or time range. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched across account fields; end with * for a prefix match.',
+ required: false,
+ }),
+ accountName: Property.ShortText({
+ displayName: 'Account Name',
+ description: 'Account name.',
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Sort order.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'relevance', value: 'relevance' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'accountName', value: 'accountName' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+ } = context.propsValue;
+ const accounts = await zohoDeskApi.searchAccounts({
+ auth: context.auth,
+ orgId,
+ searchText,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+ });
+ return { accounts, count: accounts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/set-account-sla.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/set-account-sla.ts
new file mode 100644
index 00000000000..0a23615a0a6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/set-account-sla.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSetAccountSlaOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSetAccountSlaAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_set_account_sla',
+ outputSchema: zohoDeskSetAccountSlaOutputSchema,
+ displayName: 'Set Account SLA',
+ description: 'Links or unlinks an SLA on an account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Links one SLA policy to an account, or unlinks it when Associate is No. Needs the Desk.accounts.UPDATE scope.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ slaId: Property.ShortText({
+ displayName: 'SLA ID',
+ description: 'SLA policy ID (the `sla.id` of a plan from List Support Plans, or from List Account SLAs).',
+ required: true,
+ }),
+ associate: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Associate',
+ description: 'Yes links the SLA, No unlinks it.',
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, slaId, associate } = context.propsValue;
+ await zohoDeskApi.setAccountSla({ auth: context.auth, orgId, accountId, slaId, associate });
+ return { success: true, accountId, slaId, associate };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-account-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-account-comment.ts
new file mode 100644
index 00000000000..c5481ed96b8
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-account-comment.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateAccountCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateAccountCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_account_comment',
+ outputSchema: zohoDeskCreateAccountCommentOutputSchema,
+ displayName: 'Update Account Comment',
+ description: 'Edits a comment on a account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Replaces the text of one comment on a account.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Account Comments).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'New comment text.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, commentId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.updateAccountComment({
+ auth: context.auth,
+ orgId,
+ accountId,
+ commentId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-account.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-account.ts
new file mode 100644
index 00000000000..35830dba319
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-account.ts
@@ -0,0 +1,127 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateAccountAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_account',
+ outputSchema: zohoDeskGetAccountOutputSchema,
+ displayName: 'Update Account',
+ description: 'Updates fields on an account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one account; fields left empty are not changed.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ accountName: Property.ShortText({
+ displayName: 'Account Name',
+ description: 'Account (company) name.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Account email.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Phone number.',
+ required: false,
+ }),
+ website: Property.ShortText({
+ displayName: 'Website',
+ description: 'Website URL.',
+ required: false,
+ }),
+ industry: Property.ShortText({
+ displayName: 'Industry',
+ description: 'Industry.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the account (from List Agents).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes about the account.',
+ required: false,
+ }),
+ street: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address.',
+ required: false,
+ }),
+ city: Property.ShortText({ displayName: 'City', description: 'City.', required: false }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region.',
+ required: false,
+ }),
+ code: Property.ShortText({
+ displayName: 'Postal Code',
+ description: 'Postal code.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module accounts).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ accountId,
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateAccount({
+ auth: context.auth,
+ orgId,
+ accountId,
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-many-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-many-accounts.ts
new file mode 100644
index 00000000000..44c6291ae2e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/update-many-accounts.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskUpdateManyAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateManyAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_many_accounts',
+ outputSchema: zohoDeskUpdateManyAccountsOutputSchema,
+ displayName: 'Update Many Accounts',
+ description: 'Sets one field to the same value on several accounts.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Sets one field (by API name) to the same value on several accounts at once.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountIds: Property.Array({
+ displayName: 'Account IDs',
+ description: 'Account IDs to update.',
+ required: true,
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'API name of the field to set (from List Fields, module accounts).',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Field Value',
+ description: 'Value to set. Leave empty to clear the field.',
+ required: false,
+ }),
+ isCustomField: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Custom Field',
+ description: 'Yes when Field Name is a custom field.',
+ }),
+ },
+ async run(context) {
+ const { orgId, accountIds, fieldName, fieldValue, isCustomField } = context.propsValue;
+ return await zohoDeskApi.updateManyAccounts({
+ auth: context.auth,
+ orgId,
+ accountIds: zohoDeskUtils.requiredStringList({ value: accountIds, propName: 'Account IDs' }),
+ fieldName,
+ fieldValue,
+ isCustomField,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/upload-account-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/upload-account-attachment.ts
new file mode 100644
index 00000000000..fbf821ffdb0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/accounts/upload-account-attachment.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUploadAccountAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUploadAccountAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_upload_account_attachment',
+ outputSchema: zohoDeskUploadAccountAttachmentOutputSchema,
+ displayName: 'Upload Account Attachment',
+ description: 'Attaches a file to a account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to one account. Not idempotent: each call adds another copy.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ file: Property.File({ displayName: 'File', description: 'File to attach.', required: true }),
+ },
+ async run(context) {
+ const { orgId, accountId, file } = context.propsValue;
+ return await zohoDeskApi.uploadAccountAttachment({
+ auth: context.auth,
+ orgId,
+ accountId,
+ file,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-call-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-call-comment.ts
new file mode 100644
index 00000000000..6a6ec5524b6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-call-comment.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateCallCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_call_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Create Call Comment',
+ description: 'Adds a comment to a call.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an internal comment to one call. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Comment text. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, callId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.createCallComment({
+ auth: context.auth,
+ orgId,
+ callId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-call.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-call.ts
new file mode 100644
index 00000000000..a011f807f40
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-call.ts
@@ -0,0 +1,129 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateCallAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_call',
+ outputSchema: zohoDeskCreateCallOutputSchema,
+ displayName: 'Create Call',
+ description: 'Logs or schedules a call.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Logs a call on a ticket, or schedules one (status Scheduled). Needs the Desk.calls.ALL scope. Not idempotent: each call creates a new record.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Call subject.',
+ required: true,
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ ticketId: zohoDeskAiProps.ticketId({
+ required: true,
+ description: 'Ticket the call belongs to (from List Tickets).',
+ }),
+ startTime: Property.DateTime({
+ displayName: 'Start Time',
+ description: 'Start time, ISO 8601.',
+ required: true,
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Call status. A Completed call needs a start time in the past.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Scheduled', value: 'Scheduled' },
+ { label: 'In Progress', value: 'In Progress' },
+ { label: 'Completed', value: 'Completed' },
+ { label: 'Missed', value: 'Missed' },
+ { label: 'Canceled', value: 'Canceled' },
+ ],
+ },
+ }),
+ direction: Property.StaticDropdown({
+ displayName: 'Direction',
+ description: 'Inbound or outbound call. Scheduled calls must be outbound.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'inbound', value: 'inbound' },
+ { label: 'outbound', value: 'outbound' },
+ ],
+ },
+ }),
+ duration: Property.Number({
+ displayName: 'Duration',
+ description: 'Duration in seconds.',
+ required: true,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns it (from List Agents).',
+ required: true,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority, e.g. "Low", "Normal" or "High".',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ direction,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createCall({
+ auth: context.auth,
+ orgId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ direction,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-event-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-event-comment.ts
new file mode 100644
index 00000000000..82a00ed0e40
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-event-comment.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateEventCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_event_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Create Event Comment',
+ description: 'Adds a comment to a event.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an internal comment to one event. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Comment text. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, eventId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.createEventComment({
+ auth: context.auth,
+ orgId,
+ eventId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-event.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-event.ts
new file mode 100644
index 00000000000..21f96da688f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/create-event.ts
@@ -0,0 +1,112 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateEventOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateEventAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_event',
+ outputSchema: zohoDeskCreateEventOutputSchema,
+ displayName: 'Create Event',
+ description: 'Schedules an event.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Schedules an event (meeting or appointment) with a contact, optionally on a ticket. Not idempotent: each call creates a new event.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Event subject.',
+ required: true,
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ ticketId: zohoDeskAiProps.ticketId({
+ required: false,
+ description: 'Ticket the event belongs to (from List Tickets).',
+ }),
+ startTime: Property.DateTime({
+ displayName: 'Start Time',
+ description: 'Start time, ISO 8601.',
+ required: true,
+ }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description: 'Event status, e.g. "Scheduled" or "Completed".',
+ required: false,
+ }),
+ category: Property.ShortText({
+ displayName: 'Category',
+ description: 'Event category.',
+ required: false,
+ }),
+ duration: Property.Number({
+ displayName: 'Duration',
+ description: 'Duration in seconds.',
+ required: true,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns it (from List Agents).',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority, e.g. "Low", "Normal" or "High".',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ category,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createEvent({
+ auth: context.auth,
+ orgId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ category,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-call-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-call-attachment.ts
new file mode 100644
index 00000000000..08b7000c210
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-call-attachment.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteCallAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteCallAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_call_attachment',
+ outputSchema: zohoDeskDeleteCallAttachmentOutputSchema,
+ displayName: 'Delete Call Attachment',
+ description: 'Deletes a file attached to a call.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one file attached to a call (attachment ID from Upload Call Attachment or Get Call).',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from Upload Call Attachment).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, callId, attachmentId } = context.propsValue;
+ await zohoDeskApi.deleteCallAttachment({ auth: context.auth, orgId, callId, attachmentId });
+ return { success: true, callId, attachmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-call-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-call-comment.ts
new file mode 100644
index 00000000000..7043bac87a2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-call-comment.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteCallCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_call_comment',
+ outputSchema: zohoDeskDeleteCallCommentOutputSchema,
+ displayName: 'Delete Call Comment',
+ description: 'Deletes a comment from a call.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: { description: 'Permanently deletes one comment from a call.', idempotent: false },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Call Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, callId, commentId } = context.propsValue;
+ await zohoDeskApi.deleteCallComment({ auth: context.auth, orgId, callId, commentId });
+ return { success: true, callId, commentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-calls.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-calls.ts
new file mode 100644
index 00000000000..5e09a3c2293
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-calls.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskDeleteCallsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteCallsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_calls',
+ outputSchema: zohoDeskDeleteCallsOutputSchema,
+ displayName: 'Delete Calls',
+ description: 'Moves calls to the recycle bin.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Moves one or more calls to the recycle bin. Needs the Desk.calls.ALL scope.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callIds: Property.Array({
+ displayName: 'Call IDs',
+ description: 'Call IDs to delete.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, callIds } = context.propsValue;
+ await zohoDeskApi.deleteCalls({
+ auth: context.auth,
+ orgId,
+ callIds: zohoDeskUtils.requiredStringList({ value: callIds, propName: 'Call IDs' }),
+ });
+ return { success: true, callIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-event-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-event-attachment.ts
new file mode 100644
index 00000000000..0ab20994670
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-event-attachment.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteEventAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteEventAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_event_attachment',
+ outputSchema: zohoDeskDeleteEventAttachmentOutputSchema,
+ displayName: 'Delete Event Attachment',
+ description: 'Deletes a file attached to a event.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes one file attached to a event.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Event Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, eventId, attachmentId } = context.propsValue;
+ await zohoDeskApi.deleteEventAttachment({ auth: context.auth, orgId, eventId, attachmentId });
+ return { success: true, eventId, attachmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-events.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-events.ts
new file mode 100644
index 00000000000..eb181305bd4
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/delete-events.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskDeleteEventsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteEventsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_events',
+ outputSchema: zohoDeskDeleteEventsOutputSchema,
+ displayName: 'Delete Events',
+ description: 'Moves events to the recycle bin.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: { description: 'Moves one or more events to the recycle bin.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventIds: Property.Array({
+ displayName: 'Event IDs',
+ description: 'Event IDs to delete.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, eventIds } = context.propsValue;
+ await zohoDeskApi.deleteEvents({
+ auth: context.auth,
+ orgId,
+ eventIds: zohoDeskUtils.requiredStringList({ value: eventIds, propName: 'Event IDs' }),
+ });
+ return { success: true, eventIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/download-event-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/download-event-attachment.ts
new file mode 100644
index 00000000000..096abe9be3f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/download-event-attachment.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDownloadContractCommentAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDownloadEventAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_download_event_attachment',
+ outputSchema: zohoDeskDownloadContractCommentAttachmentOutputSchema,
+ displayName: 'Download Event Attachment',
+ description: 'Downloads a file attached to a event.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Downloads one file attached to a event and returns it as a file.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Event Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, eventId, attachmentId } = context.propsValue;
+ const file = await zohoDeskApi.downloadEventAttachment({
+ auth: context.auth,
+ orgId,
+ eventId,
+ attachmentId,
+ });
+ const fileName = file.fileName ?? attachmentId;
+ return { fileName, file: await context.files.write({ fileName, data: file.data }) };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-call-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-call-comment.ts
new file mode 100644
index 00000000000..6fff8963a7a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-call-comment.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetCallCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_call_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Get Call Comment',
+ description: 'Gets one comment on a call.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one comment on a call, with its author and content.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Call Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, callId, commentId } = context.propsValue;
+ return await zohoDeskApi.getCallComment({ auth: context.auth, orgId, callId, commentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-call.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-call.ts
new file mode 100644
index 00000000000..0f0f7380c35
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-call.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetCallAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_call',
+ outputSchema: zohoDeskCreateCallOutputSchema,
+ displayName: 'Get Call',
+ description: 'Gets a call by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one call by ID with its subject, status, start time, duration, contact and ticket. Needs the Desk.calls.ALL scope.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, callId } = context.propsValue;
+ return await zohoDeskApi.getCall({ auth: context.auth, orgId, callId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-event-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-event-comment.ts
new file mode 100644
index 00000000000..b7597d0e6b1
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-event-comment.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetEventCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_event_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Get Event Comment',
+ description: 'Gets one comment on a event.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one comment on a event, with its author and content.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Event Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, eventId, commentId } = context.propsValue;
+ return await zohoDeskApi.getEventComment({ auth: context.auth, orgId, eventId, commentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-event.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-event.ts
new file mode 100644
index 00000000000..551131c3be9
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/get-event.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateEventOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetEventAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_event',
+ outputSchema: zohoDeskCreateEventOutputSchema,
+ displayName: 'Get Event',
+ description: 'Gets an event by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one event by ID with its subject, start time, duration, contact and ticket.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, eventId } = context.propsValue;
+ return await zohoDeskApi.getEvent({ auth: context.auth, orgId, eventId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-call-comments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-call-comments.ts
new file mode 100644
index 00000000000..faa6867f104
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-call-comments.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListCallCommentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListCallCommentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_call_comments',
+ outputSchema: zohoDeskListCallCommentsOutputSchema,
+ displayName: 'List Call Comments',
+ description: 'Lists the comments on a call.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the comments on one call (agent notes).', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, callId, from, limit } = context.propsValue;
+ const comments = await zohoDeskApi.listCallComments({
+ auth: context.auth,
+ orgId,
+ callId,
+ from,
+ limit,
+ });
+ return { comments, count: comments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-calls.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-calls.ts
new file mode 100644
index 00000000000..09c13a6dd30
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-calls.ts
@@ -0,0 +1,75 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListCallsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListCallsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_calls',
+ outputSchema: zohoDeskListCallsOutputSchema,
+ displayName: 'List Calls',
+ description: 'Lists logged and scheduled calls.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists calls, optionally by department, view, assignee or completion. Needs the Desk.calls.ALL scope. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Call view ID (from List Views, module calls).',
+ required: false,
+ }),
+ assignee: Property.Array({
+ displayName: 'Assignee',
+ description: 'Agent IDs to include.',
+ required: false,
+ }),
+ isCompleted: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Completed',
+ description: 'Yes returns only completed calls, No only open ones.',
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'startTime', value: 'startTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, viewId, assignee, isCompleted, sortBy, from, limit } =
+ context.propsValue;
+ const calls = await zohoDeskApi.listCalls({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ viewId,
+ assignee: zohoDeskUtils.optionalStringList({ value: assignee, propName: 'Assignee' }),
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+ });
+ return { calls, count: calls.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-event-attachments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-event-attachments.ts
new file mode 100644
index 00000000000..17f284fb297
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-event-attachments.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountAttachmentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListEventAttachmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_event_attachments',
+ outputSchema: zohoDeskListAccountAttachmentsOutputSchema,
+ displayName: 'List Event Attachments',
+ description: 'Lists the files attached to a event.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the files attached to one event, with name, size and download link (`href`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, eventId, from, limit } = context.propsValue;
+ const attachments = await zohoDeskApi.listEventAttachments({
+ auth: context.auth,
+ orgId,
+ eventId,
+ from,
+ limit,
+ });
+ return { attachments, count: attachments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-event-comments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-event-comments.ts
new file mode 100644
index 00000000000..ac2fe73abee
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-event-comments.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListCallCommentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListEventCommentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_event_comments',
+ outputSchema: zohoDeskListCallCommentsOutputSchema,
+ displayName: 'List Event Comments',
+ description: 'Lists the comments on a event.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the comments on one event (agent notes).', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, eventId, from, limit } = context.propsValue;
+ const comments = await zohoDeskApi.listEventComments({
+ auth: context.auth,
+ orgId,
+ eventId,
+ from,
+ limit,
+ });
+ return { comments, count: comments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-events.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-events.ts
new file mode 100644
index 00000000000..9b68ca8091f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/list-events.ts
@@ -0,0 +1,75 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListEventsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListEventsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_events',
+ outputSchema: zohoDeskListEventsOutputSchema,
+ displayName: 'List Events',
+ description: 'Lists scheduled events.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists events (meetings and appointments), optionally by department, view, assignee or completion. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Event view ID (from List Views, module events).',
+ required: false,
+ }),
+ assignee: Property.Array({
+ displayName: 'Assignee',
+ description: 'Agent IDs to include.',
+ required: false,
+ }),
+ isCompleted: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Completed',
+ description: 'Yes returns only completed events, No only open ones.',
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'startTime', value: 'startTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, viewId, assignee, isCompleted, sortBy, from, limit } =
+ context.propsValue;
+ const events = await zohoDeskApi.listEvents({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ viewId,
+ assignee: zohoDeskUtils.optionalStringList({ value: assignee, propName: 'Assignee' }),
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+ });
+ return { events, count: events.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-activities.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-activities.ts
new file mode 100644
index 00000000000..65a2fc082c7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-activities.ts
@@ -0,0 +1,101 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchActivitiesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchActivitiesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_activities',
+ outputSchema: zohoDeskSearchActivitiesOutputSchema,
+ displayName: 'Search Activities',
+ description: 'Searches tasks, calls and events together.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches tasks, calls and events in one query by free text, subject, linked ticket number, assignee, status, priority or time range.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched across activity fields; end with * for a prefix match.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Text to match in the subject.',
+ required: false,
+ }),
+ ticketNumber: Property.ShortText({
+ displayName: 'Ticket Number',
+ description: 'Number of the linked ticket.',
+ required: false,
+ }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID (from List Agents).',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ status: Property.ShortText({ displayName: 'Status', description: 'Status.', required: false }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority.',
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ } = context.propsValue;
+ const activities = await zohoDeskApi.searchActivities({
+ auth: context.auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ });
+ return { activities, count: activities.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-calls.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-calls.ts
new file mode 100644
index 00000000000..36e1073711a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-calls.ts
@@ -0,0 +1,101 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchCallsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchCallsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_calls',
+ outputSchema: zohoDeskSearchCallsOutputSchema,
+ displayName: 'Search Calls',
+ description: 'Searches calls by text, subject, ticket number or time range.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches calls by free text, subject, linked ticket number, assignee, status, priority or time range. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched across call fields; end with * for a prefix match.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Text to match in the subject.',
+ required: false,
+ }),
+ ticketNumber: Property.ShortText({
+ displayName: 'Ticket Number',
+ description: 'Number of the linked ticket.',
+ required: false,
+ }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID (from List Agents).',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ status: Property.ShortText({ displayName: 'Status', description: 'Status.', required: false }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority.',
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ } = context.propsValue;
+ const calls = await zohoDeskApi.searchCalls({
+ auth: context.auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ });
+ return { calls, count: calls.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-events.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-events.ts
new file mode 100644
index 00000000000..5cbb4d24c21
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/search-events.ts
@@ -0,0 +1,101 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchEventsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchEventsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_events',
+ outputSchema: zohoDeskSearchEventsOutputSchema,
+ displayName: 'Search Events',
+ description: 'Searches events by text, subject, ticket number or time range.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches events by free text, subject, linked ticket number, assignee, status, priority or time range. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched across event fields; end with * for a prefix match.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Text to match in the subject.',
+ required: false,
+ }),
+ ticketNumber: Property.ShortText({
+ displayName: 'Ticket Number',
+ description: 'Number of the linked ticket.',
+ required: false,
+ }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID (from List Agents).',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ status: Property.ShortText({ displayName: 'Status', description: 'Status.', required: false }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority.',
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ } = context.propsValue;
+ const events = await zohoDeskApi.searchEvents({
+ auth: context.auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ });
+ return { events, count: events.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-call-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-call-comment.ts
new file mode 100644
index 00000000000..b1948abdb8c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-call-comment.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateCallCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_call_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Update Call Comment',
+ description: 'Edits a comment on a call.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Replaces the text of one comment on a call.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Call Comments).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'New comment text.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, callId, commentId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.updateCallComment({
+ auth: context.auth,
+ orgId,
+ callId,
+ commentId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-call.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-call.ts
new file mode 100644
index 00000000000..28a172ae100
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-call.ts
@@ -0,0 +1,136 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUpdateCallOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateCallAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_call',
+ outputSchema: zohoDeskUpdateCallOutputSchema,
+ displayName: 'Update Call',
+ description: 'Updates fields on a call.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one call; the rest keep their current values. Needs the Desk.calls.ALL scope.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Call subject.',
+ required: false,
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ ticketId: zohoDeskAiProps.ticketId({
+ required: false,
+ description: 'Ticket the call belongs to (from List Tickets).',
+ }),
+ startTime: Property.DateTime({
+ displayName: 'Start Time',
+ description: 'Start time, ISO 8601.',
+ required: false,
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Call status. A Completed call needs a start time in the past.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Scheduled', value: 'Scheduled' },
+ { label: 'In Progress', value: 'In Progress' },
+ { label: 'Completed', value: 'Completed' },
+ { label: 'Missed', value: 'Missed' },
+ { label: 'Canceled', value: 'Canceled' },
+ ],
+ },
+ }),
+ direction: Property.StaticDropdown({
+ displayName: 'Direction',
+ description: 'Inbound or outbound call. Scheduled calls must be outbound.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'inbound', value: 'inbound' },
+ { label: 'outbound', value: 'outbound' },
+ ],
+ },
+ }),
+ duration: Property.Number({
+ displayName: 'Duration',
+ description: 'Duration in seconds.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns it (from List Agents).',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority, e.g. "Low", "Normal" or "High".',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ callId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ direction,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateCall({
+ auth: context.auth,
+ orgId,
+ callId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ direction,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-event-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-event-comment.ts
new file mode 100644
index 00000000000..b6459ca6488
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-event-comment.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateEventCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_event_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Update Event Comment',
+ description: 'Edits a comment on a event.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Replaces the text of one comment on a event.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Event Comments).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'New comment text.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, eventId, commentId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.updateEventComment({
+ auth: context.auth,
+ orgId,
+ eventId,
+ commentId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-event.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-event.ts
new file mode 100644
index 00000000000..1f7457d4665
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-event.ts
@@ -0,0 +1,119 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateEventOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateEventAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_event',
+ outputSchema: zohoDeskCreateEventOutputSchema,
+ displayName: 'Update Event',
+ description: 'Updates fields on an event.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one event; the rest keep their current values.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Event subject.',
+ required: false,
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ ticketId: zohoDeskAiProps.ticketId({
+ required: false,
+ description: 'Ticket the event belongs to (from List Tickets).',
+ }),
+ startTime: Property.DateTime({
+ displayName: 'Start Time',
+ description: 'Start time, ISO 8601.',
+ required: false,
+ }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description: 'Event status, e.g. "Scheduled" or "Completed".',
+ required: false,
+ }),
+ category: Property.ShortText({
+ displayName: 'Category',
+ description: 'Event category.',
+ required: false,
+ }),
+ duration: Property.Number({
+ displayName: 'Duration',
+ description: 'Duration in seconds.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns it (from List Agents).',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority, e.g. "Low", "Normal" or "High".',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ eventId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ category,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateEvent({
+ auth: context.auth,
+ orgId,
+ eventId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ category,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-many-calls.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-many-calls.ts
new file mode 100644
index 00000000000..85113f1b14b
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-many-calls.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateManyCallsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_many_calls',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Update Many Calls',
+ description: 'Sets one field to the same value on several calls.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Sets one field (by API name) to the same value on several calls at once.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callIds: Property.Array({
+ displayName: 'Call IDs',
+ description: 'Call IDs to update.',
+ required: true,
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'API name of the field to set (from List Fields, module calls).',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Field Value',
+ description: 'Value to set. Leave empty to clear the field.',
+ required: false,
+ }),
+ isCustomField: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Custom Field',
+ description: 'Yes when Field Name is a custom field.',
+ }),
+ },
+ async run(context) {
+ const { orgId, callIds, fieldName, fieldValue, isCustomField } = context.propsValue;
+ return await zohoDeskApi.updateManyCalls({
+ auth: context.auth,
+ orgId,
+ callIds: zohoDeskUtils.requiredStringList({ value: callIds, propName: 'Call IDs' }),
+ fieldName,
+ fieldValue,
+ isCustomField,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-many-events.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-many-events.ts
new file mode 100644
index 00000000000..94bd868efef
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/update-many-events.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateManyEventsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_many_events',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Update Many Events',
+ description: 'Sets one field to the same value on several events.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Sets one field (by API name) to the same value on several events at once.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventIds: Property.Array({
+ displayName: 'Event IDs',
+ description: 'Event IDs to update.',
+ required: true,
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'API name of the field to set (from List Fields, module events).',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Field Value',
+ description: 'Value to set. Leave empty to clear the field.',
+ required: false,
+ }),
+ isCustomField: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Custom Field',
+ description: 'Yes when Field Name is a custom field.',
+ }),
+ },
+ async run(context) {
+ const { orgId, eventIds, fieldName, fieldValue, isCustomField } = context.propsValue;
+ return await zohoDeskApi.updateManyEvents({
+ auth: context.auth,
+ orgId,
+ eventIds: zohoDeskUtils.requiredStringList({ value: eventIds, propName: 'Event IDs' }),
+ fieldName,
+ fieldValue,
+ isCustomField,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/upload-call-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/upload-call-attachment.ts
new file mode 100644
index 00000000000..528e51eac36
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/upload-call-attachment.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUploadAccountAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUploadCallAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_upload_call_attachment',
+ outputSchema: zohoDeskUploadAccountAttachmentOutputSchema,
+ displayName: 'Upload Call Attachment',
+ description: 'Attaches a file to a call.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to one call. Not idempotent: each call adds another copy.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ callId: Property.ShortText({
+ displayName: 'Call ID',
+ description: 'Call ID (from List Calls or Search Calls).',
+ required: true,
+ }),
+ file: Property.File({ displayName: 'File', description: 'File to attach.', required: true }),
+ },
+ async run(context) {
+ const { orgId, callId, file } = context.propsValue;
+ return await zohoDeskApi.uploadCallAttachment({ auth: context.auth, orgId, callId, file });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/upload-event-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/upload-event-attachment.ts
new file mode 100644
index 00000000000..a66a338aba2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/activities/upload-event-attachment.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUploadAccountAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUploadEventAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_upload_event_attachment',
+ outputSchema: zohoDeskUploadAccountAttachmentOutputSchema,
+ displayName: 'Upload Event Attachment',
+ description: 'Attaches a file to a event.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to one event. Not idempotent: each call adds another copy.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ eventId: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'Event ID (from List Events or Search Events).',
+ required: true,
+ }),
+ file: Property.File({ displayName: 'File', description: 'File to attach.', required: true }),
+ },
+ async run(context) {
+ const { orgId, eventId, file } = context.propsValue;
+ return await zohoDeskApi.uploadEventAttachment({ auth: context.auth, orgId, eventId, file });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/add-contact-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/add-contact-followers.ts
new file mode 100644
index 00000000000..cc537ebfcae
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/add-contact-followers.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAddContactFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAddContactFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_contact_followers',
+ outputSchema: zohoDeskAddContactFollowersOutputSchema,
+ displayName: 'Add Contact Followers',
+ description: 'Adds agents as followers of a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds agents (from List Agents) as followers of one contact so they get its updates.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ followerIds: Property.Array({
+ displayName: 'Agent IDs',
+ description: 'Agent IDs to add as followers.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, followerIds } = context.propsValue;
+ await zohoDeskApi.addContactFollowers({
+ auth: context.auth,
+ orgId,
+ contactId,
+ followerIds: zohoDeskUtils.requiredStringList({ value: followerIds, propName: 'Agent IDs' }),
+ });
+ return { success: true, contactId, followerIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/approve-contact-help-center-access.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/approve-contact-help-center-access.ts
new file mode 100644
index 00000000000..b4364d0f8ee
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/approve-contact-help-center-access.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskApproveContactHelpCenterAccessAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_approve_contact_help_center_access',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Approve Contact Help Center Access',
+ description: "Approves a contact's pending help-center signup.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: "Approves one contact's pending signup to the given help centers.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ helpCenterIds: Property.Array({
+ displayName: 'Help Center IDs',
+ description: 'Help center IDs to approve the contact for.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, helpCenterIds } = context.propsValue;
+ return await zohoDeskApi.approveContactHelpCenterAccess({
+ auth: context.auth,
+ orgId,
+ contactId,
+ helpCenterIds: zohoDeskUtils.requiredStringList({
+ value: helpCenterIds,
+ propName: 'Help Center IDs',
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/associate-contact-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/associate-contact-accounts.ts
new file mode 100644
index 00000000000..f21187d55d2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/associate-contact-accounts.ts
@@ -0,0 +1,51 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAssociateContactAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_associate_contact_accounts',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Associate Contact Accounts',
+ description: 'Links accounts to a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Links one contact to one or more accounts (from Search Accounts). Can View Account Tickets lets the contact see those accounts' tickets in the help center; it defaults to No.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ accountIds: Property.Array({
+ displayName: 'Account IDs',
+ description: 'Account IDs to link.',
+ required: true,
+ }),
+ canViewAccountTickets: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Can View Account Tickets',
+ description:
+ "Yes lets the contact see the accounts' tickets in the help center. Defaults to No.",
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, accountIds, canViewAccountTickets } = context.propsValue;
+ return await zohoDeskApi.associateContactAccounts({
+ auth: context.auth,
+ orgId,
+ contactId,
+ accountIds: zohoDeskUtils.requiredStringList({ value: accountIds, propName: 'Account IDs' }),
+ canViewAccountTickets,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/associate-contact-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/associate-contact-products.ts
new file mode 100644
index 00000000000..dec82cea8a7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/associate-contact-products.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAssociateContactProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_associate_contact_products',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Associate Contact Products',
+ description: 'Links or unlinks products on a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Links products (from List Products) to one contact, or unlinks them when Associate is No.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ productIds: Property.Array({
+ displayName: 'Product IDs',
+ description: 'Product IDs to link or unlink.',
+ required: true,
+ }),
+ associate: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Associate',
+ description: 'Yes links the products, No unlinks them.',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, productIds, associate, departmentId } = context.propsValue;
+ return await zohoDeskApi.associateContactProducts({
+ auth: context.auth,
+ orgId,
+ contactId,
+ productIds: zohoDeskUtils.requiredStringList({ value: productIds, propName: 'Product IDs' }),
+ associate,
+ departmentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/count-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/count-contacts.ts
new file mode 100644
index 00000000000..cb7ed277187
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/count-contacts.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_contacts',
+ outputSchema: zohoDeskCountAccountsOutputSchema,
+ displayName: 'Count Contacts',
+ description: 'Counts the contacts in a view.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Returns the number of contacts in one contact view (from List Views, module contacts), optionally only names starting with a letter.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Contact view ID (from List Views, module contacts).',
+ required: true,
+ }),
+ startsWith: Property.ShortText({
+ displayName: 'Starts With',
+ description: 'Only contacts whose name starts with this letter.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, viewId, startsWith } = context.propsValue;
+ return await zohoDeskApi.countContacts({ auth: context.auth, orgId, viewId, startsWith });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/create-contact-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/create-contact-comment.ts
new file mode 100644
index 00000000000..d9ede2ae469
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/create-contact-comment.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateAccountCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateContactCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_contact_comment',
+ outputSchema: zohoDeskCreateAccountCommentOutputSchema,
+ displayName: 'Create Contact Comment',
+ description: 'Adds a comment to a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an internal comment to one contact. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Comment text. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.createContactComment({
+ auth: context.auth,
+ orgId,
+ contactId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/create-contact.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/create-contact.ts
new file mode 100644
index 00000000000..3498cb995a4
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/create-contact.ts
@@ -0,0 +1,150 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateContactOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateContactAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_contact',
+ outputSchema: zohoDeskCreateContactOutputSchema,
+ displayName: 'Create Contact',
+ description: 'Creates a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a contact; Last Name is required. Search Contacts first to avoid duplicates: this always creates a new contact.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ lastName: Property.ShortText({
+ displayName: 'Last Name',
+ description: 'Last name.',
+ required: true,
+ }),
+ firstName: Property.ShortText({
+ displayName: 'First Name',
+ description: 'First name.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Primary email.',
+ required: false,
+ }),
+ secondaryEmail: Property.ShortText({
+ displayName: 'Secondary Email',
+ description: 'Secondary email.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Phone number.',
+ required: false,
+ }),
+ mobile: Property.ShortText({
+ displayName: 'Mobile',
+ description: 'Mobile number.',
+ required: false,
+ }),
+ accountId: zohoDeskAiProps.accountId({
+ required: false,
+ description: 'Account the contact belongs to (from Search Accounts).',
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the contact (from List Agents).',
+ required: false,
+ }),
+ title: Property.ShortText({ displayName: 'Title', description: 'Job title.', required: false }),
+ type: Property.ShortText({
+ displayName: 'Type',
+ description: 'Contact type.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes about the contact.',
+ required: false,
+ }),
+ street: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address.',
+ required: false,
+ }),
+ city: Property.ShortText({ displayName: 'City', description: 'City.', required: false }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region.',
+ required: false,
+ }),
+ zip: Property.ShortText({ displayName: 'Zip', description: 'Postal code.', required: false }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country.',
+ required: false,
+ }),
+ language: Property.ShortText({
+ displayName: 'Language',
+ description: 'Preferred language, e.g. "English".',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module contacts).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createContact({
+ auth: context.auth,
+ orgId,
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contact-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contact-attachment.ts
new file mode 100644
index 00000000000..e4033552038
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contact-attachment.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteContactAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteContactAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_contact_attachment',
+ outputSchema: zohoDeskDeleteContactAttachmentOutputSchema,
+ displayName: 'Delete Contact Attachment',
+ description: 'Deletes a file attached to a contact.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes one file attached to a contact.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Contact Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, attachmentId } = context.propsValue;
+ await zohoDeskApi.deleteContactAttachment({
+ auth: context.auth,
+ orgId,
+ contactId,
+ attachmentId,
+ });
+ return { success: true, contactId, attachmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contact-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contact-comment.ts
new file mode 100644
index 00000000000..05463f0e1ee
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contact-comment.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteContactCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteContactCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_contact_comment',
+ outputSchema: zohoDeskDeleteContactCommentOutputSchema,
+ displayName: 'Delete Contact Comment',
+ description: 'Deletes a comment from a contact.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: { description: 'Permanently deletes one comment from a contact.', idempotent: false },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Contact Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, commentId } = context.propsValue;
+ await zohoDeskApi.deleteContactComment({ auth: context.auth, orgId, contactId, commentId });
+ return { success: true, contactId, commentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contacts.ts
new file mode 100644
index 00000000000..e8b0ee380d4
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-contacts.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskDeleteContactsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_contacts',
+ outputSchema: zohoDeskDeleteContactsOutputSchema,
+ displayName: 'Delete Contacts',
+ description: 'Moves contacts to the recycle bin.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Moves one or more contacts to the recycle bin, where an admin can restore them. Needs the Desk.contacts.DELETE scope.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactIds: Property.Array({
+ displayName: 'Contact IDs',
+ description: 'Contact IDs to delete.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactIds } = context.propsValue;
+ await zohoDeskApi.deleteContacts({
+ auth: context.auth,
+ orgId,
+ contactIds: zohoDeskUtils.requiredStringList({ value: contactIds, propName: 'Contact IDs' }),
+ });
+ return { success: true, contactIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-spam-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-spam-contacts.ts
new file mode 100644
index 00000000000..26c053ded5f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/delete-spam-contacts.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteSpamContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_spam_contacts',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Delete Spam Contacts',
+ description: 'Permanently deletes contacts that are marked as spam.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes contacts that are already marked as spam (see Mark Contacts Spam). This cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactIds: Property.Array({
+ displayName: 'Contact IDs',
+ description: 'IDs of spam contacts to delete.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactIds } = context.propsValue;
+ return await zohoDeskApi.deleteSpamContacts({
+ auth: context.auth,
+ orgId,
+ contactIds: zohoDeskUtils.requiredStringList({ value: contactIds, propName: 'Contact IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/dissociate-contact-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/dissociate-contact-accounts.ts
new file mode 100644
index 00000000000..e30f3fb5479
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/dissociate-contact-accounts.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDissociateContactAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_dissociate_contact_accounts',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Dissociate Contact Accounts',
+ description: 'Unlinks accounts from a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Unlinks one or more accounts from one contact.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ accountIds: Property.Array({
+ displayName: 'Account IDs',
+ description: 'Account IDs to unlink.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, accountIds } = context.propsValue;
+ return await zohoDeskApi.dissociateContactAccounts({
+ auth: context.auth,
+ orgId,
+ contactId,
+ accountIds: zohoDeskUtils.requiredStringList({ value: accountIds, propName: 'Account IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact-comment.ts
new file mode 100644
index 00000000000..56764094504
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact-comment.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateAccountCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetContactCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_contact_comment',
+ outputSchema: zohoDeskCreateAccountCommentOutputSchema,
+ displayName: 'Get Contact Comment',
+ description: 'Gets one comment on a contact.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one comment on a contact, with its author and content.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Contact Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, commentId } = context.propsValue;
+ return await zohoDeskApi.getContactComment({ auth: context.auth, orgId, contactId, commentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact-statistics.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact-statistics.ts
new file mode 100644
index 00000000000..691b010af76
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact-statistics.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountStatisticsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetContactStatisticsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_contact_statistics',
+ outputSchema: zohoDeskGetAccountStatisticsOutputSchema,
+ displayName: 'Get Contact Statistics',
+ description: 'Gets ticket statistics for a contact.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets one contact's ticket statistics: open, closed and overdue counts, and response and satisfaction figures.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, departmentId } = context.propsValue;
+ return await zohoDeskApi.getContactStatistics({
+ auth: context.auth,
+ orgId,
+ contactId,
+ departmentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact.ts
new file mode 100644
index 00000000000..0d9169b2104
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contact.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateContactOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetContactAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_contact',
+ outputSchema: zohoDeskCreateContactOutputSchema,
+ displayName: 'Get Contact',
+ description: 'Gets a contact by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one contact by ID with all fields, including account, owner and custom fields (`cf`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, contactId } = context.propsValue;
+ return await zohoDeskApi.getContact({ auth: context.auth, orgId, contactId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contacts-by-ids.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contacts-by-ids.ts
new file mode 100644
index 00000000000..ae1358274e5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/get-contacts-by-ids.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskGetContactsByIdsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetContactsByIdsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_contacts_by_ids',
+ outputSchema: zohoDeskGetContactsByIdsOutputSchema,
+ displayName: 'Get Contacts By IDs',
+ description: 'Gets several contacts by ID in one call.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets several contacts by ID in one call, in the same shape as Get Contact.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactIds: Property.Array({
+ displayName: 'Contact IDs',
+ description: 'Contact IDs to fetch.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactIds } = context.propsValue;
+ const contacts = await zohoDeskApi.getContactsByIds({
+ auth: context.auth,
+ orgId,
+ contactIds: zohoDeskUtils.requiredStringList({ value: contactIds, propName: 'Contact IDs' }),
+ });
+ return { contacts, count: contacts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/invite-contact-to-help-center.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/invite-contact-to-help-center.ts
new file mode 100644
index 00000000000..ba1f5a4b769
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/invite-contact-to-help-center.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskInviteContactToHelpCenterOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskInviteContactToHelpCenterAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_invite_contact_to_help_center',
+ outputSchema: zohoDeskInviteContactToHelpCenterOutputSchema,
+ displayName: 'Invite Contact To Help Center',
+ description: 'Invites one contact to a help center.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Emails a help-center invitation to one contact. Not idempotent: each call sends the invitation again.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, helpCenterId } = context.propsValue;
+ await zohoDeskApi.inviteContactToHelpCenter({
+ auth: context.auth,
+ orgId,
+ contactId,
+ helpCenterId,
+ });
+ return { success: true, contactId, helpCenterId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-accounts.ts
new file mode 100644
index 00000000000..5f47ccbef23
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-accounts.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListContactAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_accounts',
+ outputSchema: zohoDeskListContactAccountsOutputSchema,
+ displayName: 'List Contact Accounts',
+ description: 'Lists the accounts a contact belongs to.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the accounts linked to one contact.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'accountName', value: 'accountName' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'mappingType', value: 'mappingType' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, sortBy, from, limit } = context.propsValue;
+ const accounts = await zohoDeskApi.listContactAccounts({
+ auth: context.auth,
+ orgId,
+ contactId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { accounts, count: accounts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-attachments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-attachments.ts
new file mode 100644
index 00000000000..afbf3838427
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-attachments.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountAttachmentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactAttachmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_attachments',
+ outputSchema: zohoDeskListAccountAttachmentsOutputSchema,
+ displayName: 'List Contact Attachments',
+ description: 'Lists the files attached to a contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the files attached to one contact, with name, size and download link (`href`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, from, limit } = context.propsValue;
+ const attachments = await zohoDeskApi.listContactAttachments({
+ auth: context.auth,
+ orgId,
+ contactId,
+ from,
+ limit,
+ });
+ return { attachments, count: attachments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-comments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-comments.ts
new file mode 100644
index 00000000000..ac19686736f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-comments.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountCommentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactCommentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_comments',
+ outputSchema: zohoDeskListAccountCommentsOutputSchema,
+ displayName: 'List Contact Comments',
+ description: 'Lists the comments on a contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the comments on one contact (internal notes).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, from, limit } = context.propsValue;
+ const comments = await zohoDeskApi.listContactComments({
+ auth: context.auth,
+ orgId,
+ contactId,
+ from,
+ limit,
+ });
+ return { comments, count: comments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-followers.ts
new file mode 100644
index 00000000000..fb927a1e4ca
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-followers.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_followers',
+ outputSchema: zohoDeskListAccountFollowersOutputSchema,
+ displayName: 'List Contact Followers',
+ description: 'Lists the agents following a contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the agents following one contact.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, from, limit } = context.propsValue;
+ const followers = await zohoDeskApi.listContactFollowers({
+ auth: context.auth,
+ orgId,
+ contactId,
+ from,
+ limit,
+ });
+ return { followers, count: followers.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-help-centers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-help-centers.ts
new file mode 100644
index 00000000000..361cd8310d5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-help-centers.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListContactHelpCentersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactHelpCentersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_help_centers',
+ outputSchema: zohoDeskListContactHelpCentersOutputSchema,
+ displayName: 'List Contact Help Centers',
+ description: "Lists a contact's status in each help center.",
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists one contact's membership status in each help center (invited, active, pending approval), with the help center IDs.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Only this help center.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, helpCenterId } = context.propsValue;
+ const helpCenters = await zohoDeskApi.listContactHelpCenters({
+ auth: context.auth,
+ orgId,
+ contactId,
+ helpCenterId,
+ });
+ return { helpCenters, count: helpCenters.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-history.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-history.ts
new file mode 100644
index 00000000000..c9a5a986335
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-history.ts
@@ -0,0 +1,46 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountHistoryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactHistoryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_history',
+ outputSchema: zohoDeskListAccountHistoryOutputSchema,
+ displayName: 'List Contact History',
+ description: 'Lists the activity history of a contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the activity history of one contact (tickets, replies, field changes), optionally only by one agent or in one department.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ agentId: zohoDeskAiProps.agentId({ required: false }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, agentId, departmentId, from, limit } = context.propsValue;
+ const history = await zohoDeskApi.listContactHistory({
+ auth: context.auth,
+ orgId,
+ contactId,
+ agentId,
+ departmentId,
+ from,
+ limit,
+ });
+ return { history, count: history.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-products.ts
new file mode 100644
index 00000000000..f2b3c0b05ab
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-products.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_products',
+ outputSchema: zohoDeskListAccountProductsOutputSchema,
+ displayName: 'List Contact Products',
+ description: 'Lists the products linked to a contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the products linked to one contact.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, departmentId, from, limit } = context.propsValue;
+ const products = await zohoDeskApi.listContactProducts({
+ auth: context.auth,
+ orgId,
+ contactId,
+ departmentId,
+ from,
+ limit,
+ });
+ return { products, count: products.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-profiles.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-profiles.ts
new file mode 100644
index 00000000000..35ee8c5605d
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-profiles.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListContactProfilesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactProfilesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_profiles',
+ outputSchema: zohoDeskListContactProfilesOutputSchema,
+ displayName: 'List Contact Profiles',
+ description: 'Lists the social and channel profiles of a contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the channel profiles (email, social, chat) linked to one contact.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, contactId } = context.propsValue;
+ const profiles = await zohoDeskApi.listContactProfiles({
+ auth: context.auth,
+ orgId,
+ contactId,
+ });
+ return { profiles, count: profiles.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-tickets.ts
new file mode 100644
index 00000000000..167358d4451
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contact-tickets.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListContactTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_tickets',
+ outputSchema: zohoDeskListContactTicketsOutputSchema,
+ displayName: 'List Contact Tickets',
+ description: 'Lists the tickets raised by a contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the tickets raised by one contact, optionally only in one department.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, departmentId, sortBy, from, limit } = context.propsValue;
+ const tickets = await zohoDeskApi.listContactTickets({
+ auth: context.auth,
+ orgId,
+ contactId,
+ departmentId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { tickets, count: tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contacts.ts
new file mode 100644
index 00000000000..e5557e5ea79
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/list-contacts.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetContactsByIdsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contacts',
+ outputSchema: zohoDeskGetContactsByIdsOutputSchema,
+ displayName: 'List Contacts',
+ description: 'Lists contacts.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists contacts in an organization, optionally from a view. Use Search Contacts to find contacts by name, email or phone. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Contact view ID (from List Views, module contacts).',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'firstName', value: 'firstName' },
+ { label: 'lastName', value: 'lastName' },
+ { label: 'email', value: 'email' },
+ { label: 'phone', value: 'phone' },
+ { label: 'account', value: 'account' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, viewId, sortBy, from, limit } = context.propsValue;
+ const contacts = await zohoDeskApi.listContacts({
+ auth: context.auth,
+ orgId,
+ viewId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { contacts, count: contacts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/mark-contacts-spam.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/mark-contacts-spam.ts
new file mode 100644
index 00000000000..861ae332579
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/mark-contacts-spam.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMarkContactsSpamAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_mark_contacts_spam',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Mark Contacts Spam',
+ description: 'Marks contacts as spam or not spam.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Marks one or more contacts as spam (Is Spam = Yes) or clears the mark (No), optionally doing the same to their existing tickets.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactIds: Property.Array({
+ displayName: 'Contact IDs',
+ description: 'Contact IDs to mark.',
+ required: true,
+ }),
+ isSpam: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Is Spam',
+ description: 'Yes marks the contacts as spam, No removes the mark.',
+ }),
+ handleExistingTickets: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Include Their Tickets',
+ description: "Yes also marks the contacts' existing tickets.",
+ }),
+ },
+ async run(context) {
+ const { orgId, contactIds, isSpam, handleExistingTickets } = context.propsValue;
+ return await zohoDeskApi.markContactsSpam({
+ auth: context.auth,
+ orgId,
+ contactIds: zohoDeskUtils.requiredStringList({ value: contactIds, propName: 'Contact IDs' }),
+ isSpam,
+ handleExistingTickets,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/merge-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/merge-contacts.ts
new file mode 100644
index 00000000000..911b1486c65
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/merge-contacts.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskMergeContactsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMergeContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_merge_contacts',
+ outputSchema: zohoDeskMergeContactsOutputSchema,
+ displayName: 'Merge Contacts',
+ description: 'Merges other contacts into one contact.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Merges the listed contacts into the target contact, moving their tickets to it; the merged contacts are removed. This cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: Property.ShortText({
+ displayName: 'Target Contact ID',
+ description: 'ID of the contact the others are merged into.',
+ required: true,
+ }),
+ contactIds: Property.Array({
+ displayName: 'Contact IDs',
+ description: 'IDs of the contacts to merge into the target contact.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, contactIds } = context.propsValue;
+ return await zohoDeskApi.mergeContacts({
+ auth: context.auth,
+ orgId,
+ contactId,
+ contactIds: zohoDeskUtils.requiredStringList({ value: contactIds, propName: 'Contact IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/reject-contact-help-center-access.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/reject-contact-help-center-access.ts
new file mode 100644
index 00000000000..f569a4584d0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/reject-contact-help-center-access.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskRejectContactHelpCenterAccessAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_reject_contact_help_center_access',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Reject Contact Help Center Access',
+ description: "Rejects a contact's pending help-center signup.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: "Rejects one contact's pending signup to the given help centers.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ helpCenterIds: Property.Array({
+ displayName: 'Help Center IDs',
+ description: 'Help center IDs to reject the contact for.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, helpCenterIds } = context.propsValue;
+ return await zohoDeskApi.rejectContactHelpCenterAccess({
+ auth: context.auth,
+ orgId,
+ contactId,
+ helpCenterIds: zohoDeskUtils.requiredStringList({
+ value: helpCenterIds,
+ propName: 'Help Center IDs',
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/remove-contact-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/remove-contact-followers.ts
new file mode 100644
index 00000000000..5f09c9ec798
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/remove-contact-followers.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAddContactFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskRemoveContactFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_remove_contact_followers',
+ outputSchema: zohoDeskAddContactFollowersOutputSchema,
+ displayName: 'Remove Contact Followers',
+ description: 'Removes followers from a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Removes agents from the followers of one contact.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ followerIds: Property.Array({
+ displayName: 'Agent IDs',
+ description: 'Agent IDs to remove.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, followerIds } = context.propsValue;
+ await zohoDeskApi.removeContactFollowers({
+ auth: context.auth,
+ orgId,
+ contactId,
+ followerIds: zohoDeskUtils.requiredStringList({ value: followerIds, propName: 'Agent IDs' }),
+ });
+ return { success: true, contactId, followerIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/search-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/search-contacts.ts
new file mode 100644
index 00000000000..d23041af56e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/search-contacts.ts
@@ -0,0 +1,131 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchContactsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_contacts',
+ outputSchema: zohoDeskSearchContactsOutputSchema,
+ displayName: 'Search Contacts',
+ description: 'Searches contacts by text, name, email, phone or account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches contacts by free text (supports a trailing * wildcard), name, email, phone, mobile, account name or time range. Use it to resolve an email address to a Contact ID before creating a ticket. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched across contact fields; end with * for a prefix match.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Exact email address.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Phone number.',
+ required: false,
+ }),
+ mobile: Property.ShortText({
+ displayName: 'Mobile',
+ description: 'Mobile number.',
+ required: false,
+ }),
+ firstName: Property.ShortText({
+ displayName: 'First Name',
+ description: 'First name.',
+ required: false,
+ }),
+ lastName: Property.ShortText({
+ displayName: 'Last Name',
+ description: 'Last name.',
+ required: false,
+ }),
+ fullName: Property.ShortText({
+ displayName: 'Full Name',
+ description: 'Full name.',
+ required: false,
+ }),
+ accountName: Property.ShortText({
+ displayName: 'Account Name',
+ description: "Name of the contact's account.",
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Sort order.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'relevance', value: 'relevance' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ email,
+ phone,
+ mobile,
+ firstName,
+ lastName,
+ fullName,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+ } = context.propsValue;
+ const contacts = await zohoDeskApi.searchContactsByFilter({
+ auth: context.auth,
+ orgId,
+ searchText,
+ email,
+ phone,
+ mobile,
+ firstName,
+ lastName,
+ fullName,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+ });
+ return { contacts, count: contacts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-contact-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-contact-comment.ts
new file mode 100644
index 00000000000..a4b80ad2c51
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-contact-comment.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateAccountCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateContactCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_contact_comment',
+ outputSchema: zohoDeskCreateAccountCommentOutputSchema,
+ displayName: 'Update Contact Comment',
+ description: 'Edits a comment on a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Replaces the text of one comment on a contact.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Contact Comments).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'New comment text.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, commentId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.updateContactComment({
+ auth: context.auth,
+ orgId,
+ contactId,
+ commentId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-contact.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-contact.ts
new file mode 100644
index 00000000000..307d2b222a1
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-contact.ts
@@ -0,0 +1,153 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskMergeContactsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateContactAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_contact',
+ outputSchema: zohoDeskMergeContactsOutputSchema,
+ displayName: 'Update Contact',
+ description: 'Updates fields on a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one contact; fields left empty are not changed.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ lastName: Property.ShortText({
+ displayName: 'Last Name',
+ description: 'Last name.',
+ required: false,
+ }),
+ firstName: Property.ShortText({
+ displayName: 'First Name',
+ description: 'First name.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Primary email.',
+ required: false,
+ }),
+ secondaryEmail: Property.ShortText({
+ displayName: 'Secondary Email',
+ description: 'Secondary email.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Phone number.',
+ required: false,
+ }),
+ mobile: Property.ShortText({
+ displayName: 'Mobile',
+ description: 'Mobile number.',
+ required: false,
+ }),
+ accountId: zohoDeskAiProps.accountId({
+ required: false,
+ description: 'Account the contact belongs to (from Search Accounts).',
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the contact (from List Agents).',
+ required: false,
+ }),
+ title: Property.ShortText({ displayName: 'Title', description: 'Job title.', required: false }),
+ type: Property.ShortText({
+ displayName: 'Type',
+ description: 'Contact type.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Notes about the contact.',
+ required: false,
+ }),
+ street: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address.',
+ required: false,
+ }),
+ city: Property.ShortText({ displayName: 'City', description: 'City.', required: false }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region.',
+ required: false,
+ }),
+ zip: Property.ShortText({ displayName: 'Zip', description: 'Postal code.', required: false }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country.',
+ required: false,
+ }),
+ language: Property.ShortText({
+ displayName: 'Language',
+ description: 'Preferred language, e.g. "English".',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module contacts).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ contactId,
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateContact({
+ auth: context.auth,
+ orgId,
+ contactId,
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-many-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-many-contacts.ts
new file mode 100644
index 00000000000..342577557af
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/update-many-contacts.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateManyContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_many_contacts',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Update Many Contacts',
+ description: 'Sets one field to the same value on several contacts.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Sets one field (by API name) to the same value on several contacts at once.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactIds: Property.Array({
+ displayName: 'Contact IDs',
+ description: 'Contact IDs to update.',
+ required: true,
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'API name of the field to set (from List Fields, module contacts).',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Field Value',
+ description: 'Value to set. Leave empty to clear the field.',
+ required: false,
+ }),
+ isCustomField: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Custom Field',
+ description: 'Yes when Field Name is a custom field.',
+ }),
+ },
+ async run(context) {
+ const { orgId, contactIds, fieldName, fieldValue, isCustomField } = context.propsValue;
+ return await zohoDeskApi.updateManyContacts({
+ auth: context.auth,
+ orgId,
+ contactIds: zohoDeskUtils.requiredStringList({ value: contactIds, propName: 'Contact IDs' }),
+ fieldName,
+ fieldValue,
+ isCustomField,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/upload-contact-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/upload-contact-attachment.ts
new file mode 100644
index 00000000000..07a20cc693a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contacts/upload-contact-attachment.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUploadAccountAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUploadContactAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_upload_contact_attachment',
+ outputSchema: zohoDeskUploadAccountAttachmentOutputSchema,
+ displayName: 'Upload Contact Attachment',
+ description: 'Attaches a file to a contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to one contact. Not idempotent: each call adds another copy.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ file: Property.File({ displayName: 'File', description: 'File to attach.', required: true }),
+ },
+ async run(context) {
+ const { orgId, contactId, file } = context.propsValue;
+ return await zohoDeskApi.uploadContactAttachment({
+ auth: context.auth,
+ orgId,
+ contactId,
+ file,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/count-contracts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/count-contracts.ts
new file mode 100644
index 00000000000..dece2d0e21d
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/count-contracts.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountContractsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_contracts',
+ outputSchema: zohoDeskCountAccountsOutputSchema,
+ displayName: 'Count Contracts',
+ description: 'Counts the contracts in a view.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Returns the number of contracts in one contract view and department.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Contract view ID (from List Views, module contracts).',
+ required: true,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Only contracts owned by this agent.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, viewId, departmentId, ownerId } = context.propsValue;
+ return await zohoDeskApi.countContracts({
+ auth: context.auth,
+ orgId,
+ viewId,
+ departmentId,
+ ownerId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/create-contract-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/create-contract-comment.ts
new file mode 100644
index 00000000000..4fa8b4af096
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/create-contract-comment.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateContractCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_contract_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Create Contract Comment',
+ description: 'Adds a comment to a contract.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an internal comment to one contract. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Comment text. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, contractId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.createContractComment({
+ auth: context.auth,
+ orgId,
+ contractId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/create-contract.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/create-contract.ts
new file mode 100644
index 00000000000..e0d7d4cb4dd
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/create-contract.ts
@@ -0,0 +1,109 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateContractOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateContractAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_contract',
+ outputSchema: zohoDeskCreateContractOutputSchema,
+ displayName: 'Create Contract',
+ description: 'Creates a support contract for an account.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a support contract for an account, with a support plan, owner, department and start date. Not idempotent: each call creates a new contract.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractName: Property.ShortText({
+ displayName: 'Contract Name',
+ description: 'Contract name.',
+ required: true,
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the contract (from List Agents).',
+ required: true,
+ }),
+ associatedSupportPlanId: Property.ShortText({
+ displayName: 'Support Plan ID',
+ description: 'Support plan the contract covers (from List Support Plans).',
+ required: true,
+ }),
+ startDate: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'Start date, YYYY-MM-DD.',
+ required: true,
+ }),
+ endDate: Property.ShortText({
+ displayName: 'End Date',
+ description: 'End date, YYYY-MM-DD.',
+ required: false,
+ }),
+ associatedSLAId: Property.ShortText({
+ displayName: 'SLA ID',
+ description: 'SLA policy for the contract (from List Account SLAs).',
+ required: false,
+ }),
+ productId: zohoDeskAiProps.productId({ required: false }),
+ contractNumber: Property.ShortText({
+ displayName: 'Contract Number',
+ description: 'Your contract number.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Contract notes.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module contracts).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createContract({
+ auth: context.auth,
+ orgId,
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/delete-contract-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/delete-contract-comment.ts
new file mode 100644
index 00000000000..fb0e48aa216
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/delete-contract-comment.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteContractCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteContractCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_contract_comment',
+ outputSchema: zohoDeskDeleteContractCommentOutputSchema,
+ displayName: 'Delete Contract Comment',
+ description: 'Deletes a comment from a contract.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes one comment from a contract.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Contract Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contractId, commentId } = context.propsValue;
+ await zohoDeskApi.deleteContractComment({ auth: context.auth, orgId, contractId, commentId });
+ return { success: true, contractId, commentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/download-contract-comment-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/download-contract-comment-attachment.ts
new file mode 100644
index 00000000000..1529d00f83a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/download-contract-comment-attachment.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDownloadContractCommentAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDownloadContractCommentAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_download_contract_comment_attachment',
+ outputSchema: zohoDeskDownloadContractCommentAttachmentOutputSchema,
+ displayName: 'Download Contract Comment Attachment',
+ description: 'Downloads a file attached to a contract comment.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Downloads one file attached to a contract comment and returns it as a file. Attachment IDs come from Get Contract Comment.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Contract Comments).',
+ required: true,
+ }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from Get Contract Comment).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contractId, commentId, attachmentId } = context.propsValue;
+ const file = await zohoDeskApi.downloadContractCommentAttachment({
+ auth: context.auth,
+ orgId,
+ contractId,
+ commentId,
+ attachmentId,
+ });
+ const fileName = file.fileName ?? attachmentId;
+ return { fileName, file: await context.files.write({ fileName, data: file.data }) };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/get-contract-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/get-contract-comment.ts
new file mode 100644
index 00000000000..f5720b6b766
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/get-contract-comment.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetContractCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_contract_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Get Contract Comment',
+ description: 'Gets one comment on a contract.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one comment on a contract, with its author and content.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Contract Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contractId, commentId } = context.propsValue;
+ return await zohoDeskApi.getContractComment({
+ auth: context.auth,
+ orgId,
+ contractId,
+ commentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/get-contract.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/get-contract.ts
new file mode 100644
index 00000000000..1f07d0706ac
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/get-contract.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateContractOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetContractAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_contract',
+ outputSchema: zohoDeskCreateContractOutputSchema,
+ displayName: 'Get Contract',
+ description: 'Gets a support contract by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one support contract by ID with its account, SLA, support plan, dates and status.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, contractId } = context.propsValue;
+ return await zohoDeskApi.getContract({ auth: context.auth, orgId, contractId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-contract-comments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-contract-comments.ts
new file mode 100644
index 00000000000..6cfcd9e86f7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-contract-comments.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListCallCommentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContractCommentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contract_comments',
+ outputSchema: zohoDeskListCallCommentsOutputSchema,
+ displayName: 'List Contract Comments',
+ description: 'Lists the comments on a contract.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the comments on one contract (agent notes).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contractId, from, limit } = context.propsValue;
+ const comments = await zohoDeskApi.listContractComments({
+ auth: context.auth,
+ orgId,
+ contractId,
+ from,
+ limit,
+ });
+ return { comments, count: comments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-contracts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-contracts.ts
new file mode 100644
index 00000000000..d656a80b71c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-contracts.ts
@@ -0,0 +1,88 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListContractsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContractsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contracts',
+ outputSchema: zohoDeskListContractsOutputSchema,
+ displayName: 'List Contracts',
+ description: 'Lists support contracts.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists support contracts, optionally for one account, by name, owner or department. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: false }),
+ contractName: Property.ShortText({
+ displayName: 'Contract Name',
+ description: 'Only contracts with this name.',
+ required: false,
+ }),
+ departmentIds: Property.Array({
+ displayName: 'Department IDs',
+ description: 'Only contracts in these departments.',
+ required: false,
+ }),
+ ownerIds: Property.Array({
+ displayName: 'Owner IDs',
+ description: 'Only contracts owned by these agents.',
+ required: false,
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Contract view ID (from List Views, module contracts).',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'contractName', value: 'contractName' },
+ { label: 'accountName', value: 'accountName' },
+ { label: 'contractStartDate', value: 'contractStartDate' },
+ { label: 'contractEndDate', value: 'contractEndDate' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, contractName, departmentIds, ownerIds, viewId, sortBy, from, limit } =
+ context.propsValue;
+ const contracts = await zohoDeskApi.listContracts({
+ auth: context.auth,
+ orgId,
+ accountId,
+ contractName,
+ departmentIds: zohoDeskUtils.optionalStringList({
+ value: departmentIds,
+ propName: 'Department IDs',
+ }),
+ ownerIds: zohoDeskUtils.optionalStringList({ value: ownerIds, propName: 'Owner IDs' }),
+ viewId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { contracts, count: contracts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-support-plans.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-support-plans.ts
new file mode 100644
index 00000000000..c31a8fe7149
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/list-support-plans.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListSupportPlansOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListSupportPlansAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_support_plans',
+ outputSchema: zohoDeskListSupportPlansOutputSchema,
+ displayName: 'List Support Plans',
+ description: 'Lists the support plans of a department.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the support plans of one department with their IDs, names and linked SLAs. Use it to get the support plan ID that Create Contract needs.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only plans in this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'DISCONTINUED', value: 'DISCONTINUED' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, status, from, limit } = context.propsValue;
+ const supportPlans = await zohoDeskApi.listSupportPlans({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ status,
+ from,
+ limit,
+ });
+ return { supportPlans, count: supportPlans.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-contract-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-contract-comment.ts
new file mode 100644
index 00000000000..34dde137e1c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-contract-comment.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUpdateContractCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateContractCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_contract_comment',
+ outputSchema: zohoDeskUpdateContractCommentOutputSchema,
+ displayName: 'Update Contract Comment',
+ description: 'Edits a comment on a contract.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Replaces the text of one comment on a contract.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Contract Comments).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'New comment text.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, contractId, commentId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.updateContractComment({
+ auth: context.auth,
+ orgId,
+ contractId,
+ commentId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-contract.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-contract.ts
new file mode 100644
index 00000000000..adb8e4818dc
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-contract.ts
@@ -0,0 +1,116 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUpdateContractOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateContractAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_contract',
+ outputSchema: zohoDeskUpdateContractOutputSchema,
+ displayName: 'Update Contract',
+ description: 'Updates fields on a support contract.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one contract; fields left empty are not changed.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractId: Property.ShortText({
+ displayName: 'Contract ID',
+ description: 'Contract ID (from List Contracts or List Account Contracts).',
+ required: true,
+ }),
+ contractName: Property.ShortText({
+ displayName: 'Contract Name',
+ description: 'Contract name.',
+ required: false,
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: false }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the contract (from List Agents).',
+ required: false,
+ }),
+ associatedSupportPlanId: Property.ShortText({
+ displayName: 'Support Plan ID',
+ description: 'Support plan the contract covers (from List Support Plans).',
+ required: false,
+ }),
+ startDate: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'Start date, YYYY-MM-DD.',
+ required: false,
+ }),
+ endDate: Property.ShortText({
+ displayName: 'End Date',
+ description: 'End date, YYYY-MM-DD.',
+ required: false,
+ }),
+ associatedSLAId: Property.ShortText({
+ displayName: 'SLA ID',
+ description: 'SLA policy for the contract (from List Account SLAs).',
+ required: false,
+ }),
+ productId: zohoDeskAiProps.productId({ required: false }),
+ contractNumber: Property.ShortText({
+ displayName: 'Contract Number',
+ description: 'Your contract number.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Contract notes.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module contracts).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ contractId,
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateContract({
+ auth: context.auth,
+ orgId,
+ contractId,
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-many-contracts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-many-contracts.ts
new file mode 100644
index 00000000000..e1a097c4eff
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/contracts/update-many-contracts.ts
@@ -0,0 +1,62 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateManyContractsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_many_contracts',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Update Many Contracts',
+ description: 'Sets one field to the same value on several contracts.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Sets one field (by API name) to the same value on several contracts at once.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contractIds: Property.Array({
+ displayName: 'Contract IDs',
+ description: 'Contract IDs to update.',
+ required: true,
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'API name of the field to set (from List Fields, module contracts).',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Field Value',
+ description: 'Value to set.',
+ required: true,
+ }),
+ isCustomField: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Is Custom Field',
+ description: 'Yes when Field Name is a custom field; No for a standard field.',
+ }),
+ },
+ async run(context) {
+ const { orgId, contractIds, fieldName, fieldValue, isCustomField } = context.propsValue;
+ return await zohoDeskApi.updateManyContracts({
+ auth: context.auth,
+ orgId,
+ contractIds: zohoDeskUtils.requiredStringList({
+ value: contractIds,
+ propName: 'Contract IDs',
+ }),
+ fieldName,
+ fieldValue,
+ isCustomField,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/add-user-badges.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/add-user-badges.ts
new file mode 100644
index 00000000000..ffff0ebfced
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/add-user-badges.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+
+export const zohoDeskAddUserBadgesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_user_badges',
+ displayName: 'Add User Badges',
+ description: 'Awards badges to a help-center user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Awards badges to one help-center user.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ badgeIds: Property.Array({
+ displayName: 'Badge IDs',
+ description: 'Badge IDs to award (from List Badges).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, badgeIds } = context.propsValue;
+ return await zohoDeskApi.addUserBadges({
+ auth: context.auth,
+ orgId,
+ userId,
+ badgeIds: zohoDeskUtils.requiredStringList({ value: badgeIds, propName: 'Badge IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/add-user-groups.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/add-user-groups.ts
new file mode 100644
index 00000000000..e282175c508
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/add-user-groups.ts
@@ -0,0 +1,51 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+
+export const zohoDeskAddUserGroupsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_user_groups',
+ displayName: 'Add User Groups',
+ description: 'Adds a help-center user to groups.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds one help-center user to groups; groups decide which help-center content they can see.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ groupIds: Property.Array({
+ displayName: 'Group IDs',
+ description: 'Group IDs to add the user to (from List Help Center Groups).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId, groupIds } = context.propsValue;
+ return await zohoDeskApi.addUserGroups({
+ auth: context.auth,
+ orgId,
+ userId,
+ helpCenterId,
+ groupIds: zohoDeskUtils.requiredStringList({ value: groupIds, propName: 'Group IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/assign-user-labels.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/assign-user-labels.ts
new file mode 100644
index 00000000000..b103ffbd479
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/assign-user-labels.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+
+export const zohoDeskAssignUserLabelsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_assign_user_labels',
+ displayName: 'Assign User Labels',
+ description: 'Assigns labels to a help-center user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Assigns labels to one help-center user; Primary Label ID, when set, must be one of Label IDs and becomes the label shown next to their name.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ labelIds: Property.Array({
+ displayName: 'Label IDs',
+ description: 'Label IDs to assign (from List Labels).',
+ required: true,
+ }),
+ primaryLabelId: Property.ShortText({
+ displayName: 'Primary Label ID',
+ description: "One of Label IDs to show as the user's primary label.",
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId, labelIds, primaryLabelId } = context.propsValue;
+ return await zohoDeskApi.assignUserLabels({
+ auth: context.auth,
+ orgId,
+ userId,
+ helpCenterId,
+ labelIds: zohoDeskUtils.requiredStringList({ value: labelIds, propName: 'Label IDs' }),
+ primaryLabelId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/get-user.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/get-user.ts
new file mode 100644
index 00000000000..8cdb8d4b535
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/get-user.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+
+export const zohoDeskGetUserAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_user',
+ displayName: 'Get User',
+ description: 'Gets a help-center user by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one help-center user with name, email, status, label and linked contact ID.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId } = context.propsValue;
+ return await zohoDeskApi.getUser({ auth: context.auth, orgId, userId, helpCenterId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-badges.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-badges.ts
new file mode 100644
index 00000000000..7716c54ce25
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-badges.ts
@@ -0,0 +1,53 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListBadgesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListBadgesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_badges',
+ outputSchema: zohoDeskListBadgesOutputSchema,
+ displayName: 'List Badges',
+ description: 'Lists the community badges defined in the organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists every community badge that can be awarded to help-center users, with its ID and name. Use it to get the badge IDs for Add User Badges.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'Only badges of this type.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'custom', value: 'custom' },
+ { label: 'default', value: 'default' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, type, from, limit } = context.propsValue;
+ const badges = await zohoDeskApi.listBadges({
+ auth: context.auth,
+ orgId,
+ type,
+ from,
+ limit,
+ });
+ return { badges, count: badges.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-help-center-groups.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-help-center-groups.ts
new file mode 100644
index 00000000000..26182a92688
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-help-center-groups.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListHelpCenterGroupsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListHelpCenterGroupsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_help_center_groups',
+ outputSchema: zohoDeskListHelpCenterGroupsOutputSchema,
+ displayName: 'List Help Center Groups',
+ description: 'Lists the user groups of a help center.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the help-center user groups with their IDs and names. Use it to get the group IDs for Add User Groups and Remove User Groups.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, helpCenterId, from, limit } = context.propsValue;
+ const groups = await zohoDeskApi.listGroups({
+ auth: context.auth,
+ orgId,
+ helpCenterId,
+ from,
+ limit,
+ });
+ return { groups, count: groups.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-help-centers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-help-centers.ts
new file mode 100644
index 00000000000..f5a44d4b458
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-help-centers.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListHelpCentersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListHelpCentersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_help_centers',
+ outputSchema: zohoDeskListHelpCentersOutputSchema,
+ displayName: 'List Help Centers',
+ description: 'Lists the help centers (customer portals) of the organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the help centers of the organization with their IDs, names and URLs. Use it to get the help center ID that user, group, label and invite actions take.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, from, limit } = context.propsValue;
+ const helpCenters = await zohoDeskApi.listHelpCenters({
+ auth: context.auth,
+ orgId,
+ from,
+ limit,
+ });
+ return { helpCenters, count: helpCenters.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-labels.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-labels.ts
new file mode 100644
index 00000000000..b46eb33fdf2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-labels.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListLabelsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListLabelsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_labels',
+ outputSchema: zohoDeskListLabelsOutputSchema,
+ displayName: 'List Labels',
+ description: 'Lists the help-center user labels.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the labels that can be put on help-center users, with their IDs and names, optionally filtered by name. Use it to get the label IDs for Assign User Labels and Remove User Labels.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ searchBy: Property.ShortText({
+ displayName: 'Search By',
+ description: 'Only labels with this exact name; end it with * to match a prefix (e.g. `vip*`).',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, helpCenterId, searchBy, from, limit } = context.propsValue;
+ const labels = await zohoDeskApi.listLabels({
+ auth: context.auth,
+ orgId,
+ helpCenterId,
+ searchBy,
+ from,
+ limit,
+ });
+ return { labels, count: labels.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-badges.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-badges.ts
new file mode 100644
index 00000000000..9fdbcaecae3
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-badges.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+
+export const zohoDeskListUserBadgesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_user_badges',
+ displayName: 'List User Badges',
+ description: 'Lists the badges a help-center user has earned.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the community badges one help-center user has, optionally only custom or default ones.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'Only badges of this type.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'custom', value: 'custom' },
+ { label: 'default', value: 'default' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, userId, type, from, limit } = context.propsValue;
+ const badges = await zohoDeskApi.listUserBadges({
+ auth: context.auth,
+ orgId,
+ userId,
+ type,
+ from,
+ limit,
+ });
+ return { badges, count: badges.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-groups.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-groups.ts
new file mode 100644
index 00000000000..7377b42fbee
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-groups.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+
+export const zohoDeskListUserGroupsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_user_groups',
+ displayName: 'List User Groups',
+ description: 'Lists the groups a help-center user belongs to.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the help-center groups one user belongs to.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId, from, limit } = context.propsValue;
+ const groups = await zohoDeskApi.listUserGroups({
+ auth: context.auth,
+ orgId,
+ userId,
+ helpCenterId,
+ from,
+ limit,
+ });
+ return { groups, count: groups.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-labels.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-labels.ts
new file mode 100644
index 00000000000..4959f8aa5b1
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-user-labels.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+
+export const zohoDeskListUserLabelsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_user_labels',
+ displayName: 'List User Labels',
+ description: 'Lists the labels on a help-center user.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the labels on one help-center user.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId, from, limit } = context.propsValue;
+ const labels = await zohoDeskApi.listUserLabels({
+ auth: context.auth,
+ orgId,
+ userId,
+ helpCenterId,
+ from,
+ limit,
+ });
+ return { labels, count: labels.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-users.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-users.ts
new file mode 100644
index 00000000000..5292b18fdde
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/list-users.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListUsersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListUsersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_users',
+ outputSchema: zohoDeskListUsersOutputSchema,
+ displayName: 'List Users',
+ description: 'Lists help-center users.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the end users of the help center (customer portal), optionally by status or a search term. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only users with this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'DISABLED', value: 'DISABLED' },
+ { label: 'DELETED', value: 'DELETED' },
+ { label: 'ALL', value: 'ALL' },
+ ],
+ },
+ }),
+ searchBy: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Text to match in user names or emails.',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, helpCenterId, status, searchBy, from, limit } = context.propsValue;
+ const users = await zohoDeskApi.listUsers({
+ auth: context.auth,
+ orgId,
+ helpCenterId,
+ status,
+ searchBy,
+ from,
+ limit,
+ });
+ return { users, count: users.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-badges.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-badges.ts
new file mode 100644
index 00000000000..3bfca842e49
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-badges.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+
+export const zohoDeskRemoveUserBadgesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_remove_user_badges',
+ displayName: 'Remove User Badges',
+ description: 'Removes badges from a help-center user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Removes badges from one help-center user.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ badgeIds: Property.Array({
+ displayName: 'Badge IDs',
+ description: 'Badge IDs to remove.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, badgeIds } = context.propsValue;
+ return await zohoDeskApi.removeUserBadges({
+ auth: context.auth,
+ orgId,
+ userId,
+ badgeIds: zohoDeskUtils.requiredStringList({ value: badgeIds, propName: 'Badge IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-groups.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-groups.ts
new file mode 100644
index 00000000000..2c4dbb31a8d
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-groups.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+
+export const zohoDeskRemoveUserGroupsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_remove_user_groups',
+ displayName: 'Remove User Groups',
+ description: 'Removes a help-center user from groups.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Removes one help-center user from groups.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ groupIds: Property.Array({
+ displayName: 'Group IDs',
+ description: 'Group IDs to remove the user from.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId, groupIds } = context.propsValue;
+ return await zohoDeskApi.removeUserGroups({
+ auth: context.auth,
+ orgId,
+ userId,
+ helpCenterId,
+ groupIds: zohoDeskUtils.requiredStringList({ value: groupIds, propName: 'Group IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-labels.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-labels.ts
new file mode 100644
index 00000000000..72e71bc9e0e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/remove-user-labels.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+
+export const zohoDeskRemoveUserLabelsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_remove_user_labels',
+ displayName: 'Remove User Labels',
+ description: 'Removes labels from a help-center user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Removes labels from one help-center user.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ labelIds: Property.Array({
+ displayName: 'Label IDs',
+ description: 'Label IDs to remove.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId, labelIds } = context.propsValue;
+ return await zohoDeskApi.removeUserLabels({
+ auth: context.auth,
+ orgId,
+ userId,
+ helpCenterId,
+ labelIds: zohoDeskUtils.requiredStringList({ value: labelIds, propName: 'Label IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/update-user.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/update-user.ts
new file mode 100644
index 00000000000..5ed79ee9dfd
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/help-center/update-user.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+
+export const zohoDeskUpdateUserAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_user',
+ displayName: 'Update User',
+ description: 'Activates or disables a help-center user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: "Sets one help-center user's status to Active or Disabled.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Help-center user ID (from List Users).',
+ required: true,
+ }),
+ helpCenterId: Property.ShortText({
+ displayName: 'Help Center ID',
+ description: 'Help center ID (from List Help Centers); needed when there is more than one.',
+ required: false,
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'New status.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'DISABLED', value: 'DISABLED' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, userId, helpCenterId, status } = context.propsValue;
+ return await zohoDeskApi.updateUser({
+ auth: context.auth,
+ orgId,
+ userId,
+ helpCenterId,
+ status,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/index.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/index.ts
new file mode 100644
index 00000000000..20b22758294
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/index.ts
@@ -0,0 +1,527 @@
+import { zohoDeskAddAccountFollowersAction } from './accounts/add-account-followers';
+import { zohoDeskAssociateAccountProductsAction } from './accounts/associate-account-products';
+import { zohoDeskCountAccountsAction } from './accounts/count-accounts';
+import { zohoDeskCreateAccountAction } from './accounts/create-account';
+import { zohoDeskCreateAccountCommentAction } from './accounts/create-account-comment';
+import { zohoDeskDeleteAccountAttachmentAction } from './accounts/delete-account-attachment';
+import { zohoDeskDeleteAccountCommentAction } from './accounts/delete-account-comment';
+import { zohoDeskDeleteAccountsAction } from './accounts/delete-accounts';
+import { zohoDeskGetAccountAction } from './accounts/get-account';
+import { zohoDeskGetAccountCommentAction } from './accounts/get-account-comment';
+import { zohoDeskGetAccountStatisticsAction } from './accounts/get-account-statistics';
+import { zohoDeskGetAgentTimeSummaryAction } from './time-tracking/get-agent-time-summary';
+import { zohoDeskGetArticleAction } from './knowledge-base/get-article';
+import { zohoDeskGetCallAction } from './activities/get-call';
+import { zohoDeskGetCallCommentAction } from './activities/get-call-comment';
+import { zohoDeskGetContactAction } from './contacts/get-contact';
+import { zohoDeskGetContactCommentAction } from './contacts/get-contact-comment';
+import { zohoDeskGetContactStatisticsAction } from './contacts/get-contact-statistics';
+import { zohoDeskGetContactTimeSummaryAction } from './time-tracking/get-contact-time-summary';
+import { zohoDeskGetContactsByIdsAction } from './contacts/get-contacts-by-ids';
+import { zohoDeskGetContractAction } from './contracts/get-contract';
+import { zohoDeskGetContractCommentAction } from './contracts/get-contract-comment';
+import { zohoDeskGetCurrentAgentAction } from './organization/get-current-agent';
+import { zohoDeskGetDepartmentAction } from './organization/get-department';
+import { zohoDeskGetEventAction } from './activities/get-event';
+import { zohoDeskGetEventCommentAction } from './activities/get-event-comment';
+import { zohoDeskGetLatestTicketThreadAction } from './threads/get-latest-ticket-thread';
+import { zohoDeskGetOrganizationAction } from './organization/get-organization';
+import { zohoDeskGetProductAction } from './products/get-product';
+import { zohoDeskGetRoleAction } from './organization/get-role';
+import { zohoDeskGetRolesByIdsAction } from './organization/get-roles-by-ids';
+import { zohoDeskGetSuggestedArticlesAction } from './tickets/get-suggested-articles';
+import { zohoDeskGetTaskAction } from './tasks/get-task';
+import { zohoDeskGetTaskCommentAction } from './tasks/get-task-comment';
+import { zohoDeskGetTaskTimeEntryAction } from './time-tracking/get-task-time-entry';
+import { zohoDeskGetTaskTimeSummaryAction } from './time-tracking/get-task-time-summary';
+import { zohoDeskGetTaskTimerAction } from './time-tracking/get-task-timer';
+import { zohoDeskGetTeamAction } from './organization/get-team';
+import { zohoDeskGetTicketAction } from './tickets/get-ticket';
+import { zohoDeskGetTicketApprovalAction } from './tickets/get-ticket-approval';
+import { zohoDeskGetTicketCommentAction } from './ticket-comments/get-ticket-comment';
+import { zohoDeskGetTicketCommentHistoryAction } from './ticket-comments/get-ticket-comment-history';
+import { zohoDeskGetTicketMetricsAction } from './tickets/get-ticket-metrics';
+import { zohoDeskGetTicketResolutionAction } from './tickets/get-ticket-resolution';
+import { zohoDeskGetTicketThreadAction } from './threads/get-ticket-thread';
+import { zohoDeskGetTicketTimeEntryAction } from './time-tracking/get-ticket-time-entry';
+import { zohoDeskGetTicketTimeSummaryAction } from './time-tracking/get-ticket-time-summary';
+import { zohoDeskGetTicketTimerAction } from './time-tracking/get-ticket-timer';
+import { zohoDeskGetUserAction } from './help-center/get-user';
+import { zohoDeskInviteContactToHelpCenterAction } from './contacts/invite-contact-to-help-center';
+import { zohoDeskLinkArticlesToTicketAction } from './tickets/link-articles-to-ticket';
+import { zohoDeskListAccountAttachmentsAction } from './accounts/list-account-attachments';
+import { zohoDeskListAccountCommentsAction } from './accounts/list-account-comments';
+import { zohoDeskListAccountContactsAction } from './accounts/list-account-contacts';
+import { zohoDeskListAccountContractsAction } from './accounts/list-account-contracts';
+import { zohoDeskListAccountFollowersAction } from './accounts/list-account-followers';
+import { zohoDeskListAccountHistoryAction } from './accounts/list-account-history';
+import { zohoDeskListAccountProductsAction } from './accounts/list-account-products';
+import { zohoDeskListAccountSlasAction } from './accounts/list-account-slas';
+import { zohoDeskListAccountTicketsAction } from './accounts/list-account-tickets';
+import { zohoDeskListAccountTimeEntriesAction } from './time-tracking/list-account-time-entries';
+import { zohoDeskListAccountsAction } from './accounts/list-accounts';
+import { zohoDeskListAgentTimeEntriesAction } from './time-tracking/list-agent-time-entries';
+import { zohoDeskListAgentsAction } from './organization/list-agents';
+import { zohoDeskListArticlesAction } from './knowledge-base/list-articles';
+import { zohoDeskListBadgesAction } from './help-center/list-badges';
+import { zohoDeskListCallCommentsAction } from './activities/list-call-comments';
+import { zohoDeskListCallsAction } from './activities/list-calls';
+import { zohoDeskListContactAccountsAction } from './contacts/list-contact-accounts';
+import { zohoDeskListContactAttachmentsAction } from './contacts/list-contact-attachments';
+import { zohoDeskListContactCommentsAction } from './contacts/list-contact-comments';
+import { zohoDeskListContactFollowersAction } from './contacts/list-contact-followers';
+import { zohoDeskListContactHelpCentersAction } from './contacts/list-contact-help-centers';
+import { zohoDeskListContactHistoryAction } from './contacts/list-contact-history';
+import { zohoDeskListContactProductsAction } from './contacts/list-contact-products';
+import { zohoDeskListContactProfilesAction } from './contacts/list-contact-profiles';
+import { zohoDeskListContactTicketsAction } from './contacts/list-contact-tickets';
+import { zohoDeskListContactTimeEntriesAction } from './time-tracking/list-contact-time-entries';
+import { zohoDeskListContactsAction } from './contacts/list-contacts';
+import { zohoDeskListContractCommentsAction } from './contracts/list-contract-comments';
+import { zohoDeskListContractsAction } from './contracts/list-contracts';
+import { zohoDeskListDepartmentAgentsAction } from './organization/list-department-agents';
+import { zohoDeskListDepartmentTeamsAction } from './organization/list-department-teams';
+import { zohoDeskListDepartmentsAction } from './organization/list-departments';
+import { zohoDeskListEventAttachmentsAction } from './activities/list-event-attachments';
+import { zohoDeskListEventCommentsAction } from './activities/list-event-comments';
+import { zohoDeskListEventsAction } from './activities/list-events';
+import { zohoDeskListFieldsAction } from './organization/list-fields';
+import { zohoDeskListHelpCenterGroupsAction } from './help-center/list-help-center-groups';
+import { zohoDeskListHelpCentersAction } from './help-center/list-help-centers';
+import { zohoDeskListLabelsAction } from './help-center/list-labels';
+import { zohoDeskListOrganizationsAction } from './organization/list-organizations';
+import { zohoDeskListProductAccountsAction } from './products/list-product-accounts';
+import { zohoDeskListProductAttachmentsAction } from './products/list-product-attachments';
+import { zohoDeskListProductContactsAction } from './products/list-product-contacts';
+import { zohoDeskListProductTicketsAction } from './products/list-product-tickets';
+import { zohoDeskListProductsAction } from './products/list-products';
+import { zohoDeskListReplyAddressesAction } from './threads/list-reply-addresses';
+import { zohoDeskListRolesAction } from './organization/list-roles';
+import { zohoDeskListSupportPlansAction } from './contracts/list-support-plans';
+import { zohoDeskListTaskActiveTimersAction } from './time-tracking/list-task-active-timers';
+import { zohoDeskListTaskAttachmentsAction } from './tasks/list-task-attachments';
+import { zohoDeskListTaskCommentsAction } from './tasks/list-task-comments';
+import { zohoDeskListTaskTimeEntriesAction } from './time-tracking/list-task-time-entries';
+import { zohoDeskListTasksAction } from './tasks/list-tasks';
+import { zohoDeskListTeamMembersAction } from './organization/list-team-members';
+import { zohoDeskListTicketActiveTimersAction } from './time-tracking/list-ticket-active-timers';
+import { zohoDeskListTicketActivitiesAction } from './tickets/list-ticket-activities';
+import { zohoDeskListTicketApprovalsAction } from './tickets/list-ticket-approvals';
+import { zohoDeskListTicketAttachmentsAction } from './ticket-comments/list-ticket-attachments';
+import { zohoDeskListTicketCallsAction } from './tickets/list-ticket-calls';
+import { zohoDeskListTicketCommentsAction } from './ticket-comments/list-ticket-comments';
+import { zohoDeskListTicketConversationsAction } from './threads/list-ticket-conversations';
+import { zohoDeskListTicketEventsAction } from './tickets/list-ticket-events';
+import { zohoDeskListTicketFollowersAction } from './tickets/list-ticket-followers';
+import { zohoDeskListTicketHistoryAction } from './tickets/list-ticket-history';
+import { zohoDeskListTicketPinsAction } from './tickets/list-ticket-pins';
+import { zohoDeskListTicketResolutionHistoryAction } from './tickets/list-ticket-resolution-history';
+import { zohoDeskListTicketTagsAction } from './tickets/list-ticket-tags';
+import { zohoDeskListTicketTasksAction } from './tasks/list-ticket-tasks';
+import { zohoDeskListTicketThreadsAction } from './threads/list-ticket-threads';
+import { zohoDeskListTicketTimeEntriesAction } from './time-tracking/list-ticket-time-entries';
+import { zohoDeskListTicketTimeEntriesByBillingTypeAction } from './time-tracking/list-ticket-time-entries-by-billing-type';
+import { zohoDeskListTicketsAction } from './tickets/list-tickets';
+import { zohoDeskListUserBadgesAction } from './help-center/list-user-badges';
+import { zohoDeskListUserGroupsAction } from './help-center/list-user-groups';
+import { zohoDeskListUserLabelsAction } from './help-center/list-user-labels';
+import { zohoDeskListUsersAction } from './help-center/list-users';
+import { zohoDeskListViewsAction } from './organization/list-views';
+import { zohoDeskMarkContactsSpamAction } from './contacts/mark-contacts-spam';
+import { zohoDeskMarkTicketReadAction } from './tickets/mark-ticket-read';
+import { zohoDeskMarkTicketUnreadAction } from './tickets/mark-ticket-unread';
+import { zohoDeskMarkTicketsSpamAction } from './tickets/mark-tickets-spam';
+import { zohoDeskMergeAccountsAction } from './accounts/merge-accounts';
+import { zohoDeskMergeContactsAction } from './contacts/merge-contacts';
+import { zohoDeskMergeTicketsAction } from './tickets/merge-tickets';
+import { zohoDeskMoveTicketAction } from './tickets/move-ticket';
+import { zohoDeskRejectContactHelpCenterAccessAction } from './contacts/reject-contact-help-center-access';
+import { zohoDeskRemoveAccountFollowersAction } from './accounts/remove-account-followers';
+import { zohoDeskRemoveContactFollowersAction } from './contacts/remove-contact-followers';
+import { zohoDeskRemoveTicketFollowersAction } from './tickets/remove-ticket-followers';
+import { zohoDeskRemoveTicketTagsAction } from './tickets/remove-ticket-tags';
+import { zohoDeskRemoveUserBadgesAction } from './help-center/remove-user-badges';
+import { zohoDeskRemoveUserGroupsAction } from './help-center/remove-user-groups';
+import { zohoDeskRemoveUserLabelsAction } from './help-center/remove-user-labels';
+import { zohoDeskSearchAction } from './organization/search';
+import { zohoDeskSearchAccountsAction } from './accounts/search-accounts';
+import { zohoDeskSearchActivitiesAction } from './activities/search-activities';
+import { zohoDeskSearchArticlesAction } from './knowledge-base/search-articles';
+import { zohoDeskSearchCallsAction } from './activities/search-calls';
+import { zohoDeskSearchContactsAction } from './contacts/search-contacts';
+import { zohoDeskSearchEventsAction } from './activities/search-events';
+import { zohoDeskSearchProductsAction } from './products/search-products';
+import { zohoDeskSearchTasksAction } from './tasks/search-tasks';
+import { zohoDeskSearchTicketsAction } from './tickets/search-tickets';
+import { zohoDeskSendTicketReplyAction } from './threads/send-ticket-reply';
+import { zohoDeskSetAccountSlaAction } from './accounts/set-account-sla';
+import { zohoDeskUnpinTicketPinAction } from './tickets/unpin-ticket-pin';
+import { zohoDeskUpdateAccountAction } from './accounts/update-account';
+import { zohoDeskUpdateAccountCommentAction } from './accounts/update-account-comment';
+import { zohoDeskUpdateCallAction } from './activities/update-call';
+import { zohoDeskUpdateCallCommentAction } from './activities/update-call-comment';
+import { zohoDeskUpdateContactAction } from './contacts/update-contact';
+import { zohoDeskUpdateContactCommentAction } from './contacts/update-contact-comment';
+import { zohoDeskUpdateContractAction } from './contracts/update-contract';
+import { zohoDeskUpdateContractCommentAction } from './contracts/update-contract-comment';
+import { zohoDeskUpdateEventAction } from './activities/update-event';
+import { zohoDeskUpdateEventCommentAction } from './activities/update-event-comment';
+import { zohoDeskUpdateManyAccountsAction } from './accounts/update-many-accounts';
+import { zohoDeskUpdateManyCallsAction } from './activities/update-many-calls';
+import { zohoDeskUpdateManyContactsAction } from './contacts/update-many-contacts';
+import { zohoDeskUpdateManyContractsAction } from './contracts/update-many-contracts';
+import { zohoDeskUpdateManyEventsAction } from './activities/update-many-events';
+import { zohoDeskUpdateManyTasksAction } from './tasks/update-many-tasks';
+import { zohoDeskUpdateManyTicketsAction } from './tickets/update-many-tickets';
+import { zohoDeskUpdateProductAction } from './products/update-product';
+import { zohoDeskUpdateTaskAction } from './tasks/update-task';
+import { zohoDeskUpdateTaskCommentAction } from './tasks/update-task-comment';
+import { zohoDeskUpdateTaskTimeEntryAction } from './time-tracking/update-task-time-entry';
+import { zohoDeskUpdateTicketAction } from './tickets/update-ticket';
+import { zohoDeskUpdateTicketApprovalAction } from './tickets/update-ticket-approval';
+import { zohoDeskUpdateTicketCommentAction } from './ticket-comments/update-ticket-comment';
+import { zohoDeskUpdateTicketResolutionAction } from './tickets/update-ticket-resolution';
+import { zohoDeskUpdateTicketTimeEntryAction } from './time-tracking/update-ticket-time-entry';
+import { zohoDeskUpdateUserAction } from './help-center/update-user';
+import { zohoDeskUploadAccountAttachmentAction } from './accounts/upload-account-attachment';
+import { zohoDeskCreateCallAction } from './activities/create-call';
+import { zohoDeskCreateCallCommentAction } from './activities/create-call-comment';
+import { zohoDeskCreateEventAction } from './activities/create-event';
+import { zohoDeskCreateEventCommentAction } from './activities/create-event-comment';
+import { zohoDeskDeleteCallAttachmentAction } from './activities/delete-call-attachment';
+import { zohoDeskDeleteCallCommentAction } from './activities/delete-call-comment';
+import { zohoDeskDeleteCallsAction } from './activities/delete-calls';
+import { zohoDeskDeleteEventAttachmentAction } from './activities/delete-event-attachment';
+import { zohoDeskDeleteEventsAction } from './activities/delete-events';
+import { zohoDeskDownloadEventAttachmentAction } from './activities/download-event-attachment';
+import { zohoDeskUploadCallAttachmentAction } from './activities/upload-call-attachment';
+import { zohoDeskUploadEventAttachmentAction } from './activities/upload-event-attachment';
+import { zohoDeskAddContactFollowersAction } from './contacts/add-contact-followers';
+import { zohoDeskApproveContactHelpCenterAccessAction } from './contacts/approve-contact-help-center-access';
+import { zohoDeskAssociateContactAccountsAction } from './contacts/associate-contact-accounts';
+import { zohoDeskAssociateContactProductsAction } from './contacts/associate-contact-products';
+import { zohoDeskCountContactsAction } from './contacts/count-contacts';
+import { zohoDeskCreateContactAction } from './contacts/create-contact';
+import { zohoDeskCreateContactCommentAction } from './contacts/create-contact-comment';
+import { zohoDeskDeleteContactAttachmentAction } from './contacts/delete-contact-attachment';
+import { zohoDeskDeleteContactCommentAction } from './contacts/delete-contact-comment';
+import { zohoDeskDeleteContactsAction } from './contacts/delete-contacts';
+import { zohoDeskDeleteSpamContactsAction } from './contacts/delete-spam-contacts';
+import { zohoDeskDissociateContactAccountsAction } from './contacts/dissociate-contact-accounts';
+import { zohoDeskUploadContactAttachmentAction } from './contacts/upload-contact-attachment';
+import { zohoDeskCountContractsAction } from './contracts/count-contracts';
+import { zohoDeskCreateContractAction } from './contracts/create-contract';
+import { zohoDeskCreateContractCommentAction } from './contracts/create-contract-comment';
+import { zohoDeskDeleteContractCommentAction } from './contracts/delete-contract-comment';
+import { zohoDeskDownloadContractCommentAttachmentAction } from './contracts/download-contract-comment-attachment';
+import { zohoDeskAddUserBadgesAction } from './help-center/add-user-badges';
+import { zohoDeskAddUserGroupsAction } from './help-center/add-user-groups';
+import { zohoDeskAssignUserLabelsAction } from './help-center/assign-user-labels';
+import { zohoDeskCountAgentsAction } from './organization/count-agents';
+import { zohoDeskCountAgentsByTypeAction } from './organization/count-agents-by-type';
+import { zohoDeskCountDepartmentsAction } from './organization/count-departments';
+import { zohoDeskCountRolesAction } from './organization/count-roles';
+import { zohoDeskFindAgentByEmailAction } from './organization/find-agent-by-email';
+import { zohoDeskGetAgentAction } from './organization/get-agent';
+import { zohoDeskAssociateProductAccountsAction } from './products/associate-product-accounts';
+import { zohoDeskAssociateProductContactsAction } from './products/associate-product-contacts';
+import { zohoDeskCreateProductAction } from './products/create-product';
+import { zohoDeskDeleteProductAttachmentAction } from './products/delete-product-attachment';
+import { zohoDeskDeleteProductsAction } from './products/delete-products';
+import { zohoDeskFindDuplicateProductsAction } from './products/find-duplicate-products';
+import { zohoDeskUploadProductAttachmentAction } from './products/upload-product-attachment';
+import { zohoDeskCountTasksAction } from './tasks/count-tasks';
+import { zohoDeskCreateTaskAction } from './tasks/create-task';
+import { zohoDeskCreateTaskCommentAction } from './tasks/create-task-comment';
+import { zohoDeskDeleteTaskAttachmentAction } from './tasks/delete-task-attachment';
+import { zohoDeskDeleteTasksAction } from './tasks/delete-tasks';
+import { zohoDeskDownloadTaskAttachmentAction } from './tasks/download-task-attachment';
+import { zohoDeskUploadTaskAttachmentAction } from './tasks/upload-task-attachment';
+import { zohoDeskCreateDraftReplyAction } from './threads/create-draft-reply';
+import { zohoDeskDownloadThreadAttachmentAction } from './threads/download-thread-attachment';
+import { zohoDeskCreateTicketCommentAction } from './ticket-comments/create-ticket-comment';
+import { zohoDeskDeleteTicketAttachmentAction } from './ticket-comments/delete-ticket-attachment';
+import { zohoDeskDeleteTicketCommentAction } from './ticket-comments/delete-ticket-comment';
+import { zohoDeskUploadTicketAttachmentAction } from './ticket-comments/upload-ticket-attachment';
+import { zohoDeskAddTicketFollowersAction } from './tickets/add-ticket-followers';
+import { zohoDeskAddTicketTagsAction } from './tickets/add-ticket-tags';
+import { zohoDeskCloseTicketsAction } from './tickets/close-tickets';
+import { zohoDeskCountTicketsAction } from './tickets/count-tickets';
+import { zohoDeskCreateTicketAction } from './tickets/create-ticket';
+import { zohoDeskCreateTicketApprovalAction } from './tickets/create-ticket-approval';
+import { zohoDeskCreateTicketPinAction } from './tickets/create-ticket-pin';
+import { zohoDeskDeleteSpamTicketsAction } from './tickets/delete-spam-tickets';
+import { zohoDeskDeleteTicketResolutionAction } from './tickets/delete-ticket-resolution';
+import { zohoDeskDeleteTicketsAction } from './tickets/delete-tickets';
+import { zohoDeskAddTaskTimeEntryAction } from './time-tracking/add-task-time-entry';
+import { zohoDeskAddTicketTimeEntryAction } from './time-tracking/add-ticket-time-entry';
+import { zohoDeskControlTaskTimerAction } from './time-tracking/control-task-timer';
+import { zohoDeskControlTicketTimerAction } from './time-tracking/control-ticket-timer';
+import { zohoDeskDeleteTicketTimeEntryAction } from './time-tracking/delete-ticket-time-entry';
+import { zohoDeskGetAccountTimeSummaryAction } from './time-tracking/get-account-time-summary';
+import { zohoDeskGetAgentTimeEntryAction } from './time-tracking/get-agent-time-entry';
+
+export const zohoDeskAiActions = [
+ zohoDeskListTicketsAction,
+ zohoDeskGetTicketAction,
+ zohoDeskCreateTicketAction,
+ zohoDeskUpdateTicketAction,
+ zohoDeskSearchTicketsAction,
+ zohoDeskDeleteTicketsAction,
+ zohoDeskCloseTicketsAction,
+ zohoDeskUpdateManyTicketsAction,
+ zohoDeskMergeTicketsAction,
+ zohoDeskMoveTicketAction,
+ zohoDeskListTicketHistoryAction,
+ zohoDeskGetTicketMetricsAction,
+ zohoDeskGetTicketResolutionAction,
+ zohoDeskUpdateTicketResolutionAction,
+ zohoDeskDeleteTicketResolutionAction,
+ zohoDeskCountTicketsAction,
+ zohoDeskListTicketTagsAction,
+ zohoDeskAddTicketTagsAction,
+ zohoDeskRemoveTicketTagsAction,
+ zohoDeskGetSuggestedArticlesAction,
+ zohoDeskLinkArticlesToTicketAction,
+ zohoDeskMarkTicketsSpamAction,
+ zohoDeskDeleteSpamTicketsAction,
+ zohoDeskListTicketFollowersAction,
+ zohoDeskAddTicketFollowersAction,
+ zohoDeskRemoveTicketFollowersAction,
+ zohoDeskListTicketActivitiesAction,
+ zohoDeskListTicketCallsAction,
+ zohoDeskListTicketEventsAction,
+ zohoDeskListTicketResolutionHistoryAction,
+ zohoDeskMarkTicketReadAction,
+ zohoDeskMarkTicketUnreadAction,
+ zohoDeskListTicketPinsAction,
+ zohoDeskCreateTicketPinAction,
+ zohoDeskUnpinTicketPinAction,
+ zohoDeskListTicketApprovalsAction,
+ zohoDeskCreateTicketApprovalAction,
+ zohoDeskGetTicketApprovalAction,
+ zohoDeskUpdateTicketApprovalAction,
+ zohoDeskListTicketThreadsAction,
+ zohoDeskGetTicketThreadAction,
+ zohoDeskGetLatestTicketThreadAction,
+ zohoDeskListTicketConversationsAction,
+ zohoDeskListReplyAddressesAction,
+ zohoDeskSendTicketReplyAction,
+ zohoDeskCreateDraftReplyAction,
+ zohoDeskDownloadThreadAttachmentAction,
+ zohoDeskListTicketCommentsAction,
+ zohoDeskGetTicketCommentAction,
+ zohoDeskCreateTicketCommentAction,
+ zohoDeskUpdateTicketCommentAction,
+ zohoDeskDeleteTicketCommentAction,
+ zohoDeskGetTicketCommentHistoryAction,
+ zohoDeskListTicketAttachmentsAction,
+ zohoDeskUploadTicketAttachmentAction,
+ zohoDeskDeleteTicketAttachmentAction,
+ zohoDeskListContactsAction,
+ zohoDeskGetContactAction,
+ zohoDeskCreateContactAction,
+ zohoDeskUpdateContactAction,
+ zohoDeskDeleteContactsAction,
+ zohoDeskSearchContactsAction,
+ zohoDeskGetContactsByIdsAction,
+ zohoDeskCountContactsAction,
+ zohoDeskUpdateManyContactsAction,
+ zohoDeskListContactAccountsAction,
+ zohoDeskListContactTicketsAction,
+ zohoDeskListContactProductsAction,
+ zohoDeskAssociateContactAccountsAction,
+ zohoDeskDissociateContactAccountsAction,
+ zohoDeskAssociateContactProductsAction,
+ zohoDeskListContactAttachmentsAction,
+ zohoDeskUploadContactAttachmentAction,
+ zohoDeskDeleteContactAttachmentAction,
+ zohoDeskListContactCommentsAction,
+ zohoDeskGetContactCommentAction,
+ zohoDeskCreateContactCommentAction,
+ zohoDeskUpdateContactCommentAction,
+ zohoDeskDeleteContactCommentAction,
+ zohoDeskListContactFollowersAction,
+ zohoDeskAddContactFollowersAction,
+ zohoDeskRemoveContactFollowersAction,
+ zohoDeskListContactHistoryAction,
+ zohoDeskGetContactStatisticsAction,
+ zohoDeskMergeContactsAction,
+ zohoDeskMarkContactsSpamAction,
+ zohoDeskDeleteSpamContactsAction,
+ zohoDeskInviteContactToHelpCenterAction,
+ zohoDeskApproveContactHelpCenterAccessAction,
+ zohoDeskRejectContactHelpCenterAccessAction,
+ zohoDeskListContactHelpCentersAction,
+ zohoDeskListContactProfilesAction,
+ zohoDeskListAccountsAction,
+ zohoDeskGetAccountAction,
+ zohoDeskCreateAccountAction,
+ zohoDeskUpdateAccountAction,
+ zohoDeskDeleteAccountsAction,
+ zohoDeskSearchAccountsAction,
+ zohoDeskCountAccountsAction,
+ zohoDeskUpdateManyAccountsAction,
+ zohoDeskListAccountContactsAction,
+ zohoDeskListAccountTicketsAction,
+ zohoDeskListAccountProductsAction,
+ zohoDeskListAccountContractsAction,
+ zohoDeskListAccountSlasAction,
+ zohoDeskSetAccountSlaAction,
+ zohoDeskAssociateAccountProductsAction,
+ zohoDeskListAccountAttachmentsAction,
+ zohoDeskUploadAccountAttachmentAction,
+ zohoDeskDeleteAccountAttachmentAction,
+ zohoDeskListAccountCommentsAction,
+ zohoDeskGetAccountCommentAction,
+ zohoDeskCreateAccountCommentAction,
+ zohoDeskUpdateAccountCommentAction,
+ zohoDeskDeleteAccountCommentAction,
+ zohoDeskListAccountFollowersAction,
+ zohoDeskAddAccountFollowersAction,
+ zohoDeskRemoveAccountFollowersAction,
+ zohoDeskListAccountHistoryAction,
+ zohoDeskGetAccountStatisticsAction,
+ zohoDeskMergeAccountsAction,
+ zohoDeskListTasksAction,
+ zohoDeskListTicketTasksAction,
+ zohoDeskGetTaskAction,
+ zohoDeskSearchTasksAction,
+ zohoDeskCountTasksAction,
+ zohoDeskCreateTaskAction,
+ zohoDeskUpdateTaskAction,
+ zohoDeskDeleteTasksAction,
+ zohoDeskUpdateManyTasksAction,
+ zohoDeskListTaskCommentsAction,
+ zohoDeskGetTaskCommentAction,
+ zohoDeskCreateTaskCommentAction,
+ zohoDeskUpdateTaskCommentAction,
+ zohoDeskListTaskAttachmentsAction,
+ zohoDeskUploadTaskAttachmentAction,
+ zohoDeskDeleteTaskAttachmentAction,
+ zohoDeskDownloadTaskAttachmentAction,
+ zohoDeskListProductsAction,
+ zohoDeskGetProductAction,
+ zohoDeskSearchProductsAction,
+ zohoDeskFindDuplicateProductsAction,
+ zohoDeskCreateProductAction,
+ zohoDeskUpdateProductAction,
+ zohoDeskDeleteProductsAction,
+ zohoDeskListProductAccountsAction,
+ zohoDeskListProductContactsAction,
+ zohoDeskListProductTicketsAction,
+ zohoDeskAssociateProductAccountsAction,
+ zohoDeskAssociateProductContactsAction,
+ zohoDeskListProductAttachmentsAction,
+ zohoDeskUploadProductAttachmentAction,
+ zohoDeskDeleteProductAttachmentAction,
+ zohoDeskListArticlesAction,
+ zohoDeskSearchArticlesAction,
+ zohoDeskGetArticleAction,
+ zohoDeskListOrganizationsAction,
+ zohoDeskGetOrganizationAction,
+ zohoDeskListAgentsAction,
+ zohoDeskGetAgentAction,
+ zohoDeskFindAgentByEmailAction,
+ zohoDeskCountAgentsAction,
+ zohoDeskCountAgentsByTypeAction,
+ zohoDeskGetCurrentAgentAction,
+ zohoDeskListDepartmentsAction,
+ zohoDeskGetDepartmentAction,
+ zohoDeskCountDepartmentsAction,
+ zohoDeskListDepartmentAgentsAction,
+ zohoDeskListDepartmentTeamsAction,
+ zohoDeskGetTeamAction,
+ zohoDeskListTeamMembersAction,
+ zohoDeskListRolesAction,
+ zohoDeskGetRoleAction,
+ zohoDeskGetRolesByIdsAction,
+ zohoDeskCountRolesAction,
+ zohoDeskListViewsAction,
+ zohoDeskListFieldsAction,
+ zohoDeskSearchAction,
+ zohoDeskListTicketTimeEntriesAction,
+ zohoDeskAddTicketTimeEntryAction,
+ zohoDeskGetTicketTimeEntryAction,
+ zohoDeskUpdateTicketTimeEntryAction,
+ zohoDeskDeleteTicketTimeEntryAction,
+ zohoDeskListTicketTimeEntriesByBillingTypeAction,
+ zohoDeskGetTicketTimeSummaryAction,
+ zohoDeskGetTicketTimerAction,
+ zohoDeskControlTicketTimerAction,
+ zohoDeskListTicketActiveTimersAction,
+ zohoDeskListTaskTimeEntriesAction,
+ zohoDeskAddTaskTimeEntryAction,
+ zohoDeskGetTaskTimeEntryAction,
+ zohoDeskUpdateTaskTimeEntryAction,
+ zohoDeskGetTaskTimeSummaryAction,
+ zohoDeskGetTaskTimerAction,
+ zohoDeskControlTaskTimerAction,
+ zohoDeskListTaskActiveTimersAction,
+ zohoDeskListContactTimeEntriesAction,
+ zohoDeskGetContactTimeSummaryAction,
+ zohoDeskListAccountTimeEntriesAction,
+ zohoDeskGetAccountTimeSummaryAction,
+ zohoDeskListAgentTimeEntriesAction,
+ zohoDeskGetAgentTimeEntryAction,
+ zohoDeskGetAgentTimeSummaryAction,
+ zohoDeskListCallsAction,
+ zohoDeskSearchCallsAction,
+ zohoDeskGetCallAction,
+ zohoDeskCreateCallAction,
+ zohoDeskUpdateCallAction,
+ zohoDeskDeleteCallsAction,
+ zohoDeskUpdateManyCallsAction,
+ zohoDeskUploadCallAttachmentAction,
+ zohoDeskDeleteCallAttachmentAction,
+ zohoDeskListCallCommentsAction,
+ zohoDeskGetCallCommentAction,
+ zohoDeskCreateCallCommentAction,
+ zohoDeskUpdateCallCommentAction,
+ zohoDeskDeleteCallCommentAction,
+ zohoDeskListEventsAction,
+ zohoDeskSearchEventsAction,
+ zohoDeskGetEventAction,
+ zohoDeskCreateEventAction,
+ zohoDeskUpdateEventAction,
+ zohoDeskDeleteEventsAction,
+ zohoDeskUpdateManyEventsAction,
+ zohoDeskListEventAttachmentsAction,
+ zohoDeskUploadEventAttachmentAction,
+ zohoDeskDeleteEventAttachmentAction,
+ zohoDeskDownloadEventAttachmentAction,
+ zohoDeskListEventCommentsAction,
+ zohoDeskGetEventCommentAction,
+ zohoDeskCreateEventCommentAction,
+ zohoDeskUpdateEventCommentAction,
+ zohoDeskSearchActivitiesAction,
+ zohoDeskListSupportPlansAction,
+ zohoDeskListContractsAction,
+ zohoDeskCountContractsAction,
+ zohoDeskGetContractAction,
+ zohoDeskCreateContractAction,
+ zohoDeskUpdateContractAction,
+ zohoDeskUpdateManyContractsAction,
+ zohoDeskListContractCommentsAction,
+ zohoDeskGetContractCommentAction,
+ zohoDeskCreateContractCommentAction,
+ zohoDeskUpdateContractCommentAction,
+ zohoDeskDeleteContractCommentAction,
+ zohoDeskDownloadContractCommentAttachmentAction,
+ zohoDeskListHelpCentersAction,
+ zohoDeskListBadgesAction,
+ zohoDeskListHelpCenterGroupsAction,
+ zohoDeskListLabelsAction,
+ zohoDeskListUsersAction,
+ zohoDeskGetUserAction,
+ zohoDeskUpdateUserAction,
+ zohoDeskListUserBadgesAction,
+ zohoDeskAddUserBadgesAction,
+ zohoDeskRemoveUserBadgesAction,
+ zohoDeskListUserGroupsAction,
+ zohoDeskAddUserGroupsAction,
+ zohoDeskRemoveUserGroupsAction,
+ zohoDeskListUserLabelsAction,
+ zohoDeskAssignUserLabelsAction,
+ zohoDeskRemoveUserLabelsAction,
+];
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/get-article.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/get-article.ts
new file mode 100644
index 00000000000..45898b669a6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/get-article.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetArticleOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetArticleAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_article',
+ outputSchema: zohoDeskGetArticleOutputSchema,
+ displayName: 'Get Article',
+ description: 'Gets a knowledge-base article with its content.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one knowledge-base article by ID (from Search Articles or Get Suggested Articles), including its full answer content, status, tags and public URL.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ articleId: Property.ShortText({
+ displayName: 'Article ID',
+ description: 'Article ID (from Search Articles).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, articleId } = context.propsValue;
+ return await zohoDeskApi.getArticle({ auth: context.auth, orgId, articleId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/list-articles.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/list-articles.ts
new file mode 100644
index 00000000000..57dd12ab338
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/list-articles.ts
@@ -0,0 +1,72 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListArticlesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListArticlesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_articles',
+ outputSchema: zohoDeskListArticlesOutputSchema,
+ displayName: 'List Articles',
+ description: 'Lists knowledge-base articles.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists knowledge-base articles, optionally in one category or with a given status. Use Search Articles to find articles about a topic.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ categoryId: Property.ShortText({
+ displayName: 'Category ID',
+ description: 'Only articles in this category.',
+ required: false,
+ }),
+ status: Property.Array({
+ displayName: 'Status',
+ description: 'Statuses to include, e.g. ["Published"].',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by; a leading "-" sorts descending.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'createdTime', value: 'createdTime' },
+ { label: '-createdTime', value: '-createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ { label: '-modifiedTime', value: '-modifiedTime' },
+ { label: 'viewCount', value: 'viewCount' },
+ { label: '-viewCount', value: '-viewCount' },
+ { label: 'likeCount', value: 'likeCount' },
+ { label: '-likeCount', value: '-likeCount' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, categoryId, status, sortBy, from, limit } = context.propsValue;
+ const articles = await zohoDeskApi.listArticles({
+ auth: context.auth,
+ orgId,
+ categoryId,
+ status: zohoDeskUtils.optionalStringList({ value: status, propName: 'Status' }),
+ sortBy,
+ from,
+ limit,
+ });
+ return { articles, count: articles.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/search-articles.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/search-articles.ts
new file mode 100644
index 00000000000..9ac63729ea6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/knowledge-base/search-articles.ts
@@ -0,0 +1,82 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskSearchArticlesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchArticlesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_articles',
+ outputSchema: zohoDeskSearchArticlesOutputSchema,
+ displayName: 'Search Articles',
+ description: 'Searches knowledge-base articles.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches knowledge-base articles by free text (supports a trailing * wildcard), title, category or tag. Use Get Article for the full answer text.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched in titles and content; end with * for a prefix match.',
+ required: false,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Text to match in the title.',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ categoryId: Property.ShortText({
+ displayName: 'Category ID',
+ description: 'Only articles in this category.',
+ required: false,
+ }),
+ tag: Property.Array({
+ displayName: 'Tags',
+ description: 'Only articles with these tags.',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Sort order.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'relevance', value: 'relevance' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, searchText, title, departmentId, categoryId, tag, sortBy, from, limit } =
+ context.propsValue;
+ const articles = await zohoDeskApi.searchArticles({
+ auth: context.auth,
+ orgId,
+ searchText,
+ title,
+ departmentId,
+ categoryId,
+ tag: zohoDeskUtils.optionalStringList({ value: tag, propName: 'Tags' }),
+ sortBy,
+ from,
+ limit,
+ });
+ return { articles, count: articles.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-agents-by-type.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-agents-by-type.ts
new file mode 100644
index 00000000000..212073a860f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-agents-by-type.ts
@@ -0,0 +1,31 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAgentsByTypeOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountAgentsByTypeAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_agents_by_type',
+ outputSchema: zohoDeskCountAgentsByTypeOutputSchema,
+ displayName: 'Count Agents By Type',
+ description: 'Counts agents by type.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Returns agent counts by type: active, deactivated, unconfirmed, light, imported and deleted.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ },
+ async run(context) {
+ const { orgId } = context.propsValue;
+ return await zohoDeskApi.countAgentsByType({ auth: context.auth, orgId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-agents.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-agents.ts
new file mode 100644
index 00000000000..c582fc52503
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-agents.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAgentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountAgentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_agents',
+ outputSchema: zohoDeskCountAgentsOutputSchema,
+ displayName: 'Count Agents',
+ description: 'Counts agents.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Returns the number of agents, optionally only active or disabled, confirmed, or including light agents.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only agents with this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'DISABLED', value: 'DISABLED' },
+ ],
+ },
+ }),
+ isConfirmed: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Confirmed',
+ description: 'Yes counts only confirmed agents.',
+ }),
+ includeLightAgent: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Include Light Agents',
+ description: 'Yes includes light agents.',
+ }),
+ },
+ async run(context) {
+ const { orgId, status, isConfirmed, includeLightAgent } = context.propsValue;
+ return await zohoDeskApi.countAgents({
+ auth: context.auth,
+ orgId,
+ status,
+ isConfirmed,
+ includeLightAgent,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-departments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-departments.ts
new file mode 100644
index 00000000000..6310781fd00
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-departments.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAgentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountDepartmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_departments',
+ outputSchema: zohoDeskCountAgentsOutputSchema,
+ displayName: 'Count Departments',
+ description: 'Counts departments.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Returns the number of departments, optionally only enabled ones.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ isEnabled: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Enabled',
+ description: 'Yes counts only enabled departments.',
+ }),
+ },
+ async run(context) {
+ const { orgId, isEnabled } = context.propsValue;
+ return await zohoDeskApi.countDepartments({ auth: context.auth, orgId, isEnabled });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-roles.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-roles.ts
new file mode 100644
index 00000000000..0621e255cd6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/count-roles.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAgentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountRolesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_roles',
+ outputSchema: zohoDeskCountAgentsOutputSchema,
+ displayName: 'Count Roles',
+ description: 'Counts roles.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Returns the number of roles, optionally only default or visible ones.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ isDefault: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Default',
+ description: 'Yes counts only default roles.',
+ }),
+ isVisible: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Visible',
+ description: 'Yes counts only visible roles.',
+ }),
+ },
+ async run(context) {
+ const { orgId, isDefault, isVisible } = context.propsValue;
+ return await zohoDeskApi.countRoles({ auth: context.auth, orgId, isDefault, isVisible });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/find-agent-by-email.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/find-agent-by-email.ts
new file mode 100644
index 00000000000..34fa35ed7ec
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/find-agent-by-email.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskFindAgentByEmailOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskFindAgentByEmailAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_find_agent_by_email',
+ outputSchema: zohoDeskFindAgentByEmailOutputSchema,
+ displayName: 'Find Agent By Email',
+ description: 'Finds an agent by email address.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets the agent with this email address, for when you know an agent's email but not their ID.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Agent email address.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, email } = context.propsValue;
+ return await zohoDeskApi.findAgentByEmail({ auth: context.auth, orgId, email });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-agent.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-agent.ts
new file mode 100644
index 00000000000..1c0ff3818c9
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-agent.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskFindAgentByEmailOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetAgentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_agent',
+ outputSchema: zohoDeskFindAgentByEmailOutputSchema,
+ displayName: 'Get Agent',
+ description: 'Gets an agent by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one agent by ID with name, email, role, profile and departments.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ agentId: zohoDeskAiProps.agentId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, agentId } = context.propsValue;
+ return await zohoDeskApi.getAgent({ auth: context.auth, orgId, agentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-current-agent.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-current-agent.ts
new file mode 100644
index 00000000000..0a0f70ec052
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-current-agent.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskFindAgentByEmailOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetCurrentAgentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_current_agent',
+ outputSchema: zohoDeskFindAgentByEmailOutputSchema,
+ displayName: 'Get Current Agent',
+ description: 'Gets the agent behind the connection.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets the agent the connection signs in as, with their ID, role and departments.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ },
+ async run(context) {
+ const { orgId } = context.propsValue;
+ return await zohoDeskApi.getCurrentAgent({ auth: context.auth, orgId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-department.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-department.ts
new file mode 100644
index 00000000000..12f94d46506
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-department.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetDepartmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetDepartmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_department',
+ outputSchema: zohoDeskGetDepartmentOutputSchema,
+ displayName: 'Get Department',
+ description: 'Gets a department by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one department by ID with its name, description, help-center visibility and agent IDs.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, departmentId } = context.propsValue;
+ return await zohoDeskApi.getDepartment({ auth: context.auth, orgId, departmentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-organization.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-organization.ts
new file mode 100644
index 00000000000..8822eba9f29
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-organization.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskGetOrganizationOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetOrganizationAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_organization',
+ outputSchema: zohoDeskGetOrganizationOutputSchema,
+ displayName: 'Get Organization',
+ description: "Gets an organization's details.",
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets one organization's details: company name, portal URL, edition, time zone and currency.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: Property.ShortText({
+ displayName: 'Organization ID',
+ description: 'Organization ID (from List Organizations).',
+ required: true,
+ }),
+ includeCustomDomain: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Include Custom Domain',
+ description: "Yes adds the help center's custom domain.",
+ }),
+ },
+ async run(context) {
+ const { organizationId, includeCustomDomain } = context.propsValue;
+ return await zohoDeskApi.getOrganization({
+ auth: context.auth,
+ organizationId,
+ includeCustomDomain,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-role.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-role.ts
new file mode 100644
index 00000000000..3e0ee27e381
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-role.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetRoleOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetRoleAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_role',
+ outputSchema: zohoDeskGetRoleOutputSchema,
+ displayName: 'Get Role',
+ description: 'Gets a role by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one role by ID with its name, parent role and sub-roles.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ roleId: Property.ShortText({
+ displayName: 'Role ID',
+ description: 'Role ID (from List Roles).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, roleId } = context.propsValue;
+ return await zohoDeskApi.getRole({ auth: context.auth, orgId, roleId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-roles-by-ids.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-roles-by-ids.ts
new file mode 100644
index 00000000000..2127f4b8bda
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-roles-by-ids.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListRolesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetRolesByIdsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_roles_by_ids',
+ outputSchema: zohoDeskListRolesOutputSchema,
+ displayName: 'Get Roles By IDs',
+ description: 'Gets several roles by ID in one call.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets several roles by ID in one call (IDs from List Roles or an agent's roleId), each with its name and parent role.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ roleIds: Property.Array({
+ displayName: 'Role IDs',
+ description: 'Role IDs to fetch (from List Roles).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, roleIds } = context.propsValue;
+ const roles = await zohoDeskApi.getRolesByIds({
+ auth: context.auth,
+ orgId,
+ roleIds: zohoDeskUtils.requiredStringList({ value: roleIds, propName: 'Role IDs' }),
+ });
+ return { roles, count: roles.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-team.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-team.ts
new file mode 100644
index 00000000000..0e450f0e9bf
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/get-team.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTeamOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTeamAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_team',
+ outputSchema: zohoDeskGetTeamOutputSchema,
+ displayName: 'Get Team',
+ description: 'Gets a team by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one team by ID with its department, roles, agents and sub-teams.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ teamId: Property.ShortText({
+ displayName: 'Team ID',
+ description: 'Team ID (from List Department Teams).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, teamId } = context.propsValue;
+ return await zohoDeskApi.getTeam({ auth: context.auth, orgId, teamId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-agents.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-agents.ts
new file mode 100644
index 00000000000..3e500d8048d
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-agents.ts
@@ -0,0 +1,115 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListAgentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAgentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_agents',
+ outputSchema: zohoDeskListAgentsOutputSchema,
+ displayName: 'List Agents',
+ description: 'Lists agents.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists agents, optionally by department, role, status or a name/email search. Agent `id` values feed assignee, owner and follower inputs. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchStr: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Text to match in the field chosen by Search Field.',
+ required: false,
+ }),
+ fieldName: Property.StaticDropdown({
+ displayName: 'Search Field',
+ description: 'Field Search Text matches. Defaults to name.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'name', value: 'name' },
+ { label: 'firstName', value: 'firstName' },
+ { label: 'lastName', value: 'lastName' },
+ { label: 'emailId', value: 'emailId' },
+ ],
+ },
+ }),
+ departmentIds: Property.Array({
+ displayName: 'Department IDs',
+ description: 'Only agents in these departments.',
+ required: false,
+ }),
+ roleIds: Property.Array({
+ displayName: 'Role IDs',
+ description: 'Only agents with these roles (from List Roles).',
+ required: false,
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only agents with this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'DISABLED', value: 'DISABLED' },
+ { label: 'DELETED', value: 'DELETED' },
+ { label: 'IMPORTED', value: 'IMPORTED' },
+ ],
+ },
+ }),
+ isConfirmed: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Confirmed',
+ description: 'Yes returns only agents who accepted their invitation.',
+ }),
+ isLightAgent: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Light Agent',
+ description: 'Yes returns only light agents, No only full agents.',
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchStr,
+ fieldName,
+ departmentIds,
+ roleIds,
+ status,
+ isConfirmed,
+ isLightAgent,
+ from,
+ limit,
+ } = context.propsValue;
+ const agents = await zohoDeskApi.listAgents({
+ auth: context.auth,
+ orgId,
+ searchStr,
+ fieldName,
+ departmentIds: zohoDeskUtils.optionalStringList({
+ value: departmentIds,
+ propName: 'Department IDs',
+ }),
+ roleIds: zohoDeskUtils.optionalStringList({ value: roleIds, propName: 'Role IDs' }),
+ status,
+ isConfirmed,
+ isLightAgent,
+ from,
+ limit,
+ });
+ return { agents, count: agents.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-department-agents.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-department-agents.ts
new file mode 100644
index 00000000000..1b364e39874
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-department-agents.ts
@@ -0,0 +1,76 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListDepartmentAgentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListDepartmentAgentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_department_agents',
+ outputSchema: zohoDeskListDepartmentAgentsOutputSchema,
+ displayName: 'List Department Agents',
+ description: 'Lists the agents in a department.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the agents in one department, optionally filtered by a name or email search.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ searchStr: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Text to match in the field chosen by Search Field.',
+ required: false,
+ }),
+ fieldName: Property.StaticDropdown({
+ displayName: 'Search Field',
+ description: 'Field Search Text matches.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'name', value: 'name' },
+ { label: 'firstName', value: 'firstName' },
+ { label: 'lastName', value: 'lastName' },
+ { label: 'emailId', value: 'emailId' },
+ ],
+ },
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only agents with this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ACTIVE', value: 'ACTIVE' },
+ { label: 'DISABLED', value: 'DISABLED' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, searchStr, fieldName, status, from, limit } = context.propsValue;
+ const agents = await zohoDeskApi.listDepartmentAgents({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ searchStr,
+ fieldName,
+ status,
+ from,
+ limit,
+ });
+ return { agents, count: agents.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-department-teams.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-department-teams.ts
new file mode 100644
index 00000000000..a179fca8ed7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-department-teams.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListDepartmentTeamsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListDepartmentTeamsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_department_teams',
+ outputSchema: zohoDeskListDepartmentTeamsOutputSchema,
+ displayName: 'List Department Teams',
+ description: 'Lists the teams in a department.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the teams in one department; a team `id` feeds Get Team and List Team Members.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ searchStr: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Text to match in team names.',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, searchStr, from, limit } = context.propsValue;
+ return await zohoDeskApi.listDepartmentTeams({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ searchStr,
+ from,
+ limit,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-departments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-departments.ts
new file mode 100644
index 00000000000..8962c8495a0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-departments.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListDepartmentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListDepartmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_departments',
+ outputSchema: zohoDeskListDepartmentsOutputSchema,
+ displayName: 'List Departments',
+ description: 'Lists departments.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists departments; their `id` values feed every Department ID input. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchStr: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Text to match in department names.',
+ required: false,
+ }),
+ isEnabled: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Enabled',
+ description: 'Yes returns only enabled departments.',
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, searchStr, isEnabled, from, limit } = context.propsValue;
+ const departments = await zohoDeskApi.listDepartmentRecords({
+ auth: context.auth,
+ orgId,
+ searchStr,
+ isEnabled,
+ from,
+ limit,
+ });
+ return { departments, count: departments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-fields.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-fields.ts
new file mode 100644
index 00000000000..88a1ac16a91
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-fields.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListFieldsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListFieldsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_fields',
+ outputSchema: zohoDeskListFieldsOutputSchema,
+ displayName: 'List Fields',
+ description: 'Lists the fields of a module, including custom fields and allowed values.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the fields of one module with their API names, types and allowed values, including custom fields (`cf_*`) and ticket statuses. Use it to learn the names and values that create, update and update-many actions accept.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Module whose fields to list.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'contacts', value: 'contacts' },
+ { label: 'accounts', value: 'accounts' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ { label: 'contracts', value: 'contracts' },
+ { label: 'products', value: 'products' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({
+ required: false,
+ description: 'Only fields used in this department.',
+ }),
+ apiNames: Property.Array({
+ displayName: 'API Names',
+ description: 'Only these fields, by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, module, departmentId, apiNames } = context.propsValue;
+ const fields = await zohoDeskApi.listFields({
+ auth: context.auth,
+ orgId,
+ module,
+ departmentId,
+ apiNames: zohoDeskUtils.optionalStringList({ value: apiNames, propName: 'API Names' }),
+ });
+ return { fields, count: fields.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-organizations.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-organizations.ts
new file mode 100644
index 00000000000..d8c11c09bb7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-organizations.ts
@@ -0,0 +1,25 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskListOrganizationsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListOrganizationsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_organizations',
+ outputSchema: zohoDeskListOrganizationsOutputSchema,
+ displayName: 'List Organizations',
+ description: 'Lists the Zoho Desk organizations the connection can access.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the Zoho Desk organizations (portals) the connected user belongs to. Every other action needs one of these IDs as Organization ID.',
+ idempotent: true,
+ },
+ props: {},
+ async run(context) {
+ const organizations = await zohoDeskApi.listOrganizationRecords({ auth: context.auth });
+ return { organizations, count: organizations.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-roles.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-roles.ts
new file mode 100644
index 00000000000..2dd551577b6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-roles.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListRolesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListRolesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_roles',
+ outputSchema: zohoDeskListRolesOutputSchema,
+ displayName: 'List Roles',
+ description: 'Lists agent roles.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists agent roles in the organization; role `id` values filter List Agents.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchStr: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Text to match in role names.',
+ required: false,
+ }),
+ isDefault: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Default',
+ description: 'Yes returns only default roles.',
+ }),
+ isVisible: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Visible',
+ description: 'Yes returns only visible roles.',
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, searchStr, isDefault, isVisible, from, limit } = context.propsValue;
+ const roles = await zohoDeskApi.listRoles({
+ auth: context.auth,
+ orgId,
+ searchStr,
+ isDefault,
+ isVisible,
+ from,
+ limit,
+ });
+ return { roles, count: roles.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-team-members.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-team-members.ts
new file mode 100644
index 00000000000..a361c1fcbb9
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-team-members.ts
@@ -0,0 +1,32 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTeamMembersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTeamMembersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_team_members',
+ outputSchema: zohoDeskListTeamMembersOutputSchema,
+ displayName: 'List Team Members',
+ description: 'Lists the agents in a team.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the agents who are members of one team.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ teamId: Property.ShortText({
+ displayName: 'Team ID',
+ description: 'Team ID (from List Department Teams).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, teamId } = context.propsValue;
+ return await zohoDeskApi.listTeamMembers({ auth: context.auth, orgId, teamId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-views.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-views.ts
new file mode 100644
index 00000000000..020b909a906
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/list-views.ts
@@ -0,0 +1,53 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListViewsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListViewsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_views',
+ outputSchema: zohoDeskListViewsOutputSchema,
+ displayName: 'List Views',
+ description: 'Lists the saved views of a module.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the predefined and custom views for one module; view `id` values feed View ID inputs on List Tickets, List Contacts and the other list and count actions.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Module whose views to list.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'contacts', value: 'contacts' },
+ { label: 'accounts', value: 'accounts' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ { label: 'activities', value: 'activities' },
+ { label: 'contracts', value: 'contracts' },
+ { label: 'products', value: 'products' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ },
+ async run(context) {
+ const { orgId, module, departmentId } = context.propsValue;
+ const views = await zohoDeskApi.listViews({ auth: context.auth, orgId, module, departmentId });
+ return { views, count: views.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/search.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/search.ts
new file mode 100644
index 00000000000..20dd0a2e577
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/organization/search.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search',
+ outputSchema: zohoDeskSearchOutputSchema,
+ displayName: 'Search',
+ description: 'Searches tickets, contacts, accounts and other records in one query.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches across modules (tickets, contacts, accounts, tasks and more) with one text query and returns the matches with their module. Use the module-specific search actions for field filters.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchStr: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Text to search for.',
+ required: true,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Sort order.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'relevance', value: 'relevance' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, searchStr, departmentId, sortBy, from, limit } = context.propsValue;
+ const results = await zohoDeskApi.search({
+ auth: context.auth,
+ orgId,
+ searchStr,
+ departmentId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { results, count: results.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/associate-product-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/associate-product-accounts.ts
new file mode 100644
index 00000000000..0eabc32aa6e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/associate-product-accounts.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateProductAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAssociateProductAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_associate_product_accounts',
+ outputSchema: zohoDeskAssociateProductAccountsOutputSchema,
+ displayName: 'Associate Product Accounts',
+ description: 'Links or unlinks accounts on a product.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Links accounts to one product, or unlinks them when Associate is No.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ accountIds: Property.Array({
+ displayName: 'Account IDs',
+ description: 'Account IDs to link or unlink.',
+ required: true,
+ }),
+ associate: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Associate',
+ description: 'Yes links the accounts, No unlinks them.',
+ }),
+ },
+ async run(context) {
+ const { orgId, productId, accountIds, associate } = context.propsValue;
+ await zohoDeskApi.associateProductAccounts({
+ auth: context.auth,
+ orgId,
+ productId,
+ accountIds: zohoDeskUtils.requiredStringList({ value: accountIds, propName: 'Account IDs' }),
+ associate,
+ });
+ return { success: true, productId, accountIds, associate };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/associate-product-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/associate-product-contacts.ts
new file mode 100644
index 00000000000..81e238f8be8
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/associate-product-contacts.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateProductContactsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAssociateProductContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_associate_product_contacts',
+ outputSchema: zohoDeskAssociateProductContactsOutputSchema,
+ displayName: 'Associate Product Contacts',
+ description: 'Links or unlinks contacts on a product.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Links contacts to one product, or unlinks them when Associate is No.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ contactIds: Property.Array({
+ displayName: 'Contact IDs',
+ description: 'Contact IDs to link or unlink.',
+ required: true,
+ }),
+ associate: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Associate',
+ description: 'Yes links the contacts, No unlinks them.',
+ }),
+ },
+ async run(context) {
+ const { orgId, productId, contactIds, associate } = context.propsValue;
+ await zohoDeskApi.associateProductContacts({
+ auth: context.auth,
+ orgId,
+ productId,
+ contactIds: zohoDeskUtils.requiredStringList({ value: contactIds, propName: 'Contact IDs' }),
+ associate,
+ });
+ return { success: true, productId, contactIds, associate };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/create-product.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/create-product.ts
new file mode 100644
index 00000000000..c4127e2f3b7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/create-product.ts
@@ -0,0 +1,103 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskGetProductOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateProductAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_product',
+ outputSchema: zohoDeskGetProductOutputSchema,
+ displayName: 'Create Product',
+ description: 'Creates a product.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a product available in the given departments. Not idempotent: each call creates a new product.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productName: Property.ShortText({
+ displayName: 'Product Name',
+ description: 'Product name.',
+ required: true,
+ }),
+ departmentIds: Property.Array({
+ displayName: 'Department IDs',
+ description: 'Departments the product is available in (from List Departments).',
+ required: true,
+ }),
+ productCode: Property.ShortText({
+ displayName: 'Product Code',
+ description: 'Product code or SKU.',
+ required: false,
+ }),
+ unitPrice: Property.Number({
+ displayName: 'Unit Price',
+ description: 'Unit price.',
+ required: false,
+ }),
+ productCategory: Property.ShortText({
+ displayName: 'Category',
+ description: 'Product category.',
+ required: false,
+ }),
+ manufacturer: Property.ShortText({
+ displayName: 'Manufacturer',
+ description: 'Manufacturer.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the product (from List Agents).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Product description.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module products).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ productName,
+ departmentIds,
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createProduct({
+ auth: context.auth,
+ orgId,
+ productName,
+ departmentIds: zohoDeskUtils.requiredStringList({
+ value: departmentIds,
+ propName: 'Department IDs',
+ }),
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/delete-product-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/delete-product-attachment.ts
new file mode 100644
index 00000000000..7b51806b195
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/delete-product-attachment.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteProductAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteProductAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_product_attachment',
+ outputSchema: zohoDeskDeleteProductAttachmentOutputSchema,
+ displayName: 'Delete Product Attachment',
+ description: 'Deletes a file attached to a product.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes one file attached to a product.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Product Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, productId, attachmentId } = context.propsValue;
+ await zohoDeskApi.deleteProductAttachment({
+ auth: context.auth,
+ orgId,
+ productId,
+ attachmentId,
+ });
+ return { success: true, productId, attachmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/delete-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/delete-products.ts
new file mode 100644
index 00000000000..2ec1874dffa
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/delete-products.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskDeleteProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_products',
+ outputSchema: zohoDeskDeleteProductsOutputSchema,
+ displayName: 'Delete Products',
+ description: 'Moves products to the recycle bin.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Moves one or more products to the recycle bin, where an admin can restore them.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productIds: Property.Array({
+ displayName: 'Product IDs',
+ description: 'Product IDs to delete.',
+ required: true,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ },
+ async run(context) {
+ const { orgId, productIds, departmentId } = context.propsValue;
+ await zohoDeskApi.deleteProducts({
+ auth: context.auth,
+ orgId,
+ productIds: zohoDeskUtils.requiredStringList({ value: productIds, propName: 'Product IDs' }),
+ departmentId,
+ });
+ return { success: true, productIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/find-duplicate-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/find-duplicate-products.ts
new file mode 100644
index 00000000000..68bfc4360ae
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/find-duplicate-products.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskFindDuplicateProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_find_duplicate_products',
+ outputSchema: zohoDeskListAccountProductsOutputSchema,
+ displayName: 'Find Duplicate Products',
+ description: 'Finds products with the same name.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Finds existing products whose name matches Product Name; use it before Create Product to avoid duplicates.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productName: Property.ShortText({
+ displayName: 'Product Name',
+ description: 'Product name to check.',
+ required: true,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, productName, from, limit } = context.propsValue;
+ const products = await zohoDeskApi.findDuplicateProducts({
+ auth: context.auth,
+ orgId,
+ productName,
+ from,
+ limit,
+ });
+ return { products, count: products.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/get-product.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/get-product.ts
new file mode 100644
index 00000000000..1c3c4597717
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/get-product.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetProductOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetProductAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_product',
+ outputSchema: zohoDeskGetProductOutputSchema,
+ displayName: 'Get Product',
+ description: 'Gets a product by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one product by ID with its code, price, category, departments and custom fields.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, productId } = context.propsValue;
+ return await zohoDeskApi.getProduct({ auth: context.auth, orgId, productId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-accounts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-accounts.ts
new file mode 100644
index 00000000000..5d03fca6d3f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-accounts.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListProductAccountsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_product_accounts',
+ outputSchema: zohoDeskListAccountsOutputSchema,
+ displayName: 'List Product Accounts',
+ description: 'Lists the accounts linked to a product.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the accounts linked to one product.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, productId, from, limit } = context.propsValue;
+ const accounts = await zohoDeskApi.listProductAccounts({
+ auth: context.auth,
+ orgId,
+ productId,
+ from,
+ limit,
+ });
+ return { accounts, count: accounts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-attachments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-attachments.ts
new file mode 100644
index 00000000000..6688a3ba5f4
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-attachments.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountAttachmentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListProductAttachmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_product_attachments',
+ outputSchema: zohoDeskListAccountAttachmentsOutputSchema,
+ displayName: 'List Product Attachments',
+ description: 'Lists the files attached to a product.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the files attached to one product, with name, size and download link (`href`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, productId, from, limit } = context.propsValue;
+ const attachments = await zohoDeskApi.listProductAttachments({
+ auth: context.auth,
+ orgId,
+ productId,
+ from,
+ limit,
+ });
+ return { attachments, count: attachments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-contacts.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-contacts.ts
new file mode 100644
index 00000000000..85ac8b4c1b5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-contacts.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListProductContactsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListProductContactsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_product_contacts',
+ outputSchema: zohoDeskListProductContactsOutputSchema,
+ displayName: 'List Product Contacts',
+ description: 'Lists the contacts linked to a product.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the contacts linked to one product.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, productId, from, limit } = context.propsValue;
+ const contacts = await zohoDeskApi.listProductContacts({
+ auth: context.auth,
+ orgId,
+ productId,
+ from,
+ limit,
+ });
+ return { contacts, count: contacts.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-tickets.ts
new file mode 100644
index 00000000000..a1aa1849122
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-product-tickets.ts
@@ -0,0 +1,43 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListProductTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListProductTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_product_tickets',
+ outputSchema: zohoDeskListProductTicketsOutputSchema,
+ displayName: 'List Product Tickets',
+ description: 'Lists the tickets about a product.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the tickets linked to one product, optionally only in one department.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, productId, departmentId, from, limit } = context.propsValue;
+ const tickets = await zohoDeskApi.listProductTickets({
+ auth: context.auth,
+ orgId,
+ productId,
+ departmentId,
+ from,
+ limit,
+ });
+ return { tickets, count: tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-products.ts
new file mode 100644
index 00000000000..e6982f4ecf8
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/list-products.ts
@@ -0,0 +1,74 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_products',
+ outputSchema: zohoDeskListAccountProductsOutputSchema,
+ displayName: 'List Products',
+ description: 'Lists products.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists products, optionally in one department or view. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Product view ID (from List Views, module products).',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Only products owned by this agent.',
+ required: false,
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by; a leading "-" sorts descending.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'productName', value: 'productName' },
+ { label: '-productName', value: '-productName' },
+ { label: 'productCode', value: 'productCode' },
+ { label: '-productCode', value: '-productCode' },
+ { label: 'unitPrice', value: 'unitPrice' },
+ { label: '-unitPrice', value: '-unitPrice' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: '-createdTime', value: '-createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ { label: '-modifiedTime', value: '-modifiedTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, viewId, ownerId, sortBy, from, limit } = context.propsValue;
+ const products = await zohoDeskApi.listProducts({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ viewId,
+ ownerId,
+ sortBy,
+ from,
+ limit,
+ });
+ return { products, count: products.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/search-products.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/search-products.ts
new file mode 100644
index 00000000000..753e9eec675
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/search-products.ts
@@ -0,0 +1,83 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchProductsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_products',
+ outputSchema: zohoDeskSearchProductsOutputSchema,
+ displayName: 'Search Products',
+ description: 'Searches products by text or name.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches products by free text (supports a trailing * wildcard), product name, linked contact or account, or time range. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched across product fields; end with * for a prefix match.',
+ required: false,
+ }),
+ productName: Property.ShortText({
+ displayName: 'Product Name',
+ description: 'Product name.',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ accountId: zohoDeskAiProps.accountId({ required: false }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ productName,
+ departmentId,
+ contactId,
+ accountId,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ } = context.propsValue;
+ const products = await zohoDeskApi.searchProducts({
+ auth: context.auth,
+ orgId,
+ searchText,
+ productName,
+ departmentId,
+ contactId,
+ accountId,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ });
+ return { products, count: products.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/update-product.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/update-product.ts
new file mode 100644
index 00000000000..cd51b27402d
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/update-product.ts
@@ -0,0 +1,107 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskGetProductOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateProductAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_product',
+ outputSchema: zohoDeskGetProductOutputSchema,
+ displayName: 'Update Product',
+ description: 'Updates fields on a product.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one product; fields left empty are not changed.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ productName: Property.ShortText({
+ displayName: 'Product Name',
+ description: 'Product name.',
+ required: false,
+ }),
+ departmentIds: Property.Array({
+ displayName: 'Department IDs',
+ description: 'Departments the product is available in (from List Departments).',
+ required: false,
+ }),
+ productCode: Property.ShortText({
+ displayName: 'Product Code',
+ description: 'Product code or SKU.',
+ required: false,
+ }),
+ unitPrice: Property.Number({
+ displayName: 'Unit Price',
+ description: 'Unit price.',
+ required: false,
+ }),
+ productCategory: Property.ShortText({
+ displayName: 'Category',
+ description: 'Product category.',
+ required: false,
+ }),
+ manufacturer: Property.ShortText({
+ displayName: 'Manufacturer',
+ description: 'Manufacturer.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who owns the product (from List Agents).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Product description.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module products).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ productId,
+ productName,
+ departmentIds,
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateProduct({
+ auth: context.auth,
+ orgId,
+ productId,
+ productName,
+ departmentIds: zohoDeskUtils.optionalStringList({
+ value: departmentIds,
+ propName: 'Department IDs',
+ }),
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/upload-product-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/upload-product-attachment.ts
new file mode 100644
index 00000000000..d71f73f3ec5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/products/upload-product-attachment.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUploadAccountAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUploadProductAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_upload_product_attachment',
+ outputSchema: zohoDeskUploadAccountAttachmentOutputSchema,
+ displayName: 'Upload Product Attachment',
+ description: 'Attaches a file to a product.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to one product. Not idempotent: each call adds another copy.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ productId: zohoDeskAiProps.productId({ required: true }),
+ file: Property.File({ displayName: 'File', description: 'File to attach.', required: true }),
+ },
+ async run(context) {
+ const { orgId, productId, file } = context.propsValue;
+ return await zohoDeskApi.uploadProductAttachment({
+ auth: context.auth,
+ orgId,
+ productId,
+ file,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/count-tasks.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/count-tasks.ts
new file mode 100644
index 00000000000..fa89ad4d046
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/count-tasks.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAccountsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountTasksAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_tasks',
+ outputSchema: zohoDeskCountAccountsOutputSchema,
+ displayName: 'Count Tasks',
+ description: 'Counts the tasks in a view.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Returns the number of tasks in one task view and department.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Task view ID (from List Views, module tasks).',
+ required: true,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, viewId, departmentId } = context.propsValue;
+ return await zohoDeskApi.countTasks({ auth: context.auth, orgId, viewId, departmentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/create-task-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/create-task-comment.ts
new file mode 100644
index 00000000000..d4e41bc59bc
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/create-task-comment.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateTaskCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_task_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Create Task Comment',
+ description: 'Adds a comment to a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an internal comment to one task. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Comment text. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.createTaskComment({
+ auth: context.auth,
+ orgId,
+ taskId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/create-task.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/create-task.ts
new file mode 100644
index 00000000000..ae25816cb2e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/create-task.ts
@@ -0,0 +1,105 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTaskOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateTaskAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_task',
+ outputSchema: zohoDeskGetTaskOutputSchema,
+ displayName: 'Create Task',
+ description: 'Creates a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a task in a department, optionally on a ticket and assigned to an agent. Not idempotent: each call creates a new task.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Task subject.',
+ required: true,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ ticketId: zohoDeskAiProps.ticketId({
+ required: false,
+ description: 'Ticket the task belongs to (from List Tickets).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID the task is assigned to (from List Agents).',
+ required: false,
+ }),
+ dueDate: Property.DateTime({
+ displayName: 'Due Date',
+ description: 'Due date, ISO 8601.',
+ required: false,
+ }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description: 'Task status, e.g. "Not Started", "In Progress" or "Completed".',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority, e.g. "Low", "Normal" or "High".',
+ required: false,
+ }),
+ category: Property.ShortText({
+ displayName: 'Category',
+ description: 'Task category.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Task details.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module tasks).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createTask({
+ auth: context.auth,
+ orgId,
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/delete-task-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/delete-task-attachment.ts
new file mode 100644
index 00000000000..6ccc14c2bf2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/delete-task-attachment.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteTaskAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteTaskAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_task_attachment',
+ outputSchema: zohoDeskDeleteTaskAttachmentOutputSchema,
+ displayName: 'Delete Task Attachment',
+ description: 'Deletes a file attached to a task.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes one file attached to a task.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Task Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, attachmentId } = context.propsValue;
+ await zohoDeskApi.deleteTaskAttachment({ auth: context.auth, orgId, taskId, attachmentId });
+ return { success: true, taskId, attachmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/delete-tasks.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/delete-tasks.ts
new file mode 100644
index 00000000000..9bc99dcbdc8
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/delete-tasks.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskDeleteTasksOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteTasksAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_tasks',
+ outputSchema: zohoDeskDeleteTasksOutputSchema,
+ displayName: 'Delete Tasks',
+ description: 'Moves tasks to the recycle bin.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Moves one or more tasks to the recycle bin, where an admin can restore them.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskIds: Property.Array({
+ displayName: 'Task IDs',
+ description: 'Task IDs to delete.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, taskIds } = context.propsValue;
+ await zohoDeskApi.deleteTasks({
+ auth: context.auth,
+ orgId,
+ taskIds: zohoDeskUtils.requiredStringList({ value: taskIds, propName: 'Task IDs' }),
+ });
+ return { success: true, taskIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/download-task-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/download-task-attachment.ts
new file mode 100644
index 00000000000..837ade6f16f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/download-task-attachment.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDownloadContractCommentAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDownloadTaskAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_download_task_attachment',
+ outputSchema: zohoDeskDownloadContractCommentAttachmentOutputSchema,
+ displayName: 'Download Task Attachment',
+ description: 'Downloads a file attached to a task.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Downloads one file attached to a task and returns it as a file.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Task Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, attachmentId } = context.propsValue;
+ const file = await zohoDeskApi.downloadTaskAttachment({
+ auth: context.auth,
+ orgId,
+ taskId,
+ attachmentId,
+ });
+ const fileName = file.fileName ?? attachmentId;
+ return { fileName, file: await context.files.write({ fileName, data: file.data }) };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/get-task-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/get-task-comment.ts
new file mode 100644
index 00000000000..c86036cdba4
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/get-task-comment.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTaskCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_task_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Get Task Comment',
+ description: 'Gets one comment on a task.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one comment on a task, with its author and content.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Task Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, commentId } = context.propsValue;
+ return await zohoDeskApi.getTaskComment({ auth: context.auth, orgId, taskId, commentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/get-task.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/get-task.ts
new file mode 100644
index 00000000000..6cd85295d54
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/get-task.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTaskOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTaskAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_task',
+ outputSchema: zohoDeskGetTaskOutputSchema,
+ displayName: 'Get Task',
+ description: 'Gets a task by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one task by ID with its subject, status, owner, due date, linked ticket and custom fields.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, taskId } = context.propsValue;
+ return await zohoDeskApi.getTask({ auth: context.auth, orgId, taskId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-task-attachments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-task-attachments.ts
new file mode 100644
index 00000000000..ee4c8e81a38
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-task-attachments.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountAttachmentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTaskAttachmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_task_attachments',
+ outputSchema: zohoDeskListAccountAttachmentsOutputSchema,
+ displayName: 'List Task Attachments',
+ description: 'Lists the files attached to a task.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the files attached to one task, with name, size and download link (`href`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, taskId, from, limit } = context.propsValue;
+ const attachments = await zohoDeskApi.listTaskAttachments({
+ auth: context.auth,
+ orgId,
+ taskId,
+ from,
+ limit,
+ });
+ return { attachments, count: attachments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-task-comments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-task-comments.ts
new file mode 100644
index 00000000000..fd2c446f9aa
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-task-comments.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListCallCommentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTaskCommentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_task_comments',
+ outputSchema: zohoDeskListCallCommentsOutputSchema,
+ displayName: 'List Task Comments',
+ description: 'Lists the comments on a task.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the comments on one task (agent notes).', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, taskId, from, limit } = context.propsValue;
+ const comments = await zohoDeskApi.listTaskComments({
+ auth: context.auth,
+ orgId,
+ taskId,
+ from,
+ limit,
+ });
+ return { comments, count: comments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-tasks.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-tasks.ts
new file mode 100644
index 00000000000..88890f4e7e1
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-tasks.ts
@@ -0,0 +1,80 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListTasksOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTasksAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_tasks',
+ outputSchema: zohoDeskListTasksOutputSchema,
+ displayName: 'List Tasks',
+ description: 'Lists tasks.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists tasks across tickets, optionally by department, view, assignee or completion. Use List Ticket Tasks for one ticket's tasks. Page with From and Limit.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description: 'Task view ID (from List Views, module tasks).',
+ required: false,
+ }),
+ assignee: Property.Array({
+ displayName: 'Assignee',
+ description: 'Agent IDs (from List Agents) to include.',
+ required: false,
+ }),
+ isCompleted: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Completed',
+ description: 'Yes returns only completed tasks, No only open ones.',
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'dueDate', value: 'dueDate' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ { label: 'priority', value: 'priority' },
+ { label: 'status', value: 'status' },
+ { label: 'subject', value: 'subject' },
+ { label: 'category', value: 'category' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, viewId, assignee, isCompleted, sortBy, from, limit } =
+ context.propsValue;
+ const tasks = await zohoDeskApi.listTasks({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ viewId,
+ assignee: zohoDeskUtils.optionalStringList({ value: assignee, propName: 'Assignee' }),
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+ });
+ return { tasks, count: tasks.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-ticket-tasks.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-ticket-tasks.ts
new file mode 100644
index 00000000000..e8fe276a1ce
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/list-ticket-tasks.ts
@@ -0,0 +1,65 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketTasksOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketTasksAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_tasks',
+ outputSchema: zohoDeskListTicketTasksOutputSchema,
+ displayName: 'List Ticket Tasks',
+ description: 'Lists the tasks on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the tasks linked to one ticket, optionally only completed or open ones.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ isCompleted: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Completed',
+ description: 'Yes returns only completed tasks, No only open ones.',
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'dueDate', value: 'dueDate' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'modifiedTime', value: 'modifiedTime' },
+ { label: 'priority', value: 'priority' },
+ { label: 'status', value: 'status' },
+ { label: 'subject', value: 'subject' },
+ { label: 'category', value: 'category' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, isCompleted, sortBy, from, limit } = context.propsValue;
+ const tasks = await zohoDeskApi.listTicketTasks({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+ });
+ return { tasks, count: tasks.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/search-tasks.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/search-tasks.ts
new file mode 100644
index 00000000000..53fb96aa2e5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/search-tasks.ts
@@ -0,0 +1,113 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchTasksOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchTasksAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_tasks',
+ outputSchema: zohoDeskSearchTasksOutputSchema,
+ displayName: 'Search Tasks',
+ description: 'Searches tasks by text, subject, ticket number, status or time range.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches tasks by free text (supports a trailing * wildcard), subject, ticket number, assignee, status, priority or time range. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Free text matched across task fields; end with * for a prefix match.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Text to match in the subject.',
+ required: false,
+ }),
+ ticketNumber: Property.ShortText({
+ displayName: 'Ticket Number',
+ description: 'Number of the ticket the task belongs to.',
+ required: false,
+ }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID (from List Agents).',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description: 'Task status.',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Task priority.',
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ dueDateRange: Property.ShortText({
+ displayName: 'Due Date Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ dueDateRange,
+ from,
+ limit,
+ } = context.propsValue;
+ const tasks = await zohoDeskApi.searchTasks({
+ auth: context.auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ dueDateRange,
+ from,
+ limit,
+ });
+ return { tasks, count: tasks.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-many-tasks.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-many-tasks.ts
new file mode 100644
index 00000000000..055fd0249d2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-many-tasks.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateManyTasksAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_many_tasks',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Update Many Tasks',
+ description: 'Sets one field to the same value on several tasks.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sets one field (by API name, e.g. "status") to the same value on several tasks at once.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskIds: Property.Array({
+ displayName: 'Task IDs',
+ description: 'Task IDs to update.',
+ required: true,
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'API name of the field to set (from List Fields, module tasks).',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Field Value',
+ description: 'Value to set. Leave empty to clear the field.',
+ required: false,
+ }),
+ isCustomField: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Custom Field',
+ description: 'Yes when Field Name is a custom field.',
+ }),
+ },
+ async run(context) {
+ const { orgId, taskIds, fieldName, fieldValue, isCustomField } = context.propsValue;
+ return await zohoDeskApi.updateManyTasks({
+ auth: context.auth,
+ orgId,
+ taskIds: zohoDeskUtils.requiredStringList({ value: taskIds, propName: 'Task IDs' }),
+ fieldName,
+ fieldValue,
+ isCustomField,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-task-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-task-comment.ts
new file mode 100644
index 00000000000..e0007825639
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-task-comment.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateCallCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTaskCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_task_comment',
+ outputSchema: zohoDeskCreateCallCommentOutputSchema,
+ displayName: 'Update Task Comment',
+ description: 'Edits a comment on a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Replaces the text of one comment on a task.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Task Comments).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'New comment text.',
+ required: true,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, commentId, content, contentType } = context.propsValue;
+ return await zohoDeskApi.updateTaskComment({
+ auth: context.auth,
+ orgId,
+ taskId,
+ commentId,
+ content,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-task.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-task.ts
new file mode 100644
index 00000000000..db8b6901c3b
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/update-task.ts
@@ -0,0 +1,108 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTaskOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTaskAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_task',
+ outputSchema: zohoDeskGetTaskOutputSchema,
+ displayName: 'Update Task',
+ description: 'Updates fields on a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one task (status, owner, due date, …); fields left empty are not changed.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Task subject.',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ ticketId: zohoDeskAiProps.ticketId({
+ required: false,
+ description: 'Ticket the task belongs to (from List Tickets).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID the task is assigned to (from List Agents).',
+ required: false,
+ }),
+ dueDate: Property.DateTime({
+ displayName: 'Due Date',
+ description: 'Due date, ISO 8601.',
+ required: false,
+ }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description: 'Task status, e.g. "Not Started", "In Progress" or "Completed".',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority, e.g. "Low", "Normal" or "High".',
+ required: false,
+ }),
+ category: Property.ShortText({
+ displayName: 'Category',
+ description: 'Task category.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Task details.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name (from List Fields, module tasks).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ taskId,
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateTask({
+ auth: context.auth,
+ orgId,
+ taskId,
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/upload-task-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/upload-task-attachment.ts
new file mode 100644
index 00000000000..794acc6a365
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tasks/upload-task-attachment.ts
@@ -0,0 +1,34 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUploadAccountAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUploadTaskAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_upload_task_attachment',
+ outputSchema: zohoDeskUploadAccountAttachmentOutputSchema,
+ displayName: 'Upload Task Attachment',
+ description: 'Attaches a file to a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to one task. Not idempotent: each call adds another copy.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ file: Property.File({ displayName: 'File', description: 'File to attach.', required: true }),
+ },
+ async run(context) {
+ const { orgId, taskId, file } = context.propsValue;
+ return await zohoDeskApi.uploadTaskAttachment({ auth: context.auth, orgId, taskId, file });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/create-draft-reply.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/create-draft-reply.ts
new file mode 100644
index 00000000000..2de0660771c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/create-draft-reply.ts
@@ -0,0 +1,98 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateDraftReplyOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateDraftReplyAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_draft_reply',
+ outputSchema: zohoDeskCreateDraftReplyOutputSchema,
+ displayName: 'Create Draft Reply',
+ description: 'Saves an email reply on a ticket as a draft.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Saves an email reply on one ticket as a draft for an agent to review and send; nothing is emailed. Not idempotent: each call creates another draft.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Reply body. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ fromEmailAddress: Property.ShortText({
+ displayName: 'From Address',
+ description:
+ "Sender address; must be one of the department's From addresses (from List Reply Addresses).",
+ required: true,
+ }),
+ to: Property.ShortText({
+ displayName: 'To',
+ description:
+ "Recipient email addresses, comma-separated. Defaults to the ticket's contact when empty.",
+ required: false,
+ }),
+ cc: Property.ShortText({
+ displayName: 'CC',
+ description: 'CC email addresses, comma-separated.',
+ required: false,
+ }),
+ bcc: Property.ShortText({
+ displayName: 'BCC',
+ description: 'BCC email addresses, comma-separated.',
+ required: false,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ inReplyToThreadId: Property.ShortText({
+ displayName: 'In Reply To Thread ID',
+ description: 'Thread ID being answered (from List Ticket Threads).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ ticketId,
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+ } = context.propsValue;
+ return await zohoDeskApi.createDraftReply({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/download-thread-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/download-thread-attachment.ts
new file mode 100644
index 00000000000..5755327a55d
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/download-thread-attachment.ts
@@ -0,0 +1,51 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDownloadContractCommentAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDownloadThreadAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_download_thread_attachment',
+ outputSchema: zohoDeskDownloadContractCommentAttachmentOutputSchema,
+ displayName: 'Download Thread Attachment',
+ description: 'Downloads a file attached to a ticket thread.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Downloads one file attached to a ticket thread and returns it as a file. Thread and attachment IDs come from Get Ticket Thread (`attachments[].id`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ threadId: Property.ShortText({
+ displayName: 'Thread ID',
+ description: 'Thread ID (from List Ticket Threads or Get Latest Ticket Thread).',
+ required: true,
+ }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID from Get Ticket Thread (`attachments[].id`).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, threadId, attachmentId } = context.propsValue;
+ const file = await zohoDeskApi.downloadThreadAttachment({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ threadId,
+ attachmentId,
+ });
+ const fileName = file.fileName ?? attachmentId;
+ return { fileName, file: await context.files.write({ fileName, data: file.data }) };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/get-latest-ticket-thread.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/get-latest-ticket-thread.ts
new file mode 100644
index 00000000000..37bf26d1578
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/get-latest-ticket-thread.ts
@@ -0,0 +1,49 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetLatestTicketThreadOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetLatestTicketThreadAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_latest_ticket_thread',
+ outputSchema: zohoDeskGetLatestTicketThreadOutputSchema,
+ displayName: 'Get Latest Ticket Thread',
+ description: 'Gets the most recent thread on a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets the most recent thread on one ticket, optionally only public or only incoming (customer) threads. Use it to read the customer's latest message before replying.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ needPublic: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Public Only',
+ description: 'Yes returns the latest public thread only.',
+ }),
+ needIncomingThread: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Incoming Only',
+ description: 'Yes returns the latest incoming (customer) thread only.',
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, needPublic, needIncomingThread } = context.propsValue;
+ return await zohoDeskApi.getLatestTicketThread({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ needPublic,
+ needIncomingThread,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/get-ticket-thread.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/get-ticket-thread.ts
new file mode 100644
index 00000000000..87e5e221ee2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/get-ticket-thread.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketThreadOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketThreadAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_thread',
+ outputSchema: zohoDeskGetTicketThreadOutputSchema,
+ displayName: 'Get Ticket Thread',
+ description: 'Gets one thread on a ticket with its full content.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one thread on a ticket with its full content (HTML `content` and `plainText`) and its attachments; the attachment ids feed Download Thread Attachment. Long content is fetched in full, never truncated.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ threadId: Property.ShortText({
+ displayName: 'Thread ID',
+ description: 'Thread ID (from List Ticket Threads or Get Latest Ticket Thread).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, threadId } = context.propsValue;
+ return await zohoDeskApi.getTicketThread({ auth: context.auth, orgId, ticketId, threadId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-reply-addresses.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-reply-addresses.ts
new file mode 100644
index 00000000000..e70b4851cb7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-reply-addresses.ts
@@ -0,0 +1,48 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListReplyAddressesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListReplyAddressesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_reply_addresses',
+ outputSchema: zohoDeskListReplyAddressesOutputSchema,
+ displayName: 'List Reply Addresses',
+ description: 'Lists the From addresses a department can send email from.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the From email addresses configured for one department. Send Ticket Reply and Create Draft Reply need one of these as From Address; prefer a verified, active one.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ isActive: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Active Only',
+ description: 'Yes returns only active addresses.',
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, departmentId, isActive, from, limit } = context.propsValue;
+ const addresses = await zohoDeskApi.listReplyAddresses({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ isActive,
+ from,
+ limit,
+ });
+ return { addresses, count: addresses.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-ticket-conversations.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-ticket-conversations.ts
new file mode 100644
index 00000000000..709eb63dc1e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-ticket-conversations.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketConversationsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketConversationsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_conversations',
+ outputSchema: zohoDeskListTicketConversationsOutputSchema,
+ displayName: 'List Ticket Conversations',
+ description: 'Lists the threads and comments on a ticket in one timeline.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists one ticket's threads and comments together in time order, the whole conversation in one call.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, from, limit } = context.propsValue;
+ const conversations = await zohoDeskApi.listTicketConversations({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+ });
+ return { conversations, count: conversations.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-ticket-threads.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-ticket-threads.ts
new file mode 100644
index 00000000000..30302b72661
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/list-ticket-threads.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketThreadsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketThreadsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_threads',
+ outputSchema: zohoDeskListTicketThreadsOutputSchema,
+ displayName: 'List Ticket Threads',
+ description: 'Lists the email and channel threads on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists the threads (emails and channel messages) on one ticket, with a summary of each. Use Get Ticket Thread for a thread's full content and attachments.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, from, limit } = context.propsValue;
+ const threads = await zohoDeskApi.listTicketThreads({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+ });
+ return { threads, count: threads.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/send-ticket-reply.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/send-ticket-reply.ts
new file mode 100644
index 00000000000..6df8dccfab5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/threads/send-ticket-reply.ts
@@ -0,0 +1,105 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSendTicketReplyOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSendTicketReplyAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_send_ticket_reply',
+ outputSchema: zohoDeskSendTicketReplyOutputSchema,
+ displayName: 'Send Ticket Reply',
+ description: 'Sends an email reply on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Sends an email reply to the customer on one ticket, from one of the department's From addresses (List Reply Addresses). The email goes out immediately; use Create Draft Reply to leave it for a human to review. Not idempotent: each call sends another email.",
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Reply body. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ fromEmailAddress: Property.ShortText({
+ displayName: 'From Address',
+ description:
+ "Sender address; must be one of the department's From addresses (from List Reply Addresses).",
+ required: true,
+ }),
+ to: Property.ShortText({
+ displayName: 'To',
+ description:
+ "Recipient email addresses, comma-separated. Defaults to the ticket's contact when empty.",
+ required: false,
+ }),
+ cc: Property.ShortText({
+ displayName: 'CC',
+ description: 'CC email addresses, comma-separated.',
+ required: false,
+ }),
+ bcc: Property.ShortText({
+ displayName: 'BCC',
+ description: 'BCC email addresses, comma-separated.',
+ required: false,
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ inReplyToThreadId: Property.ShortText({
+ displayName: 'In Reply To Thread ID',
+ description: 'Thread ID being answered (from List Ticket Threads).',
+ required: false,
+ }),
+ ticketStatus: Property.ShortText({
+ displayName: 'Ticket Status After Reply',
+ description: 'Status to set on the ticket after sending, e.g. "On Hold" or "Closed".',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ ticketId,
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+ ticketStatus,
+ } = context.propsValue;
+ return await zohoDeskApi.sendTicketReply({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+ ticketStatus,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/create-ticket-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/create-ticket-comment.ts
new file mode 100644
index 00000000000..0d79313a488
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/create-ticket-comment.ts
@@ -0,0 +1,62 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateTicketCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateTicketCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_ticket_comment',
+ outputSchema: zohoDeskCreateTicketCommentOutputSchema,
+ displayName: 'Create Ticket Comment',
+ description: 'Adds a comment to a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a comment to one ticket; private by default so only agents see it, or public when Is Public is Yes. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Comment text. HTML unless Content Type is plainText.',
+ required: true,
+ }),
+ isPublic: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Public',
+ description: 'Yes shows the comment to the contact; No keeps it agent-only.',
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content. Defaults to html.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, content, isPublic, contentType } = context.propsValue;
+ return await zohoDeskApi.createTicketComment({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ content,
+ isPublic,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/delete-ticket-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/delete-ticket-attachment.ts
new file mode 100644
index 00000000000..a1954b6d4d2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/delete-ticket-attachment.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteTicketAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteTicketAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_ticket_attachment',
+ outputSchema: zohoDeskDeleteTicketAttachmentOutputSchema,
+ displayName: 'Delete Ticket Attachment',
+ description: 'Deletes a file attached to a ticket.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one file attached to a ticket (attachment ID from List Ticket Attachments).',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'Attachment ID (from List Ticket Attachments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, attachmentId } = context.propsValue;
+ await zohoDeskApi.deleteTicketAttachment({ auth: context.auth, orgId, ticketId, attachmentId });
+ return { success: true, ticketId, attachmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/delete-ticket-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/delete-ticket-comment.ts
new file mode 100644
index 00000000000..17064b9b138
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/delete-ticket-comment.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteTicketCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteTicketCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_ticket_comment',
+ outputSchema: zohoDeskDeleteTicketCommentOutputSchema,
+ displayName: 'Delete Ticket Comment',
+ description: 'Deletes a comment from a ticket.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: { description: 'Permanently deletes one comment from a ticket.', idempotent: false },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Ticket Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, commentId } = context.propsValue;
+ await zohoDeskApi.deleteTicketComment({ auth: context.auth, orgId, ticketId, commentId });
+ return { success: true, ticketId, commentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/get-ticket-comment-history.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/get-ticket-comment-history.ts
new file mode 100644
index 00000000000..b33da857176
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/get-ticket-comment-history.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketCommentHistoryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketCommentHistoryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_comment_history',
+ outputSchema: zohoDeskGetTicketCommentHistoryOutputSchema,
+ displayName: 'Get Ticket Comment History',
+ description: 'Lists the edit history of a ticket comment.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the earlier versions of one ticket comment, with who edited it and when.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Ticket Comments).',
+ required: true,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, commentId, from, limit } = context.propsValue;
+ const history = await zohoDeskApi.getTicketCommentHistory({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ commentId,
+ from,
+ limit,
+ });
+ return { history, count: history.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/get-ticket-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/get-ticket-comment.ts
new file mode 100644
index 00000000000..5592a66ee68
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/get-ticket-comment.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateTicketCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_comment',
+ outputSchema: zohoDeskCreateTicketCommentOutputSchema,
+ displayName: 'Get Ticket Comment',
+ description: 'Gets one comment on a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one comment on a ticket, with its author, visibility and attachments.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Ticket Comments).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, commentId } = context.propsValue;
+ return await zohoDeskApi.getTicketComment({ auth: context.auth, orgId, ticketId, commentId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/list-ticket-attachments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/list-ticket-attachments.ts
new file mode 100644
index 00000000000..f536b5734d0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/list-ticket-attachments.ts
@@ -0,0 +1,48 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketAttachmentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketAttachmentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_attachments',
+ outputSchema: zohoDeskListTicketAttachmentsOutputSchema,
+ displayName: 'List Ticket Attachments',
+ description: 'Lists the files attached to a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the files attached directly to one ticket, with name, size and download link (`href`).',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ isPublic: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Public Only',
+ description: 'Yes returns only public attachments, No only private ones.',
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, isPublic, from, limit } = context.propsValue;
+ const attachments = await zohoDeskApi.listTicketAttachments({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ isPublic,
+ from,
+ limit,
+ });
+ return { attachments, count: attachments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/list-ticket-comments.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/list-ticket-comments.ts
new file mode 100644
index 00000000000..4176e0ad3bc
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/list-ticket-comments.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketCommentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketCommentsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_comments',
+ outputSchema: zohoDeskListTicketCommentsOutputSchema,
+ displayName: 'List Ticket Comments',
+ description: 'Lists the internal and public comments on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the comments on one ticket, both private (agent-only) and public.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, from, limit } = context.propsValue;
+ const comments = await zohoDeskApi.listTicketComments({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+ });
+ return { comments, count: comments.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/update-ticket-comment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/update-ticket-comment.ts
new file mode 100644
index 00000000000..d8d9aebf3db
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/update-ticket-comment.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateTicketCommentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTicketCommentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_ticket_comment',
+ outputSchema: zohoDeskCreateTicketCommentOutputSchema,
+ displayName: 'Update Ticket Comment',
+ description: 'Edits a comment on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Replaces the text of one ticket comment, and optionally its visibility.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'Comment ID (from List Ticket Comments).',
+ required: true,
+ }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'New comment text.',
+ required: true,
+ }),
+ isPublic: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Public',
+ description: 'Yes shows the comment to the contact; No keeps it agent-only.',
+ }),
+ contentType: Property.StaticDropdown({
+ displayName: 'Content Type',
+ description: 'Format of Content.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'html', value: 'html' },
+ { label: 'plainText', value: 'plainText' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, commentId, content, isPublic, contentType } = context.propsValue;
+ return await zohoDeskApi.updateTicketComment({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ commentId,
+ content,
+ isPublic,
+ contentType,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/upload-ticket-attachment.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/upload-ticket-attachment.ts
new file mode 100644
index 00000000000..2a0c4d733b7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/ticket-comments/upload-ticket-attachment.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUploadTicketAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUploadTicketAttachmentAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_upload_ticket_attachment',
+ outputSchema: zohoDeskUploadTicketAttachmentOutputSchema,
+ displayName: 'Upload Ticket Attachment',
+ description: 'Attaches a file to a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to one ticket, private unless Is Public is Yes. Not idempotent: each call adds another copy.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ file: Property.File({ displayName: 'File', description: 'File to attach.', required: true }),
+ isPublic: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Public',
+ description: 'Yes shows the file to the contact in the help center.',
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, file, isPublic } = context.propsValue;
+ return await zohoDeskApi.uploadTicketAttachment({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ file,
+ isPublic,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/add-ticket-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/add-ticket-followers.ts
new file mode 100644
index 00000000000..0ef5b850198
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/add-ticket-followers.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAddTicketFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAddTicketFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_ticket_followers',
+ outputSchema: zohoDeskAddTicketFollowersOutputSchema,
+ displayName: 'Add Ticket Followers',
+ description: 'Adds agents as followers of a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds agents (from List Agents) as followers of one ticket so they get its updates.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ followerIds: Property.Array({
+ displayName: 'Agent IDs',
+ description: 'Agent IDs to add as followers.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, followerIds } = context.propsValue;
+ await zohoDeskApi.addTicketFollowers({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ followerIds: zohoDeskUtils.requiredStringList({ value: followerIds, propName: 'Agent IDs' }),
+ });
+ return { success: true, ticketId, followerIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/add-ticket-tags.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/add-ticket-tags.ts
new file mode 100644
index 00000000000..3d87bd46654
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/add-ticket-tags.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAddTicketTagsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAddTicketTagsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_ticket_tags',
+ outputSchema: zohoDeskAddTicketTagsOutputSchema,
+ displayName: 'Add Ticket Tags',
+ description: 'Adds tags to a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Adds tags to one ticket, creating tags that don't exist yet. Tags already on the ticket are kept.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ tags: Property.Array({
+ displayName: 'Tags',
+ description: 'Tag names to add, e.g. ["billing", "vip"].',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, tags } = context.propsValue;
+ return await zohoDeskApi.addTicketTags({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ tags: zohoDeskUtils.requiredStringList({ value: tags, propName: 'Tags' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/close-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/close-tickets.ts
new file mode 100644
index 00000000000..13d27e9c77d
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/close-tickets.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskCloseTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCloseTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_close_tickets',
+ outputSchema: zohoDeskCloseTicketsOutputSchema,
+ displayName: 'Close Tickets',
+ description: 'Closes one or more tickets.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sets the status of one or more tickets to Closed in one call. Use Update Ticket for any other status.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketIds: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'Ticket IDs to close.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketIds } = context.propsValue;
+ await zohoDeskApi.closeTickets({
+ auth: context.auth,
+ orgId,
+ ticketIds: zohoDeskUtils.requiredStringList({ value: ticketIds, propName: 'Ticket IDs' }),
+ });
+ return { success: true, ticketIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/count-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/count-tickets.ts
new file mode 100644
index 00000000000..bea83877c5e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/count-tickets.ts
@@ -0,0 +1,71 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCountAgentsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCountTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_count_tickets',
+ outputSchema: zohoDeskCountAgentsOutputSchema,
+ displayName: 'Count Tickets',
+ description: 'Counts tickets matching filters.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Returns the number of tickets matching the filters (department, contact, assignee, category, created or modified time range), without returning the tickets.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID (from List Agents).',
+ required: false,
+ }),
+ category: Property.ShortText({
+ displayName: 'Category',
+ description: 'Ticket category.',
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description: 'Two ISO 8601 times separated by a comma.',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description: 'Two ISO 8601 times separated by a comma.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ departmentId,
+ contactId,
+ assigneeId,
+ category,
+ createdTimeRange,
+ modifiedTimeRange,
+ } = context.propsValue;
+ return await zohoDeskApi.countTickets({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ contactId,
+ assigneeId,
+ category,
+ createdTimeRange,
+ modifiedTimeRange,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket-approval.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket-approval.ts
new file mode 100644
index 00000000000..9c38ca86bc2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket-approval.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskCreateTicketApprovalOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateTicketApprovalAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_ticket_approval',
+ outputSchema: zohoDeskCreateTicketApprovalOutputSchema,
+ displayName: 'Create Ticket Approval',
+ description: 'Requests approval on a ticket from agents.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates an approval request on one ticket, sent to the given approver agents (from List Agents). Not idempotent: each call creates a new request.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ approverIds: Property.Array({
+ displayName: 'Approver IDs',
+ description: 'Agent IDs who can approve.',
+ required: true,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'What is being approved.',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Details for the approver.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, approverIds, subject, description } = context.propsValue;
+ return await zohoDeskApi.createTicketApproval({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ approverIds: zohoDeskUtils.requiredStringList({
+ value: approverIds,
+ propName: 'Approver IDs',
+ }),
+ subject,
+ description,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket-pin.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket-pin.ts
new file mode 100644
index 00000000000..263fb7513c6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket-pin.ts
@@ -0,0 +1,62 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskCreateTicketPinOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateTicketPinAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_ticket_pin',
+ outputSchema: zohoDeskCreateTicketPinOutputSchema,
+ displayName: 'Pin To Ticket',
+ description: 'Pins a comment or thread on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Pins one comment (from List Ticket Comments) or thread (from List Ticket Threads) to the top of a ticket.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ entityId: Property.ShortText({
+ displayName: 'Comment or Thread ID',
+ description: 'ID of the comment or thread to pin.',
+ required: true,
+ }),
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'Whether Comment or Thread ID is a comment or a thread.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'COMMENTS', value: 'COMMENTS' },
+ { label: 'THREADS', value: 'THREADS' },
+ ],
+ },
+ }),
+ isPublic: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Public',
+ description: 'Yes shows the pin to the contact in the help center.',
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, entityId, type, isPublic } = context.propsValue;
+ return await zohoDeskApi.createTicketPin({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ entityId,
+ type,
+ isPublic,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket.ts
new file mode 100644
index 00000000000..c7264b296a4
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/create-ticket.ts
@@ -0,0 +1,163 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { createTicketOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskCreateTicketAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_create_ticket',
+ outputSchema: createTicketOutputSchema,
+ displayName: 'Create Ticket',
+ description: 'Creates a new ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a ticket in a department. Needs a Department ID (from List Departments), a subject and a description; link the requester with Contact ID (from Search Contacts or Create Contact). Not idempotent: each call creates a new ticket.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: true }),
+ contactId: zohoDeskAiProps.contactId({
+ required: false,
+ description: 'Contact ID of the requester (from Search Contacts or Create Contact).',
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Ticket subject.',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Ticket description; HTML is allowed.',
+ required: true,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Requester email shown on the ticket.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Requester phone shown on the ticket.',
+ required: false,
+ }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description:
+ 'Ticket status name, e.g. "Open", "On Hold", "Escalated" or "Closed". Custom statuses are listed by List Fields (module tickets, field status).',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority name, e.g. "Low", "Medium", "High" or "Urgent".',
+ required: false,
+ }),
+ category: Property.ShortText({
+ displayName: 'Category',
+ description: 'Ticket category.',
+ required: false,
+ }),
+ subCategory: Property.ShortText({
+ displayName: 'Sub Category',
+ description: 'Ticket sub-category.',
+ required: false,
+ }),
+ dueDate: Property.DateTime({
+ displayName: 'Due Date',
+ description: 'Due date, ISO 8601.',
+ required: false,
+ }),
+ channel: Property.ShortText({
+ displayName: 'Channel',
+ description: 'Channel the ticket came in on, e.g. "Email", "Phone", "Web" or "Chat".',
+ required: false,
+ }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID to assign the ticket to (from List Agents).',
+ required: false,
+ }),
+ productId: zohoDeskAiProps.productId({
+ required: false,
+ description: 'Product the ticket is about (from List Products).',
+ }),
+ classification: Property.ShortText({
+ displayName: 'Classification',
+ description: 'Classification, e.g. "Question", "Problem", "Feature" or "Others".',
+ required: false,
+ }),
+ language: Property.ShortText({
+ displayName: 'Language',
+ description: 'Ticket language, e.g. "English".',
+ required: false,
+ }),
+ entitySkills: Property.Array({
+ displayName: 'Skill IDs',
+ description: 'Skill IDs for skill-based assignment.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description:
+ 'Custom field values keyed by API name, e.g. {"cf_order_id": "1234"} (names from List Fields).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ departmentId,
+ contactId,
+ subject,
+ description,
+ email,
+ phone,
+ status,
+ priority,
+ category,
+ subCategory,
+ dueDate,
+ channel,
+ assigneeId,
+ productId,
+ classification,
+ language,
+ entitySkills,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.createTicket({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ contactId,
+ subject,
+ description,
+ email,
+ phone,
+ status,
+ priority,
+ category,
+ subCategory,
+ dueDate,
+ channel,
+ assigneeId,
+ productId,
+ classification,
+ language,
+ entitySkills: zohoDeskUtils.optionalStringList({
+ value: entitySkills,
+ propName: 'Skill IDs',
+ }),
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-spam-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-spam-tickets.ts
new file mode 100644
index 00000000000..62e3f0e4d1f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-spam-tickets.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteSpamTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_spam_tickets',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Delete Spam Tickets',
+ description: 'Permanently deletes tickets that are marked as spam.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes tickets that are already marked as spam (see Mark Tickets Spam). This cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketIds: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'IDs of spam tickets to delete.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketIds } = context.propsValue;
+ return await zohoDeskApi.deleteSpamTickets({
+ auth: context.auth,
+ orgId,
+ ticketIds: zohoDeskUtils.requiredStringList({ value: ticketIds, propName: 'Ticket IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-ticket-resolution.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-ticket-resolution.ts
new file mode 100644
index 00000000000..b999274cb24
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-ticket-resolution.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteTicketResolutionOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteTicketResolutionAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_ticket_resolution',
+ outputSchema: zohoDeskDeleteTicketResolutionOutputSchema,
+ displayName: 'Delete Ticket Resolution',
+ description: 'Removes the resolution note from a ticket.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently removes the resolution note from one ticket.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ await zohoDeskApi.deleteTicketResolution({ auth: context.auth, orgId, ticketId });
+ return { success: true, ticketId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-tickets.ts
new file mode 100644
index 00000000000..f3409d7a1e9
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/delete-tickets.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskCloseTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_tickets',
+ outputSchema: zohoDeskCloseTicketsOutputSchema,
+ displayName: 'Delete Tickets',
+ description: 'Moves tickets to the recycle bin.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Moves one or more tickets to the recycle bin, where an admin can still restore them. Repeating the call on already-deleted tickets changes nothing.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketIds: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'Ticket IDs to delete (from List Tickets or Search Tickets).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketIds } = context.propsValue;
+ await zohoDeskApi.deleteTickets({
+ auth: context.auth,
+ orgId,
+ ticketIds: zohoDeskUtils.requiredStringList({ value: ticketIds, propName: 'Ticket IDs' }),
+ });
+ return { success: true, ticketIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-suggested-articles.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-suggested-articles.ts
new file mode 100644
index 00000000000..3ef7cba7aa0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-suggested-articles.ts
@@ -0,0 +1,47 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchArticlesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetSuggestedArticlesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_suggested_articles',
+ outputSchema: zohoDeskSearchArticlesOutputSchema,
+ displayName: 'Get Suggested Articles',
+ description: 'Gets knowledge-base articles suggested for a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Gets knowledge-base articles Zoho suggests for one ticket, based on its content. Use Get Article for an article's full text and Link Articles To Ticket to record that one was used.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({
+ required: false,
+ description: 'Department whose knowledge base to search (from List Departments).',
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, departmentId, from, limit } = context.propsValue;
+ const articles = await zohoDeskApi.getSuggestedArticles({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ departmentId,
+ from,
+ limit,
+ });
+ return { articles, count: articles.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-approval.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-approval.ts
new file mode 100644
index 00000000000..b48bd5d2a0f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-approval.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketApprovalOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketApprovalAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_approval',
+ outputSchema: zohoDeskGetTicketApprovalOutputSchema,
+ displayName: 'Get Ticket Approval',
+ description: 'Gets one approval request on a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one approval request on a ticket, with its status, requester, approver and timestamps.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ approvalId: Property.ShortText({
+ displayName: 'Approval ID',
+ description: 'Approval ID (from List Ticket Approvals).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, approvalId } = context.propsValue;
+ return await zohoDeskApi.getTicketApproval({ auth: context.auth, orgId, ticketId, approvalId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-metrics.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-metrics.ts
new file mode 100644
index 00000000000..752ed8b294e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-metrics.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketMetricsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketMetricsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_metrics',
+ outputSchema: zohoDeskGetTicketMetricsOutputSchema,
+ displayName: 'Get Ticket Metrics',
+ description: 'Gets response and resolution metrics for a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets one ticket's metrics: first response time, total response time, resolution time, response and reassign counts, reopen count and agents who handled it.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ return await zohoDeskApi.getTicketMetrics({ auth: context.auth, orgId, ticketId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-resolution.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-resolution.ts
new file mode 100644
index 00000000000..3da1c340903
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket-resolution.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketResolutionOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketResolutionAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_resolution',
+ outputSchema: zohoDeskGetTicketResolutionOutputSchema,
+ displayName: 'Get Ticket Resolution',
+ description: 'Gets the resolution note of a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets the resolution note recorded on one ticket, with its author and last-modified time.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ return await zohoDeskApi.getTicketResolution({ auth: context.auth, orgId, ticketId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket.ts
new file mode 100644
index 00000000000..f19bf473987
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/get-ticket.ts
@@ -0,0 +1,51 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket',
+ outputSchema: zohoDeskGetTicketOutputSchema,
+ displayName: 'Get Ticket',
+ description: 'Gets a ticket by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one ticket by its ID with all fields, including status, assignee, contact, department and custom fields (`cf`). To find a ticket by its number (e.g. "#123"), use Search Tickets with Ticket Number.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ include: Property.StaticMultiSelectDropdown({
+ displayName: 'Include',
+ description: 'Related data to embed in the ticket.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'contacts', value: 'contacts' },
+ { label: 'products', value: 'products' },
+ { label: 'assignee', value: 'assignee' },
+ { label: 'departments', value: 'departments' },
+ { label: 'contract', value: 'contract' },
+ { label: 'isRead', value: 'isRead' },
+ { label: 'team', value: 'team' },
+ { label: 'skills', value: 'skills' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, include } = context.propsValue;
+ return await zohoDeskApi.getTicket({ auth: context.auth, orgId, ticketId, include });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/link-articles-to-ticket.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/link-articles-to-ticket.ts
new file mode 100644
index 00000000000..ae14b951604
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/link-articles-to-ticket.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskLinkArticlesToTicketOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskLinkArticlesToTicketAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_link_articles_to_ticket',
+ outputSchema: zohoDeskLinkArticlesToTicketOutputSchema,
+ displayName: 'Link Articles To Ticket',
+ description: 'Records that knowledge-base articles were used on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Records that the given knowledge-base articles (from Search Articles or Get Suggested Articles) were used to answer one ticket.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ articleIds: Property.Array({
+ displayName: 'Article IDs',
+ description: 'Article IDs that were used.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, articleIds } = context.propsValue;
+ await zohoDeskApi.linkArticlesToTicket({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ articleIds: zohoDeskUtils.requiredStringList({ value: articleIds, propName: 'Article IDs' }),
+ });
+ return { success: true, ticketId, articleIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-activities.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-activities.ts
new file mode 100644
index 00000000000..58c48a0b27b
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-activities.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketActivitiesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketActivitiesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_activities',
+ outputSchema: zohoDeskListTicketActivitiesOutputSchema,
+ displayName: 'List Ticket Activities',
+ description: 'Lists the tasks, calls and events on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the activities (tasks, calls and events) linked to one ticket. Use List Ticket Tasks, List Ticket Calls or List Ticket Events for one kind.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ isCompleted: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Completed',
+ description: 'Yes returns only completed activities, No only open ones.',
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Sort field.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'activityTime', value: 'activityTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, isCompleted, sortBy, from, limit } = context.propsValue;
+ const activities = await zohoDeskApi.listTicketActivities({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+ });
+ return { activities, count: activities.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-approvals.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-approvals.ts
new file mode 100644
index 00000000000..b2d63d3c29c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-approvals.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketApprovalsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketApprovalsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_approvals',
+ outputSchema: zohoDeskListTicketApprovalsOutputSchema,
+ displayName: 'List Ticket Approvals',
+ description: 'Lists approval requests on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the approval requests on one ticket, optionally only Pending, Approved or Rejected ones.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only approvals with this status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Pending', value: 'Pending' },
+ { label: 'Approved', value: 'Approved' },
+ { label: 'Rejected', value: 'Rejected' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, status, from, limit } = context.propsValue;
+ const approvals = await zohoDeskApi.listTicketApprovals({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ status,
+ from,
+ limit,
+ });
+ return { approvals, count: approvals.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-calls.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-calls.ts
new file mode 100644
index 00000000000..332871d2b0f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-calls.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketCallsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketCallsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_calls',
+ outputSchema: zohoDeskListTicketCallsOutputSchema,
+ displayName: 'List Ticket Calls',
+ description: 'Lists the calls logged on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the calls logged on one ticket.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ isCompleted: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Completed',
+ description: 'Yes returns only completed calls, No only open ones.',
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Sort field.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'startTime', value: 'startTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, isCompleted, sortBy, from, limit } = context.propsValue;
+ const calls = await zohoDeskApi.listTicketCalls({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+ });
+ return { calls, count: calls.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-events.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-events.ts
new file mode 100644
index 00000000000..a5a4cc2f98c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-events.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketEventsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketEventsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_events',
+ outputSchema: zohoDeskListTicketEventsOutputSchema,
+ displayName: 'List Ticket Events',
+ description: 'Lists the events scheduled on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the events (meetings and appointments) linked to one ticket.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ isCompleted: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Completed',
+ description: 'Yes returns only completed events, No only open ones.',
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Sort field.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'startTime', value: 'startTime' },
+ { label: 'createdTime', value: 'createdTime' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, isCompleted, sortBy, from, limit } = context.propsValue;
+ const events = await zohoDeskApi.listTicketEvents({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+ });
+ return { events, count: events.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-followers.ts
new file mode 100644
index 00000000000..ccec872d1ee
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-followers.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_followers',
+ outputSchema: zohoDeskListTicketFollowersOutputSchema,
+ displayName: 'List Ticket Followers',
+ description: 'Lists the agents following a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the agents following one ticket.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ const followers = await zohoDeskApi.listTicketFollowers({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ });
+ return { followers, count: followers.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-history.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-history.ts
new file mode 100644
index 00000000000..07a4ac77cf5
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-history.ts
@@ -0,0 +1,72 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketHistoryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketHistoryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_history',
+ outputSchema: zohoDeskListTicketHistoryOutputSchema,
+ displayName: 'List Ticket History',
+ description: 'Lists the change history of a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the audit history of one ticket: field changes, comments, attachments and other events, with who did them and when. Narrow it with Event Filter, Field Name or Agent ID.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ agentId: zohoDeskAiProps.agentId({
+ required: false,
+ description: 'Only events by this agent (from List Agents).',
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'Only changes to this field, by API name.',
+ required: false,
+ }),
+ eventFilter: Property.StaticDropdown({
+ displayName: 'Event Filter',
+ description: 'Only this kind of event.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'CommentHistory', value: 'CommentHistory' },
+ { label: 'TimeEntryHistory', value: 'TimeEntryHistory' },
+ { label: 'TaskHistory', value: 'TaskHistory' },
+ { label: 'CallHistory', value: 'CallHistory' },
+ { label: 'EventHistory', value: 'EventHistory' },
+ { label: 'AttachmentHistory', value: 'AttachmentHistory' },
+ { label: 'ApprovalHistory', value: 'ApprovalHistory' },
+ { label: 'SuperviseHistory', value: 'SuperviseHistory' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, agentId, fieldName, eventFilter, from, limit } = context.propsValue;
+ const history = await zohoDeskApi.listTicketHistory({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ agentId,
+ fieldName,
+ eventFilter,
+ from,
+ limit,
+ });
+ return { history, count: history.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-pins.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-pins.ts
new file mode 100644
index 00000000000..c5f9287509a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-pins.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketPinsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketPinsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_pins',
+ outputSchema: zohoDeskListTicketPinsOutputSchema,
+ displayName: 'List Ticket Pins',
+ description: 'Lists the pinned comments and threads on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the comments and threads pinned on one ticket. The pin `id` is what Unpin Ticket Pin takes.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ types: Property.StaticMultiSelectDropdown({
+ displayName: 'Types',
+ description: 'Only pins of these types.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'comments', value: 'comments' },
+ { label: 'threads', value: 'threads' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, types } = context.propsValue;
+ const pins = await zohoDeskApi.listTicketPins({ auth: context.auth, orgId, ticketId, types });
+ return { pins, count: pins.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-resolution-history.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-resolution-history.ts
new file mode 100644
index 00000000000..673b60e375e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-resolution-history.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketResolutionHistoryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketResolutionHistoryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_resolution_history',
+ outputSchema: zohoDeskListTicketResolutionHistoryOutputSchema,
+ displayName: 'List Ticket Resolution History',
+ description: "Lists earlier versions of a ticket's resolution note.",
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists the earlier versions of one ticket's resolution note, with who changed it and when.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, from, limit } = context.propsValue;
+ const history = await zohoDeskApi.listTicketResolutionHistory({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+ });
+ return { history, count: history.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-tags.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-tags.ts
new file mode 100644
index 00000000000..3ebd02787f8
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-ticket-tags.ts
@@ -0,0 +1,29 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketTagsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketTagsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_tags',
+ outputSchema: zohoDeskListTicketTagsOutputSchema,
+ displayName: 'List Ticket Tags',
+ description: 'Lists the tags on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the tags currently on one ticket.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ return await zohoDeskApi.listTicketTags({ auth: context.auth, orgId, ticketId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-tickets.ts
new file mode 100644
index 00000000000..2a09479b3f3
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/list-tickets.ts
@@ -0,0 +1,135 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskListTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_tickets',
+ outputSchema: zohoDeskListTicketsOutputSchema,
+ displayName: 'List Tickets',
+ description:
+ 'Lists tickets, optionally filtered by department, view, status, priority, assignee or channel.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists tickets in an organization, filtered by department, view, status, priority, assignee or channel. Use Search Tickets to match text, email, phone or ticket number instead. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ departmentId: zohoDeskAiProps.departmentId({
+ required: false,
+ description: 'Only tickets in this department (from List Departments).',
+ }),
+ viewId: Property.ShortText({
+ displayName: 'View ID',
+ description:
+ 'Predefined or custom view ID (from List Views). A single-department view also needs its Department ID.',
+ required: false,
+ }),
+ status: Property.Array({
+ displayName: 'Status',
+ description: 'Status names to include, e.g. ["Open", "On Hold"].',
+ required: false,
+ }),
+ priority: Property.Array({
+ displayName: 'Priority',
+ description: 'Priorities to include, e.g. ["High", "Urgent"].',
+ required: false,
+ }),
+ assignee: Property.Array({
+ displayName: 'Assignee',
+ description: 'Agent IDs (from List Agents) to include, or ["Unassigned"].',
+ required: false,
+ }),
+ channel: Property.Array({
+ displayName: 'Channel',
+ description: 'Channels to include, e.g. ["Email", "Web", "Phone"].',
+ required: false,
+ }),
+ receivedInDays: Property.StaticDropdown({
+ displayName: 'Received In Days',
+ description: 'Only tickets received in the last 15, 30 or 90 days.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: '15', value: '15' },
+ { label: '30', value: '30' },
+ { label: '90', value: '90' },
+ ],
+ },
+ }),
+ sortBy: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'dueDate', value: 'dueDate' },
+ { label: 'createdTime', value: 'createdTime' },
+ { label: 'recentThread', value: 'recentThread' },
+ ],
+ },
+ }),
+ include: Property.StaticMultiSelectDropdown({
+ displayName: 'Include',
+ description: 'Related data to embed in each ticket.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'contacts', value: 'contacts' },
+ { label: 'products', value: 'products' },
+ { label: 'departments', value: 'departments' },
+ { label: 'team', value: 'team' },
+ { label: 'assignee', value: 'assignee' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ departmentId,
+ viewId,
+ status,
+ priority,
+ assignee,
+ channel,
+ receivedInDays,
+ sortBy,
+ include,
+ from,
+ limit,
+ } = context.propsValue;
+ const tickets = await zohoDeskApi.listTicketsByFilter({
+ auth: context.auth,
+ orgId,
+ departmentId,
+ viewId,
+ status: zohoDeskUtils.optionalStringList({ value: status, propName: 'Status' }),
+ priority: zohoDeskUtils.optionalStringList({ value: priority, propName: 'Priority' }),
+ assignee: zohoDeskUtils.optionalStringList({ value: assignee, propName: 'Assignee' }),
+ channel: zohoDeskUtils.optionalStringList({ value: channel, propName: 'Channel' }),
+ receivedInDays,
+ sortBy,
+ include,
+ from,
+ limit,
+ });
+ return { tickets, count: tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-ticket-read.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-ticket-read.ts
new file mode 100644
index 00000000000..786b90f7642
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-ticket-read.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteTicketResolutionOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMarkTicketReadAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_mark_ticket_read',
+ outputSchema: zohoDeskDeleteTicketResolutionOutputSchema,
+ displayName: 'Mark Ticket Read',
+ description: 'Marks a ticket as read for the connected agent.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Marks one ticket as read for the connected agent only.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ await zohoDeskApi.markTicketRead({ auth: context.auth, orgId, ticketId });
+ return { success: true, ticketId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-ticket-unread.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-ticket-unread.ts
new file mode 100644
index 00000000000..28351becf07
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-ticket-unread.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteTicketResolutionOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMarkTicketUnreadAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_mark_ticket_unread',
+ outputSchema: zohoDeskDeleteTicketResolutionOutputSchema,
+ displayName: 'Mark Ticket Unread',
+ description: 'Marks a ticket as unread for the connected agent.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Marks one ticket as unread for the connected agent only.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ await zohoDeskApi.markTicketUnread({ auth: context.auth, orgId, ticketId });
+ return { success: true, ticketId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-tickets-spam.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-tickets-spam.ts
new file mode 100644
index 00000000000..1388b0bef89
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/mark-tickets-spam.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskCloseTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMarkTicketsSpamAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_mark_tickets_spam',
+ outputSchema: zohoDeskCloseTicketsOutputSchema,
+ displayName: 'Mark Tickets Spam',
+ description: 'Marks tickets as spam or not spam.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Marks one or more tickets as spam (Is Spam = Yes) or clears the spam mark (No). Optionally marks their contacts as spam too.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketIds: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'Ticket IDs to mark.',
+ required: true,
+ }),
+ isSpam: zohoDeskAiProps.yesNo({
+ required: true,
+ displayName: 'Is Spam',
+ description: 'Yes marks the tickets as spam, No removes the spam mark.',
+ }),
+ contactSpam: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Mark Contacts As Spam',
+ description: "Yes also marks the tickets' contacts as spam.",
+ }),
+ handleExistingTickets: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: "Include Contacts' Other Tickets",
+ description: 'Yes also marks the other tickets of those contacts.',
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketIds, isSpam, contactSpam, handleExistingTickets } = context.propsValue;
+ await zohoDeskApi.markTicketsSpam({
+ auth: context.auth,
+ orgId,
+ ticketIds: zohoDeskUtils.requiredStringList({ value: ticketIds, propName: 'Ticket IDs' }),
+ isSpam,
+ contactSpam,
+ handleExistingTickets,
+ });
+ return { success: true, ticketIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/merge-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/merge-tickets.ts
new file mode 100644
index 00000000000..a22b26c9fa3
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/merge-tickets.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { createTicketOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMergeTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_merge_tickets',
+ outputSchema: createTicketOutputSchema,
+ displayName: 'Merge Tickets',
+ description: 'Merges other tickets into one ticket.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Merges the listed tickets into the target ticket, combining their threads, comments and attachments; the merged tickets are removed. This cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: Property.ShortText({
+ displayName: 'Target Ticket ID',
+ description: 'ID of the ticket the others are merged into.',
+ required: true,
+ }),
+ ticketIds: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'IDs of the tickets to merge into the target ticket.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, ticketIds } = context.propsValue;
+ return await zohoDeskApi.mergeTickets({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ ticketIds: zohoDeskUtils.requiredStringList({ value: ticketIds, propName: 'Ticket IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/move-ticket.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/move-ticket.ts
new file mode 100644
index 00000000000..218920472af
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/move-ticket.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskMoveTicketOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskMoveTicketAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_move_ticket',
+ outputSchema: zohoDeskMoveTicketOutputSchema,
+ displayName: 'Move Ticket',
+ description: 'Moves a ticket to another department.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Moves one ticket to another department (from List Departments). Moving to the department it is already in changes nothing.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ departmentId: zohoDeskAiProps.departmentId({
+ required: true,
+ description: 'Department to move the ticket to (from List Departments).',
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, departmentId } = context.propsValue;
+ await zohoDeskApi.moveTicket({ auth: context.auth, orgId, ticketId, departmentId });
+ return { success: true, ticketId, departmentId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/remove-ticket-followers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/remove-ticket-followers.ts
new file mode 100644
index 00000000000..347f05a78f8
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/remove-ticket-followers.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAddTicketFollowersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskRemoveTicketFollowersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_remove_ticket_followers',
+ outputSchema: zohoDeskAddTicketFollowersOutputSchema,
+ displayName: 'Remove Ticket Followers',
+ description: 'Removes followers from a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: { description: 'Removes agents from the followers of one ticket.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ followerIds: Property.Array({
+ displayName: 'Agent IDs',
+ description: 'Agent IDs to remove.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, followerIds } = context.propsValue;
+ await zohoDeskApi.removeTicketFollowers({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ followerIds: zohoDeskUtils.requiredStringList({ value: followerIds, propName: 'Agent IDs' }),
+ });
+ return { success: true, ticketId, followerIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/remove-ticket-tags.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/remove-ticket-tags.ts
new file mode 100644
index 00000000000..f38eafaa855
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/remove-ticket-tags.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskRemoveTicketTagsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskRemoveTicketTagsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_remove_ticket_tags',
+ outputSchema: zohoDeskRemoveTicketTagsOutputSchema,
+ displayName: 'Remove Ticket Tags',
+ description: 'Removes tags from a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Removes the named tags from one ticket; other tags stay.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ tags: Property.Array({
+ displayName: 'Tags',
+ description: 'Tag names to remove.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, tags } = context.propsValue;
+ await zohoDeskApi.removeTicketTags({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ tags: zohoDeskUtils.requiredStringList({ value: tags, propName: 'Tags' }),
+ });
+ return { success: true, ticketId, tags };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/search-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/search-tickets.ts
new file mode 100644
index 00000000000..8f55bb89257
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/search-tickets.ts
@@ -0,0 +1,126 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskSearchTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskSearchTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_search_tickets',
+ outputSchema: zohoDeskSearchTicketsOutputSchema,
+ displayName: 'Search Tickets',
+ description: 'Searches tickets by text, ticket number, email, contact, account or date range.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches tickets across the organization by free text (supports a trailing * wildcard), ticket number, requester email or phone, contact, account, assignee, status, priority or time range. Use it to resolve a ticket number like "#123" to a ticket ID. Page with From and Limit.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ searchText: Property.ShortText({
+ displayName: 'Search Text',
+ description:
+ 'Free text matched across ticket fields; end with * for a prefix match, e.g. "refund*".',
+ required: false,
+ }),
+ ticketNumber: Property.ShortText({
+ displayName: 'Ticket Number',
+ description: 'Ticket number without "#", e.g. "123".',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Text to match in the subject.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Requester email.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Requester phone.',
+ required: false,
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: false }),
+ accountId: zohoDeskAiProps.accountId({ required: false }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID (from List Agents).',
+ required: false,
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description:
+ 'Ticket status name, e.g. "Open", "On Hold", "Escalated" or "Closed". Custom statuses are listed by List Fields (module tickets, field status).',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority name, e.g. "High".',
+ required: false,
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description: 'Two ISO 8601 times separated by a comma.',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ searchText,
+ ticketNumber,
+ subject,
+ email,
+ phone,
+ contactId,
+ accountId,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ } = context.propsValue;
+ const tickets = await zohoDeskApi.searchTickets({
+ auth: context.auth,
+ orgId,
+ searchText,
+ ticketNumber,
+ subject,
+ email,
+ phone,
+ contactId,
+ accountId,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ });
+ return { tickets, count: tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/unpin-ticket-pin.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/unpin-ticket-pin.ts
new file mode 100644
index 00000000000..0aba0c4735a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/unpin-ticket-pin.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskAssociateAccountProductsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUnpinTicketPinAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_unpin_ticket_pin',
+ outputSchema: zohoDeskAssociateAccountProductsOutputSchema,
+ displayName: 'Unpin From Ticket',
+ description: 'Removes pins from a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Removes pins (the pin `id` from List Ticket Pins) from one ticket.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ pinIds: Property.Array({
+ displayName: 'Pin IDs',
+ description: 'Pin IDs to remove (from List Ticket Pins).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, pinIds } = context.propsValue;
+ return await zohoDeskApi.unpinTicketPin({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ pinIds: zohoDeskUtils.requiredStringList({ value: pinIds, propName: 'Pin IDs' }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-many-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-many-tickets.ts
new file mode 100644
index 00000000000..e734a03fac0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-many-tickets.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUtils } from '../../../common/utils';
+import { zohoDeskCloseTicketsOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateManyTicketsAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_many_tickets',
+ outputSchema: zohoDeskCloseTicketsOutputSchema,
+ displayName: 'Update Many Tickets',
+ description: 'Sets one field to the same value on several tickets.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sets one field (by API name, e.g. "priority" or "cf_region") to the same value on several tickets at once. Use Update Ticket to change several fields on one ticket.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketIds: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'Ticket IDs to update.',
+ required: true,
+ }),
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'API name of the field to set, e.g. "priority" (names from List Fields).',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Field Value',
+ description: 'Value to set. Leave empty to clear the field.',
+ required: false,
+ }),
+ isCustomField: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Custom Field',
+ description: 'Yes when Field Name is a custom field.',
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketIds, fieldName, fieldValue, isCustomField } = context.propsValue;
+ await zohoDeskApi.updateManyTickets({
+ auth: context.auth,
+ orgId,
+ ticketIds: zohoDeskUtils.requiredStringList({ value: ticketIds, propName: 'Ticket IDs' }),
+ fieldName,
+ fieldValue,
+ isCustomField,
+ });
+ return { success: true, ticketIds };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket-approval.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket-approval.ts
new file mode 100644
index 00000000000..a6a97330cb9
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket-approval.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUpdateTicketApprovalOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTicketApprovalAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_ticket_approval',
+ outputSchema: zohoDeskUpdateTicketApprovalOutputSchema,
+ displayName: 'Approve Or Reject Ticket Approval',
+ description: 'Approves or rejects an approval request on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Approves or rejects one pending approval request on a ticket. Only an agent named as its approver can do this.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ approvalId: Property.ShortText({
+ displayName: 'Approval ID',
+ description: 'Approval ID (from List Ticket Approvals).',
+ required: true,
+ }),
+ status: Property.StaticDropdown({
+ displayName: 'Decision',
+ description: 'Approved or Rejected.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Approved', value: 'Approved' },
+ { label: 'Rejected', value: 'Rejected' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, approvalId, status } = context.propsValue;
+ return await zohoDeskApi.updateTicketApproval({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ approvalId,
+ status,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket-resolution.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket-resolution.ts
new file mode 100644
index 00000000000..ad247742f20
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket-resolution.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketResolutionOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTicketResolutionAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_ticket_resolution',
+ outputSchema: zohoDeskGetTicketResolutionOutputSchema,
+ displayName: 'Update Ticket Resolution',
+ description: 'Sets the resolution note of a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Replaces the resolution note on one ticket, optionally emailing it to the contact. Use Delete Ticket Resolution to remove it.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ content: Property.LongText({
+ displayName: 'Content',
+ description: 'Resolution text.',
+ required: true,
+ }),
+ isNotifyContact: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Notify Contact',
+ description: "Yes emails the resolution to the ticket's contact.",
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, content, isNotifyContact } = context.propsValue;
+ return await zohoDeskApi.updateTicketResolution({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ content,
+ isNotifyContact,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket.ts
new file mode 100644
index 00000000000..87c0d27723f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/tickets/update-ticket.ts
@@ -0,0 +1,156 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskUpdateTicketOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTicketAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_ticket',
+ outputSchema: zohoDeskUpdateTicketOutputSchema,
+ displayName: 'Update Ticket',
+ description: 'Updates fields on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one ticket (status, priority, assignee, due date, custom fields, …); fields left empty are not changed and cannot be cleared here. Use Move Ticket to change its department and Close Tickets to close several at once.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'New subject.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'New description; HTML is allowed.',
+ required: false,
+ }),
+ status: Property.ShortText({
+ displayName: 'Status',
+ description:
+ 'Ticket status name, e.g. "Open", "On Hold", "Escalated" or "Closed". Custom statuses are listed by List Fields (module tickets, field status).',
+ required: false,
+ }),
+ priority: Property.ShortText({
+ displayName: 'Priority',
+ description: 'Priority name, e.g. "Low", "Medium", "High" or "Urgent".',
+ required: false,
+ }),
+ assigneeId: Property.ShortText({
+ displayName: 'Assignee ID',
+ description: 'Agent ID to assign the ticket to (from List Agents).',
+ required: false,
+ }),
+ contactId: zohoDeskAiProps.contactId({
+ required: false,
+ description: 'Contact ID to set as the requester.',
+ }),
+ productId: zohoDeskAiProps.productId({ required: false }),
+ category: Property.ShortText({
+ displayName: 'Category',
+ description: 'Ticket category.',
+ required: false,
+ }),
+ subCategory: Property.ShortText({
+ displayName: 'Sub Category',
+ description: 'Ticket sub-category.',
+ required: false,
+ }),
+ dueDate: Property.DateTime({
+ displayName: 'Due Date',
+ description: 'Due date, ISO 8601.',
+ required: false,
+ }),
+ channel: Property.ShortText({
+ displayName: 'Channel',
+ description: 'Channel, e.g. "Email", "Phone", "Web" or "Chat".',
+ required: false,
+ }),
+ classification: Property.ShortText({
+ displayName: 'Classification',
+ description: 'Classification, e.g. "Question" or "Problem".',
+ required: false,
+ }),
+ language: Property.ShortText({
+ displayName: 'Language',
+ description: 'Ticket language.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Requester email shown on the ticket.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Requester phone shown on the ticket.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name, e.g. {"cf_order_id": "1234"}.',
+ required: false,
+ }),
+ disableClosureNotification: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Disable Closure Notification',
+ description:
+ 'Yes skips the email Zoho sends to the contact when this update closes the ticket.',
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ ticketId,
+ subject,
+ description,
+ status,
+ priority,
+ assigneeId,
+ contactId,
+ productId,
+ category,
+ subCategory,
+ dueDate,
+ channel,
+ classification,
+ language,
+ email,
+ phone,
+ customFields,
+ disableClosureNotification,
+ } = context.propsValue;
+ return await zohoDeskApi.updateTicket({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ subject,
+ description,
+ status,
+ priority,
+ assigneeId,
+ contactId,
+ productId,
+ category,
+ subCategory,
+ dueDate,
+ channel,
+ classification,
+ language,
+ email,
+ phone,
+ customFields,
+ disableClosureNotification,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/add-task-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/add-task-time-entry.ts
new file mode 100644
index 00000000000..1edb1c8fe09
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/add-task-time-entry.ts
@@ -0,0 +1,118 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskAddTaskTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAddTaskTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_task_time_entry',
+ outputSchema: zohoDeskAddTaskTimeEntryOutputSchema,
+ displayName: 'Add Task Time Entry',
+ description: 'Logs time spent on a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Logs time spent on one task. Not idempotent: each call adds another entry.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ executedTime: Property.DateTime({
+ displayName: 'Executed Time',
+ description: 'When the work was done, ISO 8601.',
+ required: true,
+ }),
+ hoursSpent: Property.Number({
+ displayName: 'Hours Spent',
+ description: 'Whole hours spent.',
+ required: false,
+ }),
+ minutesSpent: Property.Number({
+ displayName: 'Minutes Spent',
+ description: 'Minutes spent (0-59).',
+ required: false,
+ }),
+ secondsSpent: Property.Number({
+ displayName: 'Seconds Spent',
+ description: 'Seconds spent (0-59).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'What the time was spent on.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who did the work (from List Agents). Defaults to the connected agent.',
+ required: false,
+ }),
+ isBillable: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Billable',
+ description: 'Yes marks the entry billable.',
+ }),
+ requestChargeType: Property.StaticDropdown({
+ displayName: 'Charge Type',
+ description: 'Kind of work.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Customer Service', value: 'Customer Service' },
+ { label: 'Upgrade Request', value: 'Upgrade Request' },
+ { label: 'Product Consultation', value: 'Product Consultation' },
+ { label: 'Support and Maintenance', value: 'Support and Maintenance' },
+ ],
+ },
+ }),
+ additionalCost: Property.Number({
+ displayName: 'Additional Cost',
+ description: 'Extra cost added to the entry.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ taskId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.addTaskTimeEntry({
+ auth: context.auth,
+ orgId,
+ taskId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/add-ticket-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/add-ticket-time-entry.ts
new file mode 100644
index 00000000000..5593a4a31aa
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/add-ticket-time-entry.ts
@@ -0,0 +1,119 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAgentTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskAddTicketTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_add_ticket_time_entry',
+ outputSchema: zohoDeskGetAgentTimeEntryOutputSchema,
+ displayName: 'Add Ticket Time Entry',
+ description: 'Logs time spent on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Logs time spent on one ticket (hours, minutes, seconds and when it was done). Not idempotent: each call adds another entry.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ executedTime: Property.DateTime({
+ displayName: 'Executed Time',
+ description: 'When the work was done, ISO 8601.',
+ required: true,
+ }),
+ hoursSpent: Property.Number({
+ displayName: 'Hours Spent',
+ description: 'Whole hours spent.',
+ required: false,
+ }),
+ minutesSpent: Property.Number({
+ displayName: 'Minutes Spent',
+ description: 'Minutes spent (0-59).',
+ required: false,
+ }),
+ secondsSpent: Property.Number({
+ displayName: 'Seconds Spent',
+ description: 'Seconds spent (0-59).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'What the time was spent on.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who did the work (from List Agents). Defaults to the connected agent.',
+ required: false,
+ }),
+ isBillable: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Billable',
+ description: 'Yes marks the entry billable.',
+ }),
+ requestChargeType: Property.StaticDropdown({
+ displayName: 'Charge Type',
+ description: 'Kind of work.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Customer Service', value: 'Customer Service' },
+ { label: 'Upgrade Request', value: 'Upgrade Request' },
+ { label: 'Product Consultation', value: 'Product Consultation' },
+ { label: 'Support and Maintenance', value: 'Support and Maintenance' },
+ ],
+ },
+ }),
+ additionalCost: Property.Number({
+ displayName: 'Additional Cost',
+ description: 'Extra cost added to the entry.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ ticketId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.addTicketTimeEntry({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/control-task-timer.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/control-task-timer.ts
new file mode 100644
index 00000000000..afc3c2818f3
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/control-task-timer.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketTimerOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskControlTaskTimerAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_control_task_timer',
+ outputSchema: zohoDeskGetTicketTimerOutputSchema,
+ displayName: 'Control Task Timer',
+ description: 'Starts, pauses, resumes or stops the timer on a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Starts, pauses, resumes or stops the connected agent's timer on one task; stopping it logs a time entry. Not idempotent: the result depends on the timer's current state.",
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ action: Property.StaticDropdown({
+ displayName: 'Action',
+ description: 'Timer action.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'START', value: 'START' },
+ { label: 'PAUSE', value: 'PAUSE' },
+ { label: 'RESUME', value: 'RESUME' },
+ { label: 'STOP', value: 'STOP' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, action } = context.propsValue;
+ return await zohoDeskApi.controlTaskTimer({ auth: context.auth, orgId, taskId, action });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/control-ticket-timer.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/control-ticket-timer.ts
new file mode 100644
index 00000000000..34870ad8e6f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/control-ticket-timer.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketTimerOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskControlTicketTimerAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_control_ticket_timer',
+ outputSchema: zohoDeskGetTicketTimerOutputSchema,
+ displayName: 'Control Ticket Timer',
+ description: 'Starts, pauses, resumes or stops the timer on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Starts, pauses, resumes or stops the connected agent's timer on one ticket; stopping it logs a time entry. Not idempotent: the result depends on the timer's current state.",
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ action: Property.StaticDropdown({
+ displayName: 'Action',
+ description: 'Timer action.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'START', value: 'START' },
+ { label: 'PAUSE', value: 'PAUSE' },
+ { label: 'RESUME', value: 'RESUME' },
+ { label: 'STOP', value: 'STOP' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, action } = context.propsValue;
+ return await zohoDeskApi.controlTicketTimer({ auth: context.auth, orgId, ticketId, action });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/delete-ticket-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/delete-ticket-time-entry.ts
new file mode 100644
index 00000000000..c25337898dd
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/delete-ticket-time-entry.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskDeleteTicketTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskDeleteTicketTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_delete_ticket_time_entry',
+ outputSchema: zohoDeskDeleteTicketTimeEntryOutputSchema,
+ displayName: 'Delete Ticket Time Entry',
+ description: 'Deletes a time entry from a ticket.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes one time entry from a ticket.',
+ idempotent: false,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ timeEntryId: Property.ShortText({
+ displayName: 'Time Entry ID',
+ description: 'Time entry ID (from the matching List Time Entries action).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, timeEntryId } = context.propsValue;
+ await zohoDeskApi.deleteTicketTimeEntry({ auth: context.auth, orgId, ticketId, timeEntryId });
+ return { success: true, ticketId, timeEntryId };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-account-time-summary.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-account-time-summary.ts
new file mode 100644
index 00000000000..84a54b9cda7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-account-time-summary.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountTimeSummaryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetAccountTimeSummaryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_account_time_summary',
+ outputSchema: zohoDeskGetAccountTimeSummaryOutputSchema,
+ displayName: 'Get Account Time Summary',
+ description: 'Get Account Time Summary.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: "Returns the total time and cost logged on one account's records.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only entries logged on this kind of record.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, accountId, module, departmentId, billStatus } = context.propsValue;
+ return await zohoDeskApi.getAccountTimeSummary({
+ auth: context.auth,
+ orgId,
+ accountId,
+ module,
+ departmentId,
+ billStatus,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-agent-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-agent-time-entry.ts
new file mode 100644
index 00000000000..f877cd5d9ec
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-agent-time-entry.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAgentTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetAgentTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_agent_time_entry',
+ outputSchema: zohoDeskGetAgentTimeEntryOutputSchema,
+ displayName: 'Get Agent Time Entry',
+ description: 'Gets one time entry logged by an agent.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one time entry logged by an agent, with its record, duration and cost.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ agentId: zohoDeskAiProps.agentId({ required: true }),
+ timeEntryId: Property.ShortText({
+ displayName: 'Time Entry ID',
+ description: 'Time entry ID (from the matching List Time Entries action).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, agentId, timeEntryId } = context.propsValue;
+ return await zohoDeskApi.getAgentTimeEntry({ auth: context.auth, orgId, agentId, timeEntryId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-agent-time-summary.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-agent-time-summary.ts
new file mode 100644
index 00000000000..02cc07b24c0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-agent-time-summary.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountTimeSummaryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetAgentTimeSummaryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_agent_time_summary',
+ outputSchema: zohoDeskGetAccountTimeSummaryOutputSchema,
+ displayName: 'Get Agent Time Summary',
+ description: 'Get Agent Time Summary.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns the total time and cost one agent has logged.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ agentId: zohoDeskAiProps.agentId({ required: true }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only entries logged on this kind of record.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, agentId, module, departmentId, billStatus } = context.propsValue;
+ return await zohoDeskApi.getAgentTimeSummary({
+ auth: context.auth,
+ orgId,
+ agentId,
+ module,
+ departmentId,
+ billStatus,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-contact-time-summary.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-contact-time-summary.ts
new file mode 100644
index 00000000000..e03de7e10d6
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-contact-time-summary.ts
@@ -0,0 +1,65 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountTimeSummaryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetContactTimeSummaryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_contact_time_summary',
+ outputSchema: zohoDeskGetAccountTimeSummaryOutputSchema,
+ displayName: 'Get Contact Time Summary',
+ description: 'Get Contact Time Summary.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: "Returns the total time and cost logged on one contact's tickets and tasks.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only time logged on tickets or tasks.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, contactId, module, departmentId, billStatus } = context.propsValue;
+ return await zohoDeskApi.getContactTimeSummary({
+ auth: context.auth,
+ orgId,
+ contactId,
+ module,
+ departmentId,
+ billStatus,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-time-entry.ts
new file mode 100644
index 00000000000..53e779be14e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-time-entry.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskAddTaskTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTaskTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_task_time_entry',
+ outputSchema: zohoDeskAddTaskTimeEntryOutputSchema,
+ displayName: 'Get Task Time Entry',
+ description: 'Gets one time entry on a task.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one time entry on a task with its duration, owner, billing and cost.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ timeEntryId: Property.ShortText({
+ displayName: 'Time Entry ID',
+ description: 'Time entry ID (from the matching List Time Entries action).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, timeEntryId } = context.propsValue;
+ return await zohoDeskApi.getTaskTimeEntry({ auth: context.auth, orgId, taskId, timeEntryId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-time-summary.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-time-summary.ts
new file mode 100644
index 00000000000..0b3d728c476
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-time-summary.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountTimeSummaryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTaskTimeSummaryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_task_time_summary',
+ outputSchema: zohoDeskGetAccountTimeSummaryOutputSchema,
+ displayName: 'Get Task Time Summary',
+ description: 'Get Task Time Summary.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns the total time and cost logged on one task.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, taskId, billStatus } = context.propsValue;
+ return await zohoDeskApi.getTaskTimeSummary({ auth: context.auth, orgId, taskId, billStatus });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-timer.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-timer.ts
new file mode 100644
index 00000000000..9d95691c3d4
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-task-timer.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketTimerOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTaskTimerAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_task_timer',
+ outputSchema: zohoDeskGetTicketTimerOutputSchema,
+ displayName: 'Get Task Timer',
+ description: "Gets the connected agent's timer on a task.",
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: "Gets the state and elapsed time of the connected agent's timer on one task.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, taskId } = context.propsValue;
+ return await zohoDeskApi.getTaskTimer({ auth: context.auth, orgId, taskId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-time-entry.ts
new file mode 100644
index 00000000000..df98428aabb
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-time-entry.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAgentTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_time_entry',
+ outputSchema: zohoDeskGetAgentTimeEntryOutputSchema,
+ displayName: 'Get Ticket Time Entry',
+ description: 'Gets one time entry on a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Gets one time entry on a ticket with its duration, owner, billing and cost.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ timeEntryId: Property.ShortText({
+ displayName: 'Time Entry ID',
+ description: 'Time entry ID (from the matching List Time Entries action).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, timeEntryId } = context.propsValue;
+ return await zohoDeskApi.getTicketTimeEntry({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ timeEntryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-time-summary.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-time-summary.ts
new file mode 100644
index 00000000000..d6e5c0664eb
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-time-summary.ts
@@ -0,0 +1,65 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAccountTimeSummaryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketTimeSummaryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_time_summary',
+ outputSchema: zohoDeskGetAccountTimeSummaryOutputSchema,
+ displayName: 'Get Ticket Time Summary',
+ description: 'Get Ticket Time Summary.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns the total time (hours, minutes, seconds) and cost logged on one ticket.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only entries logged on this kind of record.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ ],
+ },
+ }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { orgId, ticketId, module, billStatus } = context.propsValue;
+ return await zohoDeskApi.getTicketTimeSummary({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ module,
+ billStatus,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-timer.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-timer.ts
new file mode 100644
index 00000000000..a3b7a2b31e1
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/get-ticket-timer.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetTicketTimerOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskGetTicketTimerAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_get_ticket_timer',
+ outputSchema: zohoDeskGetTicketTimerOutputSchema,
+ displayName: 'Get Ticket Timer',
+ description: "Gets the connected agent's timer on a ticket.",
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Gets the state (running, paused, stopped) and elapsed time of the connected agent's timer on one ticket.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ },
+ async run(context) {
+ const { orgId, ticketId } = context.propsValue;
+ return await zohoDeskApi.getTicketTimer({ auth: context.auth, orgId, ticketId });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-account-time-entries.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-account-time-entries.ts
new file mode 100644
index 00000000000..ee7f3db30a2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-account-time-entries.ts
@@ -0,0 +1,72 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountTimeEntriesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAccountTimeEntriesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_account_time_entries',
+ outputSchema: zohoDeskListAccountTimeEntriesOutputSchema,
+ displayName: 'List Account Time Entries',
+ description: 'List Account Time Entries.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: "Lists the time entries logged on one account's records.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ accountId: zohoDeskAiProps.accountId({ required: true }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only entries logged on this kind of record.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, accountId, module, departmentId, billStatus, from, limit } = context.propsValue;
+ const timeEntries = await zohoDeskApi.listAccountTimeEntries({
+ auth: context.auth,
+ orgId,
+ accountId,
+ module,
+ departmentId,
+ billStatus,
+ from,
+ limit,
+ });
+ return { timeEntries, count: timeEntries.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-agent-time-entries.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-agent-time-entries.ts
new file mode 100644
index 00000000000..163cb6e372a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-agent-time-entries.ts
@@ -0,0 +1,69 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountTimeEntriesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListAgentTimeEntriesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_agent_time_entries',
+ outputSchema: zohoDeskListAccountTimeEntriesOutputSchema,
+ displayName: 'List Agent Time Entries',
+ description: 'List Agent Time Entries.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the time entries one agent has logged.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ agentId: zohoDeskAiProps.agentId({ required: true }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only entries logged on this kind of record.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, agentId, module, departmentId, billStatus, from, limit } = context.propsValue;
+ const timeEntries = await zohoDeskApi.listAgentTimeEntries({
+ auth: context.auth,
+ orgId,
+ agentId,
+ module,
+ departmentId,
+ billStatus,
+ from,
+ limit,
+ });
+ return { timeEntries, count: timeEntries.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-contact-time-entries.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-contact-time-entries.ts
new file mode 100644
index 00000000000..a3a5a2bcd2e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-contact-time-entries.ts
@@ -0,0 +1,70 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountTimeEntriesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListContactTimeEntriesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_contact_time_entries',
+ outputSchema: zohoDeskListAccountTimeEntriesOutputSchema,
+ displayName: 'List Contact Time Entries',
+ description: 'List Contact Time Entries.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: "Lists the time entries logged on one contact's tickets and tasks.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ contactId: zohoDeskAiProps.contactId({ required: true }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only entries logged on tickets or tasks.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ ],
+ },
+ }),
+ departmentId: zohoDeskAiProps.departmentId({ required: false }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, contactId, module, departmentId, billStatus, from, limit } = context.propsValue;
+ const timeEntries = await zohoDeskApi.listContactTimeEntries({
+ auth: context.auth,
+ orgId,
+ contactId,
+ module,
+ departmentId,
+ billStatus,
+ from,
+ limit,
+ });
+ return { timeEntries, count: timeEntries.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-task-active-timers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-task-active-timers.ts
new file mode 100644
index 00000000000..db30b9c074f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-task-active-timers.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketActiveTimersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTaskActiveTimersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_task_active_timers',
+ outputSchema: zohoDeskListTicketActiveTimersOutputSchema,
+ displayName: 'List Task Active Timers',
+ description: "Lists the agents' running timers on a task.",
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the timers agents currently have running or paused on one task.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, taskId, from, limit } = context.propsValue;
+ const timers = await zohoDeskApi.listTaskActiveTimers({
+ auth: context.auth,
+ orgId,
+ taskId,
+ from,
+ limit,
+ });
+ return { timers, count: timers.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-task-time-entries.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-task-time-entries.ts
new file mode 100644
index 00000000000..dbeb52507a7
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-task-time-entries.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTaskTimeEntriesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTaskTimeEntriesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_task_time_entries',
+ outputSchema: zohoDeskListTaskTimeEntriesOutputSchema,
+ displayName: 'List Task Time Entries',
+ description: 'List Task Time Entries.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: { description: 'Lists the time entries logged on one task.', idempotent: true },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, taskId, billStatus, createdTimeRange, modifiedTimeRange, from, limit } =
+ context.propsValue;
+ const timeEntries = await zohoDeskApi.listTaskTimeEntries({
+ auth: context.auth,
+ orgId,
+ taskId,
+ billStatus,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ });
+ return { timeEntries, count: timeEntries.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-active-timers.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-active-timers.ts
new file mode 100644
index 00000000000..fa47a16a0ac
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-active-timers.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketActiveTimersOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketActiveTimersAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_active_timers',
+ outputSchema: zohoDeskListTicketActiveTimersOutputSchema,
+ displayName: 'List Ticket Active Timers',
+ description: "Lists the agents' running timers on a ticket.",
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the timers agents currently have running or paused on one ticket.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, from, limit } = context.propsValue;
+ const timers = await zohoDeskApi.listTicketActiveTimers({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+ });
+ return { timers, count: timers.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-time-entries-by-billing-type.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-time-entries-by-billing-type.ts
new file mode 100644
index 00000000000..e42cf80d367
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-time-entries-by-billing-type.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListTicketTimeEntriesByBillingTypeOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketTimeEntriesByBillingTypeAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_time_entries_by_billing_type',
+ outputSchema: zohoDeskListTicketTimeEntriesByBillingTypeOutputSchema,
+ displayName: 'List Ticket Time Entries By Billing Type',
+ description: 'List Ticket Time Entries By Billing Type.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: "Lists one ticket's time entries priced under one billing model.",
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ billingType: Property.StaticDropdown({
+ displayName: 'Billing Type',
+ description: 'Billing model to list entries for.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'FIXED_COST_FOR_TICKETS', value: 'FIXED_COST_FOR_TICKETS' },
+ { label: 'FIXED_COST_FOR_AGENTS', value: 'FIXED_COST_FOR_AGENTS' },
+ { label: 'SPECIFIC_COST_PER_PROFILE', value: 'SPECIFIC_COST_PER_PROFILE' },
+ { label: 'SPECIFIC_COST_PER_AGENT', value: 'SPECIFIC_COST_PER_AGENT' },
+ ],
+ },
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const { orgId, ticketId, billingType, from, limit } = context.propsValue;
+ const timeEntries = await zohoDeskApi.listTicketTimeEntriesByBillingType({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ billingType,
+ from,
+ limit,
+ });
+ return { timeEntries, count: timeEntries.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-time-entries.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-time-entries.ts
new file mode 100644
index 00000000000..8821cae3728
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/list-ticket-time-entries.ts
@@ -0,0 +1,94 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskListAccountTimeEntriesOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskListTicketTimeEntriesAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_list_ticket_time_entries',
+ outputSchema: zohoDeskListAccountTimeEntriesOutputSchema,
+ displayName: 'List Ticket Time Entries',
+ description: 'List Ticket Time Entries.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the time entries logged on one ticket and, with Module, on its tasks, calls or events.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ billStatus: Property.StaticDropdown({
+ displayName: 'Bill Status',
+ description: 'Only entries with this billing status.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'billable', value: 'billable' },
+ { label: 'nonBillable', value: 'nonBillable' },
+ { label: 'billed', value: 'billed' },
+ ],
+ },
+ }),
+ module: Property.StaticDropdown({
+ displayName: 'Module',
+ description: 'Only entries logged on this kind of record.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'tickets', value: 'tickets' },
+ { label: 'tasks', value: 'tasks' },
+ { label: 'calls', value: 'calls' },
+ { label: 'events', value: 'events' },
+ ],
+ },
+ }),
+ createdTimeRange: Property.ShortText({
+ displayName: 'Created Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ modifiedTimeRange: Property.ShortText({
+ displayName: 'Modified Time Range',
+ description:
+ 'Two ISO 8601 times separated by a comma, e.g. "2024-01-01T00:00:00.000Z,2024-01-31T23:59:59.000Z".',
+ required: false,
+ }),
+ from: zohoDeskAiProps.from({ required: false }),
+ limit: zohoDeskAiProps.limit({ required: false }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ ticketId,
+ billStatus,
+ module,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ } = context.propsValue;
+ const timeEntries = await zohoDeskApi.listTicketTimeEntries({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ billStatus,
+ module,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ });
+ return { timeEntries, count: timeEntries.length };
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/update-task-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/update-task-time-entry.ts
new file mode 100644
index 00000000000..afff31e65d8
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/update-task-time-entry.ts
@@ -0,0 +1,126 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskAddTaskTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTaskTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_task_time_entry',
+ outputSchema: zohoDeskAddTaskTimeEntryOutputSchema,
+ displayName: 'Update Task Time Entry',
+ description: 'Updates a time entry on a task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one task time entry; fields left empty are not changed.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ taskId: zohoDeskAiProps.taskId({ required: true }),
+ timeEntryId: Property.ShortText({
+ displayName: 'Time Entry ID',
+ description: 'Time entry ID (from the matching List Time Entries action).',
+ required: true,
+ }),
+ executedTime: Property.DateTime({
+ displayName: 'Executed Time',
+ description: 'When the work was done, ISO 8601.',
+ required: false,
+ }),
+ hoursSpent: Property.Number({
+ displayName: 'Hours Spent',
+ description: 'Whole hours spent.',
+ required: false,
+ }),
+ minutesSpent: Property.Number({
+ displayName: 'Minutes Spent',
+ description: 'Minutes spent (0-59).',
+ required: false,
+ }),
+ secondsSpent: Property.Number({
+ displayName: 'Seconds Spent',
+ description: 'Seconds spent (0-59).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'What the time was spent on.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who did the work (from List Agents). Defaults to the connected agent.',
+ required: false,
+ }),
+ isBillable: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Billable',
+ description: 'Yes marks the entry billable.',
+ }),
+ requestChargeType: Property.StaticDropdown({
+ displayName: 'Charge Type',
+ description: 'Kind of work.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Customer Service', value: 'Customer Service' },
+ { label: 'Upgrade Request', value: 'Upgrade Request' },
+ { label: 'Product Consultation', value: 'Product Consultation' },
+ { label: 'Support and Maintenance', value: 'Support and Maintenance' },
+ ],
+ },
+ }),
+ additionalCost: Property.Number({
+ displayName: 'Additional Cost',
+ description: 'Extra cost added to the entry.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ taskId,
+ timeEntryId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateTaskTimeEntry({
+ auth: context.auth,
+ orgId,
+ taskId,
+ timeEntryId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/update-ticket-time-entry.ts b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/update-ticket-time-entry.ts
new file mode 100644
index 00000000000..c0b37318d26
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/ai/time-tracking/update-ticket-time-entry.ts
@@ -0,0 +1,126 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoDeskAuth } from '../../../auth';
+import { zohoDeskAiProps } from '../../../common/ai-props';
+import { zohoDeskApi } from '../../../common/api';
+import { zohoDeskProps } from '../../../common/props';
+import { zohoDeskGetAgentTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const zohoDeskUpdateTicketTimeEntryAction = createAction({
+ auth: zohoDeskAuth,
+ name: 'zoho_desk_update_ticket_time_entry',
+ outputSchema: zohoDeskGetAgentTimeEntryOutputSchema,
+ displayName: 'Update Ticket Time Entry',
+ description: 'Updates a time entry on a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates only the fields you set on one ticket time entry; the rest keep their current values.',
+ idempotent: true,
+ },
+ props: {
+ orgId: zohoDeskProps.orgId({
+ required: true,
+ description: 'Zoho Desk organization ID (from List Organizations).',
+ }),
+ ticketId: zohoDeskAiProps.ticketId({ required: true }),
+ timeEntryId: Property.ShortText({
+ displayName: 'Time Entry ID',
+ description: 'Time entry ID (from the matching List Time Entries action).',
+ required: true,
+ }),
+ executedTime: Property.DateTime({
+ displayName: 'Executed Time',
+ description: 'When the work was done, ISO 8601.',
+ required: false,
+ }),
+ hoursSpent: Property.Number({
+ displayName: 'Hours Spent',
+ description: 'Whole hours spent.',
+ required: false,
+ }),
+ minutesSpent: Property.Number({
+ displayName: 'Minutes Spent',
+ description: 'Minutes spent (0-59).',
+ required: false,
+ }),
+ secondsSpent: Property.Number({
+ displayName: 'Seconds Spent',
+ description: 'Seconds spent (0-59).',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'What the time was spent on.',
+ required: false,
+ }),
+ ownerId: Property.ShortText({
+ displayName: 'Owner ID',
+ description: 'Agent ID who did the work (from List Agents). Defaults to the connected agent.',
+ required: false,
+ }),
+ isBillable: zohoDeskAiProps.yesNo({
+ required: false,
+ displayName: 'Is Billable',
+ description: 'Yes marks the entry billable.',
+ }),
+ requestChargeType: Property.StaticDropdown({
+ displayName: 'Charge Type',
+ description: 'Kind of work.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Customer Service', value: 'Customer Service' },
+ { label: 'Upgrade Request', value: 'Upgrade Request' },
+ { label: 'Product Consultation', value: 'Product Consultation' },
+ { label: 'Support and Maintenance', value: 'Support and Maintenance' },
+ ],
+ },
+ }),
+ additionalCost: Property.Number({
+ displayName: 'Additional Cost',
+ description: 'Extra cost added to the entry.',
+ required: false,
+ }),
+ customFields: Property.Object({
+ displayName: 'Custom Fields',
+ description: 'Custom field values keyed by API name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const {
+ orgId,
+ ticketId,
+ timeEntryId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ } = context.propsValue;
+ return await zohoDeskApi.updateTicketTimeEntry({
+ auth: context.auth,
+ orgId,
+ ticketId,
+ timeEntryId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/create-ticket.ts b/packages/pieces/community/zoho-desk/src/lib/actions/create-ticket.ts
index eb72334d55d..637aa429f9f 100644
--- a/packages/pieces/community/zoho-desk/src/lib/actions/create-ticket.ts
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/create-ticket.ts
@@ -1,20 +1,21 @@
import { createAction, Property } from '@activepieces/pieces-framework';
-import { HttpMethod } from '@activepieces/pieces-common';
-import { zohoDeskAuth } from '../common/auth';
-import { zohoDeskApiCall } from '../common';
-import { departmentId, organizationId } from '../common/props';
+import { zohoDeskAuth } from '../auth';
+import { zohoDeskApi } from '../common/api';
+import { zohoDeskProps } from '../common/props';
+import { createTicketOutputSchema } from '../output-schemas';
export const createTicketAction = createAction({
auth: zohoDeskAuth,
name: 'create_ticket',
+ outputSchema: createTicketOutputSchema,
classification: 'WRITE',
displayName: 'Create Ticket',
description: 'Creates a new ticket.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Creates a new support ticket in a Zoho Desk organization. Use when an agent needs to log a new issue or request; requires the organization ID, a department ID, a subject, and a description, with optional contact, status, priority, channel, assignee, and custom fields. Not idempotent — each call creates a separate ticket.', idempotent: false },
props: {
- orgId: organizationId({ displayName: 'Organization', required: true }),
- departmentId: departmentId({ displayName: 'Department', required: true }),
+ orgId: zohoDeskProps.orgId({ required: true }),
+ departmentId: zohoDeskProps.departmentId({ required: true }),
contactId: Property.ShortText({
displayName: 'Contact ID',
required: false,
@@ -153,36 +154,27 @@ export const createTicketAction = createAction({
customFields,
} = propsValue;
- const requestBody: Record<string, any> = {
+ return await zohoDeskApi.createTicket({
+ auth,
+ orgId,
departmentId,
subject,
description,
- };
-
- if (contactId) requestBody['contactId'] = contactId;
- if (email) requestBody['email'] = email;
- if (phone) requestBody['phone'] = phone;
- if (status) requestBody['status'] = status;
- if (priority) requestBody['priority'] = priority;
- if (category) requestBody['category'] = category;
- if (subCategory) requestBody['subCategory'] = subCategory;
- if (dueDate) requestBody['dueDate'] = dueDate;
- if (channel) requestBody['channel'] = channel;
- if (assigneeId) requestBody['assigneeId'] = assigneeId;
- if (productId) requestBody['productId'] = productId;
- if (classification) requestBody['classification'] = classification;
- if (language) requestBody['language'] = language;
- if (entitySkills && entitySkills.length > 0) requestBody['entitySkills'] = entitySkills;
- if (customFields) requestBody['cf'] = customFields;
-
- const response = await zohoDeskApiCall({
- auth,
- method: HttpMethod.POST,
- resourceUri: '/tickets',
- orgId,
- body: requestBody,
+ contactId,
+ email,
+ phone,
+ status,
+ priority,
+ category,
+ subCategory,
+ dueDate,
+ channel,
+ assigneeId,
+ productId,
+ classification,
+ language,
+ entitySkills,
+ customFields,
});
-
- return response;
},
});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/find-contact.ts b/packages/pieces/community/zoho-desk/src/lib/actions/find-contact.ts
index 2ad55ecfda8..a722310aafb 100644
--- a/packages/pieces/community/zoho-desk/src/lib/actions/find-contact.ts
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/find-contact.ts
@@ -1,48 +1,35 @@
import { createAction, Property } from '@activepieces/pieces-framework';
-import { zohoDeskApiCall } from '../common';
-import { zohoDeskAuth } from '../common/auth';
-import { organizationId } from '../common/props';
-import { HttpMethod } from '@activepieces/pieces-common';
-import { isNil } from '@activepieces/pieces-framework';
+import { zohoDeskAuth } from '../auth';
+import { zohoDeskApi } from '../common/api';
+import { zohoDeskProps } from '../common/props';
+import { findContactOutputSchema } from '../output-schemas';
export const findContactAction = createAction({
auth: zohoDeskAuth,
name: 'find-contact',
+ outputSchema: findContactOutputSchema,
classification: 'SEARCH',
displayName: 'Find Contact',
description: 'Finds an existing contact by email.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Searches a Zoho Desk organization for contacts matching an exact email address, returning whether any were found along with the matches. Use to resolve a contact (e.g. before creating or routing a ticket) when you have the email rather than an ID; requires the organization ID and email. Read-only and idempotent.', idempotent: true },
props: {
- orgId: organizationId({ displayName: 'Organization', required: true }),
+ orgId: zohoDeskProps.orgId({ required: true }),
email: Property.ShortText({
displayName: 'Email',
required: true,
}),
},
async run(context) {
- const response = await zohoDeskApiCall({
+ const contacts = await zohoDeskApi.searchContacts({
auth: context.auth,
- method: HttpMethod.GET,
- resourceUri: '/contacts/search',
orgId: context.propsValue.orgId,
- query: {
- email: context.propsValue.email,
- },
+ email: context.propsValue.email,
});
- if (isNil(response) || response === '') {
- return {
- found: false,
- result: [],
- };
- }
-
- const contacts = response as { data: Record<string, any>[] };
-
return {
- found: contacts.data.length > 0,
- result: contacts.data,
+ found: contacts.length > 0,
+ result: contacts,
};
},
});
diff --git a/packages/pieces/community/zoho-desk/src/lib/actions/list-tickets.ts b/packages/pieces/community/zoho-desk/src/lib/actions/list-tickets.ts
index 1df2ec5e869..2cb96e44d9a 100644
--- a/packages/pieces/community/zoho-desk/src/lib/actions/list-tickets.ts
+++ b/packages/pieces/community/zoho-desk/src/lib/actions/list-tickets.ts
@@ -1,19 +1,20 @@
import { createAction, Property } from '@activepieces/pieces-framework';
-import { HttpMethod } from '@activepieces/pieces-common';
-import { zohoDeskAuth } from '../common/auth';
-import { zohoDeskApiCall } from '../common';
-import { organizationId } from '../common/props';
+import { zohoDeskAuth } from '../auth';
+import { zohoDeskApi } from '../common/api';
+import { zohoDeskProps } from '../common/props';
+import { listTicketsOutputSchema } from '../output-schemas';
export const listTicketsAction = createAction({
auth: zohoDeskAuth,
name: 'list_tickets',
+ outputSchema: listTicketsOutputSchema,
classification: 'SEARCH',
description: 'List tickets',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Retrieves tickets from a Zoho Desk organization, optionally expanding related data (contacts, products, departments, team, isRead, assignee) via the include option. Use to browse or page through existing tickets when you do not have a specific ticket ID; requires the organization ID. Read-only and idempotent.', idempotent: true },
displayName: 'List tickets.',
props: {
- orgId: organizationId({ displayName: 'Organization', required: true }),
+ orgId: zohoDeskProps.orgId({ required: true }),
include: Property.StaticMultiSelectDropdown({
displayName: 'include',
required: false,
@@ -32,18 +33,6 @@ export const listTicketsAction = createAction({
}),
},
async run({ propsValue, auth }) {
- const queryParams: Record<string, string> = {};
-
- if (propsValue.include) queryParams['include'] = propsValue.include.join(',');
-
- const response = await zohoDeskApiCall({
- auth,
- method: HttpMethod.GET,
- resourceUri: '/tickets',
- orgId: propsValue.orgId,
- query: queryParams,
- });
-
- return response;
+ return await zohoDeskApi.listTickets({ auth, orgId: propsValue.orgId, include: propsValue.include });
},
});
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/auth.ts b/packages/pieces/community/zoho-desk/src/lib/auth.ts
similarity index 94%
rename from packages/pieces/community/zoho-desk/src/lib/common/auth.ts
rename to packages/pieces/community/zoho-desk/src/lib/auth.ts
index f9b9944fe3a..965e56852ce 100644
--- a/packages/pieces/community/zoho-desk/src/lib/common/auth.ts
+++ b/packages/pieces/community/zoho-desk/src/lib/auth.ts
@@ -46,6 +46,9 @@ export const zohoDeskAuth = PieceAuth.OAuth2({
'Desk.contacts.WRITE',
'Desk.contacts.UPDATE',
'Desk.contacts.CREATE',
+ 'Desk.contacts.DELETE',
+ 'Desk.accounts.UPDATE',
+ 'Desk.calls.ALL',
'Desk.basic.READ',
'Desk.basic.CREATE',
'Desk.search.READ',
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/ai-props.ts b/packages/pieces/community/zoho-desk/src/lib/common/ai-props.ts
new file mode 100644
index 00000000000..b0bb8cc6146
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/ai-props.ts
@@ -0,0 +1,107 @@
+import { Property } from '@activepieces/pieces-framework';
+
+import type { PropParams } from './props';
+
+function ticketId<R extends boolean>({
+ required,
+ displayName = 'Ticket ID',
+ description = 'Ticket ID (the `id` from List Tickets or Search Tickets, not the ticket number).',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function contactId<R extends boolean>({
+ required,
+ displayName = 'Contact ID',
+ description = 'Contact ID (the `id` from List Contacts or Search Contacts).',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function accountId<R extends boolean>({
+ required,
+ displayName = 'Account ID',
+ description = 'Account ID (the `id` from List Accounts or Search Accounts).',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function taskId<R extends boolean>({
+ required,
+ displayName = 'Task ID',
+ description = 'Task ID (the `id` from List Tasks or Search Tasks).',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function productId<R extends boolean>({
+ required,
+ displayName = 'Product ID',
+ description = 'Product ID (the `id` from List Products or Search Products).',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function departmentId<R extends boolean>({
+ required,
+ displayName = 'Department ID',
+ description = 'Department ID (the `id` from List Departments).',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function agentId<R extends boolean>({
+ required,
+ displayName = 'Agent ID',
+ description = 'Agent ID (the `id` from List Agents).',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function from<R extends boolean>({
+ required,
+ displayName = 'From',
+ description = 'Index of the first record to return, starting at 1. Use with Limit to page through results.',
+}: PropParams<R>) {
+ return Property.Number({ displayName, description, required });
+}
+
+function limit<R extends boolean>({
+ required,
+ displayName = 'Limit',
+ description = 'Maximum number of records to return, from 1 to 100.',
+}: PropParams<R>) {
+ return Property.Number({ displayName, description, required });
+}
+
+function yesNo<R extends boolean>({
+ required,
+ displayName = 'Enabled',
+ description,
+}: PropParams<R>) {
+ return Property.StaticDropdown<boolean, R>({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: true },
+ { label: 'No', value: false },
+ ],
+ },
+ });
+}
+
+export const zohoDeskAiProps = {
+ ticketId,
+ contactId,
+ accountId,
+ taskId,
+ productId,
+ departmentId,
+ agentId,
+ from,
+ limit,
+ yesNo,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/accounts.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/accounts.ts
new file mode 100644
index 00000000000..0cc6a27d59b
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/accounts.ts
@@ -0,0 +1,762 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskFile, ZohoDeskRecord } from '../types';
+
+async function listAccounts({
+ auth,
+ orgId,
+ viewId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ viewId?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts`,
+ query: { viewId, sortBy, from, limit },
+ });
+}
+
+async function getAccount({
+ auth,
+ orgId,
+ accountId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}`,
+ });
+}
+
+async function createAccount({
+ auth,
+ orgId,
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountName: string;
+ email?: string;
+ phone?: string;
+ website?: string;
+ industry?: string;
+ ownerId?: string;
+ description?: string;
+ street?: string;
+ city?: string;
+ state?: string;
+ code?: string;
+ country?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts`,
+ body: {
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ cf: customFields,
+ },
+ });
+}
+
+async function updateAccount({
+ auth,
+ orgId,
+ accountId,
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ accountName?: string;
+ email?: string;
+ phone?: string;
+ website?: string;
+ industry?: string;
+ ownerId?: string;
+ description?: string;
+ street?: string;
+ city?: string;
+ state?: string;
+ code?: string;
+ country?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/accounts/${encodeURIComponent(accountId)}`,
+ body: {
+ accountName,
+ email,
+ phone,
+ website,
+ industry,
+ ownerId,
+ description,
+ street,
+ city,
+ state,
+ code,
+ country,
+ cf: customFields,
+ },
+ });
+}
+
+async function deleteAccounts({
+ auth,
+ orgId,
+ accountIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/moveToTrash`,
+ body: { accountIds },
+ });
+}
+
+async function searchAccounts({
+ auth,
+ orgId,
+ searchText,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ accountName?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/search`,
+ query: {
+ _all: searchText,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+ },
+ });
+}
+
+async function countAccounts({
+ auth,
+ orgId,
+ viewId,
+ startsWith,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ viewId: string;
+ startsWith?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/count`,
+ query: { viewId, startsWith },
+ });
+}
+
+async function updateManyAccounts({
+ auth,
+ orgId,
+ accountIds,
+ fieldName,
+ fieldValue,
+ isCustomField,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountIds: string[];
+ fieldName: string;
+ fieldValue?: string;
+ isCustomField?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/updateMany`,
+ body: { ids: accountIds, fieldName, fieldValue, isCustomField },
+ });
+}
+
+async function listAccountContacts({
+ auth,
+ orgId,
+ accountId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/contacts`,
+ query: { sortBy, from, limit },
+ });
+}
+
+async function listAccountTickets({
+ auth,
+ orgId,
+ accountId,
+ departmentId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ departmentId?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/tickets`,
+ query: { departmentId, sortBy, from, limit },
+ });
+}
+
+async function listAccountProducts({
+ auth,
+ orgId,
+ accountId,
+ departmentId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ departmentId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/products`,
+ query: { departmentId, from, limit },
+ });
+}
+
+async function listAccountContracts({
+ auth,
+ orgId,
+ accountId,
+ departmentId,
+ contractStatus,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ departmentId?: string;
+ contractStatus?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/contracts`,
+ query: { departmentId, contractStatus, from, limit },
+ });
+}
+
+async function listAccountSlas({
+ auth,
+ orgId,
+ accountId,
+ departmentId,
+ status,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ departmentId?: string;
+ status?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/sla`,
+ query: { departmentId, status, from, limit },
+ });
+}
+
+async function setAccountSla({
+ auth,
+ orgId,
+ accountId,
+ slaId,
+ associate,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ slaId: string;
+ associate: boolean;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/${encodeURIComponent(accountId)}/sla/${encodeURIComponent(slaId)}`,
+ body: { associate },
+ });
+}
+
+async function associateAccountProducts({
+ auth,
+ orgId,
+ accountId,
+ productIds,
+ associate,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ productIds: string[];
+ associate: boolean;
+ departmentId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/${encodeURIComponent(accountId)}/associateProducts`,
+ body: { ids: productIds, associate, departmentId },
+ });
+}
+
+async function listAccountAttachments({
+ auth,
+ orgId,
+ accountId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/attachments`,
+ query: { from, limit },
+ });
+}
+
+async function uploadAccountAttachment({
+ auth,
+ orgId,
+ accountId,
+ file,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ file: ZohoDeskFile;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.upload<ZohoDeskRecord>({
+ auth,
+ orgId,
+ path: `/accounts/${encodeURIComponent(accountId)}/attachments`,
+ file,
+ });
+}
+
+async function deleteAccountAttachment({
+ auth,
+ orgId,
+ accountId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ attachmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/accounts/${encodeURIComponent(accountId)}/attachments/${encodeURIComponent(
+ attachmentId,
+ )}`,
+ });
+}
+
+async function listAccountComments({
+ auth,
+ orgId,
+ accountId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/comments`,
+ query: { from, limit },
+ });
+}
+
+async function getAccountComment({
+ auth,
+ orgId,
+ accountId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ commentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function createAccountComment({
+ auth,
+ orgId,
+ accountId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/${encodeURIComponent(accountId)}/comments`,
+ body: { content, contentType },
+ });
+}
+
+async function updateAccountComment({
+ auth,
+ orgId,
+ accountId,
+ commentId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ commentId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PUT,
+ path: `/accounts/${encodeURIComponent(accountId)}/comments/${encodeURIComponent(commentId)}`,
+ body: { content, contentType },
+ });
+}
+
+async function deleteAccountComment({
+ auth,
+ orgId,
+ accountId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ commentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/accounts/${encodeURIComponent(accountId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function listAccountFollowers({
+ auth,
+ orgId,
+ accountId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/followers`,
+ query: { from, limit },
+ });
+}
+
+async function addAccountFollowers({
+ auth,
+ orgId,
+ accountId,
+ followerIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ followerIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/${encodeURIComponent(accountId)}/addFollowers`,
+ body: { followerIds },
+ });
+}
+
+async function removeAccountFollowers({
+ auth,
+ orgId,
+ accountId,
+ followerIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ followerIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/${encodeURIComponent(accountId)}/removeFollowers`,
+ body: { followerIds },
+ });
+}
+
+async function listAccountHistory({
+ auth,
+ orgId,
+ accountId,
+ contactId,
+ agentId,
+ departmentId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ contactId?: string;
+ agentId?: string;
+ departmentId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/history`,
+ query: { contactId, agentId, departmentId, from, limit },
+ });
+}
+
+async function getAccountStatistics({
+ auth,
+ orgId,
+ accountId,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ departmentId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/statistics`,
+ query: { departmentId },
+ });
+}
+
+async function mergeAccounts({
+ auth,
+ orgId,
+ accountId,
+ accountIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ accountIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/accounts/${encodeURIComponent(accountId)}/merge`,
+ body: { ids: accountIds },
+ });
+}
+
+export const zohoDeskAccountsApi = {
+ listAccounts,
+ getAccount,
+ createAccount,
+ updateAccount,
+ deleteAccounts,
+ searchAccounts,
+ countAccounts,
+ updateManyAccounts,
+ listAccountContacts,
+ listAccountTickets,
+ listAccountProducts,
+ listAccountContracts,
+ listAccountSlas,
+ setAccountSla,
+ associateAccountProducts,
+ listAccountAttachments,
+ uploadAccountAttachment,
+ deleteAccountAttachment,
+ listAccountComments,
+ getAccountComment,
+ createAccountComment,
+ updateAccountComment,
+ deleteAccountComment,
+ listAccountFollowers,
+ addAccountFollowers,
+ removeAccountFollowers,
+ listAccountHistory,
+ getAccountStatistics,
+ mergeAccounts,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/activities.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/activities.ts
new file mode 100644
index 00000000000..49e1e63f195
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/activities.ts
@@ -0,0 +1,853 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type {
+ ZohoDeskAuthValue,
+ ZohoDeskDownload,
+ ZohoDeskFile,
+ ZohoDeskRecord,
+} from '../types';
+
+async function updateActivity({
+ auth,
+ orgId,
+ module,
+ id,
+ fields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ module: 'calls' | 'events';
+ id: string;
+ fields: ActivityFields;
+}): Promise<ZohoDeskRecord> {
+ const { customFields, ...rest } = fields;
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/${module}/${encodeURIComponent(id)}`,
+ body: { ...rest, cf: customFields },
+ });
+}
+
+async function updateCall({
+ auth,
+ orgId,
+ callId,
+ ...fields
+}: ActivityFields & {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+}): Promise<ZohoDeskRecord> {
+ return await updateActivity({ auth, orgId, module: 'calls', id: callId, fields });
+}
+
+async function updateEvent({
+ auth,
+ orgId,
+ eventId,
+ ...fields
+}: ActivityFields & {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+}): Promise<ZohoDeskRecord> {
+ return await updateActivity({ auth, orgId, module: 'events', id: eventId, fields });
+}
+
+async function listCalls({
+ auth,
+ orgId,
+ departmentId,
+ viewId,
+ assignee,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId?: string;
+ viewId?: string;
+ assignee?: string[];
+ isCompleted?: boolean;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/calls`,
+ query: { departmentId, viewId, assignee, isCompleted, sortBy, from, limit },
+ });
+}
+
+async function searchCalls({
+ auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ subject?: string;
+ ticketNumber?: string;
+ assigneeId?: string;
+ departmentId?: string;
+ status?: string;
+ priority?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/calls/search`,
+ query: {
+ _all: searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ },
+ });
+}
+
+async function getCall({
+ auth,
+ orgId,
+ callId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/calls/${encodeURIComponent(callId)}`,
+ });
+}
+
+async function createCall({
+ auth,
+ orgId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ direction,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ subject: string;
+ contactId: string;
+ departmentId: string;
+ ticketId: string;
+ startTime: string;
+ status: string;
+ direction: string;
+ duration: number;
+ ownerId: string;
+ priority: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/calls`,
+ body: {
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ direction,
+ duration,
+ ownerId,
+ priority,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function deleteCalls({
+ auth,
+ orgId,
+ callIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/calls/moveToTrash`,
+ body: { entityIds: callIds },
+ });
+}
+
+async function updateManyCalls({
+ auth,
+ orgId,
+ callIds,
+ fieldName,
+ fieldValue,
+ isCustomField,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callIds: string[];
+ fieldName: string;
+ fieldValue?: string;
+ isCustomField?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/calls/updateMany`,
+ body: { ids: callIds, fieldName, fieldValue, isCustomField },
+ });
+}
+
+async function uploadCallAttachment({
+ auth,
+ orgId,
+ callId,
+ file,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+ file: ZohoDeskFile;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.upload<ZohoDeskRecord>({
+ auth,
+ orgId,
+ path: `/calls/${encodeURIComponent(callId)}/attachments`,
+ file,
+ });
+}
+
+async function deleteCallAttachment({
+ auth,
+ orgId,
+ callId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+ attachmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/calls/${encodeURIComponent(callId)}/attachments/${encodeURIComponent(attachmentId)}`,
+ });
+}
+
+async function listCallComments({
+ auth,
+ orgId,
+ callId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/calls/${encodeURIComponent(callId)}/comments`,
+ query: { from, limit },
+ });
+}
+
+async function getCallComment({
+ auth,
+ orgId,
+ callId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+ commentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/calls/${encodeURIComponent(callId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function createCallComment({
+ auth,
+ orgId,
+ callId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/calls/${encodeURIComponent(callId)}/comments`,
+ body: { content, contentType },
+ });
+}
+
+async function updateCallComment({
+ auth,
+ orgId,
+ callId,
+ commentId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+ commentId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/calls/${encodeURIComponent(callId)}/comments/${encodeURIComponent(commentId)}`,
+ body: { content, contentType },
+ });
+}
+
+async function deleteCallComment({
+ auth,
+ orgId,
+ callId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ callId: string;
+ commentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/calls/${encodeURIComponent(callId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function listEvents({
+ auth,
+ orgId,
+ departmentId,
+ viewId,
+ assignee,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId?: string;
+ viewId?: string;
+ assignee?: string[];
+ isCompleted?: boolean;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/events`,
+ query: { departmentId, viewId, assignee, isCompleted, sortBy, from, limit },
+ });
+}
+
+async function searchEvents({
+ auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ subject?: string;
+ ticketNumber?: string;
+ assigneeId?: string;
+ departmentId?: string;
+ status?: string;
+ priority?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/events/search`,
+ query: {
+ _all: searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ },
+ });
+}
+
+async function getEvent({
+ auth,
+ orgId,
+ eventId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/events/${encodeURIComponent(eventId)}`,
+ });
+}
+
+async function createEvent({
+ auth,
+ orgId,
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ category,
+ duration,
+ ownerId,
+ priority,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ subject: string;
+ contactId: string;
+ departmentId: string;
+ ticketId?: string;
+ startTime: string;
+ status?: string;
+ category?: string;
+ duration: number;
+ ownerId?: string;
+ priority?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/events`,
+ body: {
+ subject,
+ contactId,
+ departmentId,
+ ticketId,
+ startTime,
+ status,
+ category,
+ duration,
+ ownerId,
+ priority,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function deleteEvents({
+ auth,
+ orgId,
+ eventIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/events/moveToTrash`,
+ body: { entityIds: eventIds },
+ });
+}
+
+async function updateManyEvents({
+ auth,
+ orgId,
+ eventIds,
+ fieldName,
+ fieldValue,
+ isCustomField,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventIds: string[];
+ fieldName: string;
+ fieldValue?: string;
+ isCustomField?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/events/updateMany`,
+ body: { ids: eventIds, fieldName, fieldValue, isCustomField },
+ });
+}
+
+async function listEventAttachments({
+ auth,
+ orgId,
+ eventId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/events/${encodeURIComponent(eventId)}/attachments`,
+ query: { from, limit },
+ });
+}
+
+async function uploadEventAttachment({
+ auth,
+ orgId,
+ eventId,
+ file,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ file: ZohoDeskFile;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.upload<ZohoDeskRecord>({
+ auth,
+ orgId,
+ path: `/events/${encodeURIComponent(eventId)}/attachments`,
+ file,
+ });
+}
+
+async function deleteEventAttachment({
+ auth,
+ orgId,
+ eventId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ attachmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/events/${encodeURIComponent(eventId)}/attachments/${encodeURIComponent(attachmentId)}`,
+ });
+}
+
+async function downloadEventAttachment({
+ auth,
+ orgId,
+ eventId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ attachmentId: string;
+}): Promise<ZohoDeskDownload> {
+ return await zohoDeskClient.download({
+ auth,
+ orgId,
+ path: `/events/${encodeURIComponent(eventId)}/attachments/${encodeURIComponent(
+ attachmentId,
+ )}/content`,
+ });
+}
+
+async function listEventComments({
+ auth,
+ orgId,
+ eventId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/events/${encodeURIComponent(eventId)}/comments`,
+ query: { from, limit },
+ });
+}
+
+async function getEventComment({
+ auth,
+ orgId,
+ eventId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ commentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/events/${encodeURIComponent(eventId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function createEventComment({
+ auth,
+ orgId,
+ eventId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/events/${encodeURIComponent(eventId)}/comments`,
+ body: { content, contentType },
+ });
+}
+
+async function updateEventComment({
+ auth,
+ orgId,
+ eventId,
+ commentId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ eventId: string;
+ commentId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PUT,
+ path: `/events/${encodeURIComponent(eventId)}/comments/${encodeURIComponent(commentId)}`,
+ body: { content, contentType },
+ });
+}
+
+async function searchActivities({
+ auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ subject?: string;
+ ticketNumber?: string;
+ assigneeId?: string;
+ departmentId?: string;
+ status?: string;
+ priority?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/activities/search`,
+ query: {
+ _all: searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ },
+ });
+}
+
+export const zohoDeskActivitiesApi = {
+ updateCall,
+ updateEvent,
+ listCalls,
+ searchCalls,
+ getCall,
+ createCall,
+ deleteCalls,
+ updateManyCalls,
+ uploadCallAttachment,
+ deleteCallAttachment,
+ listCallComments,
+ getCallComment,
+ createCallComment,
+ updateCallComment,
+ deleteCallComment,
+ listEvents,
+ searchEvents,
+ getEvent,
+ createEvent,
+ deleteEvents,
+ updateManyEvents,
+ listEventAttachments,
+ uploadEventAttachment,
+ deleteEventAttachment,
+ downloadEventAttachment,
+ listEventComments,
+ getEventComment,
+ createEventComment,
+ updateEventComment,
+ searchActivities,
+};
+
+type ActivityFields = {
+ subject?: string;
+ contactId?: string;
+ departmentId?: string;
+ ticketId?: string;
+ startTime?: string;
+ status?: string;
+ duration?: number;
+ ownerId?: string;
+ priority?: string;
+ category?: string;
+ direction?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/contacts.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/contacts.ts
new file mode 100644
index 00000000000..48f102b1d2a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/contacts.ts
@@ -0,0 +1,962 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskContact, ZohoDeskFile, ZohoDeskRecord } from '../types';
+
+async function searchContacts({
+ auth,
+ orgId,
+ email,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ email: string;
+}): Promise<ZohoDeskContact[]> {
+ return await zohoDeskClient.list<ZohoDeskContact>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/contacts/search',
+ orgId,
+ query: { email },
+ });
+}
+
+async function listContacts({
+ auth,
+ orgId,
+ viewId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ viewId?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts`,
+ query: { viewId, sortBy, from, limit },
+ });
+}
+
+async function getContact({
+ auth,
+ orgId,
+ contactId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}`,
+ });
+}
+
+async function createContact({
+ auth,
+ orgId,
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ lastName: string;
+ firstName?: string;
+ email?: string;
+ secondaryEmail?: string;
+ phone?: string;
+ mobile?: string;
+ accountId?: string;
+ ownerId?: string;
+ title?: string;
+ type?: string;
+ description?: string;
+ street?: string;
+ city?: string;
+ state?: string;
+ zip?: string;
+ country?: string;
+ language?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts`,
+ body: {
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ cf: customFields,
+ },
+ });
+}
+
+async function updateContact({
+ auth,
+ orgId,
+ contactId,
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ lastName?: string;
+ firstName?: string;
+ email?: string;
+ secondaryEmail?: string;
+ phone?: string;
+ mobile?: string;
+ accountId?: string;
+ ownerId?: string;
+ title?: string;
+ type?: string;
+ description?: string;
+ street?: string;
+ city?: string;
+ state?: string;
+ zip?: string;
+ country?: string;
+ language?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/contacts/${encodeURIComponent(contactId)}`,
+ body: {
+ lastName,
+ firstName,
+ email,
+ secondaryEmail,
+ phone,
+ mobile,
+ accountId,
+ ownerId,
+ title,
+ type,
+ description,
+ street,
+ city,
+ state,
+ zip,
+ country,
+ language,
+ cf: customFields,
+ },
+ });
+}
+
+async function deleteContacts({
+ auth,
+ orgId,
+ contactIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/moveToTrash`,
+ body: { contactIds },
+ });
+}
+
+async function searchContactsByFilter({
+ auth,
+ orgId,
+ searchText,
+ email,
+ phone,
+ mobile,
+ firstName,
+ lastName,
+ fullName,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ email?: string;
+ phone?: string;
+ mobile?: string;
+ firstName?: string;
+ lastName?: string;
+ fullName?: string;
+ accountName?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/search`,
+ query: {
+ _all: searchText,
+ email,
+ phone,
+ mobile,
+ firstName,
+ lastName,
+ fullName,
+ accountName,
+ createdTimeRange,
+ modifiedTimeRange,
+ sortBy,
+ from,
+ limit,
+ },
+ });
+}
+
+async function getContactsByIds({
+ auth,
+ orgId,
+ contactIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactIds: string[];
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/contactsByIds`,
+ query: { ids: contactIds },
+ });
+}
+
+async function countContacts({
+ auth,
+ orgId,
+ viewId,
+ startsWith,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ viewId: string;
+ startsWith?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/count`,
+ query: { viewId, startsWith },
+ });
+}
+
+async function updateManyContacts({
+ auth,
+ orgId,
+ contactIds,
+ fieldName,
+ fieldValue,
+ isCustomField,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactIds: string[];
+ fieldName: string;
+ fieldValue?: string;
+ isCustomField?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/updateMany`,
+ body: { ids: contactIds, fieldName, fieldValue, isCustomField },
+ });
+}
+
+async function listContactAccounts({
+ auth,
+ orgId,
+ contactId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/accounts`,
+ query: { sortBy, from, limit },
+ });
+}
+
+async function listContactTickets({
+ auth,
+ orgId,
+ contactId,
+ departmentId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ departmentId?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/tickets`,
+ query: { departmentId, sortBy, from, limit },
+ });
+}
+
+async function listContactProducts({
+ auth,
+ orgId,
+ contactId,
+ departmentId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ departmentId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/products`,
+ query: { departmentId, from, limit },
+ });
+}
+
+async function associateContactAccounts({
+ auth,
+ orgId,
+ contactId,
+ accountIds,
+ canViewAccountTickets,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ accountIds: string[];
+ canViewAccountTickets?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/associateAccounts`,
+ body: {
+ data: accountIds.map((id) => ({
+ id,
+ isAccountTicketsViewable: canViewAccountTickets ?? false,
+ })),
+ },
+ });
+}
+
+async function dissociateContactAccounts({
+ auth,
+ orgId,
+ contactId,
+ accountIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ accountIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/dissociateAccounts`,
+ body: { ids: accountIds },
+ });
+}
+
+async function associateContactProducts({
+ auth,
+ orgId,
+ contactId,
+ productIds,
+ associate,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ productIds: string[];
+ associate: boolean;
+ departmentId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/associateProducts`,
+ body: { ids: productIds, associate, departmentId },
+ });
+}
+
+async function listContactAttachments({
+ auth,
+ orgId,
+ contactId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/attachments`,
+ query: { from, limit },
+ });
+}
+
+async function uploadContactAttachment({
+ auth,
+ orgId,
+ contactId,
+ file,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ file: ZohoDeskFile;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.upload<ZohoDeskRecord>({
+ auth,
+ orgId,
+ path: `/contacts/${encodeURIComponent(contactId)}/attachments`,
+ file,
+ });
+}
+
+async function deleteContactAttachment({
+ auth,
+ orgId,
+ contactId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ attachmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/contacts/${encodeURIComponent(contactId)}/attachments/${encodeURIComponent(
+ attachmentId,
+ )}`,
+ });
+}
+
+async function listContactComments({
+ auth,
+ orgId,
+ contactId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/comments`,
+ query: { from, limit },
+ });
+}
+
+async function getContactComment({
+ auth,
+ orgId,
+ contactId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ commentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function createContactComment({
+ auth,
+ orgId,
+ contactId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/comments`,
+ body: { content, contentType },
+ });
+}
+
+async function updateContactComment({
+ auth,
+ orgId,
+ contactId,
+ commentId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ commentId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PUT,
+ path: `/contacts/${encodeURIComponent(contactId)}/comments/${encodeURIComponent(commentId)}`,
+ body: { content, contentType },
+ });
+}
+
+async function deleteContactComment({
+ auth,
+ orgId,
+ contactId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ commentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/contacts/${encodeURIComponent(contactId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function listContactFollowers({
+ auth,
+ orgId,
+ contactId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/followers`,
+ query: { from, limit },
+ });
+}
+
+async function addContactFollowers({
+ auth,
+ orgId,
+ contactId,
+ followerIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ followerIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/addFollowers`,
+ body: { followerIds },
+ });
+}
+
+async function removeContactFollowers({
+ auth,
+ orgId,
+ contactId,
+ followerIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ followerIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/removeFollowers`,
+ body: { followerIds },
+ });
+}
+
+async function listContactHistory({
+ auth,
+ orgId,
+ contactId,
+ agentId,
+ departmentId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ agentId?: string;
+ departmentId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/history`,
+ query: { agentId, departmentId, from, limit },
+ });
+}
+
+async function getContactStatistics({
+ auth,
+ orgId,
+ contactId,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ departmentId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/statistics`,
+ query: { departmentId },
+ });
+}
+
+async function mergeContacts({
+ auth,
+ orgId,
+ contactId,
+ contactIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ contactIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/merge`,
+ body: { ids: contactIds },
+ });
+}
+
+async function markContactsSpam({
+ auth,
+ orgId,
+ contactIds,
+ isSpam,
+ handleExistingTickets,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactIds: string[];
+ isSpam: boolean;
+ handleExistingTickets?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/markSpam`,
+ body: { ids: contactIds, isSpam, handleExistingTickets },
+ });
+}
+
+async function deleteSpamContacts({
+ auth,
+ orgId,
+ contactIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/deleteSpam`,
+ body: { contactIds },
+ });
+}
+
+async function inviteContactToHelpCenter({
+ auth,
+ orgId,
+ contactId,
+ helpCenterId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ helpCenterId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/inviteAsEndUser`,
+ body: { helpCenterId },
+ });
+}
+
+async function approveContactHelpCenterAccess({
+ auth,
+ orgId,
+ contactId,
+ helpCenterIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ helpCenterIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/approveEndUserInvite`,
+ body: { helpCenterIds },
+ });
+}
+
+async function rejectContactHelpCenterAccess({
+ auth,
+ orgId,
+ contactId,
+ helpCenterIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ helpCenterIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contacts/${encodeURIComponent(contactId)}/rejectEndUserInvite`,
+ body: { helpCenterIds },
+ });
+}
+
+async function listContactHelpCenters({
+ auth,
+ orgId,
+ contactId,
+ helpCenterId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ helpCenterId?: string;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/helpCenters`,
+ query: { helpCenterId },
+ });
+}
+
+async function listContactProfiles({
+ auth,
+ orgId,
+ contactId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/profiles`,
+ });
+}
+
+export const zohoDeskContactsApi = {
+ searchContacts,
+ listContacts,
+ getContact,
+ createContact,
+ updateContact,
+ deleteContacts,
+ searchContactsByFilter,
+ getContactsByIds,
+ countContacts,
+ updateManyContacts,
+ listContactAccounts,
+ listContactTickets,
+ listContactProducts,
+ associateContactAccounts,
+ dissociateContactAccounts,
+ associateContactProducts,
+ listContactAttachments,
+ uploadContactAttachment,
+ deleteContactAttachment,
+ listContactComments,
+ getContactComment,
+ createContactComment,
+ updateContactComment,
+ deleteContactComment,
+ listContactFollowers,
+ addContactFollowers,
+ removeContactFollowers,
+ listContactHistory,
+ getContactStatistics,
+ mergeContacts,
+ markContactsSpam,
+ deleteSpamContacts,
+ inviteContactToHelpCenter,
+ approveContactHelpCenterAccess,
+ rejectContactHelpCenterAccess,
+ listContactHelpCenters,
+ listContactProfiles,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/contracts.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/contracts.ts
new file mode 100644
index 00000000000..0e2d0c41b58
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/contracts.ts
@@ -0,0 +1,376 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskDownload, ZohoDeskRecord } from '../types';
+
+async function listContracts({
+ auth,
+ orgId,
+ accountId,
+ contractName,
+ departmentIds,
+ ownerIds,
+ viewId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId?: string;
+ contractName?: string;
+ departmentIds?: string[];
+ ownerIds?: string[];
+ viewId?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contracts`,
+ query: { accountId, contractName, departmentIds, ownerIds, viewId, sortBy, from, limit },
+ });
+}
+
+async function countContracts({
+ auth,
+ orgId,
+ viewId,
+ departmentId,
+ ownerId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ viewId: string;
+ departmentId: string;
+ ownerId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contracts/count`,
+ query: { viewId, departmentId, ownerId },
+ });
+}
+
+async function getContract({
+ auth,
+ orgId,
+ contractId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contracts/${encodeURIComponent(contractId)}`,
+ });
+}
+
+async function createContract({
+ auth,
+ orgId,
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractName: string;
+ accountId: string;
+ departmentId: string;
+ ownerId: string;
+ associatedSupportPlanId: string;
+ startDate: string;
+ endDate?: string;
+ associatedSLAId?: string;
+ productId?: string;
+ contractNumber?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contracts`,
+ body: {
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function updateContract({
+ auth,
+ orgId,
+ contractId,
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+ contractName?: string;
+ accountId?: string;
+ departmentId?: string;
+ ownerId?: string;
+ associatedSupportPlanId?: string;
+ startDate?: string;
+ endDate?: string;
+ associatedSLAId?: string;
+ productId?: string;
+ contractNumber?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/contracts/${encodeURIComponent(contractId)}`,
+ body: {
+ contractName,
+ accountId,
+ departmentId,
+ ownerId,
+ associatedSupportPlanId,
+ startDate,
+ endDate,
+ associatedSLAId,
+ productId,
+ contractNumber,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function updateManyContracts({
+ auth,
+ orgId,
+ contractIds,
+ fieldName,
+ fieldValue,
+ isCustomField,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractIds: string[];
+ fieldName: string;
+ fieldValue: string;
+ isCustomField: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contracts/updateMany`,
+ body: { ids: contractIds, fieldName, fieldValue, isCustomField },
+ });
+}
+
+async function listContractComments({
+ auth,
+ orgId,
+ contractId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contracts/${encodeURIComponent(contractId)}/comments`,
+ query: { from, limit },
+ });
+}
+
+async function getContractComment({
+ auth,
+ orgId,
+ contractId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+ commentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contracts/${encodeURIComponent(contractId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function createContractComment({
+ auth,
+ orgId,
+ contractId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/contracts/${encodeURIComponent(contractId)}/comments`,
+ body: { content, contentType },
+ });
+}
+
+async function updateContractComment({
+ auth,
+ orgId,
+ contractId,
+ commentId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+ commentId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/contracts/${encodeURIComponent(contractId)}/comments/${encodeURIComponent(commentId)}`,
+ body: { content, contentType },
+ });
+}
+
+async function deleteContractComment({
+ auth,
+ orgId,
+ contractId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+ commentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/contracts/${encodeURIComponent(contractId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function downloadContractCommentAttachment({
+ auth,
+ orgId,
+ contractId,
+ commentId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contractId: string;
+ commentId: string;
+ attachmentId: string;
+}): Promise<ZohoDeskDownload> {
+ return await zohoDeskClient.download({
+ auth,
+ orgId,
+ path: `/contracts/${encodeURIComponent(contractId)}/comments/${encodeURIComponent(
+ commentId,
+ )}/attachments/${encodeURIComponent(attachmentId)}/content`,
+ });
+}
+
+async function listSupportPlans({
+ auth,
+ orgId,
+ departmentId,
+ status,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId: string;
+ status?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/supportPlans`,
+ query: { departmentId, status, from, limit },
+ });
+}
+
+export const zohoDeskContractsApi = {
+ listSupportPlans,
+ listContracts,
+ countContracts,
+ getContract,
+ createContract,
+ updateContract,
+ updateManyContracts,
+ listContractComments,
+ getContractComment,
+ createContractComment,
+ updateContractComment,
+ deleteContractComment,
+ downloadContractCommentAttachment,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/help-center-users.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/help-center-users.ts
new file mode 100644
index 00000000000..d83ef792f2a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/help-center-users.ts
@@ -0,0 +1,388 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskRecord } from '../types';
+
+async function listUsers({
+ auth,
+ orgId,
+ helpCenterId,
+ status,
+ searchBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ helpCenterId?: string;
+ status?: string;
+ searchBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/users`,
+ query: { helpCenterId, status, searchBy, from, limit },
+ });
+}
+
+async function getUser({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/users/${encodeURIComponent(userId)}`,
+ query: { helpCenterId },
+ });
+}
+
+async function updateUser({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+ status,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+ status: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/users/${encodeURIComponent(userId)}`,
+ query: { helpCenterId },
+ body: { status },
+ });
+}
+
+async function listUserBadges({
+ auth,
+ orgId,
+ userId,
+ type,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ type?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/users/${encodeURIComponent(userId)}/badges`,
+ query: { type, from, limit },
+ });
+}
+
+async function addUserBadges({
+ auth,
+ orgId,
+ userId,
+ badgeIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ badgeIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/users/${encodeURIComponent(userId)}/badges/associate`,
+ body: { badgeIds },
+ });
+}
+
+async function removeUserBadges({
+ auth,
+ orgId,
+ userId,
+ badgeIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ badgeIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/users/${encodeURIComponent(userId)}/badges/dissociate`,
+ body: { badgeIds },
+ });
+}
+
+async function listUserGroups({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/users/${encodeURIComponent(userId)}/groups`,
+ query: { helpCenterId, from, limit },
+ });
+}
+
+async function addUserGroups({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+ groupIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+ groupIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/users/${encodeURIComponent(userId)}/groups/associate`,
+ query: { helpCenterId },
+ body: { groups: groupIds.map((id) => ({ id })) },
+ });
+}
+
+async function removeUserGroups({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+ groupIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+ groupIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/users/${encodeURIComponent(userId)}/groups/dissociate`,
+ query: { helpCenterId },
+ body: { groupIds },
+ });
+}
+
+async function listUserLabels({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/users/${encodeURIComponent(userId)}/labels`,
+ query: { helpCenterId, from, limit },
+ });
+}
+
+async function assignUserLabels({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+ labelIds,
+ primaryLabelId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+ labelIds: string[];
+ primaryLabelId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/users/${encodeURIComponent(userId)}/labels/assign`,
+ query: { helpCenterId },
+ body: { labels: labelIds.map((id) => ({ id, isPrimary: id === primaryLabelId })) },
+ });
+}
+
+async function removeUserLabels({
+ auth,
+ orgId,
+ userId,
+ helpCenterId,
+ labelIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ userId: string;
+ helpCenterId?: string;
+ labelIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/users/${encodeURIComponent(userId)}/labels/remove`,
+ query: { helpCenterId },
+ body: { labelIds },
+ });
+}
+
+async function listHelpCenters({
+ auth,
+ orgId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/helpCenters`,
+ query: { from, limit },
+ });
+}
+
+async function listBadges({
+ auth,
+ orgId,
+ type,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ type?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ const badges = await zohoDeskClient.request<ZohoDeskRecord[] | ''>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/badges`,
+ query: { type, from, limit },
+ });
+ return badges || [];
+}
+
+async function listGroups({
+ auth,
+ orgId,
+ helpCenterId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ helpCenterId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/groups`,
+ query: { helpCenterId, from, limit },
+ });
+}
+
+async function listLabels({
+ auth,
+ orgId,
+ helpCenterId,
+ searchBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ helpCenterId?: string;
+ searchBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/labels`,
+ query: { helpCenterId, searchBy, from, limit },
+ });
+}
+
+export const zohoDeskHelpCenterUsersApi = {
+ listHelpCenters,
+ listBadges,
+ listGroups,
+ listLabels,
+ listUsers,
+ getUser,
+ updateUser,
+ listUserBadges,
+ addUserBadges,
+ removeUserBadges,
+ listUserGroups,
+ addUserGroups,
+ removeUserGroups,
+ listUserLabels,
+ assignUserLabels,
+ removeUserLabels,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/index.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/index.ts
new file mode 100644
index 00000000000..3da47ae923a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/index.ts
@@ -0,0 +1,29 @@
+import { zohoDeskAccountsApi } from './accounts';
+import { zohoDeskActivitiesApi } from './activities';
+import { zohoDeskContactsApi } from './contacts';
+import { zohoDeskContractsApi } from './contracts';
+import { zohoDeskHelpCenterUsersApi } from './help-center-users';
+import { zohoDeskKnowledgeBaseApi } from './knowledge-base';
+import { zohoDeskOrganizationApi } from './organization';
+import { zohoDeskProductsApi } from './products';
+import { zohoDeskTasksApi } from './tasks';
+import { zohoDeskThreadsApi } from './threads';
+import { zohoDeskTicketCommentsApi } from './ticket-comments';
+import { zohoDeskTicketsApi } from './tickets';
+import { zohoDeskTimeTrackingApi } from './time-tracking';
+
+export const zohoDeskApi = {
+ ...zohoDeskTicketsApi,
+ ...zohoDeskThreadsApi,
+ ...zohoDeskTicketCommentsApi,
+ ...zohoDeskContactsApi,
+ ...zohoDeskAccountsApi,
+ ...zohoDeskTasksApi,
+ ...zohoDeskProductsApi,
+ ...zohoDeskKnowledgeBaseApi,
+ ...zohoDeskOrganizationApi,
+ ...zohoDeskTimeTrackingApi,
+ ...zohoDeskActivitiesApi,
+ ...zohoDeskContractsApi,
+ ...zohoDeskHelpCenterUsersApi,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/knowledge-base.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/knowledge-base.ts
new file mode 100644
index 00000000000..afc5a3b7b4f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/knowledge-base.ts
@@ -0,0 +1,82 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskRecord } from '../types';
+
+async function listArticles({
+ auth,
+ orgId,
+ categoryId,
+ status,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ categoryId?: string;
+ status?: string[];
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/articles`,
+ query: { categoryId, status, sortBy, from, limit },
+ });
+}
+
+async function searchArticles({
+ auth,
+ orgId,
+ searchText,
+ title,
+ departmentId,
+ categoryId,
+ tag,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ title?: string;
+ departmentId?: string;
+ categoryId?: string;
+ tag?: string[];
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/articles/search`,
+ query: { _all: searchText, title, departmentId, categoryId, tag, sortBy, from, limit },
+ });
+}
+
+async function getArticle({
+ auth,
+ orgId,
+ articleId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ articleId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/articles/${encodeURIComponent(articleId)}`,
+ });
+}
+
+export const zohoDeskKnowledgeBaseApi = { listArticles, searchArticles, getArticle };
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/organization.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/organization.ts
new file mode 100644
index 00000000000..ebb15351e71
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/organization.ts
@@ -0,0 +1,520 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type {
+ ZohoDeskAuthValue,
+ ZohoDeskDepartment,
+ ZohoDeskOrganization,
+ ZohoDeskPage,
+ ZohoDeskRecord,
+} from '../types';
+
+async function listOrganizations({
+ auth,
+}: {
+ auth: ZohoDeskAuthValue;
+}): Promise<ZohoDeskOrganization[]> {
+ const response = await zohoDeskClient.request<ZohoDeskPage<ZohoDeskOrganization>>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/organizations',
+ });
+ return response.data;
+}
+
+async function listDepartments({
+ auth,
+ orgId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+}): Promise<ZohoDeskDepartment[]> {
+ const response = await zohoDeskClient.request<ZohoDeskPage<ZohoDeskDepartment>>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/departments',
+ orgId,
+ });
+ return response.data;
+}
+
+async function listOrganizationRecords({
+ auth,
+}: {
+ auth: ZohoDeskAuthValue;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations`,
+ });
+}
+
+async function getOrganization({
+ auth,
+ organizationId,
+ includeCustomDomain,
+}: {
+ auth: ZohoDeskAuthValue;
+ organizationId: string;
+ includeCustomDomain?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations/${encodeURIComponent(organizationId)}`,
+ query: { includeCustomDomain },
+ });
+}
+
+async function listAgents({
+ auth,
+ orgId,
+ searchStr,
+ fieldName,
+ departmentIds,
+ roleIds,
+ status,
+ isConfirmed,
+ isLightAgent,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchStr?: string;
+ fieldName?: string;
+ departmentIds?: string[];
+ roleIds?: string[];
+ status?: string;
+ isConfirmed?: boolean;
+ isLightAgent?: boolean;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents`,
+ query: {
+ searchStr,
+ fieldName,
+ departmentIds,
+ roleIds,
+ status,
+ isConfirmed,
+ isLightAgent,
+ from,
+ limit,
+ },
+ });
+}
+
+async function getAgent({
+ auth,
+ orgId,
+ agentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ agentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents/${encodeURIComponent(agentId)}`,
+ });
+}
+
+async function findAgentByEmail({
+ auth,
+ orgId,
+ email,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ email: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents/email/${encodeURIComponent(email).replace(/%40/g, '@')}`,
+ });
+}
+
+async function countAgents({
+ auth,
+ orgId,
+ status,
+ isConfirmed,
+ includeLightAgent,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ status?: string;
+ isConfirmed?: boolean;
+ includeLightAgent?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents/count`,
+ query: { status, isConfirmed, includeLightAgent },
+ });
+}
+
+async function countAgentsByType({
+ auth,
+ orgId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents/allCounts`,
+ });
+}
+
+async function getCurrentAgent({
+ auth,
+ orgId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/myinfo`,
+ });
+}
+
+async function listDepartmentRecords({
+ auth,
+ orgId,
+ searchStr,
+ isEnabled,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchStr?: string;
+ isEnabled?: boolean;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/departments`,
+ query: { searchStr, isEnabled, from, limit },
+ });
+}
+
+async function getDepartment({
+ auth,
+ orgId,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/departments/${encodeURIComponent(departmentId)}`,
+ });
+}
+
+async function countDepartments({
+ auth,
+ orgId,
+ isEnabled,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ isEnabled?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/departments/count`,
+ query: { isEnabled },
+ });
+}
+
+async function listDepartmentAgents({
+ auth,
+ orgId,
+ departmentId,
+ searchStr,
+ fieldName,
+ status,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId: string;
+ searchStr?: string;
+ fieldName?: string;
+ status?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/departments/${encodeURIComponent(departmentId)}/agents`,
+ query: { searchStr, fieldName, status, from, limit },
+ });
+}
+
+async function listDepartmentTeams({
+ auth,
+ orgId,
+ departmentId,
+ searchStr,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId: string;
+ searchStr?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/departments/${encodeURIComponent(departmentId)}/teams`,
+ query: { searchStr, from, limit },
+ });
+}
+
+async function getTeam({
+ auth,
+ orgId,
+ teamId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ teamId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/teams/${encodeURIComponent(teamId)}`,
+ });
+}
+
+async function listTeamMembers({
+ auth,
+ orgId,
+ teamId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ teamId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/teams/${encodeURIComponent(teamId)}/members`,
+ });
+}
+
+async function listRoles({
+ auth,
+ orgId,
+ searchStr,
+ isDefault,
+ isVisible,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchStr?: string;
+ isDefault?: boolean;
+ isVisible?: boolean;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/roles`,
+ query: { searchStr, isDefault, isVisible, from, limit },
+ });
+}
+
+async function getRole({
+ auth,
+ orgId,
+ roleId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ roleId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/roles/${encodeURIComponent(roleId)}`,
+ });
+}
+
+async function getRolesByIds({
+ auth,
+ orgId,
+ roleIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ roleIds: string[];
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/rolesByIds`,
+ query: { roleIds },
+ });
+}
+
+async function countRoles({
+ auth,
+ orgId,
+ isDefault,
+ isVisible,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ isDefault?: boolean;
+ isVisible?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/roles/count`,
+ query: { isDefault, isVisible },
+ });
+}
+
+async function listViews({
+ auth,
+ orgId,
+ module,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ module: string;
+ departmentId?: string;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/views`,
+ query: { module, departmentId },
+ });
+}
+
+async function listFields({
+ auth,
+ orgId,
+ module,
+ departmentId,
+ apiNames,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ module: string;
+ departmentId?: string;
+ apiNames?: string[];
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/organizationFields`,
+ query: { module, departmentId, apiNames },
+ });
+}
+
+async function search({
+ auth,
+ orgId,
+ searchStr,
+ departmentId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchStr: string;
+ departmentId?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/search`,
+ query: { searchStr, departmentId, sortBy, from, limit },
+ });
+}
+
+export const zohoDeskOrganizationApi = {
+ listOrganizations,
+ listDepartments,
+ listOrganizationRecords,
+ getOrganization,
+ listAgents,
+ getAgent,
+ findAgentByEmail,
+ countAgents,
+ countAgentsByType,
+ getCurrentAgent,
+ listDepartmentRecords,
+ getDepartment,
+ countDepartments,
+ listDepartmentAgents,
+ listDepartmentTeams,
+ getTeam,
+ listTeamMembers,
+ listRoles,
+ getRole,
+ getRolesByIds,
+ countRoles,
+ listViews,
+ listFields,
+ search,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/products.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/products.ts
new file mode 100644
index 00000000000..74a5758852c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/products.ts
@@ -0,0 +1,418 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskFile, ZohoDeskRecord } from '../types';
+
+async function listProducts({
+ auth,
+ orgId,
+ departmentId,
+ viewId,
+ ownerId,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId?: string;
+ viewId?: string;
+ ownerId?: string;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products`,
+ query: { departmentId, viewId, ownerId, sortBy, from, limit },
+ });
+}
+
+async function getProduct({
+ auth,
+ orgId,
+ productId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products/${encodeURIComponent(productId)}`,
+ });
+}
+
+async function searchProducts({
+ auth,
+ orgId,
+ searchText,
+ productName,
+ departmentId,
+ contactId,
+ accountId,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ productName?: string;
+ departmentId?: string;
+ contactId?: string;
+ accountId?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products/search`,
+ query: {
+ _all: searchText,
+ productName,
+ departmentId,
+ contactId,
+ accountId,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ },
+ });
+}
+
+async function findDuplicateProducts({
+ auth,
+ orgId,
+ productName,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productName: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products/searchDuplicates`,
+ query: { productName, from, limit },
+ });
+}
+
+async function createProduct({
+ auth,
+ orgId,
+ productName,
+ departmentIds,
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productName: string;
+ departmentIds: string[];
+ productCode?: string;
+ unitPrice?: number;
+ productCategory?: string;
+ manufacturer?: string;
+ ownerId?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/products`,
+ body: {
+ productName,
+ departmentIds,
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function updateProduct({
+ auth,
+ orgId,
+ productId,
+ productName,
+ departmentIds,
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ productName?: string;
+ departmentIds?: string[];
+ productCode?: string;
+ unitPrice?: number;
+ productCategory?: string;
+ manufacturer?: string;
+ ownerId?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/products/${encodeURIComponent(productId)}`,
+ body: {
+ productName,
+ departmentIds,
+ productCode,
+ unitPrice,
+ productCategory,
+ manufacturer,
+ ownerId,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function deleteProducts({
+ auth,
+ orgId,
+ productIds,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productIds: string[];
+ departmentId?: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/products/moveToTrash`,
+ body: { productIds, departmentId },
+ });
+}
+
+async function listProductAccounts({
+ auth,
+ orgId,
+ productId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products/${encodeURIComponent(productId)}/accounts`,
+ query: { from, limit },
+ });
+}
+
+async function listProductContacts({
+ auth,
+ orgId,
+ productId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products/${encodeURIComponent(productId)}/contacts`,
+ query: { from, limit },
+ });
+}
+
+async function listProductTickets({
+ auth,
+ orgId,
+ productId,
+ departmentId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ departmentId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products/${encodeURIComponent(productId)}/tickets`,
+ query: { departmentId, from, limit },
+ });
+}
+
+async function associateProductAccounts({
+ auth,
+ orgId,
+ productId,
+ accountIds,
+ associate,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ accountIds: string[];
+ associate: boolean;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/products/${encodeURIComponent(productId)}/associateAccounts`,
+ body: { ids: accountIds, associate },
+ });
+}
+
+async function associateProductContacts({
+ auth,
+ orgId,
+ productId,
+ contactIds,
+ associate,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ contactIds: string[];
+ associate: boolean;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/products/${encodeURIComponent(productId)}/associateContacts`,
+ body: { ids: contactIds, associate },
+ });
+}
+
+async function listProductAttachments({
+ auth,
+ orgId,
+ productId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/products/${encodeURIComponent(productId)}/attachments`,
+ query: { from, limit },
+ });
+}
+
+async function uploadProductAttachment({
+ auth,
+ orgId,
+ productId,
+ file,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ file: ZohoDeskFile;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.upload<ZohoDeskRecord>({
+ auth,
+ orgId,
+ path: `/products/${encodeURIComponent(productId)}/attachments`,
+ file,
+ });
+}
+
+async function deleteProductAttachment({
+ auth,
+ orgId,
+ productId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ productId: string;
+ attachmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/products/${encodeURIComponent(productId)}/attachments/${encodeURIComponent(
+ attachmentId,
+ )}`,
+ });
+}
+
+export const zohoDeskProductsApi = {
+ listProducts,
+ getProduct,
+ searchProducts,
+ findDuplicateProducts,
+ createProduct,
+ updateProduct,
+ deleteProducts,
+ listProductAccounts,
+ listProductContacts,
+ listProductTickets,
+ associateProductAccounts,
+ associateProductContacts,
+ listProductAttachments,
+ uploadProductAttachment,
+ deleteProductAttachment,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/tasks.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/tasks.ts
new file mode 100644
index 00000000000..3c65e2daf4b
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/tasks.ts
@@ -0,0 +1,482 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskDownload, ZohoDeskFile, ZohoDeskRecord } from '../types';
+
+async function listTasks({
+ auth,
+ orgId,
+ departmentId,
+ viewId,
+ assignee,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId?: string;
+ viewId?: string;
+ assignee?: string[];
+ isCompleted?: boolean;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks`,
+ query: { departmentId, viewId, assignee, isCompleted, sortBy, from, limit },
+ });
+}
+
+async function listTicketTasks({
+ auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ isCompleted?: boolean;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/tasks`,
+ query: { isCompleted, sortBy, from, limit },
+ });
+}
+
+async function getTask({
+ auth,
+ orgId,
+ taskId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}`,
+ });
+}
+
+async function searchTasks({
+ auth,
+ orgId,
+ searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ dueDateRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ subject?: string;
+ ticketNumber?: string;
+ assigneeId?: string;
+ departmentId?: string;
+ status?: string;
+ priority?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ dueDateRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/search`,
+ query: {
+ _all: searchText,
+ subject,
+ ticketNumber,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ dueDateRange,
+ from,
+ limit,
+ },
+ });
+}
+
+async function countTasks({
+ auth,
+ orgId,
+ viewId,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ viewId: string;
+ departmentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/count`,
+ query: { viewId, departmentId },
+ });
+}
+
+async function createTask({
+ auth,
+ orgId,
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ subject: string;
+ departmentId: string;
+ ticketId?: string;
+ contactId?: string;
+ ownerId?: string;
+ dueDate?: string;
+ status?: string;
+ priority?: string;
+ category?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tasks`,
+ body: {
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function updateTask({
+ auth,
+ orgId,
+ taskId,
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ subject?: string;
+ departmentId?: string;
+ ticketId?: string;
+ contactId?: string;
+ ownerId?: string;
+ dueDate?: string;
+ status?: string;
+ priority?: string;
+ category?: string;
+ description?: string;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/tasks/${encodeURIComponent(taskId)}`,
+ body: {
+ subject,
+ departmentId,
+ ticketId,
+ contactId,
+ ownerId,
+ dueDate,
+ status,
+ priority,
+ category,
+ description,
+ cf: customFields,
+ },
+ });
+}
+
+async function deleteTasks({
+ auth,
+ orgId,
+ taskIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tasks/moveToTrash`,
+ body: { entityIds: taskIds },
+ });
+}
+
+async function updateManyTasks({
+ auth,
+ orgId,
+ taskIds,
+ fieldName,
+ fieldValue,
+ isCustomField,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskIds: string[];
+ fieldName: string;
+ fieldValue?: string;
+ isCustomField?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tasks/updateMany`,
+ body: { ids: taskIds, fieldName, fieldValue, isCustomField },
+ });
+}
+
+async function listTaskComments({
+ auth,
+ orgId,
+ taskId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/comments`,
+ query: { from, limit },
+ });
+}
+
+async function getTaskComment({
+ auth,
+ orgId,
+ taskId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ commentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function createTaskComment({
+ auth,
+ orgId,
+ taskId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tasks/${encodeURIComponent(taskId)}/comments`,
+ body: { content, contentType },
+ });
+}
+
+async function updateTaskComment({
+ auth,
+ orgId,
+ taskId,
+ commentId,
+ content,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ commentId: string;
+ content: string;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PUT,
+ path: `/tasks/${encodeURIComponent(taskId)}/comments/${encodeURIComponent(commentId)}`,
+ body: { content, contentType },
+ });
+}
+
+async function listTaskAttachments({
+ auth,
+ orgId,
+ taskId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/attachments`,
+ query: { from, limit },
+ });
+}
+
+async function uploadTaskAttachment({
+ auth,
+ orgId,
+ taskId,
+ file,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ file: ZohoDeskFile;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.upload<ZohoDeskRecord>({
+ auth,
+ orgId,
+ path: `/tasks/${encodeURIComponent(taskId)}/attachments`,
+ file,
+ });
+}
+
+async function deleteTaskAttachment({
+ auth,
+ orgId,
+ taskId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ attachmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/tasks/${encodeURIComponent(taskId)}/attachments/${encodeURIComponent(attachmentId)}`,
+ });
+}
+
+async function downloadTaskAttachment({
+ auth,
+ orgId,
+ taskId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ attachmentId: string;
+}): Promise<ZohoDeskDownload> {
+ return await zohoDeskClient.download({
+ auth,
+ orgId,
+ path: `/tasks/${encodeURIComponent(taskId)}/attachments/${encodeURIComponent(
+ attachmentId,
+ )}/content`,
+ });
+}
+
+export const zohoDeskTasksApi = {
+ listTasks,
+ listTicketTasks,
+ getTask,
+ searchTasks,
+ countTasks,
+ createTask,
+ updateTask,
+ deleteTasks,
+ updateManyTasks,
+ listTaskComments,
+ getTaskComment,
+ createTaskComment,
+ updateTaskComment,
+ listTaskAttachments,
+ uploadTaskAttachment,
+ deleteTaskAttachment,
+ downloadTaskAttachment,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/threads.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/threads.ts
new file mode 100644
index 00000000000..ce3b36abad2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/threads.ts
@@ -0,0 +1,243 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskDownload, ZohoDeskRecord, ZohoDeskThread } from '../types';
+
+async function listTicketThreads({
+ auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/threads`,
+ query: { from, limit },
+ });
+}
+
+async function getTicketThread({
+ auth,
+ orgId,
+ ticketId,
+ threadId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ threadId: string;
+}): Promise<ZohoDeskThread> {
+ const path = `/tickets/${encodeURIComponent(ticketId)}/threads/${encodeURIComponent(threadId)}`;
+ const thread = await zohoDeskClient.request<ZohoDeskThread>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path,
+ query: { include: 'plainText' },
+ });
+ if (thread.isContentTruncated !== true) {
+ return thread;
+ }
+ return await zohoDeskClient.request<ZohoDeskThread>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `${path}/fullContent`,
+ });
+}
+
+async function getLatestTicketThread({
+ auth,
+ orgId,
+ ticketId,
+ needPublic,
+ needIncomingThread,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ needPublic?: boolean;
+ needIncomingThread?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/latestThread`,
+ query: { needPublic, needIncomingThread },
+ });
+}
+
+async function listTicketConversations({
+ auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/conversations`,
+ query: { from, limit },
+ });
+}
+
+async function listReplyAddresses({
+ auth,
+ orgId,
+ departmentId,
+ isActive,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId: string;
+ isActive?: boolean;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/mailReplyAddress`,
+ query: { departmentId, isActive, from, limit },
+ });
+}
+
+async function sendTicketReply({
+ auth,
+ orgId,
+ ticketId,
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+ ticketStatus,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ content: string;
+ fromEmailAddress: string;
+ to?: string;
+ cc?: string;
+ bcc?: string;
+ contentType?: string;
+ inReplyToThreadId?: string;
+ ticketStatus?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/sendReply`,
+ body: {
+ channel: 'EMAIL',
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+ ticketStatus,
+ },
+ });
+}
+
+async function createDraftReply({
+ auth,
+ orgId,
+ ticketId,
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ content: string;
+ fromEmailAddress: string;
+ to?: string;
+ cc?: string;
+ bcc?: string;
+ contentType?: string;
+ inReplyToThreadId?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/draftReply`,
+ body: {
+ channel: 'EMAIL',
+ content,
+ fromEmailAddress,
+ to,
+ cc,
+ bcc,
+ contentType,
+ inReplyToThreadId,
+ },
+ });
+}
+
+async function downloadThreadAttachment({
+ auth,
+ orgId,
+ ticketId,
+ threadId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ threadId: string;
+ attachmentId: string;
+}): Promise<ZohoDeskDownload> {
+ return await zohoDeskClient.download({
+ auth,
+ orgId,
+ path: `/tickets/${encodeURIComponent(ticketId)}/threads/${encodeURIComponent(
+ threadId,
+ )}/attachments/${encodeURIComponent(attachmentId)}/content`,
+ });
+}
+
+export const zohoDeskThreadsApi = {
+ listTicketThreads,
+ getTicketThread,
+ getLatestTicketThread,
+ listTicketConversations,
+ listReplyAddresses,
+ sendTicketReply,
+ createDraftReply,
+ downloadThreadAttachment,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/ticket-comments.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/ticket-comments.ts
new file mode 100644
index 00000000000..c168f79dcc2
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/ticket-comments.ts
@@ -0,0 +1,220 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskFile, ZohoDeskRecord } from '../types';
+
+async function listTicketComments({
+ auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/comments`,
+ query: { from, limit },
+ });
+}
+
+async function getTicketComment({
+ auth,
+ orgId,
+ ticketId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ commentId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function createTicketComment({
+ auth,
+ orgId,
+ ticketId,
+ content,
+ isPublic,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ content: string;
+ isPublic?: boolean;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/comments`,
+ body: { content, isPublic, contentType },
+ });
+}
+
+async function updateTicketComment({
+ auth,
+ orgId,
+ ticketId,
+ commentId,
+ content,
+ isPublic,
+ contentType,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ commentId: string;
+ content: string;
+ isPublic?: boolean;
+ contentType?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/tickets/${encodeURIComponent(ticketId)}/comments/${encodeURIComponent(commentId)}`,
+ body: { content, isPublic, contentType },
+ });
+}
+
+async function deleteTicketComment({
+ auth,
+ orgId,
+ ticketId,
+ commentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ commentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/tickets/${encodeURIComponent(ticketId)}/comments/${encodeURIComponent(commentId)}`,
+ });
+}
+
+async function getTicketCommentHistory({
+ auth,
+ orgId,
+ ticketId,
+ commentId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ commentId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/comments/${encodeURIComponent(
+ commentId,
+ )}/history`,
+ query: { from, limit },
+ });
+}
+
+async function listTicketAttachments({
+ auth,
+ orgId,
+ ticketId,
+ isPublic,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ isPublic?: boolean;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/attachments`,
+ query: { isPublic, from, limit },
+ });
+}
+
+async function uploadTicketAttachment({
+ auth,
+ orgId,
+ ticketId,
+ file,
+ isPublic,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ file: ZohoDeskFile;
+ isPublic?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.upload<ZohoDeskRecord>({
+ auth,
+ orgId,
+ path: `/tickets/${encodeURIComponent(ticketId)}/attachments`,
+ query: { isPublic },
+ file,
+ });
+}
+
+async function deleteTicketAttachment({
+ auth,
+ orgId,
+ ticketId,
+ attachmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ attachmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/tickets/${encodeURIComponent(ticketId)}/attachments/${encodeURIComponent(
+ attachmentId,
+ )}`,
+ });
+}
+
+export const zohoDeskTicketCommentsApi = {
+ listTicketComments,
+ getTicketComment,
+ createTicketComment,
+ updateTicketComment,
+ deleteTicketComment,
+ getTicketCommentHistory,
+ listTicketAttachments,
+ uploadTicketAttachment,
+ deleteTicketAttachment,
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/tickets.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/tickets.ts
new file mode 100644
index 00000000000..a01cfc7f21e
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/tickets.ts
@@ -0,0 +1,1047 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskPage, ZohoDeskRecord, ZohoDeskTicket } from '../types';
+
+async function listTickets({
+ auth,
+ orgId,
+ include,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ include?: string[];
+}): Promise<ZohoDeskPage<ZohoDeskTicket>> {
+ const query: Record<string, string> = {};
+ if (include) query['include'] = include.join(',');
+
+ return await zohoDeskClient.request<ZohoDeskPage<ZohoDeskTicket>>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/tickets',
+ orgId,
+ query,
+ });
+}
+
+async function createTicket({
+ auth,
+ orgId,
+ ...fields
+}: CreateTicketParams & { auth: ZohoDeskAuthValue }): Promise<ZohoDeskTicket> {
+ const body: Record<string, unknown> = {
+ departmentId: fields.departmentId,
+ subject: fields.subject,
+ description: fields.description,
+ };
+
+ if (fields.contactId) body['contactId'] = fields.contactId;
+ if (fields.email) body['email'] = fields.email;
+ if (fields.phone) body['phone'] = fields.phone;
+ if (fields.status) body['status'] = fields.status;
+ if (fields.priority) body['priority'] = fields.priority;
+ if (fields.category) body['category'] = fields.category;
+ if (fields.subCategory) body['subCategory'] = fields.subCategory;
+ if (fields.dueDate) body['dueDate'] = fields.dueDate;
+ if (fields.channel) body['channel'] = fields.channel;
+ if (fields.assigneeId) body['assigneeId'] = fields.assigneeId;
+ if (fields.productId) body['productId'] = fields.productId;
+ if (fields.classification) body['classification'] = fields.classification;
+ if (fields.language) body['language'] = fields.language;
+ if (fields.entitySkills && fields.entitySkills.length > 0)
+ body['entitySkills'] = fields.entitySkills;
+ if (fields.customFields) body['cf'] = fields.customFields;
+
+ return await zohoDeskClient.request<ZohoDeskTicket>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/tickets',
+ orgId,
+ body,
+ });
+}
+
+async function listTicketsByFilter({
+ auth,
+ orgId,
+ departmentId,
+ viewId,
+ status,
+ priority,
+ assignee,
+ channel,
+ receivedInDays,
+ sortBy,
+ include,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId?: string;
+ viewId?: string;
+ status?: string[];
+ priority?: string[];
+ assignee?: string[];
+ channel?: string[];
+ receivedInDays?: string;
+ sortBy?: string;
+ include?: string[];
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets`,
+ query: {
+ departmentId,
+ viewId,
+ status,
+ priority,
+ assignee,
+ channel,
+ receivedInDays,
+ sortBy,
+ include,
+ from,
+ limit,
+ },
+ });
+}
+
+async function getTicket({
+ auth,
+ orgId,
+ ticketId,
+ include,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ include?: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}`,
+ query: { include },
+ });
+}
+
+async function updateTicket({
+ auth,
+ orgId,
+ ticketId,
+ subject,
+ description,
+ status,
+ priority,
+ assigneeId,
+ contactId,
+ productId,
+ category,
+ subCategory,
+ dueDate,
+ channel,
+ classification,
+ language,
+ email,
+ phone,
+ customFields,
+ disableClosureNotification,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ subject?: string;
+ description?: string;
+ status?: string;
+ priority?: string;
+ assigneeId?: string;
+ contactId?: string;
+ productId?: string;
+ category?: string;
+ subCategory?: string;
+ dueDate?: string;
+ channel?: string;
+ classification?: string;
+ language?: string;
+ email?: string;
+ phone?: string;
+ customFields?: Record<string, unknown>;
+ disableClosureNotification?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/tickets/${encodeURIComponent(ticketId)}`,
+ query: { disableClosureNotification },
+ body: {
+ subject,
+ description,
+ status,
+ priority,
+ assigneeId,
+ contactId,
+ productId,
+ category,
+ subCategory,
+ dueDate,
+ channel,
+ classification,
+ language,
+ email,
+ phone,
+ cf: customFields,
+ },
+ });
+}
+
+async function searchTickets({
+ auth,
+ orgId,
+ searchText,
+ ticketNumber,
+ subject,
+ email,
+ phone,
+ contactId,
+ accountId,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ searchText?: string;
+ ticketNumber?: string;
+ subject?: string;
+ email?: string;
+ phone?: string;
+ contactId?: string;
+ accountId?: string;
+ assigneeId?: string;
+ departmentId?: string;
+ status?: string;
+ priority?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/search`,
+ query: {
+ _all: searchText,
+ ticketNumber,
+ subject,
+ email,
+ phone,
+ contactId,
+ accountId,
+ assigneeId,
+ departmentId,
+ status,
+ priority,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+ },
+ });
+}
+
+async function deleteTickets({
+ auth,
+ orgId,
+ ticketIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/moveToTrash`,
+ body: { ticketIds },
+ });
+}
+
+async function closeTickets({
+ auth,
+ orgId,
+ ticketIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/closeTickets`,
+ body: { ids: ticketIds },
+ });
+}
+
+async function updateManyTickets({
+ auth,
+ orgId,
+ ticketIds,
+ fieldName,
+ fieldValue,
+ isCustomField,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketIds: string[];
+ fieldName: string;
+ fieldValue?: string;
+ isCustomField?: boolean;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/updateMany`,
+ body: { ids: ticketIds, fieldName, fieldValue, isCustomField },
+ });
+}
+
+async function mergeTickets({
+ auth,
+ orgId,
+ ticketId,
+ ticketIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ ticketIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/merge`,
+ body: { ids: ticketIds },
+ });
+}
+
+async function moveTicket({
+ auth,
+ orgId,
+ ticketId,
+ departmentId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ departmentId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/move`,
+ query: { departmentId },
+ body: { departmentId },
+ });
+}
+
+async function listTicketHistory({
+ auth,
+ orgId,
+ ticketId,
+ agentId,
+ fieldName,
+ eventFilter,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ agentId?: string;
+ fieldName?: string;
+ eventFilter?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/History`,
+ query: { agentId, fieldName, eventFilter, from, limit },
+ });
+}
+
+async function getTicketMetrics({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/metrics`,
+ });
+}
+
+async function getTicketResolution({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/resolution`,
+ });
+}
+
+async function updateTicketResolution({
+ auth,
+ orgId,
+ ticketId,
+ content,
+ isNotifyContact,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ content: string;
+ isNotifyContact?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/tickets/${encodeURIComponent(ticketId)}/resolution`,
+ body: { content, isNotifyContact },
+ });
+}
+
+async function deleteTicketResolution({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/tickets/${encodeURIComponent(ticketId)}/resolution`,
+ });
+}
+
+async function countTickets({
+ auth,
+ orgId,
+ departmentId,
+ contactId,
+ assigneeId,
+ category,
+ createdTimeRange,
+ modifiedTimeRange,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ departmentId?: string;
+ contactId?: string;
+ assigneeId?: string;
+ category?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/ticketsCount`,
+ query: { departmentId, contactId, assigneeId, category, createdTimeRange, modifiedTimeRange },
+ });
+}
+
+async function listTicketTags({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/tags`,
+ });
+}
+
+async function addTicketTags({
+ auth,
+ orgId,
+ ticketId,
+ tags,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ tags: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/associateTag`,
+ body: { tags },
+ });
+}
+
+async function removeTicketTags({
+ auth,
+ orgId,
+ ticketId,
+ tags,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ tags: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/dissociateTag`,
+ body: { tags },
+ });
+}
+
+async function getSuggestedArticles({
+ auth,
+ orgId,
+ ticketId,
+ departmentId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ departmentId?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/articleSuggestion`,
+ query: { departmentId, from, limit },
+ });
+}
+
+async function linkArticlesToTicket({
+ auth,
+ orgId,
+ ticketId,
+ articleIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ articleIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/notifyArticleUsage`,
+ body: { ids: articleIds },
+ });
+}
+
+async function markTicketsSpam({
+ auth,
+ orgId,
+ ticketIds,
+ isSpam,
+ contactSpam,
+ handleExistingTickets,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketIds: string[];
+ isSpam: boolean;
+ contactSpam?: boolean;
+ handleExistingTickets?: boolean;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/markSpam`,
+ body: { ids: ticketIds, isSpam, contactSpam, handleExistingTickets },
+ });
+}
+
+async function deleteSpamTickets({
+ auth,
+ orgId,
+ ticketIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/deleteSpam`,
+ body: { ticketIds },
+ });
+}
+
+async function listTicketFollowers({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/followers`,
+ });
+}
+
+async function addTicketFollowers({
+ auth,
+ orgId,
+ ticketId,
+ followerIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ followerIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/addFollowers`,
+ body: { followerIds },
+ });
+}
+
+async function removeTicketFollowers({
+ auth,
+ orgId,
+ ticketId,
+ followerIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ followerIds: string[];
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/removeFollowers`,
+ body: { followerIds },
+ });
+}
+
+async function listTicketActivities({
+ auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ isCompleted?: boolean;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/activities`,
+ query: { isCompleted, sortBy, from, limit },
+ });
+}
+
+async function listTicketCalls({
+ auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ isCompleted?: boolean;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/calls`,
+ query: { isCompleted, sortBy, from, limit },
+ });
+}
+
+async function listTicketEvents({
+ auth,
+ orgId,
+ ticketId,
+ isCompleted,
+ sortBy,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ isCompleted?: boolean;
+ sortBy?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/events`,
+ query: { isCompleted, sortBy, from, limit },
+ });
+}
+
+async function listTicketResolutionHistory({
+ auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/resolutionHistory`,
+ query: { from, limit },
+ });
+}
+
+async function markTicketRead({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/markAsRead`,
+ });
+}
+
+async function markTicketUnread({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/markAsUnRead`,
+ });
+}
+
+async function listTicketPins({
+ auth,
+ orgId,
+ ticketId,
+ types,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ types?: string[];
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/pins`,
+ query: { types },
+ });
+}
+
+async function createTicketPin({
+ auth,
+ orgId,
+ ticketId,
+ entityId,
+ type,
+ isPublic,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ entityId: string;
+ type: string;
+ isPublic?: boolean;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/pins`,
+ body: { entityId, type, isPublic },
+ });
+}
+
+async function unpinTicketPin({
+ auth,
+ orgId,
+ ticketId,
+ pinIds,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ pinIds: string[];
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/pins/unpin`,
+ body: { ids: pinIds },
+ });
+}
+
+async function listTicketApprovals({
+ auth,
+ orgId,
+ ticketId,
+ status,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ status?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/approvals`,
+ query: { status, from, limit },
+ });
+}
+
+async function createTicketApproval({
+ auth,
+ orgId,
+ ticketId,
+ approverIds,
+ subject,
+ description,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ approverIds: string[];
+ subject: string;
+ description?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/approvals`,
+ body: { approverIds, subject, description },
+ });
+}
+
+async function getTicketApproval({
+ auth,
+ orgId,
+ ticketId,
+ approvalId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ approvalId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/approvals/${encodeURIComponent(approvalId)}`,
+ });
+}
+
+async function updateTicketApproval({
+ auth,
+ orgId,
+ ticketId,
+ approvalId,
+ status,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ approvalId: string;
+ status: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/tickets/${encodeURIComponent(ticketId)}/approvals/${encodeURIComponent(approvalId)}`,
+ body: { status },
+ });
+}
+
+export const zohoDeskTicketsApi = {
+ listTickets,
+ createTicket,
+ listTicketsByFilter,
+ getTicket,
+ updateTicket,
+ searchTickets,
+ deleteTickets,
+ closeTickets,
+ updateManyTickets,
+ mergeTickets,
+ moveTicket,
+ listTicketHistory,
+ getTicketMetrics,
+ getTicketResolution,
+ updateTicketResolution,
+ deleteTicketResolution,
+ countTickets,
+ listTicketTags,
+ addTicketTags,
+ removeTicketTags,
+ getSuggestedArticles,
+ linkArticlesToTicket,
+ markTicketsSpam,
+ deleteSpamTickets,
+ listTicketFollowers,
+ addTicketFollowers,
+ removeTicketFollowers,
+ listTicketActivities,
+ listTicketCalls,
+ listTicketEvents,
+ listTicketResolutionHistory,
+ markTicketRead,
+ markTicketUnread,
+ listTicketPins,
+ createTicketPin,
+ unpinTicketPin,
+ listTicketApprovals,
+ createTicketApproval,
+ getTicketApproval,
+ updateTicketApproval,
+};
+
+type CreateTicketParams = {
+ orgId: string;
+ departmentId: string;
+ subject: string;
+ description: string;
+ contactId?: string;
+ email?: string;
+ phone?: string;
+ status?: string;
+ priority?: string;
+ category?: string;
+ subCategory?: string;
+ dueDate?: string;
+ channel?: string;
+ assigneeId?: string;
+ productId?: string;
+ classification?: string;
+ language?: string;
+ entitySkills?: unknown[];
+ customFields?: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/api/time-tracking.ts b/packages/pieces/community/zoho-desk/src/lib/common/api/time-tracking.ts
new file mode 100644
index 00000000000..228769d0b9a
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/api/time-tracking.ts
@@ -0,0 +1,691 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoDeskClient } from '../client';
+
+import type { ZohoDeskAuthValue, ZohoDeskRecord } from '../types';
+
+async function listTicketTimeEntries({
+ auth,
+ orgId,
+ ticketId,
+ billStatus,
+ module,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ billStatus?: string;
+ module?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timeEntry`,
+ query: { billStatus, module, createdTimeRange, modifiedTimeRange, from, limit },
+ });
+}
+
+async function addTicketTimeEntry({
+ auth,
+ orgId,
+ ticketId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ executedTime: string;
+ hoursSpent?: number;
+ minutesSpent?: number;
+ secondsSpent?: number;
+ description?: string;
+ ownerId?: string;
+ isBillable?: boolean;
+ requestChargeType?: string;
+ additionalCost?: number;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timeEntry`,
+ body: {
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ cf: customFields,
+ },
+ });
+}
+
+async function getTicketTimeEntry({
+ auth,
+ orgId,
+ ticketId,
+ timeEntryId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ timeEntryId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timeEntry/${encodeURIComponent(timeEntryId)}`,
+ });
+}
+
+async function updateTicketTimeEntry({
+ auth,
+ orgId,
+ ticketId,
+ timeEntryId,
+ customFields,
+ ...fields
+}: TimeEntryFields & {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ timeEntryId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PUT,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timeEntry/${encodeURIComponent(timeEntryId)}`,
+ body: { ...fields, cf: customFields },
+ });
+}
+
+async function deleteTicketTimeEntry({
+ auth,
+ orgId,
+ ticketId,
+ timeEntryId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ timeEntryId: string;
+}): Promise<void> {
+ await zohoDeskClient.request<unknown>({
+ auth,
+ orgId,
+ method: HttpMethod.DELETE,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timeEntry/${encodeURIComponent(timeEntryId)}`,
+ });
+}
+
+async function listTicketTimeEntriesByBillingType({
+ auth,
+ orgId,
+ ticketId,
+ billingType,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ billingType: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timeEntryByBillingType`,
+ query: { billingType, from, limit },
+ });
+}
+
+async function getTicketTimeSummary({
+ auth,
+ orgId,
+ ticketId,
+ module,
+ billStatus,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ module?: string;
+ billStatus?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timeEntrySummation`,
+ query: { module, billStatus },
+ });
+}
+
+async function getTicketTimer({
+ auth,
+ orgId,
+ ticketId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timer`,
+ });
+}
+
+async function controlTicketTimer({
+ auth,
+ orgId,
+ ticketId,
+ action,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ action: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tickets/${encodeURIComponent(ticketId)}/timer`,
+ query: { action },
+ });
+}
+
+async function listTicketActiveTimers({
+ auth,
+ orgId,
+ ticketId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ ticketId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tickets/${encodeURIComponent(ticketId)}/activeTimer`,
+ query: { from, limit },
+ });
+}
+
+async function listTaskTimeEntries({
+ auth,
+ orgId,
+ taskId,
+ billStatus,
+ createdTimeRange,
+ modifiedTimeRange,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ billStatus?: string;
+ createdTimeRange?: string;
+ modifiedTimeRange?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/timeEntry`,
+ query: { billStatus, createdTimeRange, modifiedTimeRange, from, limit },
+ });
+}
+
+async function addTaskTimeEntry({
+ auth,
+ orgId,
+ taskId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ executedTime: string;
+ hoursSpent?: number;
+ minutesSpent?: number;
+ secondsSpent?: number;
+ description?: string;
+ ownerId?: string;
+ isBillable?: boolean;
+ requestChargeType?: string;
+ additionalCost?: number;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tasks/${encodeURIComponent(taskId)}/timeEntry`,
+ body: {
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ cf: customFields,
+ },
+ });
+}
+
+async function getTaskTimeEntry({
+ auth,
+ orgId,
+ taskId,
+ timeEntryId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ timeEntryId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/timeEntry/${encodeURIComponent(timeEntryId)}`,
+ });
+}
+
+async function updateTaskTimeEntry({
+ auth,
+ orgId,
+ taskId,
+ timeEntryId,
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ customFields,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ timeEntryId: string;
+ executedTime?: string;
+ hoursSpent?: number;
+ minutesSpent?: number;
+ secondsSpent?: number;
+ description?: string;
+ ownerId?: string;
+ isBillable?: boolean;
+ requestChargeType?: string;
+ additionalCost?: number;
+ customFields?: Record<string, unknown>;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.PATCH,
+ path: `/tasks/${encodeURIComponent(taskId)}/timeEntry/${encodeURIComponent(timeEntryId)}`,
+ body: {
+ executedTime,
+ hoursSpent,
+ minutesSpent,
+ secondsSpent,
+ description,
+ ownerId,
+ isBillable,
+ requestChargeType,
+ additionalCost,
+ cf: customFields,
+ },
+ });
+}
+
+async function getTaskTimeSummary({
+ auth,
+ orgId,
+ taskId,
+ billStatus,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ billStatus?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/timeEntrySummation`,
+ query: { billStatus },
+ });
+}
+
+async function getTaskTimer({
+ auth,
+ orgId,
+ taskId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/timer`,
+ });
+}
+
+async function controlTaskTimer({
+ auth,
+ orgId,
+ taskId,
+ action,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ action: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path: `/tasks/${encodeURIComponent(taskId)}/timer`,
+ query: { action },
+ });
+}
+
+async function listTaskActiveTimers({
+ auth,
+ orgId,
+ taskId,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ taskId: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/tasks/${encodeURIComponent(taskId)}/activeTimer`,
+ query: { from, limit },
+ });
+}
+
+async function listContactTimeEntries({
+ auth,
+ orgId,
+ contactId,
+ module,
+ departmentId,
+ billStatus,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ module?: string;
+ departmentId?: string;
+ billStatus?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/timeEntry`,
+ query: { module, departmentId, billStatus, from, limit },
+ });
+}
+
+async function getContactTimeSummary({
+ auth,
+ orgId,
+ contactId,
+ module,
+ departmentId,
+ billStatus,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ contactId: string;
+ module?: string;
+ departmentId?: string;
+ billStatus?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/contacts/${encodeURIComponent(contactId)}/timeEntrySummation`,
+ query: { module, departmentId, billStatus },
+ });
+}
+
+async function listAccountTimeEntries({
+ auth,
+ orgId,
+ accountId,
+ module,
+ departmentId,
+ billStatus,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ module?: string;
+ departmentId?: string;
+ billStatus?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/timeEntry`,
+ query: { module, departmentId, billStatus, from, limit },
+ });
+}
+
+async function getAccountTimeSummary({
+ auth,
+ orgId,
+ accountId,
+ module,
+ departmentId,
+ billStatus,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ accountId: string;
+ module?: string;
+ departmentId?: string;
+ billStatus?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/accounts/${encodeURIComponent(accountId)}/timeEntrySummation`,
+ query: { module, departmentId, billStatus },
+ });
+}
+
+async function listAgentTimeEntries({
+ auth,
+ orgId,
+ agentId,
+ module,
+ departmentId,
+ billStatus,
+ from,
+ limit,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ agentId: string;
+ module?: string;
+ departmentId?: string;
+ billStatus?: string;
+ from?: number;
+ limit?: number;
+}): Promise<ZohoDeskRecord[]> {
+ return await zohoDeskClient.list<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents/${encodeURIComponent(agentId)}/timeEntry`,
+ query: { module, departmentId, billStatus, from, limit },
+ });
+}
+
+async function getAgentTimeEntry({
+ auth,
+ orgId,
+ agentId,
+ timeEntryId,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ agentId: string;
+ timeEntryId: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents/${encodeURIComponent(agentId)}/timeEntry/${encodeURIComponent(timeEntryId)}`,
+ });
+}
+
+async function getAgentTimeSummary({
+ auth,
+ orgId,
+ agentId,
+ module,
+ departmentId,
+ billStatus,
+}: {
+ auth: ZohoDeskAuthValue;
+ orgId: string;
+ agentId: string;
+ module?: string;
+ departmentId?: string;
+ billStatus?: string;
+}): Promise<ZohoDeskRecord> {
+ return await zohoDeskClient.request<ZohoDeskRecord>({
+ auth,
+ orgId,
+ method: HttpMethod.GET,
+ path: `/agents/${encodeURIComponent(agentId)}/timeEntrySummation`,
+ query: { module, departmentId, billStatus },
+ });
+}
+
+export const zohoDeskTimeTrackingApi = {
+ listTicketTimeEntries,
+ addTicketTimeEntry,
+ getTicketTimeEntry,
+ updateTicketTimeEntry,
+ deleteTicketTimeEntry,
+ listTicketTimeEntriesByBillingType,
+ getTicketTimeSummary,
+ getTicketTimer,
+ controlTicketTimer,
+ listTicketActiveTimers,
+ listTaskTimeEntries,
+ addTaskTimeEntry,
+ getTaskTimeEntry,
+ updateTaskTimeEntry,
+ getTaskTimeSummary,
+ getTaskTimer,
+ controlTaskTimer,
+ listTaskActiveTimers,
+ listContactTimeEntries,
+ getContactTimeSummary,
+ listAccountTimeEntries,
+ getAccountTimeSummary,
+ listAgentTimeEntries,
+ getAgentTimeEntry,
+ getAgentTimeSummary,
+};
+
+type TimeEntryFields = {
+ executedTime?: string;
+ hoursSpent?: number;
+ minutesSpent?: number;
+ secondsSpent?: number;
+ description?: string;
+ ownerId?: string;
+ isBillable?: boolean;
+ requestChargeType?: string;
+ additionalCost?: number;
+ customFields?: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/client.ts b/packages/pieces/community/zoho-desk/src/lib/common/client.ts
new file mode 100644
index 00000000000..8b851c2961f
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/client.ts
@@ -0,0 +1,137 @@
+import FormData from 'form-data';
+
+import { HttpHeaders, HttpMethod, httpClient, QueryParams } from '@activepieces/pieces-common';
+import { isNil, tryCatch } from '@activepieces/pieces-framework';
+
+import type { ZohoDeskAuthValue, ZohoDeskDownload, ZohoDeskFile, ZohoDeskPage } from './types';
+
+function baseUrl({ auth }: { auth: ZohoDeskAuthValue }): string {
+ const location = auth.props?.location ?? 'zoho.com';
+ return `https://desk.${location}/api/v1`;
+}
+
+async function request<T>({
+ auth,
+ orgId,
+ method,
+ path,
+ query,
+ body,
+ headers,
+}: RequestParams & { auth: ZohoDeskAuthValue; headers?: HttpHeaders }): Promise<T> {
+ const response = await httpClient.sendRequest<T>({
+ method,
+ url: `${baseUrl({ auth })}${path}`,
+ headers: { ...authHeaders({ auth, orgId }), ...headers },
+ queryParams: toQueryParams({ query }),
+ body,
+ });
+ return response.body;
+}
+
+async function list<T>({
+ auth,
+ ...params
+}: RequestParams & { auth: ZohoDeskAuthValue }): Promise<T[]> {
+ const response = await request<ZohoDeskPage<T> | ''>({ auth, ...params });
+ if (isNil(response) || response === '') {
+ return [];
+ }
+ return response.data;
+}
+
+async function upload<T>({
+ auth,
+ orgId,
+ path,
+ query,
+ file,
+}: UploadParams & { auth: ZohoDeskAuthValue }): Promise<T> {
+ const form = new FormData();
+ form.append('file', file.data, file.filename);
+ return await request<T>({
+ auth,
+ orgId,
+ method: HttpMethod.POST,
+ path,
+ query,
+ body: form,
+ headers: form.getHeaders(),
+ });
+}
+
+async function download({
+ auth,
+ orgId,
+ path,
+}: DownloadParams & { auth: ZohoDeskAuthValue }): Promise<ZohoDeskDownload> {
+ const response = await httpClient.sendRequest<ArrayBuffer>({
+ method: HttpMethod.GET,
+ url: `${baseUrl({ auth })}${path}`,
+ headers: authHeaders({ auth, orgId }),
+ responseType: 'arraybuffer',
+ });
+ const disposition = response.headers?.['content-disposition'];
+ return {
+ data: Buffer.from(response.body),
+ fileName: await parseFileName({ disposition }),
+ };
+}
+
+async function parseFileName({ disposition }: { disposition: unknown }): Promise<string | undefined> {
+ if (typeof disposition !== 'string') {
+ return undefined;
+ }
+ const encoded = ENCODED_FILE_NAME_PATTERN.exec(disposition);
+ if (encoded) {
+ const { data: decoded } = await tryCatch(async () => decodeURIComponent(encoded[1]));
+ if (decoded) {
+ return decoded;
+ }
+ }
+ return PLAIN_FILE_NAME_PATTERN.exec(disposition)?.[1] ?? encoded?.[1];
+}
+
+function authHeaders({ auth, orgId }: { auth: ZohoDeskAuthValue; orgId?: string }): HttpHeaders {
+ const headers: HttpHeaders = {
+ Authorization: `Zoho-oauthtoken ${auth.access_token}`,
+ };
+ if (orgId) {
+ headers['orgId'] = orgId;
+ }
+ return headers;
+}
+
+function toQueryParams({ query }: { query?: RequestParams['query'] }): QueryParams {
+ const queryParams: QueryParams = {};
+ if (query) {
+ for (const [key, value] of Object.entries(query)) {
+ if (value !== null && value !== undefined) {
+ queryParams[key] = String(value);
+ }
+ }
+ }
+ return queryParams;
+}
+
+export const zohoDeskClient = { baseUrl, request, list, upload, download };
+
+const ENCODED_FILE_NAME_PATTERN = /filename\*=(?:UTF-8'')?"?([^";]+)"?/i;
+const PLAIN_FILE_NAME_PATTERN = /filename="?([^";]+)"?/i;
+
+type RequestParams = {
+ orgId?: string;
+ method: HttpMethod;
+ path: string;
+ query?: Record<string, string | number | boolean | string[] | undefined>;
+ body?: unknown;
+};
+
+type UploadParams = {
+ orgId?: string;
+ path: string;
+ query?: RequestParams['query'];
+ file: ZohoDeskFile;
+};
+
+type DownloadParams = { orgId?: string; path: string };
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/index.ts b/packages/pieces/community/zoho-desk/src/lib/common/index.ts
deleted file mode 100644
index b8be518ec1f..00000000000
--- a/packages/pieces/community/zoho-desk/src/lib/common/index.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import {
- httpClient,
- HttpHeaders,
- HttpMessageBody,
- HttpMethod,
- HttpRequest,
- QueryParams,
-} from '@activepieces/pieces-common';
-import { PiecePropValueSchema } from '@activepieces/pieces-framework';
-import { zohoDeskAuth } from './auth';
-
-export type ZohoDeskApiCallParams = {
- auth: PiecePropValueSchema<typeof zohoDeskAuth>;
- orgId?: string;
- method: HttpMethod;
- resourceUri: string;
- query?: Record<string, string | number | string[] | undefined>;
- body?: any;
-};
-
-export async function zohoDeskApiCall<T extends HttpMessageBody>({
- auth,
- orgId,
- method,
- resourceUri,
- query,
- body,
-}: ZohoDeskApiCallParams): Promise<T> {
- const location = auth.props?.['location'] ?? 'zoho.com';
- const baseUrl = `https://desk.${location}/api/v1`;
- const qs: QueryParams = {};
-
- if (query) {
- for (const [key, value] of Object.entries(query)) {
- if (value !== null && value !== undefined) {
- qs[key] = String(value);
- }
- }
- }
-
- const headers: HttpHeaders = {
- Authorization: `Zoho-oauthtoken ${auth.access_token}`,
- };
-
- if (orgId) {
- headers['orgId'] = orgId;
- }
-
- const request: HttpRequest = {
- method,
- url: baseUrl + resourceUri,
- headers,
- queryParams: qs,
- body,
- };
-
- const response = await httpClient.sendRequest<T>(request);
- return response.body;
-}
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/props.ts b/packages/pieces/community/zoho-desk/src/lib/common/props.ts
index 16574a92e75..a66057f138c 100644
--- a/packages/pieces/community/zoho-desk/src/lib/common/props.ts
+++ b/packages/pieces/community/zoho-desk/src/lib/common/props.ts
@@ -1,90 +1,54 @@
-import { HttpMethod } from '@activepieces/pieces-common';
-import { PiecePropValueSchema, Property } from '@activepieces/pieces-framework';
-import { zohoDeskApiCall } from '.';
-import { zohoDeskAuth } from './auth';
-
-interface DropdownParams {
- displayName: string;
- description?: string;
- required: boolean;
+import { DropdownState, Property } from '@activepieces/pieces-framework';
+import { zohoDeskAuth } from '../auth';
+import { zohoDeskApi } from './api';
+
+function orgId<R extends boolean>({ required, displayName = 'Organization', description }: PropParams<R>) {
+ return Property.Dropdown({
+ auth: zohoDeskAuth,
+ displayName,
+ description,
+ refreshers: [],
+ required,
+ options: async ({ auth }) => {
+ if (!auth) {
+ return disabledOptions({ placeholder: 'Please connect your account first.' });
+ }
+ const organizations = await zohoDeskApi.listOrganizations({ auth });
+ return {
+ disabled: false,
+ options: organizations.map((org) => ({ label: org.companyName, value: org.id })),
+ };
+ },
+ });
}
-export const organizationId = (params: DropdownParams) =>
- Property.Dropdown({
- auth: zohoDeskAuth,
- displayName: params.displayName,
- description: params.description,
- refreshers: [],
- required: params.required,
- options: async ({ auth }) => {
- if (!auth) {
- return {
- placeholder: 'Please connect your account first.',
- options: [],
- disabled: true,
- };
- }
- const authValue = auth as PiecePropValueSchema<typeof zohoDeskAuth>;
-
- const response = await zohoDeskApiCall<{ data: { id: string; companyName: string }[] }>({
- auth: authValue,
- method: HttpMethod.GET,
- resourceUri: '/organizations',
- });
-
- return {
- disabled: false,
- options: response.data.map((org) => {
- return {
- label: org.companyName,
- value: org.id,
- };
- }),
- };
- },
- });
-
-export const departmentId = (params: DropdownParams) =>
- Property.Dropdown({
- auth: zohoDeskAuth,
- displayName: params.displayName,
- description: params.description,
- refreshers: ['orgId'],
- required: params.required,
- options: async ({ auth, orgId }) => {
- if (!auth) {
- return {
- placeholder: 'Please connect your account first.',
- options: [],
- disabled: true,
- };
- }
-
- if (!orgId) {
- return {
- placeholder: 'Please select organization first.',
- options: [],
- disabled: true,
- };
- }
+function departmentId<R extends boolean>({ required, displayName = 'Department', description }: PropParams<R>) {
+ return Property.Dropdown({
+ auth: zohoDeskAuth,
+ displayName,
+ description,
+ refreshers: ['orgId'],
+ required,
+ options: async ({ auth, orgId }) => {
+ if (!auth) {
+ return disabledOptions({ placeholder: 'Please connect your account first.' });
+ }
+ if (!orgId) {
+ return disabledOptions({ placeholder: 'Please select organization first.' });
+ }
+ const departments = await zohoDeskApi.listDepartments({ auth, orgId: String(orgId) });
+ return {
+ disabled: false,
+ options: departments.map((department) => ({ label: department.name, value: department.id })),
+ };
+ },
+ });
+}
- const authValue = auth as PiecePropValueSchema<typeof zohoDeskAuth>;
+function disabledOptions({ placeholder }: { placeholder: string }): DropdownState<never> {
+ return { disabled: true, options: [], placeholder };
+}
- const response = await zohoDeskApiCall<{ data: { id: string; name: string }[] }>({
- auth: authValue,
- method: HttpMethod.GET,
- resourceUri: `/departments`,
- orgId: orgId as string,
- });
+export const zohoDeskProps = { orgId, departmentId };
- return {
- disabled: false,
- options: response.data.map((department) => {
- return {
- label: department.name,
- value: department.id,
- };
- }),
- };
- },
- });
+export type PropParams<R extends boolean> = { required: R; displayName?: string; description?: string };
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/types.ts b/packages/pieces/community/zoho-desk/src/lib/common/types.ts
new file mode 100644
index 00000000000..6b4f621b0f0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/types.ts
@@ -0,0 +1,29 @@
+export type ZohoDeskAuthValue = { access_token: string; props?: { location?: string } };
+
+export type ZohoDeskPage<T> = { data: T[] };
+
+export type ZohoDeskOrganization = { id: string; companyName: string };
+
+export type ZohoDeskDepartment = { id: string; name: string };
+
+export type ZohoDeskContact = { id: string; email?: string; firstName?: string; lastName?: string };
+
+export type ZohoDeskTicket = {
+ id: string;
+ ticketNumber?: string;
+ subject?: string;
+ status?: string;
+};
+
+export type ZohoDeskRecord = Record<string, unknown>;
+
+export type ZohoDeskFile = { filename: string; data: Buffer };
+
+export type ZohoDeskDownload = { data: Buffer; fileName: string | undefined };
+export type ZohoDeskThread = {
+ id: string;
+ isContentTruncated?: boolean;
+ content?: string;
+ [key: string]: unknown;
+};
+
diff --git a/packages/pieces/community/zoho-desk/src/lib/common/utils.ts b/packages/pieces/community/zoho-desk/src/lib/common/utils.ts
new file mode 100644
index 00000000000..64fdb63b2d0
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/common/utils.ts
@@ -0,0 +1,21 @@
+function optionalStringList({ value, propName }: StringListParams): string[] | undefined {
+ if (value === undefined || value === null) {
+ return undefined;
+ }
+ if (!value.every((item): item is string => typeof item === 'string' && item !== '')) {
+ throw new Error(`${propName} must be a list of non-empty text values.`);
+ }
+ return value;
+}
+
+function requiredStringList({ value, propName }: StringListParams): string[] {
+ const list = optionalStringList({ value, propName });
+ if (list === undefined || list.length === 0) {
+ throw new Error(`${propName} must contain at least one value.`);
+ }
+ return list;
+}
+
+export const zohoDeskUtils = { optionalStringList, requiredStringList };
+
+type StringListParams = { value: unknown[] | undefined | null; propName: string };
diff --git a/packages/pieces/community/zoho-desk/src/lib/output-schemas.ts b/packages/pieces/community/zoho-desk/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..c4365e4873c
--- /dev/null
+++ b/packages/pieces/community/zoho-desk/src/lib/output-schemas.ts
@@ -0,0 +1,4082 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const attachmentFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'previewurl', label: 'Preview URL', format: 'url' },
+ { key: 'href', label: 'Download URL', format: 'url' },
+];
+
+const commenterFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'type', label: 'Type' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'roleName', label: 'Role Name' },
+];
+
+const commentFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'content', label: 'Content' },
+ { key: 'commenterId', label: 'Commenter ID' },
+ { key: 'commentedTime', label: 'Commented Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'commenter', label: 'Commenter', children: commenterFields },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ { key: 'encodedContent', label: 'Encoded Content' },
+];
+
+const mappingInfoFields: OutputSchema['fields'] = [
+ { key: 'mappingId', label: 'Mapping ID' },
+ { key: 'mappingType', label: 'Mapping Type' },
+ {
+ key: 'isAccountTicketsViewable',
+ label: 'Is Account Tickets Viewable',
+ format: 'boolean',
+ },
+];
+
+const customerHappinessFields: OutputSchema['fields'] = [
+ { key: 'badPercentage', label: 'Bad Percentage' },
+ { key: 'okPercentage', label: 'Ok Percentage' },
+ { key: 'goodPercentage', label: 'Good Percentage' },
+];
+
+const followerFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+];
+
+const lastThreadFields: OutputSchema['fields'] = [
+ { key: 'channel', label: 'Channel' },
+ { key: 'isDraft', label: 'Is Draft', format: 'boolean' },
+ { key: 'isForward', label: 'Is Forward', format: 'boolean' },
+ { key: 'direction', label: 'Direction' },
+];
+
+const sourceFields: OutputSchema['fields'] = [
+ { key: 'extId', label: 'Ext ID' },
+ { key: 'appName', label: 'App Name' },
+ { key: 'appPhotoURL', label: 'App Photo URL', format: 'image' },
+ { key: 'permalink', label: 'Permalink' },
+ { key: 'type', label: 'Type' },
+];
+
+const ticketFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'category', label: 'Category' },
+ { key: 'language', label: 'Language' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'responseDueDate', label: 'Response Due Date', format: 'datetime' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'sentiment', label: 'Sentiment' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'relationshipType', label: 'Relationship Type' },
+ { key: 'channelCode', label: 'Channel Code' },
+ { key: 'lastThread', label: 'Last Thread', children: lastThreadFields },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+];
+
+const parentFields: OutputSchema['fields'] = [
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'id', label: 'ID' },
+ { key: 'type', label: 'Type' },
+];
+
+const tagFields: OutputSchema['fields'] = [
+ { key: 'name', label: 'Name' },
+ { key: 'tagType', label: 'Tag Type' },
+ { key: 'id', label: 'ID' },
+];
+
+const agentFields: OutputSchema['fields'] = [
+ { key: 'zuid', label: 'Zuid' },
+ { key: 'emailId', label: 'Email ID', format: 'email' },
+ { key: 'isConfirmed', label: 'Is Confirmed', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'roleId', label: 'Role ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'aboutInfo', label: 'About Info' },
+ { key: 'extn', label: 'Extn' },
+ { key: 'countryCode', label: 'Country Code' },
+ { key: 'name', label: 'Name' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'rolePermissionType', label: 'Role Permission Type' },
+ { key: 'associatedDepartmentIds', label: 'Associated Department IDs' },
+ { key: 'timeZone', label: 'Time Zone' },
+ { key: 'id', label: 'ID' },
+ { key: 'profileId', label: 'Profile ID' },
+ { key: 'channelExpert', label: 'Channel Expert' },
+ { key: 'langCode', label: 'Lang Code' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ {
+ key: 'associatedChatDepartmentIds',
+ label: 'Associated Chat Department IDs',
+ },
+ { key: 'isZiaAgent', label: 'Is Zia Agent', format: 'boolean' },
+];
+
+const approvalFields: OutputSchema['fields'] = [
+ { key: 'approver', label: 'Approver', children: followerFields },
+ { key: 'requester', label: 'Requester', children: followerFields },
+ { key: 'requestedTime', label: 'Requested Time', format: 'datetime' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'description', label: 'Description' },
+ { key: 'id', label: 'ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'processedTime', label: 'Processed Time', format: 'datetime' },
+];
+
+const resultFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'errors', label: 'Errors' },
+];
+
+const modifiedByFields: OutputSchema['fields'] = [
+ { key: 'emailId', label: 'Email ID', format: 'email' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'id', label: 'ID' },
+];
+
+const commentWithAttachmentsFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'content', label: 'Content' },
+ { key: 'commenterId', label: 'Commenter ID' },
+ { key: 'commentedTime', label: 'Commented Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'commenter', label: 'Commenter', children: commenterFields },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ { key: 'encodedContent', label: 'Encoded Content' },
+ { key: 'attachments', label: 'Attachments' },
+];
+
+const contactFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'accountCount', label: 'Account Count' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'secondaryEmail', label: 'Secondary Email', format: 'email' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'type', label: 'Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'zohoCRMContact', label: 'Zoho CRM Contact' },
+ { key: 'isAnonymous', label: 'Is Anonymous', format: 'boolean' },
+ { key: 'isEndUser', label: 'Is End User', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+];
+
+const supportPlanFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'status', label: 'Status' },
+ { key: 'supportType', label: 'Support Type' },
+];
+
+const accountFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'website', label: 'Website' },
+];
+
+const ownerFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+];
+
+const authorFields: OutputSchema['fields'] = [
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ { key: 'type', label: 'Type' },
+ { key: 'email', label: 'Email', format: 'email' },
+];
+
+const actionFields: OutputSchema['fields'] = [
+ { key: 'method', label: 'Method' },
+ { key: 'rel', label: 'Rel' },
+ { key: 'href', label: 'Download URL', format: 'url' },
+];
+
+const teamFields: OutputSchema['fields'] = [
+ { key: 'rolesWithSubordinates', label: 'Roles With Subordinates' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'roles', label: 'Roles' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'derivedAgents', label: 'Derived Agents' },
+ { key: 'id', label: 'ID' },
+ { key: 'subTeams', label: 'Sub Teams' },
+ { key: 'logoUrl', label: 'Logo URL', format: 'image' },
+ { key: 'agents', label: 'Agents' },
+];
+
+const agentRefFields: OutputSchema['fields'] = [
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'zuid', label: 'Zuid' },
+];
+
+const availableLocaleTranslationFields: OutputSchema['fields'] = [
+ { key: 'translationId', label: 'Translation ID' },
+ { key: 'authorId', label: 'Author ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'latestVersionStatus', label: 'Latest Version Status' },
+ { key: 'latestPublishedVersion', label: 'Latest Published Version' },
+ { key: 'latestVersion', label: 'Latest Version' },
+ { key: 'href', label: 'Download URL', format: 'url' },
+ { key: 'translationState', label: 'Translation State' },
+ { key: 'locale', label: 'Locale' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isLocked', label: 'Is Locked', format: 'boolean' },
+];
+
+const categoryFields: OutputSchema['fields'] = [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ { key: 'locale', label: 'Locale' },
+];
+
+const historyFields: OutputSchema['fields'] = [
+ { key: 'author', label: 'Author', children: followerFields },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'content', label: 'Content' },
+];
+
+const roleFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'reportsTo', label: 'Reports To' },
+ { key: 'immediateSubRoles', label: 'Immediate Sub Roles' },
+ {
+ key: 'shareDataWithPeers',
+ label: 'Share Data With Peers',
+ format: 'boolean',
+ },
+ { key: 'isDefault', label: 'Is Default', format: 'boolean' },
+ { key: 'isVisible', label: 'Is Visible', format: 'boolean' },
+];
+
+const threadSourceFields: OutputSchema['fields'] = [
+ { key: 'appName', label: 'App Name' },
+ { key: 'extId', label: 'Ext ID' },
+ { key: 'permalink', label: 'Permalink' },
+ { key: 'type', label: 'Type' },
+ { key: 'uuid', label: 'Uuid' },
+ { key: 'appPhotoURL', label: 'App Photo URL', format: 'image' },
+];
+
+const accountSummaryFields: OutputSchema['fields'] = [
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'id', label: 'ID' },
+];
+
+const creatorFields: OutputSchema['fields'] = [
+ { key: 'name', label: 'Name' },
+ { key: 'photoUrl', label: 'Photo URL', format: 'image' },
+ { key: 'id', label: 'ID' },
+];
+
+const agentContactFields: OutputSchema['fields'] = [
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'emailId', label: 'Email ID', format: 'email' },
+ { key: 'id', label: 'ID' },
+ { key: 'zuid', label: 'Zuid' },
+];
+
+const contactSummaryFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'type', label: 'Type' },
+ { key: 'account', label: 'Account', children: accountSummaryFields },
+];
+
+const callFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+];
+
+const entityPinnedFields: OutputSchema['fields'] = [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'encodedContent', label: 'Encoded Content' },
+ { key: 'commentedTime', label: 'Commented Time', format: 'datetime' },
+ { key: 'isPublic', label: 'Is Public', format: 'boolean' },
+ { key: 'id', label: 'ID' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'content', label: 'Content' },
+ { key: 'commenterId', label: 'Commenter ID' },
+ { key: 'commenter', label: 'Commenter', children: commenterFields },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+];
+
+const pinFields: OutputSchema['fields'] = [
+ { key: 'pinnedTime', label: 'Pinned Time', format: 'datetime' },
+ { key: 'pinnedById', label: 'Pinned By ID' },
+ { key: 'entityPinned', label: 'Entity Pinned', children: entityPinnedFields },
+ { key: 'isPublic', label: 'Is Public', format: 'boolean' },
+ { key: 'id', label: 'ID' },
+ { key: 'type', label: 'Type' },
+];
+
+const ticketContactFields: OutputSchema['fields'] = [
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'id', label: 'ID' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'secId', label: 'Sec ID' },
+];
+
+const ticketListItemFields: OutputSchema['fields'] = [
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'team', label: 'Team' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'secId', label: 'Sec ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'contact', label: 'Contact', children: ticketContactFields },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'assignee', label: 'Assignee', children: agentContactFields },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+];
+
+const timerFields: OutputSchema['fields'] = [
+ { key: 'hours', label: 'Hours', format: 'number' },
+ { key: 'seconds', label: 'Seconds', format: 'number' },
+ { key: 'minutes', label: 'Minutes', format: 'number' },
+ { key: 'state', label: 'State' },
+];
+
+const ticketAttachmentFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'isPublic', label: 'Is Public', format: 'boolean' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'previewurl', label: 'Preview URL', format: 'url' },
+ { key: 'href', label: 'Download URL', format: 'url' },
+];
+
+const linkedParentFields: OutputSchema['fields'] = [
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'associatedTicketId', label: 'Associated Ticket ID' },
+ { key: 'id', label: 'ID' },
+ { key: 'type', label: 'Type' },
+];
+
+export const zohoDeskAddAccountFollowersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'followerIds', label: 'Follower IDs' },
+ ],
+};
+
+export const zohoDeskUploadAccountAttachmentOutputSchema: OutputSchema = {
+ fields: attachmentFields,
+};
+
+export const zohoDeskListAccountAttachmentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'attachments',
+ label: 'Attachments',
+ labelKey: 'name',
+ listItems: attachmentFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCreateAccountCommentOutputSchema: OutputSchema = {
+ fields: commentFields,
+};
+
+export const zohoDeskListAccountCommentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'comments',
+ label: 'Comments',
+ labelKey: 'id',
+ listItems: commentFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListAccountContactsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'contacts',
+ label: 'Contacts',
+ labelKey: 'email',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ {
+ key: 'mappingInfo',
+ label: 'Mapping Info',
+ children: mappingInfoFields,
+ },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'accountCount', label: 'Account Count' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'secondaryEmail', label: 'Secondary Email', format: 'email' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'type', label: 'Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'zohoCRMContact', label: 'Zoho CRM Contact' },
+ { key: 'isAnonymous', label: 'Is Anonymous', format: 'boolean' },
+ { key: 'isEndUser', label: 'Is End User', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListAccountContractsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'contracts', label: 'Contracts' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListAccountFollowersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'followers',
+ label: 'Followers',
+ labelKey: 'email',
+ listItems: followerFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListAccountHistoryOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'history',
+ label: 'History',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'eventTime', label: 'Event Time', format: 'datetime' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'status', label: 'Status' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'operation', label: 'Operation' },
+ { key: 'statusType', label: 'Status Type' },
+ {
+ key: 'author',
+ label: 'Author',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'type', label: 'Type' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ ],
+ },
+ { key: 'recipients', label: 'Recipients' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListAccountProductsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'products',
+ label: 'Products',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'productName', label: 'Product Name' },
+ { key: 'productCode', label: 'Product Code' },
+ { key: 'unitPrice', label: 'Unit Price', format: 'number' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSetAccountSlaOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'slaId', label: 'Sla ID' },
+ { key: 'associate', label: 'Associate', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskListAccountSlasOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'slas', label: 'Slas' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskGetAccountStatisticsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'firstResponseTime', label: 'First Response Time' },
+ { key: 'openTickets', label: 'Open Tickets' },
+ { key: 'responseTime', label: 'Response Time' },
+ { key: 'spamTickets', label: 'Spam Tickets' },
+ { key: 'totalTickets', label: 'Total Tickets' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: [
+ { key: 'badCount', label: 'Bad Count' },
+ { key: 'goodCount', label: 'Good Count' },
+ { key: 'okCount', label: 'Ok Count' },
+ ],
+ },
+ { key: 'closedTickets', label: 'Closed Tickets' },
+ { key: 'resolutionTime', label: 'Resolution Time' },
+ {
+ key: 'channelWiseCount',
+ label: 'Channel Wise Count',
+ children: [{ key: 'phone', label: 'Phone' }],
+ },
+ { key: 'escalatedTickets', label: 'Escalated Tickets' },
+ { key: 'onholdTickets', label: 'Onhold Tickets' },
+ { key: 'overdueTickets', label: 'Overdue Tickets' },
+ ],
+};
+
+export const zohoDeskListAccountTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'tickets',
+ label: 'Tickets',
+ labelKey: 'subject',
+ listItems: ticketFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskGetAccountTimeSummaryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'totalMins', label: 'Total Mins', format: 'number' },
+ { key: 'totalHours', label: 'Total Hours', format: 'number' },
+ { key: 'totalCosts', label: 'Total Costs', format: 'number' },
+ { key: 'totalSeconds', label: 'Total Seconds', format: 'number' },
+ ],
+};
+
+export const zohoDeskListAccountTimeEntriesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'timeEntries',
+ label: 'Time Entries',
+ labelKey: 'id',
+ listItems: [
+ { key: 'parent', label: 'Parent', children: parentFields },
+ { key: 'executedTime', label: 'Executed Time', format: 'datetime' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'departmentId', label: 'Department ID' },
+ {
+ key: 'agentCostPerHour',
+ label: 'Agent Cost Per Hour',
+ format: 'number',
+ },
+ { key: 'description', label: 'Description' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'mode', label: 'Mode' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'billingType', label: 'Billing Type' },
+ { key: 'requestId', label: 'Request ID' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'requestChargeType', label: 'Request Charge Type' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'secondsSpent', label: 'Seconds Spent', format: 'number' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'fixedCost', label: 'Fixed Cost', format: 'number' },
+ { key: 'minutesSpent', label: 'Minutes Spent', format: 'number' },
+ { key: 'hoursSpent', label: 'Hours Spent', format: 'number' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'isBillable', label: 'Is Billable', format: 'boolean' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'invoiceId', label: 'Invoice ID' },
+ { key: 'additionalCost', label: 'Additional Cost', format: 'number' },
+ { key: 'totalCost', label: 'Total Cost', format: 'number' },
+ { key: 'taskId', label: 'Task ID' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCreateAccountOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'industry', label: 'Industry' },
+ { key: 'street', label: 'Street' },
+ { key: 'city', label: 'City' },
+ { key: 'state', label: 'State' },
+ { key: 'country', label: 'Country' },
+ { key: 'code', label: 'Code' },
+ { key: 'description', label: 'Description' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'annualrevenue', label: 'Annualrevenue' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'associatedSLAIds', label: 'Associated SLAIds' },
+ { key: 'zohoCRMAccount', label: 'Zoho CRM Account' },
+ { key: 'isFollowing', label: 'Is Following', format: 'boolean' },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskAddTicketFollowersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'followerIds', label: 'Follower IDs' },
+ ],
+};
+
+export const zohoDeskAddTicketTagsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'data', label: 'Data', labelKey: 'name', listItems: tagFields },
+ ],
+};
+
+export const zohoDeskFindAgentByEmailOutputSchema: OutputSchema = {
+ fields: agentFields,
+};
+
+export const zohoDeskGetAgentTimeEntryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'parent', label: 'Parent', children: parentFields },
+ { key: 'executedTime', label: 'Executed Time', format: 'datetime' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'agentCostPerHour', label: 'Agent Cost Per Hour', format: 'number' },
+ { key: 'description', label: 'Description' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'mode', label: 'Mode' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'requestId', label: 'Request ID' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'requestChargeType', label: 'Request Charge Type' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'secondsSpent', label: 'Seconds Spent', format: 'number' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'fixedCost', label: 'Fixed Cost', format: 'number' },
+ { key: 'minutesSpent', label: 'Minutes Spent', format: 'number' },
+ { key: 'hoursSpent', label: 'Hours Spent', format: 'number' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'isBillable', label: 'Is Billable', format: 'boolean' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'invoiceId', label: 'Invoice ID' },
+ { key: 'additionalCost', label: 'Additional Cost', format: 'number' },
+ { key: 'totalCost', label: 'Total Cost', format: 'number' },
+ { key: 'taskId', label: 'Task ID' },
+ ],
+};
+
+export const zohoDeskCreateTicketApprovalOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'approvals',
+ label: 'Approvals',
+ labelKey: 'subject',
+ listItems: approvalFields,
+ },
+ ],
+};
+
+export const zohoDeskGetTicketApprovalOutputSchema: OutputSchema = {
+ fields: approvalFields,
+};
+
+export const zohoDeskUpdateTicketApprovalOutputSchema: OutputSchema = {
+ fields: approvalFields,
+};
+
+export const zohoDeskListTicketApprovalsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'approvals',
+ label: 'Approvals',
+ labelKey: 'subject',
+ listItems: approvalFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskAssociateAccountProductsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'id',
+ listItems: resultFields,
+ },
+ ],
+};
+
+export const zohoDeskAssociateProductAccountsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'accountIds', label: 'Account IDs' },
+ { key: 'associate', label: 'Associate', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskAssociateProductContactsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'contactIds', label: 'Contact IDs' },
+ { key: 'associate', label: 'Associate', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskListBadgesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'badges',
+ label: 'Badges',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'isCustom', label: 'Is Custom', format: 'boolean' },
+ { key: 'iconUrl', label: 'Icon URL', format: 'image' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskAddContactFollowersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'followerIds', label: 'Follower IDs' },
+ ],
+};
+
+export const zohoDeskListContactHelpCentersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'helpCenters',
+ label: 'Help Centers',
+ listItems: [
+ {
+ key: 'helpCenter',
+ label: 'Help Center',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ { key: 'userId', label: 'User ID' },
+ { key: 'userStatus', label: 'User Status' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskInviteContactToHelpCenterOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'helpCenterId', label: 'Help Center ID' },
+ ],
+};
+
+export const zohoDeskListContactProfilesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'profiles', label: 'Profiles' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCreateCallOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'duration', label: 'Duration', format: 'number' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'reminder', label: 'Reminder' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskCreateCallCommentOutputSchema: OutputSchema = {
+ fields: commentWithAttachmentsFields,
+};
+
+export const zohoDeskListCallCommentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'comments',
+ label: 'Comments',
+ labelKey: 'id',
+ listItems: commentWithAttachmentsFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCloseTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketIds', label: 'Ticket IDs' },
+ ],
+};
+
+export const zohoDeskCreateContactOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'facebook', label: 'Facebook' },
+ { key: 'twitter', label: 'Twitter' },
+ { key: 'accountCount', label: 'Account Count' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'secondaryEmail', label: 'Secondary Email', format: 'email' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'city', label: 'City' },
+ { key: 'country', label: 'Country' },
+ { key: 'state', label: 'State' },
+ { key: 'street', label: 'Street' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'description', label: 'Description' },
+ { key: 'title', label: 'Title' },
+ { key: 'type', label: 'Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'language', label: 'Language' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'zohoCRMContact', label: 'Zoho CRM Contact' },
+ { key: 'isFollowing', label: 'Is Following', format: 'boolean' },
+ { key: 'isAnonymous', label: 'Is Anonymous', format: 'boolean' },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'isEndUser', label: 'Is End User', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskListContactAccountsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'accounts',
+ label: 'Accounts',
+ labelKey: 'email',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ {
+ key: 'mappingInfo',
+ label: 'Mapping Info',
+ children: mappingInfoFields,
+ },
+ { key: 'mappingType', label: 'Mapping Type' },
+ { key: 'zohoCRMAccount', label: 'Zoho CRM Account' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListContactTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'tickets',
+ label: 'Tickets',
+ labelKey: 'subject',
+ listItems: ticketFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskGetContactsByIdsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'contacts',
+ label: 'Contacts',
+ labelKey: 'email',
+ listItems: contactFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCreateContractOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'supportPlan', label: 'Support Plan', children: supportPlanFields },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'contractName', label: 'Contract Name' },
+ { key: 'contractNumber', label: 'Contract Number' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'notifyOn', label: 'Notify On', format: 'date' },
+ {
+ key: 'sla',
+ label: 'Sla',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ { key: 'account', label: 'Account', children: accountFields },
+ {
+ key: 'product',
+ label: 'Product',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'productName', label: 'Product Name' },
+ ],
+ },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'modifiedBy', label: 'Modified By' },
+ { key: 'startDate', label: 'Start Date', format: 'date' },
+ { key: 'endDate', label: 'End Date', format: 'date' },
+ { key: 'contractStatus', label: 'Contract Status' },
+ { key: 'owner', label: 'Owner', children: ownerFields },
+ { key: 'notificationAgentIds', label: 'Notification Agent IDs' },
+ { key: 'notifyBefore', label: 'Notify Before' },
+ { key: 'associatedSLAId', label: 'Associated SLAId' },
+ ],
+};
+
+export const zohoDeskDownloadContractCommentAttachmentOutputSchema: OutputSchema =
+ {
+ fields: [
+ { key: 'fileName', label: 'File Name' },
+ { key: 'file', label: 'File', format: 'url' },
+ ],
+ };
+
+export const zohoDeskUpdateContractCommentOutputSchema: OutputSchema = {
+ fields: commentWithAttachmentsFields,
+};
+
+export const zohoDeskListTicketConversationsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'conversations',
+ label: 'Conversations',
+ labelKey: 'id',
+ listItems: [
+ { key: 'sentiment', label: 'Sentiment' },
+ {
+ key: 'isDescriptionThread',
+ label: 'Is Description Thread',
+ format: 'boolean',
+ },
+ { key: 'canReply', label: 'Can Reply', format: 'boolean' },
+ { key: 'bcc', label: 'Bcc', format: 'email' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'aspects', label: 'Aspects' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ { key: 'type', label: 'Type' },
+ {
+ key: 'lastRatingIconURL',
+ label: 'Last Rating Icon URL',
+ format: 'image',
+ },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'cc', label: 'Cc', format: 'email' },
+ { key: 'keyWords', label: 'Key Words' },
+ { key: 'visibility', label: 'Visibility' },
+ { key: 'author', label: 'Author', children: authorFields },
+ { key: 'isForward', label: 'Is Forward', format: 'boolean' },
+ { key: 'hasAttach', label: 'Has Attach', format: 'boolean' },
+ { key: 'responderId', label: 'Responder ID' },
+ { key: 'respondedIn', label: 'Responded In' },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'readReceipts', label: 'Read Receipts' },
+ { key: 'to', label: 'To', format: 'email' },
+ {
+ key: 'fromEmailAddress',
+ label: 'From Email Address',
+ format: 'email',
+ },
+ { key: 'actions', label: 'Actions', listItems: actionFields },
+ { key: 'status', label: 'Status' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'encodedContent', label: 'Encoded Content' },
+ { key: 'commentedTime', label: 'Commented Time', format: 'datetime' },
+ { key: 'isPublic', label: 'Is Public', format: 'boolean' },
+ { key: 'content', label: 'Content' },
+ { key: 'commenterId', label: 'Commenter ID' },
+ { key: 'commenter', label: 'Commenter', children: commenterFields },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCountAccountsOutputSchema: OutputSchema = {
+ fields: [{ key: 'count', label: 'Count' }],
+};
+
+export const zohoDeskCountAgentsOutputSchema: OutputSchema = {
+ fields: [{ key: 'count', label: 'Count', format: 'number' }],
+};
+
+export const zohoDeskCountAgentsByTypeOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'lightAgents', label: 'Light Agents', format: 'number' },
+ {
+ key: 'deactivatedZiaAgents',
+ label: 'Deactivated Zia Agents',
+ format: 'number',
+ },
+ { key: 'importedAgents', label: 'Imported Agents', format: 'number' },
+ { key: 'deactivatedAgents', label: 'Deactivated Agents', format: 'number' },
+ { key: 'closedAgents', label: 'Closed Agents', format: 'number' },
+ { key: 'allAgents', label: 'All Agents', format: 'number' },
+ { key: 'activeAgents', label: 'Active Agents', format: 'number' },
+ { key: 'allZiaAgents', label: 'All Zia Agents', format: 'number' },
+ { key: 'unconfirmedAgents', label: 'Unconfirmed Agents', format: 'number' },
+ { key: 'activeZiaAgents', label: 'Active Zia Agents', format: 'number' },
+ { key: 'deletedAgents', label: 'Deleted Agents', format: 'number' },
+ ],
+};
+
+export const zohoDeskDeleteAccountAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'attachmentId', label: 'Attachment ID' },
+ ],
+};
+
+export const zohoDeskDeleteAccountCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'commentId', label: 'Comment ID' },
+ ],
+};
+
+export const zohoDeskDeleteAccountsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'accountIds', label: 'Account IDs' },
+ ],
+};
+
+export const zohoDeskDeleteContactAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'attachmentId', label: 'Attachment ID' },
+ ],
+};
+
+export const zohoDeskDeleteContactCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'commentId', label: 'Comment ID' },
+ ],
+};
+
+export const zohoDeskDeleteCallAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'attachmentId', label: 'Attachment ID' },
+ ],
+};
+
+export const zohoDeskDeleteCallCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'commentId', label: 'Comment ID' },
+ ],
+};
+
+export const zohoDeskDeleteCallsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'callIds', label: 'Call IDs' },
+ ],
+};
+
+export const zohoDeskDeleteContactsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'contactIds', label: 'Contact IDs' },
+ ],
+};
+
+export const zohoDeskDeleteContractCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'contractId', label: 'Contract ID' },
+ { key: 'commentId', label: 'Comment ID' },
+ ],
+};
+
+export const zohoDeskDeleteEventAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'eventId', label: 'Event ID' },
+ { key: 'attachmentId', label: 'Attachment ID' },
+ ],
+};
+
+export const zohoDeskDeleteEventsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'eventIds', label: 'Event IDs' },
+ ],
+};
+
+export const zohoDeskDeleteProductAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'attachmentId', label: 'Attachment ID' },
+ ],
+};
+
+export const zohoDeskDeleteProductsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'productIds', label: 'Product IDs' },
+ ],
+};
+
+export const zohoDeskDeleteTicketAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'attachmentId', label: 'Attachment ID' },
+ ],
+};
+
+export const zohoDeskDeleteTicketCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'commentId', label: 'Comment ID' },
+ ],
+};
+
+export const zohoDeskDeleteTicketTimeEntryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'timeEntryId', label: 'Time Entry ID' },
+ ],
+};
+
+export const zohoDeskDeleteTaskAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'taskId', label: 'Task ID' },
+ { key: 'attachmentId', label: 'Attachment ID' },
+ ],
+};
+
+export const zohoDeskDeleteTasksOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'taskIds', label: 'Task IDs' },
+ ],
+};
+
+export const zohoDeskDeleteTicketResolutionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ ],
+};
+
+export const zohoDeskListDepartmentAgentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'agents',
+ label: 'Agents',
+ labelKey: 'name',
+ listItems: [
+ { key: 'zuid', label: 'Zuid' },
+ { key: 'emailId', label: 'Email ID', format: 'email' },
+ { key: 'isConfirmed', label: 'Is Confirmed', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'roleId', label: 'Role ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'aboutInfo', label: 'About Info' },
+ { key: 'extn', label: 'Extn' },
+ { key: 'countryCode', label: 'Country Code' },
+ { key: 'name', label: 'Name' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'rolePermissionType', label: 'Role Permission Type' },
+ { key: 'associatedDepartmentIds', label: 'Associated Department IDs' },
+ { key: 'timeZone', label: 'Time Zone' },
+ { key: 'id', label: 'ID' },
+ { key: 'profileId', label: 'Profile ID' },
+ { key: 'channelExpert', label: 'Channel Expert' },
+ { key: 'langCode', label: 'Lang Code' },
+ {
+ key: 'associatedChatDepartmentIds',
+ label: 'Associated Chat Department IDs',
+ },
+ { key: 'isZiaAgent', label: 'Is Zia Agent', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListDepartmentTeamsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'teams', label: 'Teams', labelKey: 'name', listItems: teamFields },
+ ],
+};
+
+export const zohoDeskCreateDraftReplyOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'content', label: 'Content' },
+ { key: 'id', label: 'ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'canReply', label: 'Can Reply', format: 'boolean' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'hasAttach', label: 'Has Attach', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'replyTo', label: 'Reply To' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'author', label: 'Author', children: authorFields },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'readReceipts', label: 'Read Receipts' },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ {
+ key: 'isDescriptionThread',
+ label: 'Is Description Thread',
+ format: 'boolean',
+ },
+ {
+ key: 'isContentTruncated',
+ label: 'Is Content Truncated',
+ format: 'boolean',
+ },
+ { key: 'fullContentURL', label: 'Full Content URL', format: 'url' },
+ { key: 'visibility', label: 'Visibility' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'actions', label: 'Actions', listItems: actionFields },
+ { key: 'direction', label: 'Direction' },
+ { key: 'cc', label: 'Cc', format: 'email' },
+ { key: 'responderId', label: 'Responder ID' },
+ { key: 'bcc', label: 'Bcc', format: 'email' },
+ { key: 'to', label: 'To', format: 'email' },
+ { key: 'fromEmailAddress', label: 'From Email Address', format: 'email' },
+ { key: 'isForward', label: 'Is Forward', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskCreateEventOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ { key: 'duration', label: 'Duration', format: 'number' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'category', label: 'Category' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'reminder', label: 'Reminder' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskListFieldsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'fields',
+ label: 'Fields',
+ labelKey: 'name',
+ listItems: [
+ { key: 'displayLabel', label: 'Display Label' },
+ { key: 'apiName', label: 'API Name' },
+ { key: 'isCustomField', label: 'Is Custom Field', format: 'boolean' },
+ {
+ key: 'showToHelpCenter',
+ label: 'Show To Help Center',
+ format: 'boolean',
+ },
+ { key: 'name', label: 'Name' },
+ { key: 'i18NLabel', label: 'I18 NLabel' },
+ {
+ key: 'isEncryptedField',
+ label: 'Is Encrypted Field',
+ format: 'boolean',
+ },
+ { key: 'id', label: 'ID' },
+ { key: 'type', label: 'Type' },
+ { key: 'maxLength', label: 'Max Length', format: 'number' },
+ { key: 'isMandatory', label: 'Is Mandatory', format: 'boolean' },
+ {
+ key: 'allowedValues',
+ label: 'Allowed Values',
+ listItems: [
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'subType', label: 'Sub Type' },
+ {
+ key: 'lookup',
+ label: 'Lookup',
+ children: [
+ { key: 'onDelete', label: 'On Delete' },
+ { key: 'relatedListLabel', label: 'Related List Label' },
+ {
+ key: 'module',
+ label: 'Module',
+ children: [
+ { key: 'apiName', label: 'API Name' },
+ { key: 'nameField', label: 'Name Field' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskGetAccountOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'industry', label: 'Industry' },
+ { key: 'street', label: 'Street' },
+ { key: 'city', label: 'City' },
+ { key: 'state', label: 'State' },
+ { key: 'country', label: 'Country' },
+ { key: 'code', label: 'Code' },
+ { key: 'description', label: 'Description' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'annualrevenue', label: 'Annualrevenue' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'isFollowing', label: 'Is Following', format: 'boolean' },
+ { key: 'associatedSLAIds', label: 'Associated SLAIds' },
+ { key: 'zohoCRMAccount', label: 'Zoho CRM Account' },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskGetArticleOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'likeCount', label: 'Like Count' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'templateUsedUsersCount', label: 'Template Used Users Count' },
+ {
+ key: 'templateLastUpdatedTime',
+ label: 'Template Last Updated Time',
+ format: 'datetime',
+ },
+ { key: 'latestVersion', label: 'Latest Version' },
+ { key: 'modifierId', label: 'Modifier ID' },
+ { key: 'isFollowing', label: 'Is Following', format: 'boolean' },
+ {
+ key: 'isArticleSummaryPresent',
+ label: 'Is Article Summary Present',
+ format: 'boolean',
+ },
+ { key: 'latestVersionModifierId', label: 'Latest Version Modifier ID' },
+ { key: 'portalUrl', label: 'Portal URL', format: 'url' },
+ { key: 'translationSource', label: 'Translation Source' },
+ {
+ key: 'seo',
+ label: 'Seo',
+ children: [
+ { key: 'keywords', label: 'Keywords' },
+ { key: 'isEnabled', label: 'Is Enabled', format: 'boolean' },
+ { key: 'description', label: 'Description' },
+ { key: 'title', label: 'Title' },
+ ],
+ },
+ { key: 'latestPublishedVersion', label: 'Latest Published Version' },
+ { key: 'owner', label: 'Owner', children: agentRefFields },
+ { key: 'templateUsageCount', label: 'Template Usage Count' },
+ { key: 'myVote', label: 'My Vote' },
+ {
+ key: 'availableLocaleTranslations',
+ label: 'Available Locale Translations',
+ listItems: availableLocaleTranslationFields,
+ },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'authorId', label: 'Author ID' },
+ { key: 'feedbackCount', label: 'Feedback Count' },
+ { key: 'translationState', label: 'Translation State' },
+ { key: 'viewCount', label: 'View Count' },
+ { key: 'usageCount', label: 'Usage Count' },
+ { key: 'dislikeCount', label: 'Dislike Count' },
+ { key: 'title', label: 'Title' },
+ { key: 'permission', label: 'Permission' },
+ { key: 'locale', label: 'Locale' },
+ { key: 'category', label: 'Category', children: categoryFields },
+ { key: 'tags', label: 'Tags' },
+ {
+ key: 'metrics',
+ label: 'Metrics',
+ children: [
+ { key: 'templateUsageCount', label: 'Template Usage Count' },
+ { key: 'feedbackCount', label: 'Feedback Count' },
+ { key: 'unlikeCount', label: 'Unlike Count' },
+ { key: 'dislikeCount', label: 'Dislike Count' },
+ { key: 'lastUsageTime', label: 'Last Usage Time', format: 'datetime' },
+ { key: 'likeCount', label: 'Like Count' },
+ { key: 'viewCount', label: 'View Count' },
+ {
+ key: 'lastActivityTime',
+ label: 'Last Activity Time',
+ format: 'datetime',
+ },
+ { key: 'usageCount', label: 'Usage Count' },
+ ],
+ },
+ { key: 'position', label: 'Position' },
+ { key: 'id', label: 'ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'answer', label: 'Answer' },
+ { key: 'categoryId', label: 'Category ID' },
+ { key: 'author', label: 'Author', children: agentRefFields },
+ { key: 'isTemplate', label: 'Is Template', format: 'boolean' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'expiryDate', label: 'Expiry Date', format: 'datetime' },
+ { key: 'createdBy', label: 'Created By', children: agentRefFields },
+ { key: 'modifiedBy', label: 'Modified By', children: agentRefFields },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'currentVersion', label: 'Current Version' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'permalink', label: 'Permalink' },
+ { key: 'rootCategoryId', label: 'Root Category ID' },
+ { key: 'translationId', label: 'Translation ID' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'latestVersionStatus', label: 'Latest Version Status' },
+ {
+ key: 'latestVersionModifiedBy',
+ label: 'Latest Version Modified By',
+ children: agentRefFields,
+ },
+ { key: 'reviewedBy', label: 'Reviewed By' },
+ { key: 'reviewedTime', label: 'Reviewed Time', format: 'datetime' },
+ { key: 'sourceLocale', label: 'Source Locale' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'articleNumber', label: 'Article Number' },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'isLocked', label: 'Is Locked', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskGetDepartmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'nameInCustomerPortal', label: 'Name In Customer Portal' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'chatStatus', label: 'Chat Status' },
+ { key: 'associatedAgentIds', label: 'Associated Agent IDs' },
+ { key: 'isEnabled', label: 'Is Enabled', format: 'boolean' },
+ { key: 'isDefault', label: 'Is Default', format: 'boolean' },
+ {
+ key: 'isAssignToTeamEnabled',
+ label: 'Is Assign To Team Enabled',
+ format: 'boolean',
+ },
+ {
+ key: 'isVisibleInCustomerPortal',
+ label: 'Is Visible In Customer Portal',
+ format: 'boolean',
+ },
+ { key: 'hasLogo', label: 'Has Logo', format: 'boolean' },
+ { key: 'sanitizedName', label: 'Sanitized Name' },
+ ],
+};
+
+export const zohoDeskGetOrganizationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'country', label: 'Country' },
+ { key: 'migrationFrom', label: 'Migration From' },
+ { key: 'city', label: 'City' },
+ {
+ key: 'preferredCommunicationChannels',
+ label: 'Preferred Communication Channels',
+ },
+ { key: 'companyName', label: 'Company Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'edition', label: 'Edition' },
+ { key: 'industry', label: 'Industry' },
+ { key: 'preferredSolution', label: 'Preferred Solution' },
+ { key: 'employeeCount', label: 'Employee Count', format: 'number' },
+ { key: 'isAdminInOrg', label: 'Is Admin In Org', format: 'boolean' },
+ { key: 'faviconURL', label: 'Favicon URL', format: 'url' },
+ { key: 'portalName', label: 'Portal Name' },
+ { key: 'street', label: 'Street' },
+ { key: 'currencyLocale', label: 'Currency Locale' },
+ { key: 'alias', label: 'Alias' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'state', label: 'State' },
+ {
+ key: 'isPayloadEncryptionEnabled',
+ label: 'Is Payload Encryption Enabled',
+ format: 'boolean',
+ },
+ { key: 'fax', label: 'Fax' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'website', label: 'Website' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'timeZone', label: 'Time Zone' },
+ { key: 'currencySymbol', label: 'Currency Symbol' },
+ { key: 'logoURL', label: 'Logo URL', format: 'image' },
+ { key: 'customDomain', label: 'Custom Domain' },
+ { key: 'employeeCountRange', label: 'Employee Count Range' },
+ { key: 'isDefault', label: 'Is Default', format: 'boolean' },
+ { key: 'phoneNumber', label: 'Phone Number' },
+ { key: 'portalURL', label: 'Portal URL', format: 'url' },
+ { key: 'primaryContact', label: 'Primary Contact', format: 'email' },
+ { key: 'designation', label: 'Designation' },
+ { key: 'currencyCode', label: 'Currency Code' },
+ { key: 'isSandboxPortal', label: 'Is Sandbox Portal', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskGetProductOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'departmentIds', label: 'Department IDs' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'productName', label: 'Product Name' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'productCode', label: 'Product Code' },
+ { key: 'manufacturer', label: 'Manufacturer' },
+ { key: 'productCategory', label: 'Product Category' },
+ { key: 'unitPrice', label: 'Unit Price', format: 'number' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'modifiedBy', label: 'Modified By' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskGetTicketResolutionOutputSchema: OutputSchema = {
+ fields: historyFields,
+};
+
+export const zohoDeskGetRoleOutputSchema: OutputSchema = { fields: roleFields };
+
+export const zohoDeskGetTaskOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'category', label: 'Category' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'reminder', label: 'Reminder' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskGetTeamOutputSchema: OutputSchema = { fields: teamFields };
+
+export const zohoDeskGetTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'language', label: 'Language' },
+ { key: 'source', label: 'Source', children: threadSourceFields },
+ { key: 'resolution', label: 'Resolution' },
+ { key: 'sharedDepartments', label: 'Shared Departments' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'approvalCount', label: 'Approval Count' },
+ { key: 'isOverDue', label: 'Is Over Due', format: 'boolean' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ {
+ key: 'contact',
+ label: 'Contact',
+ children: [
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'id', label: 'ID' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'type', label: 'Type' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'account', label: 'Account', children: accountSummaryFields },
+ ],
+ },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ {
+ key: 'isResponseOverdue',
+ label: 'Is Response Overdue',
+ format: 'boolean',
+ },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'secondaryContacts', label: 'Secondary Contacts' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'classification', label: 'Classification' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'taskCount', label: 'Task Count' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'assignee', label: 'Assignee', children: followerFields },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'entitySkills', label: 'Entity Skills' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'sentiment', label: 'Sentiment' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'skillsInfo', label: 'Skills Info' },
+ { key: 'isRead', label: 'Is Read', format: 'boolean' },
+ { key: 'description', label: 'Description' },
+ { key: 'timeEntryCount', label: 'Time Entry Count' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'responseDueDate', label: 'Response Due Date', format: 'datetime' },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'modifiedBy', label: 'Modified By' },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ { key: 'followerCount', label: 'Follower Count' },
+ { key: 'email', label: 'Email', format: 'email' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'channelCode', label: 'Channel Code' },
+ {
+ key: 'product',
+ label: 'Product',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'productName', label: 'Product Name' },
+ ],
+ },
+ { key: 'isFollowing', label: 'Is Following', format: 'boolean' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'slaId', label: 'Sla ID' },
+ { key: 'team', label: 'Team' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'contractId', label: 'Contract ID' },
+ { key: 'tagCount', label: 'Tag Count' },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'isEscalated', label: 'Is Escalated', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ ],
+};
+
+export const zohoDeskListHelpCenterGroupsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'groups',
+ label: 'Groups',
+ labelKey: 'name',
+ listItems: [
+ { key: 'creator', label: 'Creator', children: creatorFields },
+ { key: 'modifier', label: 'Modifier', children: creatorFields },
+ { key: 'logoUrl', label: 'Logo URL', format: 'image' },
+ { key: 'helpCenterId', label: 'Help Center ID' },
+ { key: 'isAssociated', label: 'Is Associated', format: 'boolean' },
+ { key: 'count', label: 'Count' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'status', label: 'Status' },
+ { key: 'id', label: 'ID' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListHelpCentersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'helpCenters',
+ label: 'Help Centers',
+ labelKey: 'name',
+ listItems: [
+ {
+ key: 'isMultilingualEnabled',
+ label: 'Is Multilingual Enabled',
+ format: 'boolean',
+ },
+ { key: 'id', label: 'ID' },
+ { key: 'logoUrl', label: 'Logo URL', format: 'image' },
+ { key: 'departmentIds', label: 'Department IDs' },
+ { key: 'name', label: 'Name' },
+ {
+ key: 'isEncodedPermalinkAllowed',
+ label: 'Is Encoded Permalink Allowed',
+ format: 'boolean',
+ },
+ { key: 'url', label: 'URL', format: 'url' },
+ {
+ key: 'helpCenterLocales',
+ label: 'Help Center Locales',
+ labelKey: 'name',
+ listItems: [
+ { key: 'locale', label: 'Locale' },
+ { key: 'status', label: 'Status' },
+ { key: 'type', label: 'Type' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ { key: 'locales', label: 'Locales' },
+ { key: 'primaryLocale', label: 'Primary Locale' },
+ { key: 'status', label: 'Status' },
+ { key: 'isDefault', label: 'Is Default', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const createTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'language', label: 'Language' },
+ { key: 'source', label: 'Source', children: threadSourceFields },
+ { key: 'resolution', label: 'Resolution' },
+ { key: 'sharedDepartments', label: 'Shared Departments' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'approvalCount', label: 'Approval Count' },
+ { key: 'isOverDue', label: 'Is Over Due', format: 'boolean' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ {
+ key: 'isResponseOverdue',
+ label: 'Is Response Overdue',
+ format: 'boolean',
+ },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'secondaryContacts', label: 'Secondary Contacts' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'classification', label: 'Classification' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'taskCount', label: 'Task Count' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'entitySkills', label: 'Entity Skills' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'description', label: 'Description' },
+ { key: 'timeEntryCount', label: 'Time Entry Count' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'responseDueDate', label: 'Response Due Date', format: 'datetime' },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'modifiedBy', label: 'Modified By' },
+ { key: 'email', label: 'Email', format: 'email' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'channelCode', label: 'Channel Code' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'slaId', label: 'Sla ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'isEscalated', label: 'Is Escalated', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ ],
+};
+
+export const findContactOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'found', label: 'Found', format: 'boolean' },
+ {
+ key: 'result',
+ label: 'Result',
+ labelKey: 'title',
+ listItems: [
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'country', label: 'Country' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'secondaryEmail', label: 'Secondary Email', format: 'email' },
+ { key: 'city', label: 'City' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'description', label: 'Description' },
+ { key: 'language', label: 'Language' },
+ { key: 'title', label: 'Title' },
+ { key: 'type', label: 'Type' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'twitter', label: 'Twitter' },
+ { key: 'street', label: 'Street' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'isEndUser', label: 'Is End User', format: 'boolean' },
+ { key: 'zohoCRMContact', label: 'Zoho CRM Contact' },
+ { key: 'id', label: 'ID' },
+ { key: 'state', label: 'State' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'owner', label: 'Owner', children: agentContactFields },
+ { key: 'accountCount', label: 'Account Count' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'facebook', label: 'Facebook' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'isAnonymous', label: 'Is Anonymous', format: 'boolean' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'account', label: 'Account', children: accountSummaryFields },
+ ],
+ },
+ ],
+};
+
+export const listTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'data',
+ label: 'Data',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'category', label: 'Category' },
+ { key: 'language', label: 'Language' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ {
+ key: 'responseDueDate',
+ label: 'Response Due Date',
+ format: 'datetime',
+ },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'sentiment', label: 'Sentiment' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'relationshipType', label: 'Relationship Type' },
+ { key: 'contact', label: 'Contact', children: contactSummaryFields },
+ { key: 'assignee', label: 'Assignee', children: followerFields },
+ { key: 'channelCode', label: 'Channel Code' },
+ { key: 'lastThread', label: 'Last Thread', children: lastThreadFields },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+ },
+ ],
+};
+
+export const zohoDeskListLabelsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'labels',
+ label: 'Labels',
+ labelKey: 'name',
+ listItems: [
+ { key: 'creator', label: 'Creator', children: creatorFields },
+ { key: 'modifier', label: 'Modifier', children: creatorFields },
+ {
+ key: 'preferences',
+ label: 'Preferences',
+ children: [
+ { key: 'textColor', label: 'Text Color' },
+ { key: 'bgColor', label: 'Bg Color' },
+ { key: 'shape', label: 'Shape' },
+ ],
+ },
+ { key: 'id', label: 'ID' },
+ { key: 'helpCenterId', label: 'Help Center ID' },
+ { key: 'count', label: 'Count' },
+ { key: 'name', label: 'Name' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'logoUrl', label: 'Logo URL', format: 'image' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskLinkArticlesToTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'articleIds', label: 'Article IDs' },
+ ],
+};
+
+export const zohoDeskListAccountsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'accounts',
+ label: 'Accounts',
+ labelKey: 'email',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'zohoCRMAccount', label: 'Zoho CRM Account' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListAgentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'agents',
+ label: 'Agents',
+ labelKey: 'name',
+ listItems: agentFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListArticlesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'articles',
+ label: 'Articles',
+ labelKey: 'title',
+ listItems: [
+ { key: 'likeCount', label: 'Like Count' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'templateUsedUsersCount', label: 'Template Used Users Count' },
+ {
+ key: 'templateLastUpdatedTime',
+ label: 'Template Last Updated Time',
+ format: 'datetime',
+ },
+ { key: 'permission', label: 'Permission' },
+ { key: 'latestVersion', label: 'Latest Version' },
+ { key: 'title', label: 'Title' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'authorId', label: 'Author ID' },
+ { key: 'modifierId', label: 'Modifier ID' },
+ { key: 'feedbackCount', label: 'Feedback Count' },
+ { key: 'translationState', label: 'Translation State' },
+ { key: 'viewCount', label: 'View Count' },
+ { key: 'usageCount', label: 'Usage Count' },
+ { key: 'dislikeCount', label: 'Dislike Count' },
+ { key: 'portalUrl', label: 'Portal URL', format: 'url' },
+ { key: 'latestVersionModifierId', label: 'Latest Version Modifier ID' },
+ { key: 'translationSource', label: 'Translation Source' },
+ { key: 'latestPublishedVersion', label: 'Latest Published Version' },
+ { key: 'owner', label: 'Owner', children: agentRefFields },
+ { key: 'templateUsageCount', label: 'Template Usage Count' },
+ {
+ key: 'availableLocaleTranslations',
+ label: 'Available Locale Translations',
+ listItems: availableLocaleTranslationFields,
+ },
+ { key: 'locale', label: 'Locale' },
+ { key: 'category', label: 'Category', children: categoryFields },
+ { key: 'position', label: 'Position' },
+ { key: 'id', label: 'ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'categoryId', label: 'Category ID' },
+ { key: 'author', label: 'Author', children: agentRefFields },
+ { key: 'isTemplate', label: 'Is Template', format: 'boolean' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'createdBy', label: 'Created By', children: agentRefFields },
+ { key: 'modifiedBy', label: 'Modified By', children: agentRefFields },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'expiryDate', label: 'Expiry Date', format: 'datetime' },
+ { key: 'permalink', label: 'Permalink' },
+ { key: 'rootCategoryId', label: 'Root Category ID' },
+ { key: 'translationId', label: 'Translation ID' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'latestVersionStatus', label: 'Latest Version Status' },
+ {
+ key: 'latestVersionModifiedBy',
+ label: 'Latest Version Modified By',
+ children: agentRefFields,
+ },
+ { key: 'sourceLocale', label: 'Source Locale' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'articleNumber', label: 'Article Number' },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'isLocked', label: 'Is Locked', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListCallsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'calls',
+ label: 'Calls',
+ labelKey: 'subject',
+ listItems: callFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListContractsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'contracts',
+ label: 'Contracts',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ {
+ key: 'supportPlan',
+ label: 'Support Plan',
+ children: supportPlanFields,
+ },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'associatedSupportPlanId', label: 'Associated Support Plan ID' },
+ { key: 'contractName', label: 'Contract Name' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'startDate', label: 'Start Date', format: 'date' },
+ { key: 'endDate', label: 'End Date', format: 'date' },
+ { key: 'contractStatus', label: 'Contract Status' },
+ { key: 'associatedSLAId', label: 'Associated SLAId' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListDepartmentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'departments',
+ label: 'Departments',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'nameInCustomerPortal', label: 'Name In Customer Portal' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'chatStatus', label: 'Chat Status' },
+ { key: 'isEnabled', label: 'Is Enabled', format: 'boolean' },
+ { key: 'isDefault', label: 'Is Default', format: 'boolean' },
+ {
+ key: 'isVisibleInCustomerPortal',
+ label: 'Is Visible In Customer Portal',
+ format: 'boolean',
+ },
+ { key: 'hasLogo', label: 'Has Logo', format: 'boolean' },
+ { key: 'sanitizedName', label: 'Sanitized Name' },
+ {
+ key: 'isAssignToTeamEnabled',
+ label: 'Is Assign To Team Enabled',
+ format: 'boolean',
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListEventsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'category', label: 'Category' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketFollowersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'followers',
+ label: 'Followers',
+ labelKey: 'email',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'following', label: 'Following' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListOrganizationsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'organizations',
+ label: 'Organizations',
+ labelKey: 'id',
+ listItems: [
+ { key: 'country', label: 'Country' },
+ { key: 'migrationFrom', label: 'Migration From' },
+ { key: 'city', label: 'City' },
+ {
+ key: 'preferredCommunicationChannels',
+ label: 'Preferred Communication Channels',
+ },
+ { key: 'companyName', label: 'Company Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'edition', label: 'Edition' },
+ { key: 'industry', label: 'Industry' },
+ { key: 'preferredSolution', label: 'Preferred Solution' },
+ { key: 'employeeCount', label: 'Employee Count', format: 'number' },
+ { key: 'isAdminInOrg', label: 'Is Admin In Org', format: 'boolean' },
+ { key: 'faviconURL', label: 'Favicon URL', format: 'url' },
+ { key: 'portalName', label: 'Portal Name' },
+ { key: 'street', label: 'Street' },
+ { key: 'currencyLocale', label: 'Currency Locale' },
+ { key: 'alias', label: 'Alias' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'state', label: 'State' },
+ {
+ key: 'isPayloadEncryptionEnabled',
+ label: 'Is Payload Encryption Enabled',
+ format: 'boolean',
+ },
+ { key: 'fax', label: 'Fax' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'website', label: 'Website' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'timeZone', label: 'Time Zone' },
+ { key: 'currencySymbol', label: 'Currency Symbol' },
+ { key: 'logoURL', label: 'Logo URL', format: 'image' },
+ { key: 'employeeCountRange', label: 'Employee Count Range' },
+ { key: 'isDefault', label: 'Is Default', format: 'boolean' },
+ { key: 'phoneNumber', label: 'Phone Number' },
+ { key: 'portalURL', label: 'Portal URL', format: 'url' },
+ { key: 'primaryContact', label: 'Primary Contact', format: 'email' },
+ { key: 'designation', label: 'Designation' },
+ { key: 'currencyCode', label: 'Currency Code' },
+ {
+ key: 'isSandboxPortal',
+ label: 'Is Sandbox Portal',
+ format: 'boolean',
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketTagsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tags', label: 'Tags', labelKey: 'name', listItems: tagFields },
+ ],
+};
+
+export const zohoDeskListTasksOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'tasks',
+ label: 'Tasks',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'category', label: 'Category' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'tickets',
+ label: 'Tickets',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'category', label: 'Category' },
+ { key: 'language', label: 'Language' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ {
+ key: 'responseDueDate',
+ label: 'Response Due Date',
+ format: 'datetime',
+ },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'sentiment', label: 'Sentiment' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'relationshipType', label: 'Relationship Type' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'channelCode', label: 'Channel Code' },
+ { key: 'lastThread', label: 'Last Thread' },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ { key: 'contact', label: 'Contact', children: contactSummaryFields },
+ { key: 'assignee', label: 'Assignee', children: followerFields },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'users', label: 'Users' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskMergeContactsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'facebook', label: 'Facebook' },
+ { key: 'twitter', label: 'Twitter' },
+ { key: 'accountCount', label: 'Account Count' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'secondaryEmail', label: 'Secondary Email', format: 'email' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'city', label: 'City' },
+ { key: 'country', label: 'Country' },
+ { key: 'state', label: 'State' },
+ { key: 'street', label: 'Street' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'description', label: 'Description' },
+ { key: 'title', label: 'Title' },
+ { key: 'type', label: 'Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'language', label: 'Language' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'isFollowing', label: 'Is Following', format: 'boolean' },
+ { key: 'zohoCRMContact', label: 'Zoho CRM Contact' },
+ { key: 'isAnonymous', label: 'Is Anonymous', format: 'boolean' },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'isEndUser', label: 'Is End User', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskMoveTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ ],
+};
+
+export const zohoDeskListProductContactsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'contacts',
+ label: 'Contacts',
+ labelKey: 'email',
+ listItems: contactFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListProductTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'tickets',
+ label: 'Tickets',
+ labelKey: 'subject',
+ listItems: ticketFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCreateTicketPinOutputSchema: OutputSchema = {
+ fields: pinFields,
+};
+
+export const zohoDeskListTicketPinsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'pins', label: 'Pins', labelKey: 'id', listItems: pinFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskRemoveTicketTagsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'tags', label: 'Tags' },
+ ],
+};
+
+export const zohoDeskSendTicketReplyOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'content', label: 'Content' },
+ { key: 'id', label: 'ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'canReply', label: 'Can Reply', format: 'boolean' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'hasAttach', label: 'Has Attach', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'replyTo', label: 'Reply To' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'author', label: 'Author', children: authorFields },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'respondedIn', label: 'Responded In' },
+ { key: 'readReceipts', label: 'Read Receipts' },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ {
+ key: 'isDescriptionThread',
+ label: 'Is Description Thread',
+ format: 'boolean',
+ },
+ {
+ key: 'isContentTruncated',
+ label: 'Is Content Truncated',
+ format: 'boolean',
+ },
+ { key: 'fullContentURL', label: 'Full Content URL', format: 'url' },
+ { key: 'actions', label: 'Actions' },
+ { key: 'visibility', label: 'Visibility' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'cc', label: 'Cc', format: 'email' },
+ { key: 'responderId', label: 'Responder ID' },
+ { key: 'bcc', label: 'Bcc', format: 'email' },
+ { key: 'to', label: 'To', format: 'email' },
+ { key: 'fromEmailAddress', label: 'From Email Address', format: 'email' },
+ { key: 'isForward', label: 'Is Forward', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskListReplyAddressesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'addresses',
+ label: 'Addresses',
+ labelKey: 'displayName',
+ listItems: [
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'displayName', label: 'Display Name' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'serviceProviderType', label: 'Service Provider Type' },
+ { key: 'issues', label: 'Issues' },
+ { key: 'smtpDetails', label: 'Smtp Details' },
+ {
+ key: 'isDepartmentDefault',
+ label: 'Is Department Default',
+ format: 'boolean',
+ },
+ { key: 'id', label: 'ID' },
+ { key: 'isActive', label: 'Is Active', format: 'boolean' },
+ { key: 'createdBy', label: 'Created By', children: followerFields },
+ { key: 'modifiedBy', label: 'Modified By' },
+ { key: 'address', label: 'Address', format: 'email' },
+ { key: 'isVerified', label: 'Is Verified', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketResolutionHistoryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'history', label: 'History', listItems: historyFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListRolesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'roles', label: 'Roles', labelKey: 'name', listItems: roleFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchAccountsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'accounts',
+ label: 'Accounts',
+ labelKey: 'id',
+ listItems: [
+ { key: 'owner', label: 'Owner', children: agentContactFields },
+ { key: 'country', label: 'Country' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'website', label: 'Website' },
+ { key: 'code', label: 'Code' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'city', label: 'City' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'description', label: 'Description' },
+ { key: 'industry', label: 'Industry' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'street', label: 'Street' },
+ { key: 'annualrevenue', label: 'Annualrevenue' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'state', label: 'State' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'email', label: 'Email' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchActivitiesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'activities',
+ label: 'Activities',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'duration', label: 'Duration', format: 'number' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'contact', label: 'Contact', children: ticketContactFields },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ {
+ key: 'modifiedBy',
+ label: 'Modified By',
+ children: agentContactFields,
+ },
+ { key: 'id', label: 'ID' },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'reminder', label: 'Reminder' },
+ { key: 'ticket', label: 'Ticket', children: ticketListItemFields },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'module', label: 'Module' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'assignee', label: 'Assignee', children: agentContactFields },
+ { key: 'category', label: 'Category' },
+ { key: 'activityType', label: 'Activity Type' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'title',
+ listItems: [
+ { key: 'owner', label: 'Owner', children: agentContactFields },
+ { key: 'country', label: 'Country' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'code', label: 'Code' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'accountName', label: 'Account Name' },
+ { key: 'city', label: 'City' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'module', label: 'Module' },
+ { key: 'description', label: 'Description' },
+ { key: 'industry', label: 'Industry' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'street', label: 'Street' },
+ { key: 'annualrevenue', label: 'Annualrevenue' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'state', label: 'State' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'language', label: 'Language' },
+ { key: 'resolution', label: 'Resolution' },
+ { key: 'sharedDepartments', label: 'Shared Departments' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'isOverDue', label: 'Is Over Due', format: 'boolean' },
+ { key: 'contact', label: 'Contact', children: contactSummaryFields },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'parentTicket', label: 'Parent Ticket' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'secondaryContacts', label: 'Secondary Contacts' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'classification', label: 'Classification' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'assignee', label: 'Assignee', children: agentContactFields },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'childTicketCount', label: 'Child Ticket Count' },
+ { key: 'status', label: 'Status' },
+ { key: 'entitySkills', label: 'Entity Skills' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'isRead', label: 'Is Read', format: 'boolean' },
+ {
+ key: 'responseDueDate',
+ label: 'Response Due Date',
+ format: 'datetime',
+ },
+ { key: 'modifiedBy', label: 'Modified By' },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ {
+ key: 'product',
+ label: 'Product',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'productName', label: 'Product Name' },
+ ],
+ },
+ { key: 'slaId', label: 'Sla ID' },
+ { key: 'relationshipType', label: 'Relationship Type' },
+ { key: 'lastThread', label: 'Last Thread', children: lastThreadFields },
+ { key: 'team', label: 'Team' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'isEscalated', label: 'Is Escalated', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'secondaryEmail', label: 'Secondary Email' },
+ { key: 'title', label: 'Title' },
+ { key: 'type', label: 'Type' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'twitter', label: 'Twitter' },
+ { key: 'isEndUser', label: 'Is End User', format: 'boolean' },
+ { key: 'zohoCRMContact', label: 'Zoho CRM Contact' },
+ {
+ key: 'customerHappiness',
+ label: 'Customer Happiness',
+ children: customerHappinessFields,
+ },
+ { key: 'zip', label: 'Zip' },
+ { key: 'accountCount', label: 'Account Count' },
+ { key: 'facebook', label: 'Facebook' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'firstName', label: 'First Name' },
+ { key: 'isAnonymous', label: 'Is Anonymous', format: 'boolean' },
+ { key: 'account', label: 'Account' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchArticlesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'articles', label: 'Articles' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchCallsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'calls',
+ label: 'Calls',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'duration', label: 'Duration', format: 'number' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'contact', label: 'Contact', children: ticketContactFields },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ {
+ key: 'modifiedBy',
+ label: 'Modified By',
+ children: agentContactFields,
+ },
+ { key: 'id', label: 'ID' },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ { key: 'direction', label: 'Direction' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'reminder', label: 'Reminder' },
+ { key: 'ticket', label: 'Ticket', children: ticketListItemFields },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'assignee', label: 'Assignee', children: agentContactFields },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'activityType', label: 'Activity Type' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchContactsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'contacts', label: 'Contacts' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchEventsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'duration', label: 'Duration', format: 'number' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'contact', label: 'Contact', children: ticketContactFields },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ {
+ key: 'modifiedBy',
+ label: 'Modified By',
+ children: agentContactFields,
+ },
+ { key: 'id', label: 'ID' },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'reminder', label: 'Reminder' },
+ { key: 'ticket', label: 'Ticket' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'assignee', label: 'Assignee', children: agentContactFields },
+ { key: 'category', label: 'Category' },
+ { key: 'activityType', label: 'Activity Type' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchProductsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'products', label: 'Products' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchTasksOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tasks', label: 'Tasks' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskSearchTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'tickets',
+ label: 'Tickets',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'language', label: 'Language' },
+ { key: 'resolution', label: 'Resolution' },
+ { key: 'sharedDepartments', label: 'Shared Departments' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'isOverDue', label: 'Is Over Due', format: 'boolean' },
+ { key: 'contact', label: 'Contact', children: contactSummaryFields },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'parentTicket', label: 'Parent Ticket' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'secondaryContacts', label: 'Secondary Contacts' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'classification', label: 'Classification' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'assignee', label: 'Assignee', children: agentContactFields },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'childTicketCount', label: 'Child Ticket Count' },
+ { key: 'status', label: 'Status' },
+ { key: 'entitySkills', label: 'Entity Skills' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'isRead', label: 'Is Read', format: 'boolean' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'responseDueDate',
+ label: 'Response Due Date',
+ format: 'datetime',
+ },
+ { key: 'modifiedBy', label: 'Modified By' },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'product', label: 'Product' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'slaId', label: 'Sla ID' },
+ { key: 'relationshipType', label: 'Relationship Type' },
+ { key: 'lastThread', label: 'Last Thread' },
+ { key: 'team', label: 'Team' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'isEscalated', label: 'Is Escalated', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListSupportPlansOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'supportPlans',
+ label: 'Support Plans',
+ labelKey: 'name',
+ listItems: [
+ { key: 'creditDetails', label: 'Credit Details' },
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'status', label: 'Status' },
+ { key: 'supportType', label: 'Support Type' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ {
+ key: 'sla',
+ label: 'Sla',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ { key: 'createdBy', label: 'Created By', children: ownerFields },
+ { key: 'modifiedBy', label: 'Modified By', children: ownerFields },
+ {
+ key: 'department',
+ label: 'Department',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketActiveTimersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'timers',
+ label: 'Timers',
+ listItems: [
+ { key: 'timer', label: 'Timer', children: timerFields },
+ { key: 'userId', label: 'User ID' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskUploadTicketAttachmentOutputSchema: OutputSchema = {
+ fields: ticketAttachmentFields,
+};
+
+export const zohoDeskListTicketAttachmentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'attachments',
+ label: 'Attachments',
+ labelKey: 'name',
+ listItems: ticketAttachmentFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskCreateTicketCommentOutputSchema: OutputSchema = {
+ fields: entityPinnedFields,
+};
+
+export const zohoDeskGetTicketCommentHistoryOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'history',
+ label: 'History',
+ listItems: [
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'commentedTime', label: 'Commented Time', format: 'datetime' },
+ { key: 'isPublic', label: 'Is Public', format: 'boolean' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'commenterId', label: 'Commenter ID' },
+ { key: 'content', label: 'Content' },
+ { key: 'commenter', label: 'Commenter', children: commenterFields },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketCommentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'comments',
+ label: 'Comments',
+ labelKey: 'id',
+ listItems: entityPinnedFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskGetTicketTimerOutputSchema: OutputSchema = {
+ fields: timerFields,
+};
+
+export const zohoDeskListTicketTimeEntriesByBillingTypeOutputSchema: OutputSchema =
+ {
+ fields: [
+ { key: 'timeEntries', label: 'Time Entries' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+ };
+
+export const zohoDeskAddTaskTimeEntryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'parent', label: 'Parent', children: linkedParentFields },
+ { key: 'executedTime', label: 'Executed Time', format: 'datetime' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'agentCostPerHour', label: 'Agent Cost Per Hour', format: 'number' },
+ { key: 'description', label: 'Description' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'mode', label: 'Mode' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'requestId', label: 'Request ID' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'requestChargeType', label: 'Request Charge Type' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'secondsSpent', label: 'Seconds Spent', format: 'number' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'fixedCost', label: 'Fixed Cost', format: 'number' },
+ { key: 'minutesSpent', label: 'Minutes Spent', format: 'number' },
+ { key: 'hoursSpent', label: 'Hours Spent', format: 'number' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'isBillable', label: 'Is Billable', format: 'boolean' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'invoiceId', label: 'Invoice ID' },
+ { key: 'additionalCost', label: 'Additional Cost', format: 'number' },
+ { key: 'totalCost', label: 'Total Cost', format: 'number' },
+ { key: 'taskId', label: 'Task ID' },
+ ],
+};
+
+export const zohoDeskListTaskTimeEntriesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'timeEntries',
+ label: 'Time Entries',
+ labelKey: 'id',
+ listItems: [
+ { key: 'parent', label: 'Parent', children: linkedParentFields },
+ { key: 'executedTime', label: 'Executed Time', format: 'datetime' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'departmentId', label: 'Department ID' },
+ {
+ key: 'agentCostPerHour',
+ label: 'Agent Cost Per Hour',
+ format: 'number',
+ },
+ { key: 'description', label: 'Description' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'mode', label: 'Mode' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'billingType', label: 'Billing Type' },
+ { key: 'requestId', label: 'Request ID' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ { key: 'requestChargeType', label: 'Request Charge Type' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'secondsSpent', label: 'Seconds Spent', format: 'number' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'fixedCost', label: 'Fixed Cost', format: 'number' },
+ { key: 'minutesSpent', label: 'Minutes Spent', format: 'number' },
+ { key: 'hoursSpent', label: 'Hours Spent', format: 'number' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'isBillable', label: 'Is Billable', format: 'boolean' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'invoiceId', label: 'Invoice ID' },
+ { key: 'additionalCost', label: 'Additional Cost', format: 'number' },
+ { key: 'totalCost', label: 'Total Cost', format: 'number' },
+ { key: 'taskId', label: 'Task ID' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTeamMembersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'members',
+ label: 'Members',
+ labelKey: 'id',
+ listItems: [
+ { key: 'firstName', label: 'First Name' },
+ { key: 'lastName', label: 'Last Name' },
+ { key: 'photoURL', label: 'Photo URL', format: 'image' },
+ { key: 'roleId', label: 'Role ID' },
+ { key: 'profileId', label: 'Profile ID' },
+ { key: 'emailId', label: 'Email ID', format: 'email' },
+ { key: 'id', label: 'ID' },
+ { key: 'zuid', label: 'Zuid' },
+ ],
+ },
+ ],
+};
+
+export const zohoDeskGetTicketThreadOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'content', label: 'Content' },
+ { key: 'id', label: 'ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'canReply', label: 'Can Reply', format: 'boolean' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'hasAttach', label: 'Has Attach', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'replyTo', label: 'Reply To', format: 'email' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'author', label: 'Author', children: authorFields },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'sentiment', label: 'Sentiment' },
+ { key: 'aspects', label: 'Aspects' },
+ { key: 'plainText', label: 'Plain Text' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'readReceipts', label: 'Read Receipts' },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ {
+ key: 'isDescriptionThread',
+ label: 'Is Description Thread',
+ format: 'boolean',
+ },
+ {
+ key: 'isContentTruncated',
+ label: 'Is Content Truncated',
+ format: 'boolean',
+ },
+ { key: 'keyWords', label: 'Key Words' },
+ { key: 'fullContentURL', label: 'Full Content URL', format: 'url' },
+ { key: 'actions', label: 'Actions' },
+ { key: 'visibility', label: 'Visibility' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'cc', label: 'Cc', format: 'email' },
+ { key: 'responderId', label: 'Responder ID' },
+ { key: 'bcc', label: 'Bcc', format: 'email' },
+ { key: 'to', label: 'To', format: 'email' },
+ { key: 'fromEmailAddress', label: 'From Email Address', format: 'email' },
+ { key: 'isForward', label: 'Is Forward', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskGetLatestTicketThreadOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'content', label: 'Content' },
+ { key: 'id', label: 'ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'canReply', label: 'Can Reply', format: 'boolean' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'hasAttach', label: 'Has Attach', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'replyTo', label: 'Reply To', format: 'email' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'author', label: 'Author', children: authorFields },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'sentiment', label: 'Sentiment' },
+ { key: 'aspects', label: 'Aspects' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'readReceipts', label: 'Read Receipts' },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ { key: 'source', label: 'Source', children: sourceFields },
+ {
+ key: 'isDescriptionThread',
+ label: 'Is Description Thread',
+ format: 'boolean',
+ },
+ {
+ key: 'isContentTruncated',
+ label: 'Is Content Truncated',
+ format: 'boolean',
+ },
+ { key: 'keyWords', label: 'Key Words' },
+ { key: 'fullContentURL', label: 'Full Content URL', format: 'url' },
+ { key: 'actions', label: 'Actions' },
+ { key: 'visibility', label: 'Visibility' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'cc', label: 'Cc', format: 'email' },
+ { key: 'responderId', label: 'Responder ID' },
+ { key: 'bcc', label: 'Bcc', format: 'email' },
+ { key: 'to', label: 'To', format: 'email' },
+ { key: 'fromEmailAddress', label: 'From Email Address', format: 'email' },
+ { key: 'isForward', label: 'Is Forward', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskListTicketThreadsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'threads',
+ label: 'Threads',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'canReply', label: 'Can Reply', format: 'boolean' },
+ { key: 'contentType', label: 'Content Type' },
+ { key: 'hasAttach', label: 'Has Attach', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'summary', label: 'Summary' },
+ { key: 'author', label: 'Author', children: authorFields },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'sentiment', label: 'Sentiment' },
+ { key: 'aspects', label: 'Aspects' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'respondedIn', label: 'Responded In' },
+ {
+ key: 'lastRatingIconURL',
+ label: 'Last Rating Icon URL',
+ format: 'image',
+ },
+ { key: 'readReceipts', label: 'Read Receipts' },
+ { key: 'impersonatedUser', label: 'Impersonated User' },
+ {
+ key: 'isDescriptionThread',
+ label: 'Is Description Thread',
+ format: 'boolean',
+ },
+ { key: 'source', label: 'Source', children: sourceFields },
+ { key: 'keyWords', label: 'Key Words' },
+ { key: 'actions', label: 'Actions' },
+ { key: 'visibility', label: 'Visibility' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'cc', label: 'Cc', format: 'email' },
+ { key: 'responderId', label: 'Responder ID' },
+ { key: 'bcc', label: 'Bcc', format: 'email' },
+ { key: 'to', label: 'To', format: 'email' },
+ {
+ key: 'fromEmailAddress',
+ label: 'From Email Address',
+ format: 'email',
+ },
+ { key: 'isForward', label: 'Is Forward', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketActivitiesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'activities',
+ label: 'Activities',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'id', label: 'ID' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ { key: 'activityType', label: 'Activity Type' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketCallsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'calls',
+ label: 'Calls',
+ labelKey: 'subject',
+ listItems: callFields,
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketEventsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'callId', label: 'Call ID' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'id', label: 'ID' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskListTicketHistoryOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'history',
+ label: 'History',
+ listItems: [
+ { key: 'eventName', label: 'Event Name' },
+ { key: 'eventTime', label: 'Event Time', format: 'datetime' },
+ {
+ key: 'actor',
+ label: 'Actor',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'type', label: 'Type' },
+ ],
+ },
+ { key: 'source', label: 'Source' },
+ {
+ key: 'eventInfo',
+ label: 'Event Info',
+ listItems: [
+ { key: 'propertyName', label: 'Property Name' },
+ {
+ key: 'propertyValue',
+ label: 'Property Value',
+ children: [
+ { key: 'previousValue', label: 'Previous Value' },
+ { key: 'updatedValue', label: 'Updated Value' },
+ { key: 'type', label: 'Type' },
+ ],
+ },
+ { key: 'propertyType', label: 'Property Type' },
+ {
+ key: 'systemProperty',
+ label: 'System Property',
+ format: 'boolean',
+ },
+ ],
+ },
+ { key: 'actorInfo', label: 'Actor Info' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskGetTicketMetricsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'firstResponseTime', label: 'First Response Time' },
+ { key: 'totalResponseTime', label: 'Total Response Time' },
+ { key: 'responseCount', label: 'Response Count' },
+ { key: 'outgoingCount', label: 'Outgoing Count' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'resolutionTime', label: 'Resolution Time' },
+ { key: 'reopenCount', label: 'Reopen Count' },
+ { key: 'reassignCount', label: 'Reassign Count' },
+ {
+ key: 'stagingData',
+ label: 'Staging Data',
+ listItems: [
+ { key: 'status', label: 'Status' },
+ { key: 'handledTime', label: 'Handled Time' },
+ ],
+ },
+ {
+ key: 'agentsHandled',
+ label: 'Agents Handled',
+ listItems: [
+ { key: 'agentId', label: 'Agent ID' },
+ { key: 'agentName', label: 'Agent Name' },
+ { key: 'handlingTime', label: 'Handling Time' },
+ ],
+ },
+ ],
+};
+
+export const zohoDeskListTicketTasksOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'tasks',
+ label: 'Tasks',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'callId', label: 'Call ID' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isCommented', label: 'Is Commented', format: 'boolean' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'id', label: 'ID' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zohoDeskUpdateCallOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'startTime', label: 'Start Time', format: 'datetime' },
+ { key: 'direction', label: 'Direction' },
+ { key: 'duration', label: 'Duration', format: 'number' },
+ { key: 'activityTime', label: 'Activity Time', format: 'datetime' },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'status', label: 'Status' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'reminder', label: 'Reminder' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'creatorId', label: 'Creator ID' },
+ { key: 'callId', label: 'Call ID' },
+ { key: 'completedTime', label: 'Completed Time', format: 'datetime' },
+ { key: 'modifiedBy', label: 'Modified By', children: modifiedByFields },
+ { key: 'ticketId', label: 'Ticket ID' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ ],
+};
+
+export const zohoDeskUpdateContractOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'supportPlan', label: 'Support Plan', children: supportPlanFields },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'contractName', label: 'Contract Name' },
+ { key: 'contractNumber', label: 'Contract Number' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'notifyOn', label: 'Notify On', format: 'date' },
+ {
+ key: 'sla',
+ label: 'Sla',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ { key: 'account', label: 'Account', children: accountFields },
+ {
+ key: 'product',
+ label: 'Product',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'productName', label: 'Product Name' },
+ ],
+ },
+ { key: 'ownerId', label: 'Owner ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'createdBy', label: 'Created By' },
+ { key: 'modifiedBy', label: 'Modified By' },
+ { key: 'associatedSLAId', label: 'Associated SLAId' },
+ { key: 'notifyBefore', label: 'Notify Before' },
+ { key: 'owner', label: 'Owner', children: ownerFields },
+ { key: 'notificationAgentIds', label: 'Notification Agent IDs' },
+ { key: 'startDate', label: 'Start Date', format: 'date' },
+ { key: 'endDate', label: 'End Date', format: 'date' },
+ { key: 'contractStatus', label: 'Contract Status' },
+ ],
+};
+
+export const zohoDeskUpdateManyAccountsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Result', labelKey: 'id', listItems: resultFields },
+ ],
+};
+
+export const zohoDeskUpdateTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'modifiedTime', label: 'Modified Time', format: 'datetime' },
+ { key: 'subCategory', label: 'Sub Category' },
+ { key: 'statusType', label: 'Status Type' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'dueDate', label: 'Due Date', format: 'datetime' },
+ { key: 'departmentId', label: 'Department ID' },
+ { key: 'channel', label: 'Channel' },
+ { key: 'onholdTime', label: 'Onhold Time', format: 'datetime' },
+ { key: 'language', label: 'Language' },
+ { key: 'source', label: 'Source', children: threadSourceFields },
+ { key: 'resolution', label: 'Resolution' },
+ { key: 'sharedDepartments', label: 'Shared Departments' },
+ { key: 'closedTime', label: 'Closed Time', format: 'datetime' },
+ { key: 'approvalCount', label: 'Approval Count' },
+ { key: 'isOverDue', label: 'Is Over Due', format: 'boolean' },
+ { key: 'isTrashed', label: 'Is Trashed', format: 'boolean' },
+ { key: 'createdTime', label: 'Created Time', format: 'datetime' },
+ { key: 'id', label: 'ID' },
+ {
+ key: 'isResponseOverdue',
+ label: 'Is Response Overdue',
+ format: 'boolean',
+ },
+ {
+ key: 'customerResponseTime',
+ label: 'Customer Response Time',
+ format: 'datetime',
+ },
+ { key: 'productId', label: 'Product ID' },
+ { key: 'contactId', label: 'Contact ID' },
+ { key: 'threadCount', label: 'Thread Count' },
+ { key: 'secondaryContacts', label: 'Secondary Contacts' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'classification', label: 'Classification' },
+ { key: 'commentCount', label: 'Comment Count' },
+ { key: 'taskCount', label: 'Task Count' },
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'webUrl', label: 'Web URL', format: 'url' },
+ { key: 'isSpam', label: 'Is Spam', format: 'boolean' },
+ { key: 'status', label: 'Status' },
+ { key: 'entitySkills', label: 'Entity Skills' },
+ { key: 'ticketNumber', label: 'Ticket Number' },
+ { key: 'customFields', label: 'Custom Fields' },
+ { key: 'isArchived', label: 'Is Archived', format: 'boolean' },
+ { key: 'description', label: 'Description' },
+ { key: 'timeEntryCount', label: 'Time Entry Count' },
+ { key: 'channelRelatedInfo', label: 'Channel Related Info' },
+ { key: 'responseDueDate', label: 'Response Due Date', format: 'datetime' },
+ { key: 'isDeleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'modifiedBy', label: 'Modified By' },
+ { key: 'email', label: 'Email', format: 'email' },
+ {
+ key: 'layoutDetails',
+ label: 'Layout Details',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'layoutName', label: 'Layout Name' },
+ ],
+ },
+ { key: 'channelCode', label: 'Channel Code' },
+ { key: 'cf', label: 'Custom Fields (API Names)' },
+ { key: 'slaId', label: 'Sla ID' },
+ { key: 'layoutId', label: 'Layout ID' },
+ { key: 'assigneeId', label: 'Assignee ID' },
+ { key: 'teamId', label: 'Team ID' },
+ { key: 'attachmentCount', label: 'Attachment Count' },
+ { key: 'isEscalated', label: 'Is Escalated', format: 'boolean' },
+ { key: 'category', label: 'Category' },
+ ],
+};
+
+export const zohoDeskListViewsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'views',
+ label: 'Views',
+ labelKey: 'name',
+ listItems: [
+ { key: 'viewName', label: 'View Name' },
+ { key: 'isCustomView', label: 'Is Custom View', format: 'boolean' },
+ { key: 'isLocked', label: 'Is Locked', format: 'boolean' },
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ { key: 'deprecatedViewId', label: 'Deprecated View ID' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};