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(zendesk): add AI actions and output schemas (#16079)

Kishan Parmar5155542009e9
diff --git a/packages/pieces/community/zendesk/package.json b/packages/pieces/community/zendesk/package.json
index 094de48cd91..8d0126069dd 100644
--- a/packages/pieces/community/zendesk/package.json
+++ b/packages/pieces/community/zendesk/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-zendesk",
- "version": "0.4.0",
+ "version": "0.5.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/zendesk/src/index.ts b/packages/pieces/community/zendesk/src/index.ts
index 48da21b7b21..a6c2376d561 100644
--- a/packages/pieces/community/zendesk/src/index.ts
+++ b/packages/pieces/community/zendesk/src/index.ts
@@ -30,12 +30,111 @@ import { findAgentAction } from './lib/actions/find-agent';
import { findGroupAction } from './lib/actions/find-group';
import { findLatestCommentAction } from './lib/actions/find-latest-comment';
import { updateUserAction } from './lib/actions/update-user';
+import { zendeskGetAutomation } from './lib/actions/ai/admin/get-automation';
+import { zendeskGetSatisfactionRating } from './lib/actions/ai/admin/get-satisfaction-rating';
+import { zendeskGetTicketSlaMetrics } from './lib/actions/ai/admin/get-ticket-sla-metrics';
+import { zendeskGetTicketTrigger } from './lib/actions/ai/admin/get-ticket-trigger';
+import { zendeskListAutomations } from './lib/actions/ai/admin/list-automations';
+import { zendeskListSatisfactionRatings } from './lib/actions/ai/admin/list-satisfaction-ratings';
+import { zendeskListSlaPolicies } from './lib/actions/ai/admin/list-sla-policies';
+import { zendeskListTicketTriggers } from './lib/actions/ai/admin/list-ticket-triggers';
+import { zendeskSearchAutomations } from './lib/actions/ai/admin/search-automations';
+import { zendeskSearchTicketTriggers } from './lib/actions/ai/admin/search-ticket-triggers';
+import { zendeskCreateCustomObjectRecord } from './lib/actions/ai/custom-objects/create-custom-object-record';
+import { zendeskDeleteCustomObjectRecord } from './lib/actions/ai/custom-objects/delete-custom-object-record';
+import { zendeskGetCustomObjectRecord } from './lib/actions/ai/custom-objects/get-custom-object-record';
+import { zendeskListCustomObjectFields } from './lib/actions/ai/custom-objects/list-custom-object-fields';
+import { zendeskListCustomObjectRecords } from './lib/actions/ai/custom-objects/list-custom-object-records';
+import { zendeskListCustomObjects } from './lib/actions/ai/custom-objects/list-custom-objects';
+import { zendeskSearchCustomObjectRecords } from './lib/actions/ai/custom-objects/search-custom-object-records';
+import { zendeskUpdateCustomObjectRecord } from './lib/actions/ai/custom-objects/update-custom-object-record';
+import { zendeskUpsertCustomObjectRecord } from './lib/actions/ai/custom-objects/upsert-custom-object-record';
+import { zendeskListGroupUsers } from './lib/actions/ai/groups/list-group-users';
+import { zendeskListGroups } from './lib/actions/ai/groups/list-groups';
+import { zendeskListBrands } from './lib/actions/ai/lookups/list-brands';
+import { zendeskListCustomStatuses } from './lib/actions/ai/lookups/list-custom-statuses';
+import { zendeskListOrganizationFields } from './lib/actions/ai/lookups/list-organization-fields';
+import { zendeskListTicketFields } from './lib/actions/ai/lookups/list-ticket-fields';
+import { zendeskListTicketForms } from './lib/actions/ai/lookups/list-ticket-forms';
+import { zendeskListUserFields } from './lib/actions/ai/lookups/list-user-fields';
+import { zendeskGetMacro } from './lib/actions/ai/macros/get-macro';
+import { zendeskListMacros } from './lib/actions/ai/macros/list-macros';
+import { zendeskPreviewMacroOnTicket } from './lib/actions/ai/macros/preview-macro-on-ticket';
+import { zendeskSearchMacros } from './lib/actions/ai/macros/search-macros';
+import { zendeskAddOrganizationTags } from './lib/actions/ai/organizations/add-organization-tags';
+import { zendeskCreateOrUpdateOrganization } from './lib/actions/ai/organizations/create-or-update-organization';
+import { zendeskCreateOrganizationMembership } from './lib/actions/ai/organizations/create-organization-membership';
+import { zendeskCreateOrganization } from './lib/actions/ai/organizations/create-organization';
+import { zendeskDeleteOrganizationMembership } from './lib/actions/ai/organizations/delete-organization-membership';
+import { zendeskDeleteOrganization } from './lib/actions/ai/organizations/delete-organization';
+import { zendeskGetOrganizationTags } from './lib/actions/ai/organizations/get-organization-tags';
+import { zendeskGetOrganization } from './lib/actions/ai/organizations/get-organization';
+import { zendeskListOrganizationMemberships } from './lib/actions/ai/organizations/list-organization-memberships';
+import { zendeskListOrganizationUsers } from './lib/actions/ai/organizations/list-organization-users';
+import { zendeskListOrganizations } from './lib/actions/ai/organizations/list-organizations';
+import { zendeskRemoveOrganizationTags } from './lib/actions/ai/organizations/remove-organization-tags';
+import { zendeskSearchOrganizations } from './lib/actions/ai/organizations/search-organizations';
+import { zendeskUpdateOrganization } from './lib/actions/ai/organizations/update-organization';
+import { zendeskCountSearchResults } from './lib/actions/ai/search/count-search-results';
+import { zendeskCountViewTickets } from './lib/actions/ai/search/count-view-tickets';
+import { zendeskListViewTickets } from './lib/actions/ai/search/list-view-tickets';
+import { zendeskListViews } from './lib/actions/ai/search/list-views';
+import { zendeskSearch } from './lib/actions/ai/search/search';
+import { zendeskAddTicketComment } from './lib/actions/ai/tickets/add-ticket-comment';
+import { zendeskAddTicketTags } from './lib/actions/ai/tickets/add-ticket-tags';
+import { zendeskCreateManyTickets } from './lib/actions/ai/tickets/create-many-tickets';
+import { zendeskCreateTicket } from './lib/actions/ai/tickets/create-ticket';
+import { zendeskDeleteTicket } from './lib/actions/ai/tickets/delete-ticket';
+import { zendeskGetAttachment } from './lib/actions/ai/tickets/get-attachment';
+import { zendeskGetJobStatus } from './lib/actions/ai/tickets/get-job-status';
+import { zendeskGetManyTickets } from './lib/actions/ai/tickets/get-many-tickets';
+import { zendeskGetTicketConversationLog } from './lib/actions/ai/tickets/get-ticket-conversation-log';
+import { zendeskGetTicketMetrics } from './lib/actions/ai/tickets/get-ticket-metrics';
+import { zendeskGetTicketTags } from './lib/actions/ai/tickets/get-ticket-tags';
+import { zendeskGetTicket } from './lib/actions/ai/tickets/get-ticket';
+import { zendeskListDeletedTickets } from './lib/actions/ai/tickets/list-deleted-tickets';
+import { zendeskListProblemTickets } from './lib/actions/ai/tickets/list-problem-tickets';
+import { zendeskListSuspendedTickets } from './lib/actions/ai/tickets/list-suspended-tickets';
+import { zendeskListTicketAudits } from './lib/actions/ai/tickets/list-ticket-audits';
+import { zendeskListTicketComments } from './lib/actions/ai/tickets/list-ticket-comments';
+import { zendeskListTicketEmailCcs } from './lib/actions/ai/tickets/list-ticket-email-ccs';
+import { zendeskListTicketFollowers } from './lib/actions/ai/tickets/list-ticket-followers';
+import { zendeskListTicketIncidents } from './lib/actions/ai/tickets/list-ticket-incidents';
+import { zendeskListTickets } from './lib/actions/ai/tickets/list-tickets';
+import { zendeskMakeCommentPrivate } from './lib/actions/ai/tickets/make-comment-private';
+import { zendeskMarkTicketsAsSpam } from './lib/actions/ai/tickets/mark-tickets-as-spam';
+import { zendeskMergeTickets } from './lib/actions/ai/tickets/merge-tickets';
+import { zendeskRecoverSuspendedTickets } from './lib/actions/ai/tickets/recover-suspended-tickets';
+import { zendeskRedactComment } from './lib/actions/ai/tickets/redact-comment';
+import { zendeskRemoveTicketTags } from './lib/actions/ai/tickets/remove-ticket-tags';
+import { zendeskRestoreTicket } from './lib/actions/ai/tickets/restore-ticket';
+import { zendeskUpdateManyTickets } from './lib/actions/ai/tickets/update-many-tickets';
+import { zendeskUpdateTicket } from './lib/actions/ai/tickets/update-ticket';
+import { zendeskAddUserTags } from './lib/actions/ai/users/add-user-tags';
+import { zendeskCreateOrUpdateUser } from './lib/actions/ai/users/create-or-update-user';
+import { zendeskCreateUserIdentity } from './lib/actions/ai/users/create-user-identity';
+import { zendeskCreateUser } from './lib/actions/ai/users/create-user';
+import { zendeskDeleteUserIdentity } from './lib/actions/ai/users/delete-user-identity';
+import { zendeskDeleteUser } from './lib/actions/ai/users/delete-user';
+import { zendeskGetCurrentUser } from './lib/actions/ai/users/get-current-user';
+import { zendeskGetManyUsers } from './lib/actions/ai/users/get-many-users';
+import { zendeskGetUserTags } from './lib/actions/ai/users/get-user-tags';
+import { zendeskGetUser } from './lib/actions/ai/users/get-user';
+import { zendeskListUserGroups } from './lib/actions/ai/users/list-user-groups';
+import { zendeskListUserIdentities } from './lib/actions/ai/users/list-user-identities';
+import { zendeskListUsers } from './lib/actions/ai/users/list-users';
+import { zendeskMakeUserIdentityPrimary } from './lib/actions/ai/users/make-user-identity-primary';
+import { zendeskMergeUsers } from './lib/actions/ai/users/merge-users';
+import { zendeskRemoveUserTags } from './lib/actions/ai/users/remove-user-tags';
+import { zendeskSearchUsers } from './lib/actions/ai/users/search-users';
+import { zendeskUpdateUserIdentity } from './lib/actions/ai/users/update-user-identity';
+import { zendeskUpdateUser } from './lib/actions/ai/users/update-user';
export const zendesk = createPiece({
displayName: 'Zendesk',
description: 'Customer service software and support ticket system',
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/zendesk.png',
authors: ["kishanprmr","MoShizzle","khaledmashaly","abuaboud","aryel780","onyedikachi-david","murex971"],
categories: [PieceCategory.CUSTOMER_SUPPORT],
@@ -58,6 +157,105 @@ export const zendesk = createPiece({
findGroupAction,
findLatestCommentAction,
updateUserAction,
+ zendeskGetAutomation,
+ zendeskGetSatisfactionRating,
+ zendeskGetTicketSlaMetrics,
+ zendeskGetTicketTrigger,
+ zendeskListAutomations,
+ zendeskListSatisfactionRatings,
+ zendeskListSlaPolicies,
+ zendeskListTicketTriggers,
+ zendeskSearchAutomations,
+ zendeskSearchTicketTriggers,
+ zendeskCreateCustomObjectRecord,
+ zendeskDeleteCustomObjectRecord,
+ zendeskGetCustomObjectRecord,
+ zendeskListCustomObjectFields,
+ zendeskListCustomObjectRecords,
+ zendeskListCustomObjects,
+ zendeskSearchCustomObjectRecords,
+ zendeskUpdateCustomObjectRecord,
+ zendeskUpsertCustomObjectRecord,
+ zendeskListGroupUsers,
+ zendeskListGroups,
+ zendeskListBrands,
+ zendeskListCustomStatuses,
+ zendeskListOrganizationFields,
+ zendeskListTicketFields,
+ zendeskListTicketForms,
+ zendeskListUserFields,
+ zendeskGetMacro,
+ zendeskListMacros,
+ zendeskPreviewMacroOnTicket,
+ zendeskSearchMacros,
+ zendeskAddOrganizationTags,
+ zendeskCreateOrUpdateOrganization,
+ zendeskCreateOrganizationMembership,
+ zendeskCreateOrganization,
+ zendeskDeleteOrganizationMembership,
+ zendeskDeleteOrganization,
+ zendeskGetOrganizationTags,
+ zendeskGetOrganization,
+ zendeskListOrganizationMemberships,
+ zendeskListOrganizationUsers,
+ zendeskListOrganizations,
+ zendeskRemoveOrganizationTags,
+ zendeskSearchOrganizations,
+ zendeskUpdateOrganization,
+ zendeskCountSearchResults,
+ zendeskCountViewTickets,
+ zendeskListViewTickets,
+ zendeskListViews,
+ zendeskSearch,
+ zendeskAddTicketComment,
+ zendeskAddTicketTags,
+ zendeskCreateManyTickets,
+ zendeskCreateTicket,
+ zendeskDeleteTicket,
+ zendeskGetAttachment,
+ zendeskGetJobStatus,
+ zendeskGetManyTickets,
+ zendeskGetTicketConversationLog,
+ zendeskGetTicketMetrics,
+ zendeskGetTicketTags,
+ zendeskGetTicket,
+ zendeskListDeletedTickets,
+ zendeskListProblemTickets,
+ zendeskListSuspendedTickets,
+ zendeskListTicketAudits,
+ zendeskListTicketComments,
+ zendeskListTicketEmailCcs,
+ zendeskListTicketFollowers,
+ zendeskListTicketIncidents,
+ zendeskListTickets,
+ zendeskMakeCommentPrivate,
+ zendeskMarkTicketsAsSpam,
+ zendeskMergeTickets,
+ zendeskRecoverSuspendedTickets,
+ zendeskRedactComment,
+ zendeskRemoveTicketTags,
+ zendeskRestoreTicket,
+ zendeskUpdateManyTickets,
+ zendeskUpdateTicket,
+ zendeskAddUserTags,
+ zendeskCreateOrUpdateUser,
+ zendeskCreateUserIdentity,
+ zendeskCreateUser,
+ zendeskDeleteUserIdentity,
+ zendeskDeleteUser,
+ zendeskGetCurrentUser,
+ zendeskGetManyUsers,
+ zendeskGetUserTags,
+ zendeskGetUser,
+ zendeskListUserGroups,
+ zendeskListUserIdentities,
+ zendeskListUsers,
+ zendeskMakeUserIdentityPrimary,
+ zendeskMergeUsers,
+ zendeskRemoveUserTags,
+ zendeskSearchUsers,
+ zendeskUpdateUserIdentity,
+ zendeskUpdateUser,
createCustomApiCallAction({
baseUrl: (auth) => (auth ? getZendeskBaseUrl(auth) : ''),
auth: zendeskAuth,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/add-comment-to-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/add-comment-to-ticket.ts
index 0c5a5546788..e9dd45d7fa4 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/add-comment-to-ticket.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/add-comment-to-ticket.ts
@@ -6,14 +6,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { ticketIdDropdown } from '../common/props';
+import { addCommentToTicketOutputSchema } from '../output-schemas';
export const addCommentToTicketAction = createAction({
auth: zendeskAuth,
name: 'add-comment-to-ticket',
+ outputSchema: addCommentToTicketOutputSchema,
classification: 'WRITE',
displayName: 'Add Comment to Ticket',
description: 'Append a public/private comment to a ticket.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Appends a comment to an existing ticket identified by ticket ID, as either plain text or HTML, defaulting to public (visible to the requester) unless marked private. Use to reply on a ticket, post an internal note, or attach files via upload tokens. The author is the authenticated user unless an author email is supplied (resolved to a user ID). Not idempotent: each call adds a new comment.', idempotent: false },
props: {
ticket_id: ticketIdDropdown,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/add-tag-to-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/add-tag-to-ticket.ts
index 8c022780aa5..c1a0a82eeca 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/add-tag-to-ticket.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/add-tag-to-ticket.ts
@@ -6,14 +6,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { ticketIdDropdown } from '../common/props';
+import { addTagToTicketOutputSchema } from '../output-schemas';
export const addTagToTicketAction = createAction({
auth: zendeskAuth,
name: 'add-tag-to-ticket',
+ outputSchema: addTagToTicketOutputSchema,
classification: 'WRITE',
displayName: 'Add Tag to Ticket',
description: 'Apply one or more tags to a ticket.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Adds one or more tags to a ticket identified by ticket ID, merging with the ticket\'s existing tags rather than replacing them (unlike Update Ticket, which overwrites the tag set). Use to label or categorize a ticket without disturbing tags already present. At least one tag is required. Effectively idempotent for tags already present (Zendesk de-duplicates), so re-running with the same tags leaves the set unchanged.', idempotent: true },
props: {
ticket_id: ticketIdDropdown,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-automation.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-automation.ts
new file mode 100644
index 00000000000..29f1017d70a
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-automation.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetAutomationOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetAutomation = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_automation',
+ outputSchema: zendeskGetAutomationOutputSchema,
+ displayName: 'Get Automation',
+ description: 'Get an automation by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one automation with its conditions and actions. Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ automation_id: zendeskAiProps.requiredId({ displayName: 'Automation ID', description: 'Numeric automation ID, from List or Search Automations.' }),
+ },
+ async run({ auth, propsValue }) {
+ const automationId = zendeskApi.id({ value: propsValue.automation_id, label: 'Automation ID' });
+ const response = await zendeskApi.request<{ automation: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/automations/${automationId}.json`,
+ });
+ return response.automation;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-satisfaction-rating.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-satisfaction-rating.ts
new file mode 100644
index 00000000000..4e4b1f88336
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-satisfaction-rating.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetSatisfactionRatingOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetSatisfactionRating = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_satisfaction_rating',
+ outputSchema: zendeskGetSatisfactionRatingOutputSchema,
+ displayName: 'Get Satisfaction Rating',
+ description: 'Get a satisfaction rating by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one customer satisfaction rating with score, comment, reason and ticket ID. Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ satisfaction_rating_id: zendeskAiProps.requiredId({ displayName: 'Satisfaction Rating ID', description: 'Numeric rating ID, from List Satisfaction Ratings.' }),
+ },
+ async run({ auth, propsValue }) {
+ const satisfactionRatingId = zendeskApi.id({ value: propsValue.satisfaction_rating_id, label: 'Satisfaction Rating ID' });
+ const response = await zendeskApi.request<{ satisfaction_rating: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/satisfaction_ratings/${satisfactionRatingId}.json`,
+ });
+ return response.satisfaction_rating;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-ticket-sla-metrics.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-ticket-sla-metrics.ts
new file mode 100644
index 00000000000..4e6111d8c08
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-ticket-sla-metrics.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetTicketSlaMetricsOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetTicketSlaMetrics = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_ticket_sla_metrics',
+ outputSchema: zendeskGetTicketSlaMetricsOutputSchema,
+ displayName: 'Get Ticket SLA Metrics',
+ description: 'Get the SLA targets and breaches of a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Lists the SLA metrics applied to one ticket (first reply, next reply, resolution time) with stage, breach time and whether they are breached. Requires the Professional plan or above. Use Get Ticket Metrics for raw timings.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ policy_metrics: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/slas/policy_metrics.json`,
+ });
+ return { policy_metrics: response.policy_metrics, count: response.policy_metrics.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-ticket-trigger.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-ticket-trigger.ts
new file mode 100644
index 00000000000..e9690e0084e
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/get-ticket-trigger.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetTicketTriggerOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetTicketTrigger = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_ticket_trigger',
+ outputSchema: zendeskGetTicketTriggerOutputSchema,
+ displayName: 'Get Ticket Trigger',
+ description: 'Get a ticket trigger by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one ticket trigger with its conditions and actions. Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ trigger_id: zendeskAiProps.requiredId({ displayName: 'Trigger ID', description: 'Numeric trigger ID, from List or Search Ticket Triggers.' }),
+ },
+ async run({ auth, propsValue }) {
+ const triggerId = zendeskApi.id({ value: propsValue.trigger_id, label: 'Trigger ID' });
+ const response = await zendeskApi.request<{ trigger: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/triggers/${triggerId}.json`,
+ });
+ return response.trigger;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-automations.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-automations.ts
new file mode 100644
index 00000000000..396e97d3a14
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-automations.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListAutomationsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListAutomations = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_automations',
+ outputSchema: zendeskListAutomationsOutputSchema,
+ displayName: 'List Automations',
+ description: 'List the time-based automations.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists automations, the time-based business rules that act on tickets hourly (e.g. close solved tickets after 4 days). Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ automations: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/automations.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ active: propsValue.active }),
+ },
+ });
+ return {
+ automations: response.automations,
+ count: response.automations.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-satisfaction-ratings.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-satisfaction-ratings.ts
new file mode 100644
index 00000000000..5830feccd13
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-satisfaction-ratings.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListSatisfactionRatingsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListSatisfactionRatings = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_satisfaction_ratings',
+ outputSchema: zendeskListSatisfactionRatingsOutputSchema,
+ displayName: 'List Satisfaction Ratings',
+ description: 'List customer satisfaction (CSAT) ratings.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists customer satisfaction ratings with score, comment, reason and ticket ID, newest first. Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ score: Property.StaticDropdown({
+ displayName: 'Score',
+ description: 'Only return ratings with this score.',
+ required: false,
+ options: { options: [{ label: 'Offered', value: 'offered' }, { label: 'Unoffered', value: 'unoffered' }, { label: 'Received', value: 'received' }, { label: 'Good', value: 'good' }, { label: 'Bad', value: 'bad' }, { label: 'Good with comment', value: 'good_with_comment' }, { label: 'Bad with comment', value: 'bad_with_comment' }] },
+ }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ satisfaction_ratings: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/satisfaction_ratings.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ score: propsValue.score }),
+ },
+ });
+ return {
+ satisfaction_ratings: response.satisfaction_ratings,
+ count: response.satisfaction_ratings.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-sla-policies.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-sla-policies.ts
new file mode 100644
index 00000000000..68772cdce9f
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-sla-policies.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskListSlaPoliciesOutputSchema } from '../../../output-schemas';
+
+export const zendeskListSlaPolicies = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_sla_policies',
+ outputSchema: zendeskListSlaPoliciesOutputSchema,
+ displayName: 'List SLA Policies',
+ description: 'List the SLA policies.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists SLA policies with their filters and per-priority targets. Requires an admin and the Professional plan or above.',
+ idempotent: true,
+ },
+ props: {
+ },
+ async run({ auth }) {
+ const response = await zendeskApi.request<{ sla_policies: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/slas/policies.json`,
+ });
+ return { sla_policies: response.sla_policies, count: response.sla_policies.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-ticket-triggers.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-ticket-triggers.ts
new file mode 100644
index 00000000000..d970d7090ff
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/list-ticket-triggers.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListTicketTriggersOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketTriggers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_triggers',
+ outputSchema: zendeskListTicketTriggersOutputSchema,
+ displayName: 'List Ticket Triggers',
+ description: 'List the ticket triggers.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists ticket triggers, the business rules that run when tickets are created or updated, with their conditions and actions. Use it to explain why a ticket changed. Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ triggers: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/triggers.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ active: propsValue.active }),
+ },
+ });
+ return {
+ triggers: response.triggers,
+ count: response.triggers.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/search-automations.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/search-automations.ts
new file mode 100644
index 00000000000..c709d4063dd
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/search-automations.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskSearchAutomationsOutputSchema } from '../../../output-schemas';
+
+export const zendeskSearchAutomations = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_search_automations',
+ outputSchema: zendeskSearchAutomationsOutputSchema,
+ displayName: 'Search Automations',
+ description: 'Search automations by title.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Finds automations whose title matches the query. Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ query: Property.ShortText({ displayName: 'Query', description: 'Text to match against automation titles.', required: true }),
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ automations: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/automations/search.json`,
+ queryParams: zendeskApi.query({ query: propsValue.query, active: propsValue.active }),
+ });
+ return { automations: response.automations, count: response.automations.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/admin/search-ticket-triggers.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/search-ticket-triggers.ts
new file mode 100644
index 00000000000..b9c7d19b420
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/admin/search-ticket-triggers.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskSearchTicketTriggersOutputSchema } from '../../../output-schemas';
+
+export const zendeskSearchTicketTriggers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_search_ticket_triggers',
+ outputSchema: zendeskSearchTicketTriggersOutputSchema,
+ displayName: 'Search Ticket Triggers',
+ description: 'Search ticket triggers by title.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Finds ticket triggers whose title matches the query. Requires an admin.',
+ idempotent: true,
+ },
+ props: {
+ query: Property.ShortText({ displayName: 'Query', description: 'Text to match against trigger titles.', required: true }),
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ triggers: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/triggers/search.json`,
+ queryParams: zendeskApi.query({ query: propsValue.query, active: propsValue.active }),
+ });
+ return { triggers: response.triggers, count: response.triggers.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/create-custom-object-record.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/create-custom-object-record.ts
new file mode 100644
index 00000000000..d4a1906b33e
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/create-custom-object-record.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetCustomObjectRecordOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateCustomObjectRecord = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_custom_object_record',
+ outputSchema: zendeskGetCustomObjectRecordOutputSchema,
+ displayName: 'Create Custom Object Record',
+ description: 'Create a record of a custom object.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates one record of a custom object with a name and field values keyed by the field keys from List Custom Object Fields. Not idempotent; use Upsert Custom Object Record with an external ID to avoid duplicates.',
+ idempotent: false,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({
+ displayName: 'Custom Object Key',
+ description: 'The object key, from List Custom Objects.',
+ }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Record name. Required unless the object autonumbers names.',
+ required: false,
+ }),
+ external_id: Property.ShortText({ displayName: 'External ID', description: 'Your own unique reference.', required: false }),
+ custom_object_fields: Property.Json({
+ displayName: 'Field Values',
+ description: 'Object of field keys to values, keys from List Custom Object Fields.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const key = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const fields = zendeskApi.jsonObject({ value: propsValue.custom_object_fields, label: 'Field Values' });
+ const response = await zendeskApi.request<{ custom_object_record: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: `/custom_objects/${key}/records.json`,
+ body: {
+ custom_object_record: zendeskApi.compact({
+ name: propsValue.name,
+ external_id: propsValue.external_id,
+ custom_object_fields: Object.keys(fields).length > 0 ? fields : undefined,
+ }),
+ },
+ });
+ return response.custom_object_record;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/delete-custom-object-record.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/delete-custom-object-record.ts
new file mode 100644
index 00000000000..a2757f498e5
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/delete-custom-object-record.ts
@@ -0,0 +1,35 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskDeleteCustomObjectRecordOutputSchema } from '../../../output-schemas';
+
+export const zendeskDeleteCustomObjectRecord = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_delete_custom_object_record',
+ outputSchema: zendeskDeleteCustomObjectRecordOutputSchema,
+ displayName: 'Delete Custom Object Record',
+ description: 'Delete a custom object record.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one custom object record. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({ displayName: 'Custom Object Key', description: 'The object key, from List Custom Objects.' }),
+ record_id: zendeskAiProps.requiredId({ displayName: 'Record ID', description: 'Record ID, from List or Search Custom Object Records.' }),
+ },
+ async run({ auth, propsValue }) {
+ const customObjectKey = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const recordId = zendeskApi.pathSegment({ value: propsValue.record_id, label: 'Record ID' });
+ await zendeskApi.request<unknown>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/custom_objects/${customObjectKey}/records/${recordId}.json`,
+ });
+ return { success: true, custom_object_key: propsValue.custom_object_key, record_id: propsValue.record_id };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/get-custom-object-record.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/get-custom-object-record.ts
new file mode 100644
index 00000000000..2decc20daf6
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/get-custom-object-record.ts
@@ -0,0 +1,35 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetCustomObjectRecordOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetCustomObjectRecord = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_custom_object_record',
+ outputSchema: zendeskGetCustomObjectRecordOutputSchema,
+ displayName: 'Get Custom Object Record',
+ description: 'Get a custom object record by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one custom object record with its name, external ID and field values.',
+ idempotent: true,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({ displayName: 'Custom Object Key', description: 'The object key, from List Custom Objects.' }),
+ record_id: zendeskAiProps.requiredId({ displayName: 'Record ID', description: 'Record ID, from List or Search Custom Object Records.' }),
+ },
+ async run({ auth, propsValue }) {
+ const customObjectKey = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const recordId = zendeskApi.pathSegment({ value: propsValue.record_id, label: 'Record ID' });
+ const response = await zendeskApi.request<{ custom_object_record: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/custom_objects/${customObjectKey}/records/${recordId}.json`,
+ });
+ return response.custom_object_record;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-object-fields.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-object-fields.ts
new file mode 100644
index 00000000000..64eb825b702
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-object-fields.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListCustomObjectFieldsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListCustomObjectFields = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_custom_object_fields',
+ outputSchema: zendeskListCustomObjectFieldsOutputSchema,
+ displayName: 'List Custom Object Fields',
+ description: 'List the fields of a custom object.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the fields of one custom object with their keys, types and options, which Create, Update and Upsert Custom Object Record use in custom_object_fields.',
+ idempotent: true,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({ displayName: 'Custom Object Key', description: 'The object key, from List Custom Objects.' }),
+ include_standard_fields: Property.StaticDropdown({
+ displayName: 'Include Standard Fields',
+ description: 'Also return the built-in name and external ID fields.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const customObjectKey = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const response = await zendeskApi.request<{ custom_object_fields: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/custom_objects/${customObjectKey}/fields.json`,
+ queryParams: zendeskApi.query({ include_standard_fields: propsValue.include_standard_fields }),
+ });
+ return { custom_object_fields: response.custom_object_fields, count: response.custom_object_fields.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-object-records.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-object-records.ts
new file mode 100644
index 00000000000..7437b8e3723
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-object-records.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListCustomObjectRecordsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListCustomObjectRecords = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_custom_object_records',
+ outputSchema: zendeskListCustomObjectRecordsOutputSchema,
+ displayName: 'List Custom Object Records',
+ description: 'List the records of a custom object.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the records of one custom object, optionally only the given external IDs. Use Search Custom Object Records to match on text or field values.',
+ idempotent: true,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({ displayName: 'Custom Object Key', description: 'The object key, from List Custom Objects.' }),
+ external_ids: Property.ShortText({ displayName: 'External IDs', description: 'Comma-separated external IDs to return.', required: false }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const customObjectKey = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const response = await zendeskApi.request<{ custom_object_records: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/custom_objects/${customObjectKey}/records.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ 'filter[external_ids]': propsValue.external_ids }),
+ },
+ });
+ return {
+ custom_object_records: response.custom_object_records,
+ count: response.custom_object_records.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-objects.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-objects.ts
new file mode 100644
index 00000000000..3e0b4d6ddc8
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/list-custom-objects.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskListCustomObjectsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListCustomObjects = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_custom_objects',
+ outputSchema: zendeskListCustomObjectsOutputSchema,
+ displayName: 'List Custom Objects',
+ description: 'List the custom object types in the account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the custom object types defined in the account, with the key every custom object record action needs. Custom objects require Zendesk Suite or Support Professional and above.',
+ idempotent: true,
+ },
+ props: {
+ },
+ async run({ auth }) {
+ const response = await zendeskApi.request<{ custom_objects: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/custom_objects.json`,
+ });
+ return { custom_objects: response.custom_objects, count: response.custom_objects.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/search-custom-object-records.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/search-custom-object-records.ts
new file mode 100644
index 00000000000..d6e95d00c46
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/search-custom-object-records.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListCustomObjectRecordsOutputSchema } from '../../../output-schemas';
+
+export const zendeskSearchCustomObjectRecords = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_search_custom_object_records',
+ outputSchema: zendeskListCustomObjectRecordsOutputSchema,
+ displayName: 'Search Custom Object Records',
+ description: 'Search the records of a custom object.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches the records of one custom object by name and text field values. Use List Custom Object Records to page through all records or fetch by external ID.',
+ idempotent: true,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({ displayName: 'Custom Object Key', description: 'The object key, from List Custom Objects.' }),
+ query: Property.ShortText({ displayName: 'Query', description: 'Text to search for in record names and text fields.', required: true }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const customObjectKey = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const response = await zendeskApi.request<{ custom_object_records: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/custom_objects/${customObjectKey}/records/search.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ query: propsValue.query }),
+ },
+ });
+ return {
+ custom_object_records: response.custom_object_records,
+ count: response.custom_object_records.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/update-custom-object-record.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/update-custom-object-record.ts
new file mode 100644
index 00000000000..f6d0bd06d9e
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/update-custom-object-record.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetCustomObjectRecordOutputSchema } from '../../../output-schemas';
+
+export const zendeskUpdateCustomObjectRecord = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_update_custom_object_record',
+ outputSchema: zendeskGetCustomObjectRecordOutputSchema,
+ displayName: 'Update Custom Object Record',
+ description: 'Change fields on a custom object record.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates one custom object record by ID; only the given fields change. Set a field to null in Field Values to clear it. Record IDs come from List or Search Custom Object Records.',
+ idempotent: true,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({
+ displayName: 'Custom Object Key',
+ description: 'The object key, from List Custom Objects.',
+ }),
+ record_id: zendeskAiProps.requiredId({
+ displayName: 'Record ID',
+ description: 'Record ID, from List or Search Custom Object Records.',
+ }),
+ name: Property.ShortText({ displayName: 'Name', required: false }),
+ external_id: Property.ShortText({ displayName: 'External ID', required: false }),
+ custom_object_fields: Property.Json({
+ displayName: 'Field Values',
+ description: 'Object of field keys to values, keys from List Custom Object Fields.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const key = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const recordId = zendeskApi.pathSegment({ value: propsValue.record_id, label: 'Record ID' });
+ const fields = zendeskApi.jsonObject({ value: propsValue.custom_object_fields, label: 'Field Values' });
+ const record = zendeskApi.compact({
+ name: propsValue.name,
+ external_id: propsValue.external_id,
+ custom_object_fields: Object.keys(fields).length > 0 ? fields : undefined,
+ });
+ if (Object.keys(record).length === 0) {
+ throw new Error('Provide at least one field to update.');
+ }
+ const response = await zendeskApi.request<{ custom_object_record: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PATCH,
+ path: `/custom_objects/${key}/records/${recordId}.json`,
+ body: { custom_object_record: record },
+ });
+ return response.custom_object_record;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/upsert-custom-object-record.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/upsert-custom-object-record.ts
new file mode 100644
index 00000000000..9b7825f4a2f
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/custom-objects/upsert-custom-object-record.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskUpsertCustomObjectRecordOutputSchema } from '../../../output-schemas';
+
+export const zendeskUpsertCustomObjectRecord = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_upsert_custom_object_record',
+ outputSchema: zendeskUpsertCustomObjectRecordOutputSchema,
+ displayName: 'Upsert Custom Object Record',
+ description: 'Update the record with this external ID or name, or create one.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Upserts one custom object record: matches by External ID, or by Name when External ID is empty, updates the given field values, and creates the record when nothing matches. created is true when a new record was made. Safe to retry.',
+ idempotent: true,
+ },
+ props: {
+ custom_object_key: zendeskAiProps.requiredId({
+ displayName: 'Custom Object Key',
+ description: 'The object key, from List Custom Objects.',
+ }),
+ external_id: Property.ShortText({ displayName: 'External ID', description: 'Match key, preferred over Name.', required: false }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Match key when External ID is empty; otherwise the name to set.',
+ required: false,
+ }),
+ custom_object_fields: Property.Json({
+ displayName: 'Field Values',
+ description: 'Object of field keys to values, keys from List Custom Object Fields.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { external_id, name } = propsValue;
+ if (!external_id && !name) {
+ throw new Error('Pass External ID or Name to match the record on.');
+ }
+ const key = zendeskApi.pathSegment({ value: propsValue.custom_object_key, label: 'Custom Object Key' });
+ const fields = zendeskApi.jsonObject({ value: propsValue.custom_object_fields, label: 'Field Values' });
+ const response = await zendeskApi.send<{ custom_object_record: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PATCH,
+ path: `/custom_objects/${key}/records.json`,
+ queryParams: external_id ? { external_id } : { name: name ?? '' },
+ body: {
+ custom_object_record: zendeskApi.compact({
+ name: external_id ? name : undefined,
+ custom_object_fields: Object.keys(fields).length > 0 ? fields : undefined,
+ }),
+ },
+ });
+ return { created: response.status === 201, custom_object_record: response.body.custom_object_record };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/groups/list-group-users.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/groups/list-group-users.ts
new file mode 100644
index 00000000000..c59e967202c
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/groups/list-group-users.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetManyUsersOutputSchema } from '../../../output-schemas';
+
+export const zendeskListGroupUsers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_group_users',
+ outputSchema: zendeskGetManyUsersOutputSchema,
+ displayName: 'List Group Users',
+ description: 'List the agents in a group.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the agents who belong to one group, e.g. to pick an assignee that matches the ticket group. Group IDs come from List Groups.',
+ idempotent: true,
+ },
+ props: {
+ group_id: zendeskAiProps.requiredId({ displayName: 'Group ID', description: 'Numeric group ID, from List Groups.' }),
+ },
+ async run({ auth, propsValue }) {
+ const groupId = zendeskApi.id({ value: propsValue.group_id, label: 'Group ID' });
+ const response = await zendeskApi.request<{ users: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/groups/${groupId}/users.json`,
+ });
+ return { users: response.users, count: response.users.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/groups/list-groups.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/groups/list-groups.ts
new file mode 100644
index 00000000000..590f79aa87b
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/groups/list-groups.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListGroupsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListGroups = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_groups',
+ outputSchema: zendeskListGroupsOutputSchema,
+ displayName: 'List Groups',
+ description: 'List agent groups.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the agent groups tickets can be assigned to, with their IDs for Create Ticket, Update Ticket and List Group Users.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ groups: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/groups.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ groups: response.groups,
+ count: response.groups.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-brands.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-brands.ts
new file mode 100644
index 00000000000..67bc5884d4a
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-brands.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListBrandsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListBrands = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_brands',
+ outputSchema: zendeskListBrandsOutputSchema,
+ displayName: 'List Brands',
+ description: 'List the brands in the account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists brands with their IDs, names and subdomains, for Brand ID on Create Ticket and Update Ticket.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ brands: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/brands.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ brands: response.brands,
+ count: response.brands.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-custom-statuses.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-custom-statuses.ts
new file mode 100644
index 00000000000..337d62aa511
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-custom-statuses.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskListCustomStatusesOutputSchema } from '../../../output-schemas';
+
+export const zendeskListCustomStatuses = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_custom_statuses',
+ outputSchema: zendeskListCustomStatusesOutputSchema,
+ displayName: 'List Custom Statuses',
+ description: 'List the custom ticket statuses.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the ticket statuses defined in the account with their IDs and status category, for Custom Status ID on Update Ticket and Update Many Tickets.',
+ idempotent: true,
+ },
+ props: {
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ custom_statuses: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/custom_statuses.json`,
+ queryParams: zendeskApi.query({ active: propsValue.active }),
+ });
+ return { custom_statuses: response.custom_statuses, count: response.custom_statuses.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-organization-fields.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-organization-fields.ts
new file mode 100644
index 00000000000..47b0c1faf7d
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-organization-fields.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListOrganizationFieldsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListOrganizationFields = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_organization_fields',
+ outputSchema: zendeskListOrganizationFieldsOutputSchema,
+ displayName: 'List Organization Fields',
+ description: 'List the custom organization fields.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists custom organization fields with their keys, types and options, for organization_fields on Create Organization and Update Organization.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ organization_fields: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organization_fields.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ organization_fields: response.organization_fields,
+ count: response.organization_fields.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-ticket-fields.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-ticket-fields.ts
new file mode 100644
index 00000000000..51338953d54
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-ticket-fields.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListTicketFieldsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketFields = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_fields',
+ outputSchema: zendeskListTicketFieldsOutputSchema,
+ displayName: 'List Ticket Fields',
+ description: 'List system and custom ticket fields.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists ticket fields with their IDs, types and dropdown option values. Use the IDs and option values in Custom Fields on Create Ticket and Update Ticket.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ ticket_fields: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/ticket_fields.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ ticket_fields: response.ticket_fields,
+ count: response.ticket_fields.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-ticket-forms.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-ticket-forms.ts
new file mode 100644
index 00000000000..6e8707e6388
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-ticket-forms.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskListTicketFormsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketForms = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_forms',
+ outputSchema: zendeskListTicketFormsOutputSchema,
+ displayName: 'List Ticket Forms',
+ description: 'List ticket forms.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists ticket forms with the ticket field IDs each one shows, for Ticket Form ID on Create Ticket.',
+ idempotent: true,
+ },
+ props: {
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ ticket_forms: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/ticket_forms.json`,
+ queryParams: zendeskApi.query({ active: propsValue.active }),
+ });
+ return { ticket_forms: response.ticket_forms, count: response.ticket_forms.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-user-fields.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-user-fields.ts
new file mode 100644
index 00000000000..baf7a250950
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/lookups/list-user-fields.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListUserFieldsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListUserFields = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_user_fields',
+ outputSchema: zendeskListUserFieldsOutputSchema,
+ displayName: 'List User Fields',
+ description: 'List the custom user fields.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists custom user fields with their keys, types and options, for user_fields on Create User and Update User.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ user_fields: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/user_fields.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ user_fields: response.user_fields,
+ count: response.user_fields.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/macros/get-macro.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/get-macro.ts
new file mode 100644
index 00000000000..ee45e1c8285
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/get-macro.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetMacroOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetMacro = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_macro',
+ outputSchema: zendeskGetMacroOutputSchema,
+ displayName: 'Get Macro',
+ description: 'Get a macro by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one macro with its title, description and the actions it applies (comment text, status, tags, fields).',
+ idempotent: true,
+ },
+ props: {
+ macro_id: zendeskAiProps.requiredId({ displayName: 'Macro ID', description: 'Numeric macro ID, from List Macros or Search Macros.' }),
+ },
+ async run({ auth, propsValue }) {
+ const macroId = zendeskApi.id({ value: propsValue.macro_id, label: 'Macro ID' });
+ const response = await zendeskApi.request<{ macro: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/macros/${macroId}.json`,
+ });
+ return response.macro;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/macros/list-macros.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/list-macros.ts
new file mode 100644
index 00000000000..b364789faa4
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/list-macros.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListMacrosOutputSchema } from '../../../output-schemas';
+
+export const zendeskListMacros = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_macros',
+ outputSchema: zendeskListMacrosOutputSchema,
+ displayName: 'List Macros',
+ description: 'List the macros available to the connected agent.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists macros, the canned responses and field changes agents apply to tickets, with their actions. Use Search Macros to find one by title, then Preview Macro on Ticket to see its effect.',
+ idempotent: true,
+ },
+ props: {
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ access: Property.StaticDropdown({
+ displayName: 'Access',
+ description: 'Only return macros with this visibility.',
+ required: false,
+ options: { options: [{ label: 'Personal', value: 'personal' }, { label: 'Agents', value: 'agents' }, { label: 'Shared', value: 'shared' }, { label: 'Account', value: 'account' }] },
+ }),
+ group_id: Property.ShortText({ displayName: 'Group ID', description: 'Only return macros available to this group, from List Groups.', required: false }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ macros: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/macros.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ active: propsValue.active, access: propsValue.access, group_id: propsValue.group_id }),
+ },
+ });
+ return {
+ macros: response.macros,
+ count: response.macros.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/macros/preview-macro-on-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/preview-macro-on-ticket.ts
new file mode 100644
index 00000000000..37341928259
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/preview-macro-on-ticket.ts
@@ -0,0 +1,35 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskPreviewMacroOnTicketOutputSchema } from '../../../output-schemas';
+
+export const zendeskPreviewMacroOnTicket = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_preview_macro_on_ticket',
+ outputSchema: zendeskPreviewMacroOnTicketOutputSchema,
+ displayName: 'Preview Macro on Ticket',
+ description: 'Show how a ticket would look after applying a macro.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Computes the changes a macro would make to one ticket, including the rendered comment text, without saving anything. To apply it, pass the returned ticket fields and comment to Update Ticket and Add Ticket Comment.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ macro_id: zendeskAiProps.requiredId({ displayName: 'Macro ID', description: 'Numeric macro ID, from List Macros or Search Macros.' }),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const macroId = zendeskApi.id({ value: propsValue.macro_id, label: 'Macro ID' });
+ const response = await zendeskApi.request<{ result: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/macros/${macroId}/apply.json`,
+ });
+ return response.result;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/macros/search-macros.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/search-macros.ts
new file mode 100644
index 00000000000..686f3701758
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/macros/search-macros.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskSearchMacrosOutputSchema } from '../../../output-schemas';
+
+export const zendeskSearchMacros = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_search_macros',
+ outputSchema: zendeskSearchMacrosOutputSchema,
+ displayName: 'Search Macros',
+ description: 'Search macros by title.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Finds macros whose title matches the query. Use the returned macro ID with Get Macro or Preview Macro on Ticket.',
+ idempotent: true,
+ },
+ props: {
+ query: Property.ShortText({ displayName: 'Query', description: 'Text to match against macro titles.', required: true }),
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ limit: zendeskAiProps.limit(),
+ page: zendeskAiProps.page(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ macros: unknown[]; next_page?: string | null }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/macros/search.json`,
+ queryParams: {
+ ...zendeskApi.offsetQuery({ limit: propsValue.limit, page: propsValue.page }),
+ ...zendeskApi.query({ query: propsValue.query, active: propsValue.active }),
+ },
+ });
+ return {
+ macros: response.macros,
+ count: response.macros.length,
+ ...zendeskApi.offsetResult({ nextPage: response.next_page, page: propsValue.page }),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/add-organization-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/add-organization-tags.ts
new file mode 100644
index 00000000000..9a1ec4a55c8
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/add-organization-tags.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskAddOrganizationTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_add_organization_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Add Organization Tags',
+ description: 'Add tags to an organization, keeping existing tags.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds tags to one organization and keeps the tags already on it; re-adding an existing tag changes nothing. Returns the full tag list.',
+ idempotent: true,
+ },
+ props: {
+ organization_id: zendeskAiProps.requiredId({ displayName: 'Organization ID', description: 'Numeric organization ID, from Search Organizations or List Organizations.' }),
+ tags: Property.Array({ displayName: 'Tags', description: 'Tags to add; tags are lowercase and cannot contain spaces.', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ const organizationId = zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' });
+ const tags = zendeskApi.stringList(propsValue.tags);
+ if (tags.length === 0) {
+ throw new Error('Tags must contain at least one tag.');
+ }
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/organizations/${organizationId}/tags.json`,
+ body: { tags },
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-or-update-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-or-update-organization.ts
new file mode 100644
index 00000000000..446e3aa6282
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-or-update-organization.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskOrganizationFields } from './organization-fields';
+import { zendeskCreateOrUpdateOrganizationOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateOrUpdateOrganization = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_or_update_organization',
+ outputSchema: zendeskCreateOrUpdateOrganizationOutputSchema,
+ displayName: 'Create or Update Organization',
+ description: 'Update the organization with this external ID, or create one.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Upserts one organization: Zendesk matches an existing organization by External ID and updates the given fields, otherwise creates it with Name. created is true when a new organization was made. Safe to retry. Use Update Organization when you already hold the organization ID.',
+ idempotent: true,
+ },
+ props: zendeskOrganizationFields.props({ nameRequired: true }),
+ async run({ auth, propsValue }) {
+ if (!propsValue.external_id) {
+ throw new Error('Pass External ID so Zendesk can match an existing organization.');
+ }
+ const response = await zendeskApi.send<{ organization: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/organizations/create_or_update.json',
+ body: { organization: zendeskOrganizationFields.body(propsValue) },
+ });
+ return { created: response.status === 201, organization: response.body.organization };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-organization-membership.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-organization-membership.ts
new file mode 100644
index 00000000000..8d5b9a25554
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-organization-membership.ts
@@ -0,0 +1,47 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCreateOrganizationMembershipOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateOrganizationMembership = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_organization_membership',
+ outputSchema: zendeskCreateOrganizationMembershipOutputSchema,
+ displayName: 'Create Organization Membership',
+ description: 'Add a user to an organization.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a user to an organization. Users can belong to several organizations only when the account allows it; otherwise use Update User with Organization ID. Fails with 422 when the membership already exists. Remove it with Delete Organization Membership.',
+ idempotent: false,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users.' }),
+ organization_id: zendeskAiProps.requiredId({
+ displayName: 'Organization ID',
+ description: 'Numeric organization ID, from Search Organizations.',
+ }),
+ default: zendeskAiProps.optionalBoolean({
+ displayName: 'Default',
+ description: 'Make this the user default organization for new tickets.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ organization_membership: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/organization_memberships.json',
+ body: {
+ organization_membership: zendeskApi.compact({
+ user_id: Number(zendeskApi.id({ value: propsValue.user_id, label: 'User ID' })),
+ organization_id: Number(zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' })),
+ default: zendeskApi.optionalBoolean(propsValue.default),
+ }),
+ },
+ });
+ return response.organization_membership;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-organization.ts
new file mode 100644
index 00000000000..96cdfc1b5ca
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/create-organization.ts
@@ -0,0 +1,31 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskOrganizationFields } from './organization-fields';
+import { zendeskGetOrganizationOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateOrganization = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_organization',
+ outputSchema: zendeskGetOrganizationOutputSchema,
+ displayName: 'Create Organization',
+ description: 'Create an organization.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates one organization. Fails with 422 when the name is already taken, so use Create or Update Organization to avoid duplicates, or Search Organizations first. Not idempotent. Requires an admin or an agent allowed to manage organizations.',
+ idempotent: false,
+ },
+ props: zendeskOrganizationFields.props({ nameRequired: true }),
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ organization: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/organizations.json',
+ body: { organization: zendeskOrganizationFields.body(propsValue) },
+ });
+ return response.organization;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/delete-organization-membership.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/delete-organization-membership.ts
new file mode 100644
index 00000000000..fd9baa422f1
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/delete-organization-membership.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskDeleteOrganizationMembershipOutputSchema } from '../../../output-schemas';
+
+export const zendeskDeleteOrganizationMembership = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_delete_organization_membership',
+ outputSchema: zendeskDeleteOrganizationMembershipOutputSchema,
+ displayName: 'Delete Organization Membership',
+ description: 'Remove a user from an organization.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Removes a user from an organization by deleting the membership; the user and organization remain. The membership ID comes from List Organization Memberships.',
+ idempotent: true,
+ },
+ props: {
+ organization_membership_id: zendeskAiProps.requiredId({ displayName: 'Organization Membership ID', description: 'Numeric membership ID, from List Organization Memberships.' }),
+ },
+ async run({ auth, propsValue }) {
+ const organizationMembershipId = zendeskApi.id({ value: propsValue.organization_membership_id, label: 'Organization Membership ID' });
+ await zendeskApi.request<unknown>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/organization_memberships/${organizationMembershipId}.json`,
+ });
+ return { success: true, organization_membership_id: Number(organizationMembershipId) };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/delete-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/delete-organization.ts
new file mode 100644
index 00000000000..68b0c39dd15
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/delete-organization.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskDeleteOrganizationOutputSchema } from '../../../output-schemas';
+
+export const zendeskDeleteOrganization = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_delete_organization',
+ outputSchema: zendeskDeleteOrganizationOutputSchema,
+ displayName: 'Delete Organization',
+ description: 'Delete an organization.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one organization; its users and tickets remain but lose the association. Cannot be undone. Requires an admin.',
+ idempotent: false,
+ },
+ props: {
+ organization_id: zendeskAiProps.requiredId({ displayName: 'Organization ID', description: 'Numeric organization ID, from Search Organizations or List Organizations.' }),
+ },
+ async run({ auth, propsValue }) {
+ const organizationId = zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' });
+ await zendeskApi.request<unknown>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/organizations/${organizationId}.json`,
+ });
+ return { success: true, organization_id: Number(organizationId) };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/get-organization-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/get-organization-tags.ts
new file mode 100644
index 00000000000..e6e631a9957
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/get-organization-tags.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetOrganizationTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_organization_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Get Organization Tags',
+ description: 'List the tags on an organization.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Lists the tags on one organization. Change them with Add Organization Tags or Remove Organization Tags.',
+ idempotent: true,
+ },
+ props: {
+ organization_id: zendeskAiProps.requiredId({ displayName: 'Organization ID', description: 'Numeric organization ID, from Search Organizations or List Organizations.' }),
+ },
+ async run({ auth, propsValue }) {
+ const organizationId = zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' });
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations/${organizationId}/tags.json`,
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/get-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/get-organization.ts
new file mode 100644
index 00000000000..db5d6b7742b
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/get-organization.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetOrganizationOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetOrganization = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_organization',
+ outputSchema: zendeskGetOrganizationOutputSchema,
+ displayName: 'Get Organization',
+ description: 'Get an organization by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one organization by numeric ID, with domain names, group, notes, tags and organization fields. Use Search Organizations to find one by name or external ID.',
+ idempotent: true,
+ },
+ props: {
+ organization_id: zendeskAiProps.requiredId({ displayName: 'Organization ID', description: 'Numeric organization ID, from Search Organizations or List Organizations.' }),
+ },
+ async run({ auth, propsValue }) {
+ const organizationId = zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' });
+ const response = await zendeskApi.request<{ organization: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations/${organizationId}.json`,
+ });
+ return response.organization;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organization-memberships.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organization-memberships.ts
new file mode 100644
index 00000000000..f89b47258a6
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organization-memberships.ts
@@ -0,0 +1,50 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListOrganizationMembershipsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListOrganizationMemberships = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_organization_memberships',
+ outputSchema: zendeskListOrganizationMembershipsOutputSchema,
+ displayName: 'List Organization Memberships',
+ description: 'List which users belong to which organizations.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists organization memberships, each linking a user to an organization and flagging the default one. Pass User ID for one user organizations, or Organization ID for one organization members; omit both for the whole account. Membership IDs feed Delete Organization Membership.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.optionalId({ displayName: 'User ID', description: 'Only memberships of this user.' }),
+ organization_id: zendeskAiProps.optionalId({
+ displayName: 'Organization ID',
+ description: 'Only memberships of this organization.',
+ }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.optionalId({ value: propsValue.user_id, label: 'User ID' });
+ const organizationId = zendeskApi.optionalId({ value: propsValue.organization_id, label: 'Organization ID' });
+ if (userId !== undefined && organizationId !== undefined) {
+ throw new Error('Pass User ID or Organization ID, not both.');
+ }
+ const scope =
+ userId !== undefined ? `/users/${userId}` : organizationId !== undefined ? `/organizations/${organizationId}` : '';
+ const response = await zendeskApi.request<{ organization_memberships: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `${scope}/organization_memberships.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ organization_memberships: response.organization_memberships,
+ count: response.organization_memberships.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organization-users.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organization-users.ts
new file mode 100644
index 00000000000..c4c1406f8af
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organization-users.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListOrganizationUsersOutputSchema } from '../../../output-schemas';
+
+export const zendeskListOrganizationUsers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_organization_users',
+ outputSchema: zendeskListOrganizationUsersOutputSchema,
+ displayName: 'List Organization Users',
+ description: 'List the users in an organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the users that belong to one organization, optionally only one role. Use List Organization Memberships for the membership records and their IDs.',
+ idempotent: true,
+ },
+ props: {
+ organization_id: zendeskAiProps.requiredId({ displayName: 'Organization ID', description: 'Numeric organization ID, from Search Organizations or List Organizations.' }),
+ role: Property.StaticDropdown({
+ displayName: 'Role',
+ description: 'Only return users with this role.',
+ required: false,
+ options: { options: [{ label: 'End user', value: 'end-user' }, { label: 'Agent', value: 'agent' }, { label: 'Admin', value: 'admin' }] },
+ }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const organizationId = zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' });
+ const response = await zendeskApi.request<{ users: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations/${organizationId}/users.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ role: propsValue.role }),
+ },
+ });
+ return {
+ users: response.users,
+ count: response.users.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organizations.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organizations.ts
new file mode 100644
index 00000000000..6d0bd37a304
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/list-organizations.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListOrganizationsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListOrganizations = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_organizations',
+ outputSchema: zendeskListOrganizationsOutputSchema,
+ displayName: 'List Organizations',
+ description: 'List organizations.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists organizations one page at a time. Use Search Organizations to find one by name or external ID.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ organizations: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ organizations: response.organizations,
+ count: response.organizations.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/organization-fields.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/organization-fields.ts
new file mode 100644
index 00000000000..31081d9f37f
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/organization-fields.ts
@@ -0,0 +1,83 @@
+import { Property } from '@activepieces/pieces-framework';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+
+function props({ nameRequired }: { nameRequired: boolean }) {
+ return {
+ name: Property.ShortText({ displayName: 'Name', description: 'Unique organization name.', required: nameRequired }),
+ external_id: Property.ShortText({
+ displayName: 'External ID',
+ description: 'Your own reference for the organization.',
+ required: false,
+ }),
+ domain_names: Property.Array({
+ displayName: 'Domain Names',
+ description: 'Email domains; new end users with these domains join the organization. Replaces the existing list; an empty list is ignored.',
+ required: false,
+ }),
+ group_id: zendeskAiProps.optionalId({
+ displayName: 'Group ID',
+ description: 'Group that new tickets from this organization go to, from List Groups.',
+ }),
+ details: Property.LongText({ displayName: 'Details', description: 'Details such as an address.', required: false }),
+ notes: Property.LongText({ displayName: 'Notes', description: 'Internal notes visible to agents.', required: false }),
+ tags: Property.Array({
+ displayName: 'Tags',
+ description: 'Replaces every tag on the organization; an empty list is ignored. Prefer Add Organization Tags or Remove Organization Tags on existing ones, which also clear tags.',
+ required: false,
+ }),
+ organization_fields: Property.Json({
+ displayName: 'Organization Fields',
+ description: 'Object of custom organization field keys to values, keys from List Organization Fields.',
+ required: false,
+ }),
+ shared_tickets: zendeskAiProps.optionalBoolean({
+ displayName: 'Shared Tickets',
+ description: 'Whether members can see each other tickets.',
+ }),
+ shared_comments: zendeskAiProps.optionalBoolean({
+ displayName: 'Shared Comments',
+ description: 'Whether members can comment on each other tickets.',
+ }),
+ additional_fields: zendeskAiProps.additionalFields({
+ description: 'Other organization attributes from the Zendesk Organizations API, or null values to clear fields.',
+ }),
+ };
+}
+
+function body(values: OrganizationFieldValues): Record<string, unknown> {
+ const tags = zendeskApi.stringList(values.tags);
+ const domainNames = zendeskApi.stringList(values.domain_names);
+ const organizationFields = zendeskApi.jsonObject({ value: values.organization_fields, label: 'Organization Fields' });
+ return {
+ ...zendeskApi.jsonObject({ value: values.additional_fields, label: 'Additional Fields' }),
+ ...zendeskApi.compact({
+ name: values.name,
+ external_id: values.external_id,
+ domain_names: domainNames.length > 0 ? domainNames : undefined,
+ group_id: zendeskApi.optionalId({ value: values.group_id, label: 'Group ID' }),
+ details: values.details,
+ notes: values.notes,
+ tags: tags.length > 0 ? tags : undefined,
+ organization_fields: Object.keys(organizationFields).length > 0 ? organizationFields : undefined,
+ shared_tickets: zendeskApi.optionalBoolean(values.shared_tickets),
+ shared_comments: zendeskApi.optionalBoolean(values.shared_comments),
+ }),
+ };
+}
+
+export const zendeskOrganizationFields = { props, body };
+
+type OrganizationFieldValues = {
+ name?: string;
+ external_id?: string;
+ domain_names?: unknown[];
+ group_id?: string;
+ details?: string;
+ notes?: string;
+ tags?: unknown[];
+ organization_fields?: unknown;
+ shared_tickets?: string;
+ shared_comments?: string;
+ additional_fields?: unknown;
+};
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/remove-organization-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/remove-organization-tags.ts
new file mode 100644
index 00000000000..96070c16249
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/remove-organization-tags.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskRemoveOrganizationTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_remove_organization_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Remove Organization Tags',
+ description: 'Remove tags from an organization.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Removes the given tags from one organization and keeps the rest; tags not on it are ignored. Returns the remaining tag list.',
+ idempotent: true,
+ },
+ props: {
+ organization_id: zendeskAiProps.requiredId({ displayName: 'Organization ID', description: 'Numeric organization ID, from Search Organizations or List Organizations.' }),
+ tags: Property.Array({ displayName: 'Tags', description: 'Tags to remove; tags are lowercase and cannot contain spaces.', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ const organizationId = zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' });
+ const tags = zendeskApi.stringList(propsValue.tags);
+ if (tags.length === 0) {
+ throw new Error('Tags must contain at least one tag.');
+ }
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/organizations/${organizationId}/tags.json`,
+ queryParams: {
+ tags: tags.join(','),
+ },
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/search-organizations.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/search-organizations.ts
new file mode 100644
index 00000000000..b68acffb00d
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/search-organizations.ts
@@ -0,0 +1,33 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskSearchOrganizationsOutputSchema } from '../../../output-schemas';
+
+export const zendeskSearchOrganizations = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_search_organizations',
+ outputSchema: zendeskSearchOrganizationsOutputSchema,
+ displayName: 'Search Organizations',
+ description: 'Find organizations by exact name or external ID.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Finds organizations by exact name or exact external ID; pass one of the two. Use Search with type:organization for partial or attribute matches.',
+ idempotent: true,
+ },
+ props: {
+ name: Property.ShortText({ displayName: 'Name', description: 'Exact organization name.', required: false }),
+ external_id: Property.ShortText({ displayName: 'External ID', description: 'Exact organization external ID.', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ organizations: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations/search.json`,
+ queryParams: zendeskApi.query({ name: propsValue.name, external_id: propsValue.external_id }),
+ });
+ return { organizations: response.organizations, count: response.organizations.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/update-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/update-organization.ts
new file mode 100644
index 00000000000..18181fa448c
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/organizations/update-organization.ts
@@ -0,0 +1,43 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskOrganizationFields } from './organization-fields';
+import { zendeskGetOrganizationOutputSchema } from '../../../output-schemas';
+
+export const zendeskUpdateOrganization = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_update_organization',
+ outputSchema: zendeskGetOrganizationOutputSchema,
+ displayName: 'Update Organization',
+ description: 'Change fields on an existing organization.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates one organization by ID; omitted fields keep their values. Tags and Domain Names replace the whole list, so prefer Add Organization Tags or Remove Organization Tags for tags. Requires an admin or an agent allowed to manage organizations.',
+ idempotent: true,
+ },
+ props: {
+ organization_id: zendeskAiProps.requiredId({
+ displayName: 'Organization ID',
+ description: 'Numeric organization ID, from Search Organizations or List Organizations.',
+ }),
+ ...zendeskOrganizationFields.props({ nameRequired: false }),
+ },
+ async run({ auth, propsValue }) {
+ const organizationId = zendeskApi.id({ value: propsValue.organization_id, label: 'Organization ID' });
+ const organization = zendeskOrganizationFields.body(propsValue);
+ if (Object.keys(organization).length === 0) {
+ throw new Error('Provide at least one field to update.');
+ }
+ const response = await zendeskApi.request<{ organization: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/organizations/${organizationId}.json`,
+ body: { organization },
+ });
+ return response.organization;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/search/count-search-results.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/search/count-search-results.ts
new file mode 100644
index 00000000000..31907e54cb5
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/search/count-search-results.ts
@@ -0,0 +1,32 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskCountSearchResultsOutputSchema } from '../../../output-schemas';
+
+export const zendeskCountSearchResults = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_count_search_results',
+ outputSchema: zendeskCountSearchResultsOutputSchema,
+ displayName: 'Count Search Results',
+ description: 'Count the records matching a search query.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns how many tickets, users or organizations match a Zendesk search query, using the same syntax as Search (e.g. "type:ticket status:open"). Use it to size a result before paging through Search.',
+ idempotent: true,
+ },
+ props: {
+ query: Property.ShortText({ displayName: 'Query', description: 'Zendesk search query, e.g. type:ticket status:open tags:vip.', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ count: number }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/search/count.json`,
+ queryParams: zendeskApi.query({ query: propsValue.query }),
+ });
+ return { count: response.count };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/search/count-view-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/search/count-view-tickets.ts
new file mode 100644
index 00000000000..d3e55ab4ae1
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/search/count-view-tickets.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCountViewTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskCountViewTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_count_view_tickets',
+ outputSchema: zendeskCountViewTicketsOutputSchema,
+ displayName: 'Count View Tickets',
+ description: 'Count the tickets in a view.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the number of tickets in one view. Counts are cached by Zendesk and can be a few minutes old; fresh is false while a new count is computed.',
+ idempotent: true,
+ },
+ props: {
+ view_id: zendeskAiProps.requiredId({ displayName: 'View ID', description: 'Numeric view ID from List Views, or incoming, my or my_groups.' }),
+ },
+ async run({ auth, propsValue }) {
+ const viewId = zendeskApi.pathSegment({ value: propsValue.view_id, label: 'View ID' });
+ const response = await zendeskApi.request<{ view_count: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/views/${viewId}/count.json`,
+ });
+ return response.view_count;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/search/list-view-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/search/list-view-tickets.ts
new file mode 100644
index 00000000000..75884afc27c
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/search/list-view-tickets.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListViewTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListViewTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_view_tickets',
+ outputSchema: zendeskListViewTicketsOutputSchema,
+ displayName: 'List View Tickets',
+ description: 'List the tickets in a view.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the tickets currently matching one view, in the view sort order. View IDs come from List Views; the built-in views incoming, my and my_groups also work. Use Search for ad-hoc filters. Pass next_cursor back as Cursor while has_more is true.',
+ idempotent: true,
+ },
+ props: {
+ view_id: zendeskAiProps.requiredId({ displayName: 'View ID', description: 'Numeric view ID from List Views, or incoming, my or my_groups.' }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const viewId = zendeskApi.pathSegment({ value: propsValue.view_id, label: 'View ID' });
+ const response = await zendeskApi.request<{ tickets: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/views/${viewId}/tickets.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return { tickets: response.tickets, count: response.tickets.length, ...zendeskApi.cursorResult(response.meta) };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/search/list-views.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/search/list-views.ts
new file mode 100644
index 00000000000..0d93bfc3362
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/search/list-views.ts
@@ -0,0 +1,53 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListViewsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListViews = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_views',
+ outputSchema: zendeskListViewsOutputSchema,
+ displayName: 'List Views',
+ description: 'List the ticket views available to the connected agent.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists ticket views, the saved ticket filters agents work from, with their conditions. Use a view ID with List View Tickets or Count View Tickets.',
+ idempotent: true,
+ },
+ props: {
+ active: Property.StaticDropdown({
+ displayName: 'Active',
+ description: 'Filter by active (Yes) or inactive (No). Omit for both.',
+ required: false,
+ options: { options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ access: Property.StaticDropdown({
+ displayName: 'Access',
+ description: 'Only return views with this visibility.',
+ required: false,
+ options: { options: [{ label: 'Personal', value: 'personal' }, { label: 'Shared', value: 'shared' }, { label: 'Account', value: 'account' }] },
+ }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ views: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/views.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ active: propsValue.active, access: propsValue.access }),
+ },
+ });
+ return {
+ views: response.views,
+ count: response.views.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/search/search.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/search/search.ts
new file mode 100644
index 00000000000..77ce1a0a338
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/search/search.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskSearchOutputSchema } from '../../../output-schemas';
+
+export const zendeskSearch = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_search',
+ outputSchema: zendeskSearchOutputSchema,
+ displayName: 'Search',
+ description: 'Search tickets, users and organizations with Zendesk search syntax.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches tickets, users and organizations with Zendesk search syntax, e.g. "type:ticket status<solved requester:[email protected]", "type:ticket tags:vip created>2026-01-01" or "type:organization name:Acme*". Always include type: to get one kind of record; each result has result_type. Returns at most 1000 results in total; narrow the query instead of paging deeper. The index lags writes by a few minutes, so use Get Ticket for a just-created record.',
+ idempotent: true,
+ },
+ props: {
+ query: Property.LongText({
+ displayName: 'Query',
+ description: 'Zendesk search query, e.g. type:ticket status:open assignee:me.',
+ required: true,
+ }),
+ sort_by: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Defaults to relevance.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Updated at', value: 'updated_at' },
+ { label: 'Created at', value: 'created_at' },
+ { label: 'Priority', value: 'priority' },
+ { label: 'Status', value: 'status' },
+ { label: 'Ticket type', value: 'ticket_type' },
+ ],
+ },
+ }),
+ sort_order: zendeskAiProps.sortOrder(),
+ limit: zendeskAiProps.limit(),
+ page: zendeskAiProps.page(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ results: unknown[]; count: number; next_page?: string | null }>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/search.json',
+ queryParams: {
+ ...zendeskApi.offsetQuery({ limit: propsValue.limit, page: propsValue.page }),
+ ...zendeskApi.query({
+ query: propsValue.query,
+ sort_by: propsValue.sort_by,
+ sort_order: propsValue.sort_order,
+ }),
+ },
+ });
+ return {
+ results: response.results,
+ count: response.results.length,
+ total_count: response.count,
+ ...zendeskApi.offsetResult({ nextPage: response.next_page, page: propsValue.page }),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/add-ticket-comment.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/add-ticket-comment.ts
new file mode 100644
index 00000000000..7fa026a0b27
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/add-ticket-comment.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddTicketCommentOutputSchema } from '../../../output-schemas';
+
+export const zendeskAddTicketComment = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_add_ticket_comment',
+ outputSchema: zendeskAddTicketCommentOutputSchema,
+ displayName: 'Add Ticket Comment',
+ description: 'Reply to a ticket or add an internal note.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a comment to a ticket: a public reply emailed to the requester, or an internal note when Public is false. Optionally sets the ticket status in the same update, e.g. pending after asking the customer a question. Not idempotent: every call appends another comment, so check List Ticket Comments before retrying.',
+ idempotent: false,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ body: Property.LongText({ displayName: 'Comment Body', required: true }),
+ is_html: Property.Checkbox({
+ displayName: 'Comment Is HTML',
+ description: 'Send Comment Body as HTML instead of plain text.',
+ required: false,
+ }),
+ public: zendeskAiProps.optionalBoolean({
+ displayName: 'Public',
+ description: 'Yes (default) replies to the requester; No adds an internal note only agents see.',
+ }),
+ author_id: zendeskAiProps.optionalId({
+ displayName: 'Author ID',
+ description: 'User ID to post as. Defaults to the connected user.',
+ }),
+ status: zendeskAiProps.ticketStatus({ description: 'Optional status to set together with the comment.' }),
+ },
+ async run({ auth, propsValue }) {
+ const p = propsValue;
+ const ticketId = zendeskApi.id({ value: p.ticket_id, label: 'Ticket ID' });
+ return zendeskApi.request<{ ticket: Record<string, unknown>; audit: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/tickets/${ticketId}.json`,
+ body: {
+ ticket: zendeskApi.compact({
+ comment: zendeskApi.compact({
+ [p.is_html ? 'html_body' : 'body']: p.body,
+ public: zendeskApi.optionalBoolean(p.public),
+ author_id: zendeskApi.optionalId({ value: p.author_id, label: 'Author ID' }),
+ }),
+ status: p.status,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/add-ticket-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/add-ticket-tags.ts
new file mode 100644
index 00000000000..c390bd6bce5
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/add-ticket-tags.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskAddTicketTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_add_ticket_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Add Ticket Tags',
+ description: 'Add tags to a ticket, keeping its existing tags.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds tags to one ticket and keeps the tags already on it; re-adding an existing tag changes nothing. Returns the full tag list. Update Ticket with Tags replaces the whole set instead. Pass Updated Stamp to fail with 409 rather than race a concurrent change.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ tags: Property.Array({ displayName: 'Tags', description: 'Tags to add; tags are lowercase and cannot contain spaces.', required: true }),
+ updated_stamp: Property.ShortText({
+ displayName: 'Updated Stamp',
+ description: 'The updated_at value read from Get Ticket; enables safe update so a concurrent change returns 409.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const tags = zendeskApi.stringList(propsValue.tags);
+ if (tags.length === 0) {
+ throw new Error('Tags must contain at least one tag.');
+ }
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/tickets/${ticketId}/tags.json`,
+ body: {
+ tags,
+ ...(propsValue.updated_stamp ? { safe_update: true, updated_stamp: propsValue.updated_stamp } : {}),
+ },
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/create-many-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/create-many-tickets.ts
new file mode 100644
index 00000000000..f3872c99b4c
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/create-many-tickets.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskCreateManyTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateManyTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_many_tickets',
+ outputSchema: zendeskCreateManyTicketsOutputSchema,
+ displayName: 'Create Many Tickets',
+ description: 'Queue the creation of up to 100 tickets.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Queues a background job that creates up to 100 tickets and returns the job status, not the tickets. Poll Get Job Status with the returned id until status is completed; its results list the new ticket IDs. Each ticket object needs a comment, e.g. {"subject": "...", "comment": {"body": "..."}, "requester": {"email": "..."}}. Not idempotent. Use Create Ticket for a single ticket.',
+ idempotent: false,
+ },
+ props: {
+ tickets: Property.Json({
+ displayName: 'Tickets',
+ description: 'JSON array of up to 100 ticket objects in the Zendesk Tickets API format.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const tickets = zendeskApi.jsonArray({ value: propsValue.tickets, label: 'Tickets' }) ?? [];
+ if (tickets.length === 0 || tickets.length > 100) {
+ throw new Error(`Tickets must hold 1 to 100 ticket objects, got ${tickets.length}.`);
+ }
+ const response = await zendeskApi.request<{ job_status: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/tickets/create_many.json',
+ body: { tickets },
+ });
+ return response.job_status;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/create-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/create-ticket.ts
new file mode 100644
index 00000000000..686c30bbf91
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/create-ticket.ts
@@ -0,0 +1,143 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCreateTicketOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateTicket = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_ticket',
+ outputSchema: zendeskCreateTicketOutputSchema,
+ displayName: 'Create Ticket',
+ description: 'Create a support ticket with a first comment.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates one Zendesk ticket whose first comment becomes its description. Identify the requester by Requester ID (from Search Users) or by Requester Email, which Zendesk creates as a new end user when no user has that email. Use Create Many Tickets for bulk creation. Not idempotent: each call creates a new ticket, so pass External ID and check with List Tickets before retrying.',
+ idempotent: false,
+ },
+ props: {
+ comment_body: Property.LongText({
+ displayName: 'Comment Body',
+ description: 'The first comment, which becomes the ticket description.',
+ required: true,
+ }),
+ comment_is_html: Property.Checkbox({
+ displayName: 'Comment Is HTML',
+ description: 'Send Comment Body as HTML instead of plain text.',
+ required: false,
+ }),
+ comment_public: zendeskAiProps.optionalBoolean({
+ displayName: 'Public Comment',
+ description: 'Whether the requester can see the first comment. Defaults to public.',
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ required: false,
+ }),
+ requester_id: zendeskAiProps.optionalId({
+ displayName: 'Requester ID',
+ description: 'User ID of the requester, from Search Users. Do not combine with Requester Email.',
+ }),
+ requester_email: Property.ShortText({
+ displayName: 'Requester Email',
+ description: 'Email of the requester; Zendesk creates the end user if none exists. Do not combine with Requester ID.',
+ required: false,
+ }),
+ requester_name: Property.ShortText({
+ displayName: 'Requester Name',
+ description: 'Name used when Requester Email creates a new end user.',
+ required: false,
+ }),
+ assignee_id: zendeskAiProps.optionalId({
+ displayName: 'Assignee ID',
+ description: 'Agent user ID, from List Users with role agent or List Group Users.',
+ }),
+ group_id: zendeskAiProps.optionalId({
+ displayName: 'Group ID',
+ description: 'Group ID, from List Groups.',
+ }),
+ organization_id: zendeskAiProps.optionalId({
+ displayName: 'Organization ID',
+ description: 'Organization ID, from Search Organizations.',
+ }),
+ status: zendeskAiProps.ticketStatus({ description: 'Initial status. Defaults to new, or open when an assignee is set.' }),
+ priority: zendeskAiProps.ticketPriority(),
+ type: zendeskAiProps.ticketType(),
+ problem_id: zendeskAiProps.optionalId({
+ displayName: 'Problem ID',
+ description: 'For type incident: the problem ticket ID, from List Problem Tickets.',
+ }),
+ due_at: Property.DateTime({
+ displayName: 'Due At',
+ description: 'Due date, only valid for type task.',
+ required: false,
+ }),
+ tags: Property.Array({
+ displayName: 'Tags',
+ required: false,
+ }),
+ external_id: Property.ShortText({
+ displayName: 'External ID',
+ description: 'Your own reference for the ticket, searchable with List Tickets.',
+ required: false,
+ }),
+ brand_id: zendeskAiProps.optionalId({
+ displayName: 'Brand ID',
+ description: 'Brand ID, from List Brands.',
+ }),
+ ticket_form_id: zendeskAiProps.optionalId({
+ displayName: 'Ticket Form ID',
+ description: 'Ticket form ID, from List Ticket Forms.',
+ }),
+ custom_fields: Property.Json({
+ displayName: 'Custom Fields',
+ description: 'Array of {"id": <ticket field ID from List Ticket Fields>, "value": <value>}.',
+ required: false,
+ }),
+ additional_fields: zendeskAiProps.additionalFields({
+ description: 'Other ticket attributes from the Zendesk Tickets API, e.g. {"email_ccs": [{"user_email": "[email protected]"}]}.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const p = propsValue;
+ if (p.requester_id && p.requester_email) {
+ throw new Error('Pass either Requester ID or Requester Email, not both.');
+ }
+ const tags = zendeskApi.stringList(p.tags);
+ const ticket = {
+ ...zendeskApi.jsonObject({ value: p.additional_fields, label: 'Additional Fields' }),
+ ...zendeskApi.compact({
+ subject: p.subject,
+ comment: zendeskApi.compact({
+ [p.comment_is_html ? 'html_body' : 'body']: p.comment_body,
+ public: zendeskApi.optionalBoolean(p.comment_public),
+ }),
+ requester_id: zendeskApi.optionalId({ value: p.requester_id, label: 'Requester ID' }),
+ requester: p.requester_email ? zendeskApi.compact({ email: p.requester_email, name: p.requester_name }) : undefined,
+ assignee_id: zendeskApi.optionalId({ value: p.assignee_id, label: 'Assignee ID' }),
+ group_id: zendeskApi.optionalId({ value: p.group_id, label: 'Group ID' }),
+ organization_id: zendeskApi.optionalId({ value: p.organization_id, label: 'Organization ID' }),
+ status: p.status,
+ priority: p.priority,
+ type: p.type,
+ problem_id: zendeskApi.optionalId({ value: p.problem_id, label: 'Problem ID' }),
+ due_at: p.due_at,
+ tags: tags.length > 0 ? tags : undefined,
+ external_id: p.external_id,
+ brand_id: zendeskApi.optionalId({ value: p.brand_id, label: 'Brand ID' }),
+ ticket_form_id: zendeskApi.optionalId({ value: p.ticket_form_id, label: 'Ticket Form ID' }),
+ custom_fields: zendeskApi.jsonArray({ value: p.custom_fields, label: 'Custom Fields' }),
+ }),
+ };
+ const response = await zendeskApi.request<{ ticket: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/tickets.json',
+ body: { ticket },
+ });
+ return response.ticket;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/delete-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/delete-ticket.ts
new file mode 100644
index 00000000000..3ea4c659057
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/delete-ticket.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskDeleteTicketOutputSchema } from '../../../output-schemas';
+
+export const zendeskDeleteTicket = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_delete_ticket',
+ outputSchema: zendeskDeleteTicketOutputSchema,
+ displayName: 'Delete Ticket',
+ description: 'Move a ticket to deleted tickets.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Soft-deletes one ticket: it moves to deleted tickets for 30 days and can be brought back with Restore Ticket until Zendesk purges it. Requires an admin or an agent with permission to delete tickets. Use Mark Tickets as Spam instead for spam, which also suspends the requester.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ await zendeskApi.request<unknown>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/tickets/${ticketId}.json`,
+ });
+ return { success: true, ticket_id: Number(ticketId) };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-attachment.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-attachment.ts
new file mode 100644
index 00000000000..cad4ee1a178
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-attachment.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetAttachmentOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetAttachment = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_attachment',
+ outputSchema: zendeskGetAttachmentOutputSchema,
+ displayName: 'Get Attachment',
+ description: 'Get an attachment, including its download URL.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one attachment by ID, with file name, content type, size, malware scan result and content_url to download it. Attachment IDs come from the attachments of List Ticket Comments.',
+ idempotent: true,
+ },
+ props: {
+ attachment_id: zendeskAiProps.requiredId({ displayName: 'Attachment ID', description: 'Numeric attachment ID, from List Ticket Comments.' }),
+ },
+ async run({ auth, propsValue }) {
+ const attachmentId = zendeskApi.id({ value: propsValue.attachment_id, label: 'Attachment ID' });
+ const response = await zendeskApi.request<{ attachment: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/attachments/${attachmentId}.json`,
+ });
+ return response.attachment;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-job-status.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-job-status.ts
new file mode 100644
index 00000000000..3372c7367b8
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-job-status.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetJobStatusOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetJobStatus = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_job_status',
+ outputSchema: zendeskGetJobStatusOutputSchema,
+ displayName: 'Get Job Status',
+ description: 'Check the progress of a background job.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Reads the status of a background job started by Create Many Tickets, Update Many Tickets, Merge Tickets or Mark Tickets as Spam: queued, working, completed, failed or killed, with per-item results once completed. Call again later while the status is queued or working; job statuses expire after about an hour.',
+ idempotent: true,
+ },
+ props: {
+ job_status_id: zendeskAiProps.requiredId({ displayName: 'Job Status ID', description: 'The id returned by a bulk or merge action.' }),
+ },
+ async run({ auth, propsValue }) {
+ const jobStatusId = zendeskApi.pathSegment({ value: propsValue.job_status_id, label: 'Job Status ID' });
+ const response = await zendeskApi.request<{ job_status: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/job_statuses/${jobStatusId}.json`,
+ });
+ return response.job_status;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-many-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-many-tickets.ts
new file mode 100644
index 00000000000..7d5e28d3b4a
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-many-tickets.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskGetManyTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetManyTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_many_tickets',
+ outputSchema: zendeskGetManyTicketsOutputSchema,
+ displayName: 'Get Many Tickets',
+ description: 'Get up to 100 tickets by their IDs in one call.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches up to 100 tickets by numeric ID in a single request. Prefer it over repeated Get Ticket calls. IDs that do not exist or are deleted are silently left out, so compare count with the number of IDs requested.',
+ idempotent: true,
+ },
+ props: {
+ ticket_ids: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'Up to 100 numeric ticket IDs.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ids = zendeskApi.idList({ values: propsValue.ticket_ids, label: 'Ticket IDs', max: 100 });
+ const response = await zendeskApi.request<{ tickets: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/tickets/show_many.json',
+ queryParams: { ids: ids.join(',') },
+ });
+ return { tickets: response.tickets, count: response.tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-conversation-log.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-conversation-log.ts
new file mode 100644
index 00000000000..b2c58d196ed
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-conversation-log.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetTicketConversationLogOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetTicketConversationLog = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_ticket_conversation_log',
+ outputSchema: zendeskGetTicketConversationLogOutputSchema,
+ displayName: 'Get Ticket Conversation Log',
+ description: 'Get the messaging conversation of a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the conversation events of a messaging ticket (web widget, mobile SDK, social messaging), including end-user and bot messages that List Ticket Comments does not show. Email and API tickets return few or no events.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ events: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/conversation_log.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ events: response.events,
+ count: response.events.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-metrics.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-metrics.ts
new file mode 100644
index 00000000000..2f84246d403
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-metrics.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetTicketMetricsOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetTicketMetrics = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_ticket_metrics',
+ outputSchema: zendeskGetTicketMetricsOutputSchema,
+ displayName: 'Get Ticket Metrics',
+ description: 'Get response and resolution metrics for a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches the metrics of one ticket: reply, reopen and assignee counts, first reply time, first and full resolution time, agent wait and requester wait time, in calendar and business minutes. Use List Ticket SLA Metrics for SLA targets and breaches.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ ticket_metric: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/metrics.json`,
+ });
+ return response.ticket_metric;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-tags.ts
new file mode 100644
index 00000000000..009a4603477
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket-tags.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetTicketTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_ticket_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Get Ticket Tags',
+ description: 'List the tags on a ticket.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Lists the tags currently on one ticket. Change them with Add Ticket Tags or Remove Ticket Tags.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/tags.json`,
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket.ts
new file mode 100644
index 00000000000..9002aabb21d
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/get-ticket.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCreateTicketOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetTicket = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_ticket',
+ outputSchema: zendeskCreateTicketOutputSchema,
+ displayName: 'Get Ticket',
+ description: 'Get a ticket by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one Zendesk ticket by numeric ID, including status, priority, requester, assignee, group, tags and custom field values. Use List Ticket Comments for the conversation and Get Many Tickets to read up to 100 tickets at once. Deleted tickets return not found; see List Deleted Tickets.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ ticket: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}.json`,
+ });
+ return response.ticket;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-deleted-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-deleted-tickets.ts
new file mode 100644
index 00000000000..4bd40f2b6cb
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-deleted-tickets.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListDeletedTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListDeletedTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_deleted_tickets',
+ outputSchema: zendeskListDeletedTicketsOutputSchema,
+ displayName: 'List Deleted Tickets',
+ description: 'List soft-deleted tickets that can still be restored.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists tickets deleted in the last 30 days, which Restore Ticket can bring back, with who deleted them and when. Requires an admin or an agent with permission to delete tickets. Pass next_cursor back as Cursor while has_more is true.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ deleted_tickets: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/deleted_tickets.json',
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ deleted_tickets: response.deleted_tickets,
+ count: response.deleted_tickets.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-problem-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-problem-tickets.ts
new file mode 100644
index 00000000000..7582a0e567d
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-problem-tickets.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListProblemTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListProblemTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_problem_tickets',
+ outputSchema: zendeskListProblemTicketsOutputSchema,
+ displayName: 'List Problem Tickets',
+ description: 'List tickets of type problem.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the tickets of type problem, which incidents can be linked to through Problem ID on Create Ticket or Update Ticket. Use List Ticket Incidents to see the incidents of one problem.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ tickets: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/problems.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ tickets: response.tickets,
+ count: response.tickets.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-suspended-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-suspended-tickets.ts
new file mode 100644
index 00000000000..904314385c5
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-suspended-tickets.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListSuspendedTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListSuspendedTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_suspended_tickets',
+ outputSchema: zendeskListSuspendedTicketsOutputSchema,
+ displayName: 'List Suspended Tickets',
+ description: 'List incoming messages held as suspended tickets.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists suspended tickets: incoming emails Zendesk held back (suspected spam, suspended sender, unverified address) with the cause of each. Recover them with Recover Suspended Tickets. Requires an unrestricted agent.',
+ idempotent: true,
+ },
+ props: {
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ suspended_tickets: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/suspended_tickets.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ suspended_tickets: response.suspended_tickets,
+ count: response.suspended_tickets.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-audits.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-audits.ts
new file mode 100644
index 00000000000..9c66bf9bbdb
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-audits.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListTicketAuditsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketAudits = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_audits',
+ outputSchema: zendeskListTicketAuditsOutputSchema,
+ displayName: 'List Ticket Audits',
+ description: 'List the change history of a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the audit trail of one ticket: every update, oldest first, with its author, channel and events (field changes, comments, notifications, triggers fired). Use it to answer who changed what and when; use List Ticket Comments when only the conversation matters.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ audits: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/audits.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ audits: response.audits,
+ count: response.audits.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-comments.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-comments.ts
new file mode 100644
index 00000000000..953c0623cd4
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-comments.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListTicketCommentsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketComments = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_comments',
+ outputSchema: zendeskListTicketCommentsOutputSchema,
+ displayName: 'List Ticket Comments',
+ description: 'List the comments on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the public replies and internal notes on one ticket, with author, body, attachments and public flag. Set Sort Order to newest first with Limit 1 to read the latest comment. Pass next_page back as Page while has_more is true. Comment IDs feed Make Comment Private and Redact Comment; attachment IDs feed Get Attachment.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ sort_order: Property.StaticDropdown({
+ displayName: 'Sort Order',
+ description: 'asc for oldest first (default), desc for newest first.',
+ required: false,
+ options: { options: [{ label: 'Oldest first', value: 'asc' }, { label: 'Newest first', value: 'desc' }] },
+ }),
+ limit: zendeskAiProps.limit(),
+ page: zendeskAiProps.page(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ comments: unknown[]; next_page?: string | null }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/comments.json`,
+ queryParams: {
+ ...zendeskApi.offsetQuery({ limit: propsValue.limit, page: propsValue.page }),
+ ...zendeskApi.query({ sort_order: propsValue.sort_order }),
+ },
+ });
+ return {
+ comments: response.comments,
+ count: response.comments.length,
+ ...zendeskApi.offsetResult({ nextPage: response.next_page, page: propsValue.page }),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-email-ccs.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-email-ccs.ts
new file mode 100644
index 00000000000..0e03423719c
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-email-ccs.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListTicketEmailCcsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketEmailCcs = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_email_ccs',
+ outputSchema: zendeskListTicketEmailCcsOutputSchema,
+ displayName: 'List Ticket Email CCs',
+ description: 'List the users copied on a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the users CCed on a ticket, who receive its public replies by email. Followers (agents notified internally) come from List Ticket Followers.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ users: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/email_ccs.json`,
+ });
+ return { users: response.users, count: response.users.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-followers.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-followers.ts
new file mode 100644
index 00000000000..dd490c421d2
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-followers.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetManyUsersOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketFollowers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_followers',
+ outputSchema: zendeskGetManyUsersOutputSchema,
+ displayName: 'List Ticket Followers',
+ description: 'List the agents following a ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the agents following a ticket, who get notified of its updates but are not emailed as CCs. Email CCs come from List Ticket Email CCs.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ users: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/followers.json`,
+ });
+ return { users: response.users, count: response.users.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-incidents.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-incidents.ts
new file mode 100644
index 00000000000..f0cbde21151
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-ticket-incidents.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListTicketIncidentsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTicketIncidents = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_ticket_incidents',
+ outputSchema: zendeskListTicketIncidentsOutputSchema,
+ displayName: 'List Ticket Incidents',
+ description: 'List the incidents linked to a problem ticket.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the incident tickets linked to one problem ticket. Problem ticket IDs come from List Problem Tickets. Returns an empty list for tickets that are not problems.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId({ description: 'Numeric ID of a ticket of type problem, from List Problem Tickets.' }),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const response = await zendeskApi.request<{ tickets: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tickets/${ticketId}/incidents.json`,
+ });
+ return { tickets: response.tickets, count: response.tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-tickets.ts
new file mode 100644
index 00000000000..2a5fdfbc3ef
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/list-tickets.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_tickets',
+ outputSchema: zendeskListTicketsOutputSchema,
+ displayName: 'List Tickets',
+ description: 'List tickets in the account, newest or oldest first.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists tickets across the account one page at a time, optionally filtered by External ID. Use Search for filtering by status, requester, tag, text or dates; use this to page through all tickets or to find a ticket by your own external ID. Pass next_cursor back as Cursor while has_more is true.',
+ idempotent: true,
+ },
+ props: {
+ external_id: Property.ShortText({
+ displayName: 'External ID',
+ description: 'Only return tickets with this external ID.',
+ required: false,
+ }),
+ sort: Property.StaticDropdown({
+ displayName: 'Sort',
+ required: false,
+ options: {
+ options: [
+ { label: 'ID (oldest first)', value: 'id' },
+ { label: 'ID (newest first)', value: '-id' },
+ { label: 'Updated (oldest first)', value: 'updated_at' },
+ { label: 'Updated (newest first)', value: '-updated_at' },
+ { label: 'Status (ascending)', value: 'status' },
+ { label: 'Status (descending)', value: '-status' },
+ ],
+ },
+ }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ tickets: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/tickets.json',
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...(propsValue.external_id ? { external_id: propsValue.external_id } : {}),
+ ...(propsValue.sort ? { sort: propsValue.sort } : {}),
+ },
+ });
+ return {
+ tickets: response.tickets,
+ count: response.tickets.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/make-comment-private.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/make-comment-private.ts
new file mode 100644
index 00000000000..2767f4a2852
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/make-comment-private.ts
@@ -0,0 +1,35 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskMakeCommentPrivateOutputSchema } from '../../../output-schemas';
+
+export const zendeskMakeCommentPrivate = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_make_comment_private',
+ outputSchema: zendeskMakeCommentPrivateOutputSchema,
+ displayName: 'Make Comment Private',
+ description: 'Turn a public ticket comment into an internal note.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Makes one public comment on a ticket private, hiding it from the requester; it cannot be made public again. The comment ID comes from List Ticket Comments. Use Redact Comment to remove sensitive text instead of hiding the whole comment.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ comment_id: zendeskAiProps.requiredId({ displayName: 'Comment ID', description: 'Numeric comment ID, from List Ticket Comments.' }),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const commentId = zendeskApi.id({ value: propsValue.comment_id, label: 'Comment ID' });
+ await zendeskApi.request<unknown>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/tickets/${ticketId}/comments/${commentId}/make_private.json`,
+ });
+ return { success: true, ticket_id: Number(ticketId), comment_id: Number(commentId) };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/mark-tickets-as-spam.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/mark-tickets-as-spam.ts
new file mode 100644
index 00000000000..d2dcabcbfd6
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/mark-tickets-as-spam.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskCreateManyTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskMarkTicketsAsSpam = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_mark_tickets_as_spam',
+ outputSchema: zendeskCreateManyTicketsOutputSchema,
+ displayName: 'Mark Tickets as Spam',
+ description: 'Mark up to 100 tickets as spam and suspend their requesters.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Queues a job that marks up to 100 tickets as spam: each ticket is deleted and its requester is suspended, so later email from them lands in suspended tickets. Use only for confirmed spam; use Delete Ticket to remove a ticket without suspending the requester. Returns the job status; poll Get Job Status with its id. Requires an agent with permission to delete tickets.',
+ idempotent: true,
+ },
+ props: {
+ ticket_ids: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'Up to 100 numeric ticket IDs.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ids = zendeskApi.idList({ values: propsValue.ticket_ids, label: 'Ticket IDs', max: 100 });
+ const response = await zendeskApi.request<{ job_status: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/tickets/mark_many_as_spam.json',
+ queryParams: { ids: ids.join(',') },
+ });
+ return response.job_status;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/merge-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/merge-tickets.ts
new file mode 100644
index 00000000000..7dedd6238c6
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/merge-tickets.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskMergeTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskMergeTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_merge_tickets',
+ outputSchema: zendeskMergeTicketsOutputSchema,
+ displayName: 'Merge Tickets',
+ description: 'Merge up to 5 tickets into a target ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Queues a job that merges up to 5 source tickets into the target ticket: sources are closed and their comments are linked into the target. Irreversible. Returns the job status; poll Get Job Status with its id. Closed tickets cannot be merged in either direction.',
+ idempotent: false,
+ },
+ props: {
+ target_ticket_id: zendeskAiProps.ticketId({ description: 'The ticket that remains open and receives the merge.' }),
+ source_ticket_ids: Property.Array({
+ displayName: 'Source Ticket IDs',
+ description: 'Up to 5 ticket IDs to merge into the target and close.',
+ required: true,
+ }),
+ target_comment: Property.LongText({
+ displayName: 'Target Comment',
+ description: 'Comment added to the target ticket. Zendesk writes a default one when empty.',
+ required: false,
+ }),
+ target_comment_is_public: Property.Checkbox({ displayName: 'Target Comment Is Public', required: false }),
+ source_comment: Property.LongText({
+ displayName: 'Source Comment',
+ description: 'Comment added to each source ticket. Zendesk writes a default one when empty.',
+ required: false,
+ }),
+ source_comment_is_public: Property.Checkbox({ displayName: 'Source Comment Is Public', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const p = propsValue;
+ const targetId = zendeskApi.id({ value: p.target_ticket_id, label: 'Target Ticket ID' });
+ const ids = zendeskApi.idList({ values: p.source_ticket_ids, label: 'Source Ticket IDs', max: 5 });
+ const response = await zendeskApi.request<{ job_status: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: `/tickets/${targetId}/merge.json`,
+ body: zendeskApi.compact({
+ ids: ids.map(Number),
+ target_comment: p.target_comment,
+ target_comment_is_public: p.target_comment_is_public,
+ source_comment: p.source_comment,
+ source_comment_is_public: p.source_comment_is_public,
+ }),
+ });
+ return response.job_status;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/recover-suspended-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/recover-suspended-tickets.ts
new file mode 100644
index 00000000000..e1db6fcab99
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/recover-suspended-tickets.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskRecoverSuspendedTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskRecoverSuspendedTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_recover_suspended_tickets',
+ outputSchema: zendeskRecoverSuspendedTicketsOutputSchema,
+ displayName: 'Recover Suspended Tickets',
+ description: 'Turn up to 100 suspended tickets into regular tickets.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Recovers up to 100 suspended tickets, turning each held message into a regular ticket (or a comment on the ticket it replied to). Suspended ticket IDs come from List Suspended Tickets. Not idempotent: a recovered suspended ticket no longer exists. Requires an unrestricted agent.',
+ idempotent: false,
+ },
+ props: {
+ suspended_ticket_ids: Property.Array({
+ displayName: 'Suspended Ticket IDs',
+ description: 'Up to 100 suspended ticket IDs, from List Suspended Tickets.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ids = zendeskApi.idList({ values: propsValue.suspended_ticket_ids, label: 'Suspended Ticket IDs', max: 100 });
+ const response = await zendeskApi.request<{ tickets: unknown[] }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/suspended_tickets/recover_many.json',
+ queryParams: { ids: ids.join(',') },
+ });
+ return { tickets: response.tickets, count: response.tickets.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/redact-comment.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/redact-comment.ts
new file mode 100644
index 00000000000..820de1ababd
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/redact-comment.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskRedactCommentOutputSchema } from '../../../output-schemas';
+
+export const zendeskRedactComment = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_redact_comment',
+ outputSchema: zendeskRedactCommentOutputSchema,
+ displayName: 'Redact Comment',
+ description: 'Permanently remove sensitive text or attachments from a ticket comment.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently redacts parts of one ticket comment, e.g. a card number or password. Read the comment html_body with List Ticket Comments, wrap each sensitive part in <redact></redact> tags, and pass that full HTML as HTML Body; or list attachment URLs to remove. Irreversible. Requires Agent Workspace and an agent allowed to delete tickets; does not work on closed tickets.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ comment_id: zendeskAiProps.requiredId({
+ displayName: 'Comment ID',
+ description: 'Numeric comment ID, from List Ticket Comments.',
+ }),
+ html_body: Property.LongText({
+ displayName: 'HTML Body',
+ description: 'The comment html_body with the text to remove wrapped in <redact></redact> tags.',
+ required: false,
+ }),
+ external_attachment_urls: Property.Array({
+ displayName: 'Attachment URLs',
+ description: 'content_url values of the comment attachments to redact.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const commentId = zendeskApi.id({ value: propsValue.comment_id, label: 'Comment ID' });
+ const urls = zendeskApi.stringList(propsValue.external_attachment_urls);
+ if (!propsValue.html_body && urls.length === 0) {
+ throw new Error('Pass HTML Body with <redact> tags or Attachment URLs.');
+ }
+ const response = await zendeskApi.request<{ comment: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/comment_redactions/${commentId}.json`,
+ body: zendeskApi.compact({
+ ticket_id: Number(ticketId),
+ html_body: propsValue.html_body,
+ external_attachment_urls: urls.length > 0 ? urls : undefined,
+ }),
+ });
+ return response.comment;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/remove-ticket-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/remove-ticket-tags.ts
new file mode 100644
index 00000000000..d49142717a1
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/remove-ticket-tags.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskRemoveTicketTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_remove_ticket_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Remove Ticket Tags',
+ description: 'Remove tags from a ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Removes the given tags from one ticket and keeps the rest; tags not on the ticket are ignored. Returns the remaining tag list.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ tags: Property.Array({ displayName: 'Tags', description: 'Tags to remove; tags are lowercase and cannot contain spaces.', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ const tags = zendeskApi.stringList(propsValue.tags);
+ if (tags.length === 0) {
+ throw new Error('Tags must contain at least one tag.');
+ }
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/tickets/${ticketId}/tags.json`,
+ queryParams: {
+ tags: tags.join(','),
+ },
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/restore-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/restore-ticket.ts
new file mode 100644
index 00000000000..e0142ffdf00
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/restore-ticket.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskDeleteTicketOutputSchema } from '../../../output-schemas';
+
+export const zendeskRestoreTicket = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_restore_ticket',
+ outputSchema: zendeskDeleteTicketOutputSchema,
+ displayName: 'Restore Ticket',
+ description: 'Restore a soft-deleted ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Restores a ticket removed by Delete Ticket, as long as Zendesk has not purged it yet (30 days). Find candidates with List Deleted Tickets. Requires an admin or an agent with permission to delete tickets.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId({ description: 'Numeric ID of the deleted ticket, from List Deleted Tickets.' }),
+ },
+ async run({ auth, propsValue }) {
+ const ticketId = zendeskApi.id({ value: propsValue.ticket_id, label: 'Ticket ID' });
+ await zendeskApi.request<unknown>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/deleted_tickets/${ticketId}/restore.json`,
+ });
+ return { success: true, ticket_id: Number(ticketId) };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/update-many-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/update-many-tickets.ts
new file mode 100644
index 00000000000..e585e7d0060
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/update-many-tickets.ts
@@ -0,0 +1,74 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCreateManyTicketsOutputSchema } from '../../../output-schemas';
+
+export const zendeskUpdateManyTickets = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_update_many_tickets',
+ outputSchema: zendeskCreateManyTicketsOutputSchema,
+ displayName: 'Update Many Tickets',
+ description: 'Apply the same change to up to 100 tickets.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Queues a background job that applies the same field changes to up to 100 tickets and returns the job status. Poll Get Job Status with the returned id for per-ticket results. Additional Tags and Remove Tags change tags without replacing the existing set. Use Update Ticket for a single ticket.',
+ idempotent: true,
+ },
+ props: {
+ ticket_ids: Property.Array({
+ displayName: 'Ticket IDs',
+ description: 'Up to 100 numeric ticket IDs.',
+ required: true,
+ }),
+ status: zendeskAiProps.ticketStatus({ description: 'New status for every ticket.' }),
+ priority: zendeskAiProps.ticketPriority(),
+ type: zendeskAiProps.ticketType(),
+ assignee_id: zendeskAiProps.optionalId({ displayName: 'Assignee ID', description: 'Agent user ID.' }),
+ group_id: zendeskAiProps.optionalId({ displayName: 'Group ID', description: 'Group ID, from List Groups.' }),
+ organization_id: zendeskAiProps.optionalId({ displayName: 'Organization ID', description: 'Organization ID.' }),
+ custom_status_id: zendeskAiProps.optionalId({
+ displayName: 'Custom Status ID',
+ description: 'Custom status ID, from List Custom Statuses.',
+ }),
+ additional_tags: Property.Array({ displayName: 'Additional Tags', description: 'Tags to add.', required: false }),
+ remove_tags: Property.Array({ displayName: 'Remove Tags', description: 'Tags to remove.', required: false }),
+ additional_fields: zendeskAiProps.additionalFields({
+ description: 'Other ticket attributes to set on every ticket, e.g. {"custom_fields": [{"id": 123, "value": "x"}]}.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const p = propsValue;
+ const ids = zendeskApi.idList({ values: p.ticket_ids, label: 'Ticket IDs', max: 100 });
+ const additionalTags = zendeskApi.stringList(p.additional_tags);
+ const removeTags = zendeskApi.stringList(p.remove_tags);
+ const ticket = {
+ ...zendeskApi.jsonObject({ value: p.additional_fields, label: 'Additional Fields' }),
+ ...zendeskApi.compact({
+ status: p.status,
+ priority: p.priority,
+ type: p.type,
+ assignee_id: zendeskApi.optionalId({ value: p.assignee_id, label: 'Assignee ID' }),
+ group_id: zendeskApi.optionalId({ value: p.group_id, label: 'Group ID' }),
+ organization_id: zendeskApi.optionalId({ value: p.organization_id, label: 'Organization ID' }),
+ custom_status_id: zendeskApi.optionalId({ value: p.custom_status_id, label: 'Custom Status ID' }),
+ additional_tags: additionalTags.length > 0 ? additionalTags : undefined,
+ remove_tags: removeTags.length > 0 ? removeTags : undefined,
+ }),
+ };
+ if (Object.keys(ticket).length === 0) {
+ throw new Error('Provide at least one field to update.');
+ }
+ const response = await zendeskApi.request<{ job_status: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/tickets/update_many.json',
+ queryParams: { ids: ids.join(',') },
+ body: { ticket },
+ });
+ return response.job_status;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/update-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/update-ticket.ts
new file mode 100644
index 00000000000..363c5a81045
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/tickets/update-ticket.ts
@@ -0,0 +1,107 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCreateTicketOutputSchema } from '../../../output-schemas';
+
+export const zendeskUpdateTicket = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_update_ticket',
+ outputSchema: zendeskCreateTicketOutputSchema,
+ displayName: 'Update Ticket',
+ description: 'Change fields on an existing ticket.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates fields on one ticket; omitted fields keep their values. Use Add Ticket Comment to reply, Add Ticket Tags or Remove Ticket Tags to change tags without replacing them (Tags here replaces the whole set), and Update Many Tickets for bulk changes. To clear a field such as the assignee, pass {"assignee_id": null} in Additional Fields. Pass Updated Stamp (the ticket updated_at) to fail with 409 instead of overwriting a concurrent change.',
+ idempotent: true,
+ },
+ props: {
+ ticket_id: zendeskAiProps.ticketId(),
+ subject: Property.ShortText({ displayName: 'Subject', required: false }),
+ status: zendeskAiProps.ticketStatus({ description: 'New status. closed is final and cannot be reopened.' }),
+ priority: zendeskAiProps.ticketPriority(),
+ type: zendeskAiProps.ticketType(),
+ assignee_id: zendeskAiProps.optionalId({
+ displayName: 'Assignee ID',
+ description: 'Agent user ID, from List Users with role agent or List Group Users.',
+ }),
+ group_id: zendeskAiProps.optionalId({ displayName: 'Group ID', description: 'Group ID, from List Groups.' }),
+ organization_id: zendeskAiProps.optionalId({
+ displayName: 'Organization ID',
+ description: 'Organization ID, from Search Organizations.',
+ }),
+ requester_id: zendeskAiProps.optionalId({ displayName: 'Requester ID', description: 'User ID, from Search Users.' }),
+ problem_id: zendeskAiProps.optionalId({
+ displayName: 'Problem ID',
+ description: 'For type incident: the problem ticket ID, from List Problem Tickets.',
+ }),
+ custom_status_id: zendeskAiProps.optionalId({
+ displayName: 'Custom Status ID',
+ description: 'Custom status ID, from List Custom Statuses.',
+ }),
+ brand_id: zendeskAiProps.optionalId({ displayName: 'Brand ID', description: 'Brand ID, from List Brands.' }),
+ due_at: Property.DateTime({ displayName: 'Due At', description: 'Due date, only valid for type task.', required: false }),
+ tags: Property.Array({
+ displayName: 'Tags',
+ description: 'Replaces every tag on the ticket; an empty list is ignored. Prefer Add Ticket Tags or Remove Ticket Tags, which also clear tags.',
+ required: false,
+ }),
+ external_id: Property.ShortText({ displayName: 'External ID', required: false }),
+ custom_fields: Property.Json({
+ displayName: 'Custom Fields',
+ description: 'Array of {"id": <ticket field ID from List Ticket Fields>, "value": <value>}. Only listed fields change.',
+ required: false,
+ }),
+ additional_fields: zendeskAiProps.additionalFields({
+ description: 'Other ticket attributes from the Zendesk Tickets API, or null values to clear fields, e.g. {"assignee_id": null}.',
+ }),
+ updated_stamp: Property.ShortText({
+ displayName: 'Updated Stamp',
+ description: 'The updated_at value read from Get Ticket; enables safe update so a concurrent change returns 409.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const p = propsValue;
+ const ticketId = zendeskApi.id({ value: p.ticket_id, label: 'Ticket ID' });
+ const tags = zendeskApi.stringList(p.tags);
+ const ticket = {
+ ...zendeskApi.jsonObject({ value: p.additional_fields, label: 'Additional Fields' }),
+ ...zendeskApi.compact({
+ subject: p.subject,
+ status: p.status,
+ priority: p.priority,
+ type: p.type,
+ assignee_id: zendeskApi.optionalId({ value: p.assignee_id, label: 'Assignee ID' }),
+ group_id: zendeskApi.optionalId({ value: p.group_id, label: 'Group ID' }),
+ organization_id: zendeskApi.optionalId({ value: p.organization_id, label: 'Organization ID' }),
+ requester_id: zendeskApi.optionalId({ value: p.requester_id, label: 'Requester ID' }),
+ problem_id: zendeskApi.optionalId({ value: p.problem_id, label: 'Problem ID' }),
+ custom_status_id: zendeskApi.optionalId({ value: p.custom_status_id, label: 'Custom Status ID' }),
+ brand_id: zendeskApi.optionalId({ value: p.brand_id, label: 'Brand ID' }),
+ due_at: p.due_at,
+ tags: tags.length > 0 ? tags : undefined,
+ external_id: p.external_id,
+ custom_fields: zendeskApi.jsonArray({ value: p.custom_fields, label: 'Custom Fields' }),
+ }),
+ };
+ if (Object.keys(ticket).length === 0) {
+ throw new Error('Provide at least one field to update.');
+ }
+ const response = await zendeskApi.request<{ ticket: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/tickets/${ticketId}.json`,
+ body: {
+ ticket: {
+ ...ticket,
+ ...(p.updated_stamp ? { safe_update: true, updated_stamp: p.updated_stamp } : {}),
+ },
+ },
+ });
+ return response.ticket;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/add-user-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/add-user-tags.ts
new file mode 100644
index 00000000000..06dc3a0160b
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/add-user-tags.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskAddUserTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_add_user_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Add User Tags',
+ description: 'Add tags to a user, keeping existing tags.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds tags to one user and keeps the tags already on them; re-adding an existing tag changes nothing. Returns the full tag list. Requires user tagging to be enabled in the account.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ tags: Property.Array({ displayName: 'Tags', description: 'Tags to add; tags are lowercase and cannot contain spaces.', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const tags = zendeskApi.stringList(propsValue.tags);
+ if (tags.length === 0) {
+ throw new Error('Tags must contain at least one tag.');
+ }
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/users/${userId}/tags.json`,
+ body: { tags },
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-or-update-user.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-or-update-user.ts
new file mode 100644
index 00000000000..d3ddc90e2f3
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-or-update-user.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskUserFields } from './user-fields';
+import { zendeskCreateOrUpdateUserOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateOrUpdateUser = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_or_update_user',
+ outputSchema: zendeskCreateOrUpdateUserOutputSchema,
+ displayName: 'Create or Update User',
+ description: 'Update the user with this email or external ID, or create one.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Upserts one user: Zendesk matches an existing user by Email or External ID (pass at least one) and updates the given fields, otherwise creates the user. created is true when a new user was made. Safe to retry. Use Update User when you already hold the user ID.',
+ idempotent: true,
+ },
+ props: zendeskUserFields.props({ nameRequired: true }),
+ async run({ auth, propsValue }) {
+ if (!propsValue.email && !propsValue.external_id) {
+ throw new Error('Pass Email or External ID so Zendesk can match an existing user.');
+ }
+ const response = await zendeskApi.send<{ user: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/users/create_or_update.json',
+ body: { user: zendeskUserFields.body(propsValue) },
+ });
+ return { created: response.status === 201, user: response.body.user };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-user-identity.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-user-identity.ts
new file mode 100644
index 00000000000..e2099f81f67
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-user-identity.ts
@@ -0,0 +1,62 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCreateUserIdentityOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateUserIdentity = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_user_identity',
+ outputSchema: zendeskCreateUserIdentityOutputSchema,
+ displayName: 'Create User Identity',
+ description: 'Add an email, phone or other identity to a user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds one identity to a user: an email address, phone number or social handle. Fails with 422 when the value already belongs to any user. Not idempotent. Make it primary with Make User Identity Primary.',
+ idempotent: false,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users.' }),
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ required: true,
+ options: {
+ options: [
+ { label: 'Email', value: 'email' },
+ { label: 'Phone number', value: 'phone_number' },
+ { label: 'X (Twitter)', value: 'twitter' },
+ { label: 'Facebook', value: 'facebook' },
+ { label: 'Google', value: 'google' },
+ ],
+ },
+ }),
+ value: Property.ShortText({
+ displayName: 'Value',
+ description: 'The email address, phone number in E.164 format, or handle.',
+ required: true,
+ }),
+ verified: zendeskAiProps.optionalBoolean({
+ displayName: 'Verified',
+ description: 'Mark the identity as verified so Zendesk sends no verification message.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const response = await zendeskApi.request<{ identity: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: `/users/${userId}/identities.json`,
+ body: {
+ identity: zendeskApi.compact({
+ type: propsValue.type,
+ value: propsValue.value,
+ verified: zendeskApi.optionalBoolean(propsValue.verified),
+ }),
+ },
+ });
+ return response.identity;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-user.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-user.ts
new file mode 100644
index 00000000000..0ad0af1d955
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/create-user.ts
@@ -0,0 +1,31 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskUserFields } from './user-fields';
+import { zendeskCreateUserOutputSchema } from '../../../output-schemas';
+
+export const zendeskCreateUser = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_create_user',
+ outputSchema: zendeskCreateUserOutputSchema,
+ displayName: 'Create User',
+ description: 'Create an end user, agent or admin.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates one user; role defaults to end user. Fails with 422 when the email or external ID already belongs to a user, so use Create or Update User to avoid duplicates, or Search Users first. Not idempotent.',
+ idempotent: false,
+ },
+ props: zendeskUserFields.props({ nameRequired: true }),
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ user: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/users.json',
+ body: { user: zendeskUserFields.body(propsValue) },
+ });
+ return response.user;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/delete-user-identity.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/delete-user-identity.ts
new file mode 100644
index 00000000000..9d11497ea93
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/delete-user-identity.ts
@@ -0,0 +1,35 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskDeleteUserIdentityOutputSchema } from '../../../output-schemas';
+
+export const zendeskDeleteUserIdentity = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_delete_user_identity',
+ outputSchema: zendeskDeleteUserIdentityOutputSchema,
+ displayName: 'Delete User Identity',
+ description: 'Remove an email, phone or other identity from a user.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Removes one identity (email, phone or social account) from a user. The primary identity cannot be deleted; make another identity primary first with Make User Identity Primary.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ identity_id: zendeskAiProps.requiredId({ displayName: 'Identity ID', description: 'Numeric identity ID, from List User Identities.' }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const identityId = zendeskApi.id({ value: propsValue.identity_id, label: 'Identity ID' });
+ await zendeskApi.request<unknown>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/users/${userId}/identities/${identityId}.json`,
+ });
+ return { success: true, user_id: Number(userId), identity_id: Number(identityId) };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/delete-user.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/delete-user.ts
new file mode 100644
index 00000000000..51d2da63b8f
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/delete-user.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskDeleteUserOutputSchema } from '../../../output-schemas';
+
+export const zendeskDeleteUser = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_delete_user',
+ outputSchema: zendeskDeleteUserOutputSchema,
+ displayName: 'Delete User',
+ description: 'Delete a user.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Soft-deletes one user: they can no longer sign in and their tickets stay. Zendesk permanently removes deleted users later, so this cannot be undone from the API. Agents must be downgraded to end users first. Requires an admin, or an agent allowed to manage end users.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const response = await zendeskApi.request<{ user: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/users/${userId}.json`,
+ });
+ return response.user;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-current-user.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-current-user.ts
new file mode 100644
index 00000000000..9bdb4c84159
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-current-user.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskGetCurrentUserOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetCurrentUser = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_current_user',
+ outputSchema: zendeskGetCurrentUserOutputSchema,
+ displayName: 'Get Current User',
+ description: 'Get the user the connection is authenticated as.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the user behind this connection, with role and permissions. Use it to learn the connected agent ID, e.g. to assign tickets to yourself or check admin access.',
+ idempotent: true,
+ },
+ props: {
+ },
+ async run({ auth }) {
+ const response = await zendeskApi.request<{ user: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users/me.json`,
+ });
+ return response.user;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-many-users.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-many-users.ts
new file mode 100644
index 00000000000..3a6d7d91b8c
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-many-users.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskGetManyUsersOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetManyUsers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_many_users',
+ outputSchema: zendeskGetManyUsersOutputSchema,
+ displayName: 'Get Many Users',
+ description: 'Get up to 100 users by their IDs or external IDs.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches up to 100 users in one request, by numeric User IDs or by External IDs (pass one of the two). Prefer it over repeated Get User calls. Unknown IDs are left out, so compare count with the number requested.',
+ idempotent: true,
+ },
+ props: {
+ user_ids: Property.Array({ displayName: 'User IDs', description: 'Up to 100 numeric user IDs.', required: false }),
+ external_ids: Property.Array({ displayName: 'External IDs', description: 'Up to 100 user external IDs.', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const externalIds = zendeskApi.stringList(propsValue.external_ids);
+ const hasUserIds = zendeskApi.stringList(propsValue.user_ids).length > 0;
+ if (hasUserIds === externalIds.length > 0) {
+ throw new Error('Pass either User IDs or External IDs, not both or neither.');
+ }
+ if (externalIds.length > 100) {
+ throw new Error(`External IDs accepts at most 100 IDs per call, got ${externalIds.length}.`);
+ }
+ const response = await zendeskApi.request<{ users: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/users/show_many.json',
+ queryParams: hasUserIds
+ ? { ids: zendeskApi.idList({ values: propsValue.user_ids, label: 'User IDs', max: 100 }).join(',') }
+ : { external_ids: externalIds.join(',') },
+ });
+ return { users: response.users, count: response.users.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-user-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-user-tags.ts
new file mode 100644
index 00000000000..6022e134b35
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-user-tags.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetUserTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_user_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Get User Tags',
+ description: 'List the tags on a user.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Lists the tags on one user. Change them with Add User Tags or Remove User Tags.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users/${userId}/tags.json`,
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-user.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-user.ts
new file mode 100644
index 00000000000..b1f5cd3259d
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/get-user.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetUserOutputSchema } from '../../../output-schemas';
+
+export const zendeskGetUser = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_get_user',
+ outputSchema: zendeskGetUserOutputSchema,
+ displayName: 'Get User',
+ description: 'Get a user by their ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches one user (end user, agent or admin) by numeric ID, with email, phone, role, organization, tags and user fields. Use Search Users to find a user by email or name, and Get Many Users for up to 100 IDs.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const response = await zendeskApi.request<{ user: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users/${userId}.json`,
+ });
+ return response.user;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-user-groups.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-user-groups.ts
new file mode 100644
index 00000000000..1daf014891e
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-user-groups.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListGroupsOutputSchema } from '../../../output-schemas';
+
+export const zendeskListUserGroups = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_user_groups',
+ outputSchema: zendeskListGroupsOutputSchema,
+ displayName: 'List User Groups',
+ description: 'List the groups an agent belongs to.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the groups one agent belongs to. End users belong to no groups. Use List Group Users for the reverse lookup.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const response = await zendeskApi.request<{ groups: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users/${userId}/groups.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ groups: response.groups,
+ count: response.groups.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-user-identities.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-user-identities.ts
new file mode 100644
index 00000000000..0581036fdd3
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-user-identities.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListUserIdentitiesOutputSchema } from '../../../output-schemas';
+
+export const zendeskListUserIdentities = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_user_identities',
+ outputSchema: zendeskListUserIdentitiesOutputSchema,
+ displayName: 'List User Identities',
+ description: 'List the emails, phones and other identities of a user.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the identities of one user: email addresses, phone numbers and social accounts, with which is primary and verified. Identity IDs feed Update User Identity, Make User Identity Primary and Delete User Identity.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const response = await zendeskApi.request<{ identities: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users/${userId}/identities.json`,
+ queryParams: zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ });
+ return {
+ identities: response.identities,
+ count: response.identities.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-users.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-users.ts
new file mode 100644
index 00000000000..820195c5266
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/list-users.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { CursorMeta, zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskListUsersOutputSchema } from '../../../output-schemas';
+
+export const zendeskListUsers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_list_users',
+ outputSchema: zendeskListUsersOutputSchema,
+ displayName: 'List Users',
+ description: 'List users, optionally by role.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists users one page at a time, optionally only end users, agents or admins (e.g. role agent to find assignees). Use Search Users to look up a user by email, name or other attribute.',
+ idempotent: true,
+ },
+ props: {
+ role: Property.StaticDropdown({
+ displayName: 'Role',
+ description: 'Only return users with this role.',
+ required: false,
+ options: { options: [{ label: 'End user', value: 'end-user' }, { label: 'Agent', value: 'agent' }, { label: 'Admin', value: 'admin' }] },
+ }),
+ external_id: Property.ShortText({ displayName: 'External ID', description: 'Only return users with this external ID.', required: false }),
+ limit: zendeskAiProps.limit(),
+ cursor: zendeskAiProps.cursor(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ users: unknown[]; meta?: CursorMeta }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users.json`,
+ queryParams: {
+ ...zendeskApi.cursorQuery({ limit: propsValue.limit, cursor: propsValue.cursor }),
+ ...zendeskApi.query({ role: propsValue.role, external_id: propsValue.external_id }),
+ },
+ });
+ return {
+ users: response.users,
+ count: response.users.length,
+ ...zendeskApi.cursorResult(response.meta),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/make-user-identity-primary.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/make-user-identity-primary.ts
new file mode 100644
index 00000000000..02e03da7660
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/make-user-identity-primary.ts
@@ -0,0 +1,35 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskMakeUserIdentityPrimaryOutputSchema } from '../../../output-schemas';
+
+export const zendeskMakeUserIdentityPrimary = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_make_user_identity_primary',
+ outputSchema: zendeskMakeUserIdentityPrimaryOutputSchema,
+ displayName: 'Make User Identity Primary',
+ description: 'Make an identity the primary one for its type.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Makes one identity the primary identity of its type, e.g. the email Zendesk sends notifications to. Returns the user identities after the change.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ identity_id: zendeskAiProps.requiredId({ displayName: 'Identity ID', description: 'Numeric identity ID, from List User Identities.' }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const identityId = zendeskApi.id({ value: propsValue.identity_id, label: 'Identity ID' });
+ const response = await zendeskApi.request<{ identities: unknown[] }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/users/${userId}/identities/${identityId}/make_primary.json`,
+ });
+ return { identities: response.identities, count: response.identities.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/merge-users.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/merge-users.ts
new file mode 100644
index 00000000000..c95ca2869bc
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/merge-users.ts
@@ -0,0 +1,45 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskGetUserOutputSchema } from '../../../output-schemas';
+
+export const zendeskMergeUsers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_merge_users',
+ outputSchema: zendeskGetUserOutputSchema,
+ displayName: 'Merge Users',
+ description: 'Merge a duplicate end user into another user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Merges the source end user into the target user: the source tickets, identities and memberships move to the target and the source is deleted. Irreversible. Only end users can be merged as the source. Returns the target user.',
+ idempotent: false,
+ },
+ props: {
+ source_user_id: zendeskAiProps.requiredId({
+ displayName: 'Source User ID',
+ description: 'The duplicate end user to merge away, from Search Users.',
+ }),
+ target_user_id: zendeskAiProps.requiredId({
+ displayName: 'Target User ID',
+ description: 'The user that remains and receives the data, from Search Users.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const sourceId = zendeskApi.id({ value: propsValue.source_user_id, label: 'Source User ID' });
+ const targetId = zendeskApi.id({ value: propsValue.target_user_id, label: 'Target User ID' });
+ if (sourceId === targetId) {
+ throw new Error('Source and target user must differ.');
+ }
+ const response = await zendeskApi.request<{ user: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/users/${sourceId}/merge.json`,
+ body: { user: { id: Number(targetId) } },
+ });
+ return response.user;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/remove-user-tags.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/remove-user-tags.ts
new file mode 100644
index 00000000000..2fdc53d7e66
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/remove-user-tags.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskAddOrganizationTagsOutputSchema } from '../../../output-schemas';
+
+export const zendeskRemoveUserTags = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_remove_user_tags',
+ outputSchema: zendeskAddOrganizationTagsOutputSchema,
+ displayName: 'Remove User Tags',
+ description: 'Remove tags from a user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Removes the given tags from one user and keeps the rest; tags not on the user are ignored. Returns the remaining tag list.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users, List Users or Get Current User.' }),
+ tags: Property.Array({ displayName: 'Tags', description: 'Tags to remove; tags are lowercase and cannot contain spaces.', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const tags = zendeskApi.stringList(propsValue.tags);
+ if (tags.length === 0) {
+ throw new Error('Tags must contain at least one tag.');
+ }
+ const response = await zendeskApi.request<{ tags: unknown[] }>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/users/${userId}/tags.json`,
+ queryParams: {
+ tags: tags.join(','),
+ },
+ });
+ return { tags: response.tags, count: response.tags.length };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/search-users.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/search-users.ts
new file mode 100644
index 00000000000..ba5d3e7202b
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/search-users.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskSearchUsersOutputSchema } from '../../../output-schemas';
+
+export const zendeskSearchUsers = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_search_users',
+ outputSchema: zendeskSearchUsersOutputSchema,
+ displayName: 'Search Users',
+ description: 'Find users by email, name, phone or other attributes.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches users with Zendesk search syntax: a plain email or name, or terms like email:[email protected], role:agent, organization:acme or tags:vip. Use External ID for an exact external ID match. Returns user IDs for Create Ticket, Update Ticket and the user actions.',
+ idempotent: true,
+ },
+ props: {
+ query: Property.ShortText({ displayName: 'Query', description: 'Search terms, e.g. [email protected] or role:agent name:Jane.', required: false }),
+ external_id: Property.ShortText({ displayName: 'External ID', description: 'Exact external ID to match instead of a query.', required: false }),
+ limit: zendeskAiProps.limit(),
+ page: zendeskAiProps.page(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await zendeskApi.request<{ users: unknown[]; next_page?: string | null }>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users/search.json`,
+ queryParams: {
+ ...zendeskApi.offsetQuery({ limit: propsValue.limit, page: propsValue.page }),
+ ...zendeskApi.query({ query: propsValue.query, external_id: propsValue.external_id }),
+ },
+ });
+ return {
+ users: response.users,
+ count: response.users.length,
+ ...zendeskApi.offsetResult({ nextPage: response.next_page, page: propsValue.page }),
+ };
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/update-user-identity.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/update-user-identity.ts
new file mode 100644
index 00000000000..5860f14f27a
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/update-user-identity.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskCreateUserIdentityOutputSchema } from '../../../output-schemas';
+
+export const zendeskUpdateUserIdentity = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_update_user_identity',
+ outputSchema: zendeskCreateUserIdentityOutputSchema,
+ displayName: 'Update User Identity',
+ description: 'Change the value or verification of a user identity.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates one identity of a user: corrects its value (email or phone) or marks it verified. Omitted fields keep their values. Identity IDs come from List User Identities.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({ displayName: 'User ID', description: 'Numeric user ID, from Search Users.' }),
+ identity_id: zendeskAiProps.requiredId({
+ displayName: 'Identity ID',
+ description: 'Numeric identity ID, from List User Identities.',
+ }),
+ value: Property.ShortText({ displayName: 'Value', description: 'New email address or phone number.', required: false }),
+ verified: zendeskAiProps.optionalBoolean({ displayName: 'Verified', description: 'Yes marks the identity verified.' }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const identityId = zendeskApi.id({ value: propsValue.identity_id, label: 'Identity ID' });
+ const identity = zendeskApi.compact({
+ value: propsValue.value,
+ verified: zendeskApi.optionalBoolean(propsValue.verified),
+ });
+ if (Object.keys(identity).length === 0) {
+ throw new Error('Provide Value or Verified.');
+ }
+ const response = await zendeskApi.request<{ identity: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/users/${userId}/identities/${identityId}.json`,
+ body: { identity },
+ });
+ return response.identity;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/update-user.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/update-user.ts
new file mode 100644
index 00000000000..57317ed8285
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/update-user.ts
@@ -0,0 +1,50 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { zendeskAuth } from '../../../auth';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+import { zendeskUserFields } from './user-fields';
+import { zendeskGetUserOutputSchema } from '../../../output-schemas';
+
+export const zendeskUpdateUser = createAction({
+ auth: zendeskAuth,
+ name: 'zendesk_update_user',
+ outputSchema: zendeskGetUserOutputSchema,
+ displayName: 'Update User',
+ description: 'Change fields on an existing user.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates one user by ID; omitted fields keep their values. Email here adds a new primary identity rather than editing the old one; manage emails and phones with the user identity actions. Tags replaces the whole set, so prefer Add User Tags or Remove User Tags. Suspended Yes blocks the user from signing in and suspends their new tickets.',
+ idempotent: true,
+ },
+ props: {
+ user_id: zendeskAiProps.requiredId({
+ displayName: 'User ID',
+ description: 'Numeric user ID, from Search Users or List Users.',
+ }),
+ ...zendeskUserFields.props({ nameRequired: false }),
+ suspended: zendeskAiProps.optionalBoolean({
+ displayName: 'Suspended',
+ description: 'Yes suspends the user, No lifts the suspension.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const userId = zendeskApi.id({ value: propsValue.user_id, label: 'User ID' });
+ const user = zendeskApi.compact({
+ ...zendeskUserFields.body(propsValue),
+ suspended: zendeskApi.optionalBoolean(propsValue.suspended),
+ });
+ if (Object.keys(user).length === 0) {
+ throw new Error('Provide at least one field to update.');
+ }
+ const response = await zendeskApi.request<{ user: Record<string, unknown> }>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/users/${userId}.json`,
+ body: { user },
+ });
+ return response.user;
+ },
+});
diff --git a/packages/pieces/community/zendesk/src/lib/actions/ai/users/user-fields.ts b/packages/pieces/community/zendesk/src/lib/actions/ai/users/user-fields.ts
new file mode 100644
index 00000000000..7d04c62cc6d
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/actions/ai/users/user-fields.ts
@@ -0,0 +1,85 @@
+import { Property } from '@activepieces/pieces-framework';
+import { zendeskApi } from '../../../common/api';
+import { zendeskAiProps } from '../../../common/ai-props';
+
+function props({ nameRequired }: { nameRequired: boolean }) {
+ return {
+ name: Property.ShortText({ displayName: 'Name', required: nameRequired }),
+ email: Property.ShortText({ displayName: 'Email', description: 'Primary email address.', required: false }),
+ phone: Property.ShortText({ displayName: 'Phone', required: false }),
+ role: Property.StaticDropdown({
+ displayName: 'Role',
+ description: 'Defaults to end-user. Only admins can create agents and admins.',
+ required: false,
+ options: {
+ options: [
+ { label: 'End user', value: 'end-user' },
+ { label: 'Agent', value: 'agent' },
+ { label: 'Admin', value: 'admin' },
+ ],
+ },
+ }),
+ organization_id: zendeskAiProps.optionalId({
+ displayName: 'Organization ID',
+ description: 'Organization ID, from Search Organizations.',
+ }),
+ external_id: Property.ShortText({ displayName: 'External ID', description: 'Your own reference for the user.', required: false }),
+ tags: Property.Array({
+ displayName: 'Tags',
+ description: 'Replaces every tag on the user; an empty list is ignored. Prefer Add User Tags or Remove User Tags on existing users, which also clear tags.',
+ required: false,
+ }),
+ user_fields: Property.Json({
+ displayName: 'User Fields',
+ description: 'Object of custom user field keys to values, keys from List User Fields, e.g. {"plan": "pro"}.',
+ required: false,
+ }),
+ details: Property.LongText({ displayName: 'Details', description: 'Details such as an address.', required: false }),
+ notes: Property.LongText({ displayName: 'Notes', description: 'Internal notes visible to agents.', required: false }),
+ verified: zendeskAiProps.optionalBoolean({
+ displayName: 'Verified',
+ description: 'Mark the email as verified so Zendesk sends no verification email.',
+ }),
+ additional_fields: zendeskAiProps.additionalFields({
+ description: 'Other user attributes from the Zendesk Users API, e.g. {"time_zone": "Berlin", "locale": "de"}, or null values to clear fields.',
+ }),
+ };
+}
+
+function body(values: UserFieldValues): Record<string, unknown> {
+ const tags = zendeskApi.stringList(values.tags);
+ const userFields = zendeskApi.jsonObject({ value: values.user_fields, label: 'User Fields' });
+ return {
+ ...zendeskApi.jsonObject({ value: values.additional_fields, label: 'Additional Fields' }),
+ ...zendeskApi.compact({
+ name: values.name,
+ email: values.email,
+ phone: values.phone,
+ role: values.role,
+ organization_id: zendeskApi.optionalId({ value: values.organization_id, label: 'Organization ID' }),
+ external_id: values.external_id,
+ tags: tags.length > 0 ? tags : undefined,
+ user_fields: Object.keys(userFields).length > 0 ? userFields : undefined,
+ details: values.details,
+ notes: values.notes,
+ verified: zendeskApi.optionalBoolean(values.verified),
+ }),
+ };
+}
+
+export const zendeskUserFields = { props, body };
+
+type UserFieldValues = {
+ name?: string;
+ email?: string;
+ phone?: string;
+ role?: string;
+ organization_id?: string;
+ external_id?: string;
+ tags?: unknown[];
+ user_fields?: unknown;
+ details?: string;
+ notes?: string;
+ verified?: string;
+ additional_fields?: unknown;
+};
diff --git a/packages/pieces/community/zendesk/src/lib/actions/attach-file-to-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/attach-file-to-ticket.ts
index 52468c0aace..afe224f29ec 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/attach-file-to-ticket.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/attach-file-to-ticket.ts
@@ -6,10 +6,12 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { ticketIdDropdown } from '../common/props';
+import { attachFileToTicketOutputSchema } from '../output-schemas';
export const attachFileToTicketAction = createAction({
auth: zendeskAuth,
name: 'attach-file-to-ticket',
+ outputSchema: attachFileToTicketOutputSchema,
classification: 'WRITE',
displayName: 'Attach File to Ticket',
description: 'Attach a file to a ticket.',
diff --git a/packages/pieces/community/zendesk/src/lib/actions/create-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/create-organization.ts
index c140e470ec1..f07b7ae8a20 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/create-organization.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/create-organization.ts
@@ -6,14 +6,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { groupIdDropdown } from '../common/props';
+import { createOrganizationOutputSchema } from '../output-schemas';
export const createOrganizationAction = createAction({
auth: zendeskAuth,
name: 'create-organization',
+ outputSchema: createOrganizationOutputSchema,
classification: 'WRITE',
displayName: 'Create Organization',
description: 'Create a new organization record.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Creates a new organization in Zendesk; the organization name is required and must be unique. Use to onboard a new company or account, optionally setting domain names, tags, group, shared-ticket/comment visibility, and custom organization fields. Not idempotent: each call creates a distinct organization, and a duplicate name will fail validation.', idempotent: false },
props: {
name: Property.ShortText({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/create-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/create-ticket.ts
index 0a9182eb85c..cad36184f49 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/create-ticket.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/create-ticket.ts
@@ -9,14 +9,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { organizationIdDropdown, brandIdDropdown, problemTicketIdDropdown, groupIdDropdown } from '../common/props';
+import { createTicketOutputSchema } from '../output-schemas';
export const createTicketAction = createAction({
auth: zendeskAuth,
name: 'create-ticket',
+ outputSchema: createTicketOutputSchema,
classification: 'WRITE',
displayName: 'Create Ticket',
description: 'Create a new ticket in Zendesk.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Creates a new support ticket in Zendesk, requiring either a plain-text or HTML comment body as the opening message. Use to open a new case, log a customer request, or file an issue; the subject defaults to the first comment if omitted. Requester, assignee, collaborator, and follower are passed as emails (resolved to user IDs, creating a new requester user if no match) rather than IDs, and tags, priority, status, and custom fields can be set on creation. Not idempotent: each call creates a distinct ticket.', idempotent: false },
props: {
subject: Property.ShortText({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/create-user.ts b/packages/pieces/community/zendesk/src/lib/actions/create-user.ts
index 71e6652cd24..29adba8cd6f 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/create-user.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/create-user.ts
@@ -12,14 +12,16 @@ import {
groupIdDropdown,
userFieldsDynamicProp,
} from '../common/props';
+import { createUserOutputSchema } from '../output-schemas';
export const createUserAction = createAction({
auth: zendeskAuth,
name: 'create-user',
+ outputSchema: createUserOutputSchema,
classification: 'WRITE',
displayName: 'Create User',
description: 'Add a new user to the Zendesk instance.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Creates a new user (end-user, agent, or admin; defaults to end-user) in the Zendesk instance; only the name is required. Use to add a customer, agent, or admin account, optionally setting email, phone, role, organization (by ID or by new organization name), tags, custom user fields, and additional identities. A verification email is sent unless skipped. Not idempotent: each call creates a distinct user, and a duplicate email fails validation.', idempotent: false },
props: {
name: Property.ShortText({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/delete-user.ts b/packages/pieces/community/zendesk/src/lib/actions/delete-user.ts
index 641d95cf872..e6c9cd04d5f 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/delete-user.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/delete-user.ts
@@ -9,14 +9,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { userIdDropdown } from '../common/props';
+import { deleteUserOutputSchema } from '../output-schemas';
export const deleteUserAction = createAction({
auth: zendeskAuth,
name: 'delete-user',
+ outputSchema: deleteUserOutputSchema,
classification: 'DESTRUCTIVE',
displayName: 'Delete User',
description: 'Remove a user and associated records from the account.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Soft-deletes a user identified by user ID from the Zendesk account; deleted users are not recoverable in the UI (use a permanent/GDPR erasure endpoint for full removal). Use to offboard or remove an account. Requires the confirmation checkbox to be set, and the account owner or restricted users cannot be deleted. Idempotent in effect: once removed the user stays removed, though a repeat call on an already-deleted user returns a not-found error.', idempotent: true },
props: {
user_id: userIdDropdown,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/find-agent.ts b/packages/pieces/community/zendesk/src/lib/actions/find-agent.ts
index b44de977b36..044ddb193f6 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/find-agent.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/find-agent.ts
@@ -5,6 +5,7 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { findAgentOutputSchema } from '../output-schemas';
interface ZendeskAgent {
id: number;
@@ -25,10 +26,11 @@ interface ZendeskUsersResponse {
export const findAgentAction = createAction({
auth: zendeskAuth,
name: 'find-agent',
+ outputSchema: findAgentOutputSchema,
classification: 'SEARCH',
displayName: 'Find an Agent',
description: 'Find an agent by email or name.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Finds an agent (staff/support team member) in Zendesk by searching for their email or name. Returns the first matching agent with their profile details. Useful for assigning tickets or sending notifications to specific agents.', idempotent: true },
props: {
search_type: Property.StaticDropdown({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/find-group.ts b/packages/pieces/community/zendesk/src/lib/actions/find-group.ts
index 89340bc1a63..85ceb3c4d7d 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/find-group.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/find-group.ts
@@ -5,6 +5,7 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { findGroupOutputSchema } from '../output-schemas';
interface ZendeskGroup {
id: number;
@@ -21,10 +22,11 @@ interface ZendeskGroupsResponse {
export const findGroupAction = createAction({
auth: zendeskAuth,
name: 'find-group',
+ outputSchema: findGroupOutputSchema,
classification: 'READ',
displayName: 'Find a Group',
description: 'Find a group by name.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Finds a support group in Zendesk by name. Returns the first matching group with its profile details. Useful for assigning tickets or routing work to specific support teams.', idempotent: true },
props: {
group_name: Property.ShortText({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/find-latest-comment.ts b/packages/pieces/community/zendesk/src/lib/actions/find-latest-comment.ts
index 93d11736e55..baed557dcd1 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/find-latest-comment.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/find-latest-comment.ts
@@ -6,13 +6,14 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { ticketIdDropdown } from '../common/props';
+import { findLatestCommentOutputSchema } from '../output-schemas';
interface ZendeskComment {
id: number;
type: string;
body: string;
html_body: string;
- plain_text_body: string;
+ plain_body: string;
public: boolean;
author_id: number;
created_at: string;
@@ -32,10 +33,11 @@ interface ZendeskCommentsResponse {
export const findLatestCommentAction = createAction({
auth: zendeskAuth,
name: 'find-latest-comment',
+ outputSchema: findLatestCommentOutputSchema,
classification: 'READ',
displayName: 'Find Latest Comment',
description: 'Find the latest comment on a ticket.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Retrieves the most recent comment on a specified ticket, including the comment body, author, timestamp, and any attachments. Useful for extracting the latest response in a ticket thread or analyzing recent customer communication.', idempotent: true },
props: {
ticket_id: ticketIdDropdown,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/find-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/find-organization.ts
index 5edae8f6187..b8836c331fc 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/find-organization.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/find-organization.ts
@@ -8,14 +8,16 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { findOrganizationOutputSchema } from '../output-schemas';
export const findOrganizationAction = createAction({
auth: zendeskAuth,
name: 'find-organization',
+ outputSchema: findOrganizationOutputSchema,
classification: 'SEARCH',
displayName: 'Find Organization(s)',
description: 'Search organizations by name, domain, external ID, or other criteria.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Searches Zendesk organizations and returns matching records. A required search-type selector chooses the mode: match by name, domain, external ID, tag, or details, or pass a raw Zendesk search-syntax string via the Custom Query mode for arbitrary filters. Use to look up an organization or its ID before creating/updating tickets or users; results can be sorted by relevance, created, or updated date. Read-only and idempotent.', idempotent: true },
props: {
search_type: Property.StaticDropdown({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/find-tickets.ts b/packages/pieces/community/zendesk/src/lib/actions/find-tickets.ts
index 30f527478d5..05f538c715e 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/find-tickets.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/find-tickets.ts
@@ -7,14 +7,16 @@ import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { isEmpty } from '@activepieces/pieces-framework';
import dayjs from 'dayjs'
+import { findTicketsOutputSchema } from '../output-schemas';
export const findTicketsAction = createAction({
auth: zendeskAuth,
name: 'find-tickets',
+ outputSchema: findTicketsOutputSchema,
classification: 'SEARCH',
displayName: 'Find Ticket(s)',
description: 'Search tickets by ID, field, or content.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Searches Zendesk tickets and returns matching records. A required search-type selector chooses the mode: match by ticket ID, status, priority, type, tag, requester or assignee email, subject/content text, or pass a raw Zendesk search-syntax string via the Custom Query mode. Optional date-time filters narrow by created/updated/solved/due date with comparison operators. Use to locate tickets or a ticket ID before commenting or updating; results can be sorted. Read-only and idempotent.', idempotent: true },
props: {
search_type: Property.StaticDropdown({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/find-user.ts b/packages/pieces/community/zendesk/src/lib/actions/find-user.ts
index 50e0b7785c5..8145da22b4f 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/find-user.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/find-user.ts
@@ -5,14 +5,16 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { findUserOutputSchema } from '../output-schemas';
export const findUserAction = createAction({
auth: zendeskAuth,
name: 'find-user',
+ outputSchema: findUserOutputSchema,
classification: 'SEARCH',
displayName: 'Find User(s)',
description: 'Search users by email, name, role, or other criteria.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Searches Zendesk users and returns matching records. A required search-type selector chooses the mode: match by email, name, role, organization, tag, or external ID, or pass a raw Zendesk search-syntax string via the Custom Query mode. Use to look up a user or resolve their ID before assigning tickets or adding comments; no matches returns an empty result set rather than an error. Read-only and idempotent.', idempotent: true },
props: {
search_type: Property.StaticDropdown({
diff --git a/packages/pieces/community/zendesk/src/lib/actions/remove-tag-from-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/remove-tag-from-ticket.ts
index 43b958ebef9..50c2237d4ca 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/remove-tag-from-ticket.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/remove-tag-from-ticket.ts
@@ -6,14 +6,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { ticketIdDropdown } from '../common/props';
+import { removeTagFromTicketOutputSchema } from '../output-schemas';
export const removeTagFromTicketAction = createAction({
auth: zendeskAuth,
name: 'remove-tag-from-ticket',
+ outputSchema: removeTagFromTicketOutputSchema,
classification: 'WRITE',
displayName: 'Remove Tag(s) from Ticket',
description: 'Remove one or more tags from a ticket.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Removes one or more tags from a ticket identified by ticket ID. Tags are removed from the existing tag set without disturbing other tags. If a tag does not exist on the ticket, it is silently ignored. Effectively idempotent for tags already absent.', idempotent: true },
props: {
ticket_id: ticketIdDropdown,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/update-organization.ts b/packages/pieces/community/zendesk/src/lib/actions/update-organization.ts
index 146da350065..6a7e69afbcf 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/update-organization.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/update-organization.ts
@@ -9,14 +9,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { organizationIdDropdown, groupIdDropdown } from '../common/props';
+import { createOrganizationOutputSchema } from '../output-schemas';
export const updateOrganizationAction = createAction({
auth: zendeskAuth,
name: 'update-organization',
+ outputSchema: createOrganizationOutputSchema,
classification: 'WRITE',
displayName: 'Update Organization',
description: 'Update existing organization fields.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Updates an existing organization identified by organization ID, changing fields such as name, details, notes, domain names, tags, group, visibility settings, or custom fields. Use to edit an account record already in Zendesk. Note that the domain names and tags arrays REPLACE all existing values rather than appending. At least one field must be provided. Idempotent: re-applying the same field values leaves the organization in the same state.', idempotent: true },
props: {
organization_id: organizationIdDropdown,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/update-ticket.ts b/packages/pieces/community/zendesk/src/lib/actions/update-ticket.ts
index d16a0e9668c..b470f17e725 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/update-ticket.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/update-ticket.ts
@@ -12,14 +12,16 @@ import {
brandIdDropdown,
problemTicketIdDropdown,
} from '../common/props';
+import { updateTicketOutputSchema } from '../output-schemas';
export const updateTicketAction = createAction({
auth: zendeskAuth,
name: 'update-ticket',
+ outputSchema: updateTicketOutputSchema,
classification: 'WRITE',
displayName: 'Update Ticket',
description: 'Modify ticket fields or status via API call.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Updates an existing ticket identified by ticket ID, changing fields such as subject, status, priority, type, assignee, organization, tags, due date, or custom fields. Use to advance or edit a ticket already created. Two effects to note: setting the tags array REPLACES all existing tags (use Add Tag to Ticket to append), and supplying a comment body APPENDS a new comment on each call, so repeated calls with a comment are not idempotent; field-only updates are effectively idempotent. At least one field must be provided.', idempotent: false },
props: {
ticket_id: ticketIdDropdown,
diff --git a/packages/pieces/community/zendesk/src/lib/actions/update-user.ts b/packages/pieces/community/zendesk/src/lib/actions/update-user.ts
index e04174631fa..1cf38fc73f6 100644
--- a/packages/pieces/community/zendesk/src/lib/actions/update-user.ts
+++ b/packages/pieces/community/zendesk/src/lib/actions/update-user.ts
@@ -9,14 +9,16 @@ import {
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
import { userFieldsDynamicProp } from '../common/props';
+import { updateUserOutputSchema } from '../output-schemas';
export const updateUserAction = createAction({
auth: zendeskAuth,
name: 'update-user',
+ outputSchema: updateUserOutputSchema,
classification: 'WRITE',
displayName: 'Update User',
description: 'Update existing user fields.',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Updates an existing user identified by user ID, changing name, email, phone, tags, or custom user fields. Use to edit a user record already in Zendesk. Note that the tags array REPLACES all existing tags rather than appending. At least one field must be provided, and emails must remain unique. Idempotent: re-applying the same field values leaves the user in the same state.', idempotent: true },
props: {
user_id: Property.ShortText({
diff --git a/packages/pieces/community/zendesk/src/lib/common/ai-props.ts b/packages/pieces/community/zendesk/src/lib/common/ai-props.ts
new file mode 100644
index 00000000000..724ffb9c464
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/common/ai-props.ts
@@ -0,0 +1,140 @@
+import { Property } from '@activepieces/pieces-framework';
+
+function ticketId({ description }: { description?: string } = {}) {
+ return requiredId({
+ displayName: 'Ticket ID',
+ description: description ?? 'Numeric ticket ID, from Search, List Tickets or Create Ticket.',
+ });
+}
+
+function requiredId({ displayName, description }: { displayName: string; description: string }) {
+ return Property.ShortText({ displayName, description, required: true });
+}
+
+function page() {
+ return Property.Number({
+ displayName: 'Page',
+ description: 'Page number, starting at 1. Pass next_page from a previous call.',
+ required: false,
+ });
+}
+
+function limit() {
+ return Property.Number({
+ displayName: 'Limit',
+ description: 'Records per page, 1 to 100. Defaults to 25.',
+ required: false,
+ });
+}
+
+function cursor() {
+ return Property.ShortText({
+ displayName: 'Cursor',
+ description: 'The next_cursor value from a previous call, to fetch the next page.',
+ required: false,
+ });
+}
+
+function sortOrder() {
+ return Property.StaticDropdown({
+ displayName: 'Sort Order',
+ description: 'asc for oldest first (default), desc for newest first.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Oldest first', value: 'asc' },
+ { label: 'Newest first', value: 'desc' },
+ ],
+ },
+ });
+}
+
+function ticketStatus({ description }: { description: string }) {
+ return Property.StaticDropdown({
+ displayName: 'Status',
+ description,
+ required: false,
+ options: {
+ options: [
+ { label: 'New', value: 'new' },
+ { label: 'Open', value: 'open' },
+ { label: 'Pending', value: 'pending' },
+ { label: 'On-hold', value: 'hold' },
+ { label: 'Solved', value: 'solved' },
+ { label: 'Closed', value: 'closed' },
+ ],
+ },
+ });
+}
+
+function ticketPriority() {
+ return Property.StaticDropdown({
+ displayName: 'Priority',
+ required: false,
+ options: {
+ options: [
+ { label: 'Low', value: 'low' },
+ { label: 'Normal', value: 'normal' },
+ { label: 'High', value: 'high' },
+ { label: 'Urgent', value: 'urgent' },
+ ],
+ },
+ });
+}
+
+function ticketType() {
+ return Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'incident requires Problem ID to link it to a problem ticket.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Question', value: 'question' },
+ { label: 'Incident', value: 'incident' },
+ { label: 'Problem', value: 'problem' },
+ { label: 'Task', value: 'task' },
+ ],
+ },
+ });
+}
+
+function optionalId({ displayName, description }: { displayName: string; description: string }) {
+ return Property.ShortText({ displayName, description, required: false });
+}
+
+function optionalBoolean({ displayName, description }: { displayName: string; description: string }) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required: false,
+ options: {
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ });
+}
+
+function additionalFields({ description }: { description: string }) {
+ return Property.Json({
+ displayName: 'Additional Fields',
+ description,
+ required: false,
+ });
+}
+
+export const zendeskAiProps = {
+ ticketId,
+ requiredId,
+ limit,
+ page,
+ cursor,
+ sortOrder,
+ ticketStatus,
+ ticketPriority,
+ ticketType,
+ optionalId,
+ optionalBoolean,
+ additionalFields,
+};
diff --git a/packages/pieces/community/zendesk/src/lib/common/api.ts b/packages/pieces/community/zendesk/src/lib/common/api.ts
new file mode 100644
index 00000000000..2585fb1ee80
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/common/api.ts
@@ -0,0 +1,195 @@
+import { HttpError, HttpMethod, QueryParams, httpClient } from '@activepieces/pieces-common';
+import { ZendeskAuthValue, getZendeskAuthentication, getZendeskBaseUrl } from './client';
+
+async function request<T>(params: RequestParams): Promise<T> {
+ const response = await send<T>(params);
+ return response.body;
+}
+
+async function send<T>({ auth, method, path, queryParams, body }: RequestParams): Promise<{ status: number; body: T }> {
+ try {
+ const response = await httpClient.sendRequest<T>({
+ method,
+ url: `${getZendeskBaseUrl(auth)}${path}`,
+ authentication: getZendeskAuthentication(auth),
+ queryParams,
+ body,
+ });
+ return { status: response.status, body: response.body };
+ } catch (error) {
+ if (error instanceof HttpError) {
+ throw new Error(describeError({ status: error.response.status, body: error.response.body }), { cause: error });
+ }
+ throw error;
+ }
+}
+
+function optionalBoolean(value: unknown): boolean | undefined {
+ if (value === undefined || value === null || value === '') {
+ return undefined;
+ }
+ return value === true || value === 'true';
+}
+
+function id({ value, label }: { value: unknown; label: string }): string {
+ const text = String(value ?? '').trim();
+ if (!/^\d+$/.test(text)) {
+ throw new Error(`${label} must be a numeric Zendesk ID, got "${text}".`);
+ }
+ return text;
+}
+
+function optionalId({ value, label }: { value: unknown; label: string }): number | undefined {
+ if (value === undefined || value === null || String(value).trim() === '') {
+ return undefined;
+ }
+ return Number(id({ value, label }));
+}
+
+function jsonArray({ value, label }: { value: unknown; label: string }): unknown[] | undefined {
+ if (value === undefined || value === null || value === '') {
+ return undefined;
+ }
+ if (!Array.isArray(value)) {
+ throw new Error(`${label} must be a JSON array.`);
+ }
+ return value;
+}
+
+function idList({ values, label, max }: { values: unknown; label: string; max: number }): string[] {
+ const list = Array.isArray(values) ? values : [];
+ const ids = list.map((value) => id({ value, label }));
+ if (ids.length === 0) {
+ throw new Error(`${label} must contain at least one ID.`);
+ }
+ if (ids.length > max) {
+ throw new Error(`${label} accepts at most ${max} IDs per call, got ${ids.length}.`);
+ }
+ return ids;
+}
+
+function stringList(values: unknown): string[] {
+ const list = Array.isArray(values) ? values : [];
+ return list.map((value) => String(value).trim()).filter((value) => value.length > 0);
+}
+
+function cursorQuery({ limit, cursor }: { limit?: number; cursor?: string }): QueryParams {
+ return {
+ 'page[size]': String(Math.min(Math.max(limit ?? 25, 1), 100)),
+ ...(cursor ? { 'page[after]': cursor } : {}),
+ };
+}
+
+function cursorResult(meta: CursorMeta | undefined): { has_more: boolean; next_cursor: string | null } {
+ const hasMore = meta?.has_more ?? false;
+ return { has_more: hasMore, next_cursor: hasMore ? meta?.after_cursor ?? null : null };
+}
+
+function query(values: Record<string, unknown>): QueryParams {
+ return Object.fromEntries(
+ Object.entries(values)
+ .filter(([, value]) => value !== undefined && value !== null && value !== '')
+ .map(([key, value]) => [key, String(value)]),
+ );
+}
+
+function offsetQuery({ limit, page }: { limit?: number; page?: number }): QueryParams {
+ return {
+ per_page: String(Math.min(Math.max(limit ?? 25, 1), 100)),
+ page: String(Math.max(page ?? 1, 1)),
+ };
+}
+
+function offsetResult({ nextPage, page }: { nextPage: string | null | undefined; page?: number }): {
+ has_more: boolean;
+ next_page: number | null;
+} {
+ const hasMore = !!nextPage;
+ return { has_more: hasMore, next_page: hasMore ? Math.max(page ?? 1, 1) + 1 : null };
+}
+
+function pathSegment({ value, label }: { value: unknown; label: string }): string {
+ const text = String(value ?? '').trim();
+ if (text.length === 0) {
+ throw new Error(`${label} is required.`);
+ }
+ return encodeURIComponent(text);
+}
+
+function jsonObject({ value, label }: { value: unknown; label: string }): Record<string, unknown> {
+ if (value === undefined || value === null || value === '') {
+ return {};
+ }
+ if (typeof value !== 'object' || Array.isArray(value)) {
+ throw new Error(`${label} must be a JSON object.`);
+ }
+ return { ...value };
+}
+
+function compact(values: Record<string, unknown>): Record<string, unknown> {
+ return Object.fromEntries(
+ Object.entries(values).filter(([, value]) => value !== undefined && value !== null && value !== ''),
+ );
+}
+
+function describeError({ status, body }: { status: number; body: unknown }): string {
+ const detail = vendorMessage(body);
+ const hint = STATUS_HINTS[status];
+ return [`Zendesk API error ${status}`, hint, detail].filter((part) => part).join(': ');
+}
+
+function vendorMessage(body: unknown): string {
+ if (typeof body === 'string') {
+ return body;
+ }
+ if (!body || typeof body !== 'object') {
+ return '';
+ }
+ const parts = [
+ 'error' in body ? body.error : undefined,
+ 'description' in body ? body.description : undefined,
+ 'details' in body ? body.details : undefined,
+ ];
+ return parts
+ .filter((part) => part !== undefined && part !== null)
+ .map((part) => (typeof part === 'string' ? part : JSON.stringify(part)))
+ .join(' — ');
+}
+
+const STATUS_HINTS: Record<number, string> = {
+ 401: 'the connection is invalid or expired',
+ 403: 'the connected user lacks the permission or plan feature for this operation',
+ 404: 'the record was not found',
+ 409: 'the record changed since it was read (safe update conflict)',
+ 422: 'Zendesk rejected the input',
+ 429: 'rate limit exceeded, retry later',
+};
+
+export const zendeskApi = {
+ request,
+ send,
+ optionalBoolean,
+ id,
+ optionalId,
+ pathSegment,
+ jsonArray,
+ idList,
+ stringList,
+ query,
+ cursorQuery,
+ cursorResult,
+ offsetQuery,
+ offsetResult,
+ jsonObject,
+ compact,
+};
+
+export type CursorMeta = { has_more?: boolean; after_cursor?: string | null };
+
+type RequestParams = {
+ auth: ZendeskAuthValue;
+ method: HttpMethod;
+ path: string;
+ queryParams?: QueryParams;
+ body?: unknown;
+};
diff --git a/packages/pieces/community/zendesk/src/lib/output-schemas.ts b/packages/pieces/community/zendesk/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..1c9e9a8e5d9
--- /dev/null
+++ b/packages/pieces/community/zendesk/src/lib/output-schemas.ts
@@ -0,0 +1,2584 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const attachmentFields: OutputSchema['fields'] = [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'content_url', label: 'Content URL', format: 'url' },
+ { key: 'mapped_content_url', label: 'Mapped Content URL', format: 'url' },
+ { key: 'content_type', label: 'Content Type' },
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'width', label: 'Width' },
+ { key: 'height', label: 'Height' },
+ { key: 'inline', label: 'Inline', format: 'boolean' },
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'malware_access_override', label: 'Malware Access Override', format: 'boolean' },
+ { key: 'malware_scan_result', label: 'Malware Scan Result' },
+ { key: 'thumbnails', label: 'Thumbnails' },
+];
+
+const userFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'time_zone', label: 'Time Zone' },
+ { key: 'iana_time_zone', label: 'Iana Time Zone' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'shared_phone_number', label: 'Shared Phone Number' },
+ { key: 'photo', label: 'Photo' },
+ { key: 'locale_id', label: 'Locale ID', format: 'number' },
+ { key: 'locale', label: 'Locale' },
+ { key: 'organization_id', label: 'Organization ID', format: 'number' },
+ { key: 'role', label: 'Role' },
+ { key: 'verified', label: 'Verified', format: 'boolean' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'tags', label: 'Tags' },
+ { key: 'alias', label: 'Alias' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'shared', label: 'Shared', format: 'boolean' },
+ { key: 'shared_agent', label: 'Shared Agent', format: 'boolean' },
+ { key: 'last_login_at', label: 'Last Login At', format: 'datetime' },
+ { key: 'two_factor_auth_enabled', label: 'Two Factor Auth Enabled' },
+ { key: 'signature', label: 'Signature' },
+ { key: 'details', label: 'Details' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'role_type', label: 'Role Type', format: 'number' },
+ { key: 'custom_role_id', label: 'Custom Role ID', format: 'number' },
+ { key: 'is_billing_admin', label: 'Is Billing Admin', format: 'boolean' },
+ { key: 'moderator', label: 'Moderator', format: 'boolean' },
+ { key: 'ticket_restriction', label: 'Ticket Restriction' },
+ { key: 'only_private_comments', label: 'Only Private Comments', format: 'boolean' },
+ { key: 'restricted_agent', label: 'Restricted Agent', format: 'boolean' },
+ { key: 'suspended', label: 'Suspended', format: 'boolean' },
+ { key: 'default_group_id', label: 'Default Group ID', format: 'number' },
+ { key: 'report_csv', label: 'Report CSV', format: 'boolean' },
+ { key: 'user_fields', label: 'User Fields' },
+ { key: 'suspension_details', label: 'Suspension Details' },
+];
+
+const organizationFields: OutputSchema['fields'] = [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ { key: 'shared_tickets', label: 'Shared Tickets', format: 'boolean' },
+ { key: 'shared_comments', label: 'Shared Comments', format: 'boolean' },
+ { key: 'ticket_restriction', label: 'Ticket Restriction' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'domain_names', label: 'Domain Names' },
+ { key: 'details', label: 'Details' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'group_id', label: 'Group ID' },
+ { key: 'tags', label: 'Tags' },
+ { key: 'organization_fields', label: 'Organization Fields' },
+ { key: 'children_count', label: 'Children Count', format: 'number' },
+];
+
+const ticketFields: OutputSchema['fields'] = [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'external_id', label: 'External ID' },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'to', label: 'To' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'type', label: 'Type' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'raw_subject', label: 'Raw Subject (with placeholders)' },
+ { key: 'description', label: 'Description' },
+ { key: 'priority', label: 'Priority' },
+ { key: 'status', label: 'Status' },
+ { key: 'recipient', label: 'Recipient' },
+ { key: 'requester_id', label: 'Requester ID', format: 'number' },
+ { key: 'submitter_id', label: 'Submitter ID', format: 'number' },
+ { key: 'assignee_id', label: 'Assignee ID', format: 'number' },
+ { key: 'organization_id', label: 'Organization ID', format: 'number' },
+ { key: 'group_id', label: 'Group ID', format: 'number' },
+ { key: 'collaborator_ids', label: 'Collaborator IDs' },
+ { key: 'follower_ids', label: 'Follower IDs' },
+ { key: 'email_cc_ids', label: 'Email CC IDs' },
+ { key: 'forum_topic_id', label: 'Forum Topic ID' },
+ { key: 'problem_id', label: 'Problem ID' },
+ { key: 'has_incidents', label: 'Has Incidents', format: 'boolean' },
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ { key: 'due_at', label: 'Due At', format: 'datetime' },
+ { key: 'tags', label: 'Tags' },
+ {
+ key: 'custom_fields',
+ label: 'Custom Fields',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'satisfaction_rating',
+ label: 'Satisfaction Rating',
+ children: [
+ { key: 'score', label: 'Score' },
+ ],
+ },
+ { key: 'sharing_agreement_ids', label: 'Sharing Agreement IDs' },
+ { key: 'custom_status_id', label: 'Custom Status ID', format: 'number' },
+ { key: 'followup_ids', label: 'Followup IDs' },
+ { key: 'ticket_form_id', label: 'Ticket Form ID', format: 'number' },
+ { key: 'brand_id', label: 'Brand ID', format: 'number' },
+ { key: 'allow_channelback', label: 'Allow Channelback', format: 'boolean' },
+ { key: 'allow_attachments', label: 'Allow Attachments', format: 'boolean' },
+ { key: 'from_messaging_channel', label: 'From Messaging Channel', format: 'boolean' },
+ { key: 'support_type', label: 'Support Type' },
+];
+
+export const zendeskAddTicketCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'ticket', label: 'Ticket', children: ticketFields },
+ {
+ key: 'audit',
+ label: 'Audit',
+ children: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ { key: 'subject', label: 'Subject' },
+ { key: 'recipients', label: 'Recipients' },
+ ],
+ },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ {
+ key: 'to',
+ label: 'To',
+ children: [
+ { key: 'address', label: 'Address', format: 'email' },
+ { key: 'name', label: 'Name' },
+ { key: 'email_ccs', label: 'Email Ccs' },
+ ],
+ },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const zendeskAddOrganizationTagsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tags', label: 'Tags' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskCreateTicketOutputSchema: OutputSchema = { fields: ticketFields };
+
+export const zendeskDeleteTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ ],
+};
+
+export const attachFileToTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'ticket', label: 'Ticket', children: ticketFields },
+ {
+ key: 'audit',
+ label: 'Audit',
+ children: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ { key: 'source', label: 'Source' },
+ ],
+ },
+ { key: 'subject', label: 'Subject' },
+ { key: 'body', label: 'Body' },
+ { key: 'recipients', label: 'Recipients' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments', labelKey: 'id', listItems: attachmentFields },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ ],
+ },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'to', label: 'To' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'upload_token', label: 'Upload Token' },
+ ],
+};
+
+export const zendeskGetTicketConversationLogOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'reference', label: 'Reference' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ {
+ key: 'author',
+ label: 'Author',
+ children: [
+ { key: 'type', label: 'Type' },
+ { key: 'zen:support:user_id', label: 'Zen Support User ID', format: 'number' },
+ { key: 'display_name', label: 'Display Name' },
+ ],
+ },
+ {
+ key: 'content',
+ label: 'Content',
+ children: [
+ { key: 'type', label: 'Type' },
+ { key: 'body', label: 'Body' },
+ ],
+ },
+ { key: 'type', label: 'Type' },
+ { key: 'attachments', label: 'Attachments' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ { key: 'email_id', label: 'Email ID' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskCountSearchResultsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskCountViewTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'view_id', label: 'View ID', format: 'number' },
+ { key: 'value', label: 'Value', format: 'number' },
+ { key: 'pretty', label: 'Pretty' },
+ { key: 'fresh', label: 'Fresh', format: 'boolean' },
+ ],
+};
+
+export const zendeskCreateManyTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'job_type', label: 'Job Type' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'progress', label: 'Progress' },
+ { key: 'status', label: 'Status' },
+ { key: 'message', label: 'Message' },
+ { key: 'results', label: 'Results' },
+ ],
+};
+
+export const zendeskDeleteOrganizationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'organization_id', label: 'Organization ID', format: 'number' },
+ ],
+};
+
+export const zendeskDeleteCustomObjectRecordOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'custom_object_key', label: 'Custom Object Key' },
+ { key: 'record_id', label: 'Record ID' },
+ ],
+};
+
+export const zendeskDeleteUserOutputSchema: OutputSchema = { fields: userFields };
+
+export const zendeskDeleteUserIdentityOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'identity_id', label: 'Identity ID', format: 'number' },
+ ],
+};
+
+export const zendeskDeleteOrganizationMembershipOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'organization_membership_id', label: 'Organization Membership ID', format: 'number' },
+ ],
+};
+
+export const zendeskGetAttachmentOutputSchema: OutputSchema = { fields: attachmentFields };
+
+export const zendeskGetAutomationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'conditions',
+ label: 'Conditions',
+ children: [
+ {
+ key: 'all',
+ label: 'All',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'operator', label: 'Operator' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'raw_title', label: 'Raw Title' },
+ ],
+};
+
+export const zendeskGetMacroOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'restriction', label: 'Restriction' },
+ { key: 'raw_title', label: 'Raw Title' },
+ ],
+};
+
+export const zendeskGetManyTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tickets', label: 'Tickets', labelKey: 'subject', listItems: ticketFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskGetManyUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'users', label: 'Users', labelKey: 'name', listItems: userFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskGetOrganizationOutputSchema: OutputSchema = { fields: organizationFields };
+
+export const zendeskGetCustomObjectRecordOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'custom_object_key', label: 'Custom Object Key' },
+ { key: 'custom_object_fields', label: 'Custom Object Fields' },
+ { key: 'created_by_user_id', label: 'Created By User ID' },
+ { key: 'updated_by_user_id', label: 'Updated By User ID' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'photo', label: 'Photo' },
+ ],
+};
+
+export const zendeskGetTicketTriggerOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'conditions',
+ label: 'Conditions',
+ children: [
+ {
+ key: 'all',
+ label: 'All',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'operator', label: 'Operator' },
+ { key: 'value', label: 'Value', format: 'boolean' },
+ ],
+ },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ { key: 'description', label: 'Description' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'raw_title', label: 'Raw Title' },
+ { key: 'category_id', label: 'Category ID' },
+ ],
+};
+
+export const zendeskGetUserOutputSchema: OutputSchema = { fields: userFields };
+
+export const zendeskCreateUserIdentityOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'value', label: 'Value', format: 'email' },
+ { key: 'verified', label: 'Verified', format: 'boolean' },
+ { key: 'primary', label: 'Primary', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'verification_method', label: 'Verification Method' },
+ { key: 'verified_at', label: 'Verified At' },
+ { key: 'undeliverable_count', label: 'Undeliverable Count', format: 'number' },
+ { key: 'deliverable_state', label: 'Deliverable State' },
+ ],
+};
+
+export const zendeskGetJobStatusOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'job_type', label: 'Job Type' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'progress', label: 'Progress', format: 'number' },
+ { key: 'status', label: 'Status' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'id',
+ listItems: [
+ { key: 'index', label: 'Index', format: 'number' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'account_id', label: 'Account ID', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const zendeskListTicketAuditsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'audits',
+ label: 'Audits',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ { key: 'email_id', label: 'Email ID' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ { key: 'value', label: 'Value' },
+ { key: 'field_name', label: 'Field Name' },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ { key: 'subject', label: 'Subject' },
+ { key: 'recipients', label: 'Recipients' },
+ { key: 'previous_value', label: 'Previous Value' },
+ { key: 'comment_id', label: 'Comment ID' },
+ ],
+ },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ {
+ key: 'to',
+ label: 'To',
+ children: [
+ { key: 'address', label: 'Address', format: 'email' },
+ { key: 'name', label: 'Name' },
+ { key: 'email_ccs', label: 'Email Ccs' },
+ ],
+ },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListAutomationsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'automations',
+ label: 'Automations',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'conditions',
+ label: 'Conditions',
+ children: [
+ {
+ key: 'all',
+ label: 'All',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'operator', label: 'Operator' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'raw_title', label: 'Raw Title' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListBrandsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'brands',
+ label: 'Brands',
+ labelKey: 'name',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ { key: 'brand_url', label: 'Brand URL', format: 'url' },
+ { key: 'subdomain', label: 'Subdomain' },
+ { key: 'host_mapping', label: 'Host Mapping' },
+ { key: 'has_help_center', label: 'Has Help Center', format: 'boolean' },
+ { key: 'help_center_state', label: 'Help Center State' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'is_deleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'logo', label: 'Logo' },
+ { key: 'ticket_form_ids', label: 'Ticket Form IDs' },
+ { key: 'signature_template', label: 'Signature Template' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListTicketEmailCcsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'users', label: 'Users', labelKey: 'name', listItems: userFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskListCustomObjectFieldsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'custom_object_fields',
+ label: 'Custom Object Fields',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'key', label: 'Key' },
+ { key: 'title', label: 'Title' },
+ { key: 'description', label: 'Description' },
+ { key: 'raw_title', label: 'Raw Title' },
+ { key: 'raw_description', label: 'Raw Description' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'system', label: 'System', format: 'boolean' },
+ { key: 'regexp_for_validation', label: 'Regexp For Validation' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'required', label: 'Required', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskListCustomObjectRecordsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'custom_object_records',
+ label: 'Custom Object Records',
+ labelKey: 'name',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'custom_object_key', label: 'Custom Object Key' },
+ { key: 'custom_object_fields', label: 'Custom Object Fields' },
+ { key: 'created_by_user_id', label: 'Created By User ID' },
+ { key: 'updated_by_user_id', label: 'Updated By User ID' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'photo', label: 'Photo' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListTicketCommentsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'comments',
+ label: 'Comments',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments', labelKey: 'id', listItems: attachmentFields },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ {
+ key: 'to',
+ label: 'To',
+ children: [
+ { key: 'address', label: 'Address', format: 'email' },
+ { key: 'name', label: 'Name' },
+ { key: 'email_ccs', label: 'Email Ccs' },
+ ],
+ },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_page', label: 'Next Page' },
+ ],
+};
+
+export const zendeskListCustomObjectsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'custom_objects',
+ label: 'Custom Objects',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'key', label: 'Key' },
+ { key: 'created_by_user_id', label: 'Created By User ID' },
+ { key: 'updated_by_user_id', label: 'Updated By User ID' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'title', label: 'Title' },
+ { key: 'raw_title', label: 'Raw Title' },
+ { key: 'title_pluralized', label: 'Title Pluralized' },
+ { key: 'raw_title_pluralized', label: 'Raw Title Pluralized' },
+ { key: 'description', label: 'Description' },
+ { key: 'raw_description', label: 'Raw Description' },
+ { key: 'include_in_list_view', label: 'Include In List View', format: 'boolean' },
+ { key: 'allows_photos', label: 'Allows Photos', format: 'boolean' },
+ { key: 'created_via', label: 'Created Via' },
+ { key: 'allows_attachments', label: 'Allows Attachments', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskListCustomStatusesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'custom_statuses',
+ label: 'Custom Statuses',
+ labelKey: 'id',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'status_category', label: 'Status Category' },
+ { key: 'agent_label', label: 'Agent Label' },
+ { key: 'raw_agent_label', label: 'Raw Agent Label' },
+ { key: 'end_user_label', label: 'End User Label' },
+ { key: 'raw_end_user_label', label: 'Raw End User Label' },
+ { key: 'description', label: 'Description' },
+ { key: 'raw_description', label: 'Raw Description' },
+ { key: 'end_user_description', label: 'End User Description' },
+ { key: 'raw_end_user_description', label: 'Raw End User Description' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskListDeletedTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'deleted_tickets',
+ label: 'Deleted Tickets',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'actor',
+ label: 'Actor',
+ children: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ { key: 'deleted_at', label: 'Deleted At', format: 'datetime' },
+ { key: 'previous_state', label: 'Previous State' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListGroupsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'groups',
+ label: 'Groups',
+ labelKey: 'name',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListUserIdentitiesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'identities',
+ label: 'Identities',
+ labelKey: 'id',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'value', label: 'Value', format: 'email' },
+ { key: 'verified', label: 'Verified', format: 'boolean' },
+ { key: 'primary', label: 'Primary', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'verification_method', label: 'Verification Method' },
+ { key: 'verified_at', label: 'Verified At' },
+ { key: 'undeliverable_count', label: 'Undeliverable Count', format: 'number' },
+ { key: 'deliverable_state', label: 'Deliverable State' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListTicketIncidentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tickets', label: 'Tickets', labelKey: 'subject', listItems: ticketFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskListMacrosOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'macros',
+ label: 'Macros',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'restriction', label: 'Restriction' },
+ { key: 'raw_title', label: 'Raw Title' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListOrganizationMembershipsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'organization_memberships',
+ label: 'Organization Memberships',
+ labelKey: 'id',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'organization_id', label: 'Organization ID', format: 'number' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'organization_name', label: 'Organization Name' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'view_tickets', label: 'View Tickets', format: 'boolean' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListOrganizationUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'users', label: 'Users', labelKey: 'name', listItems: userFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListOrganizationFieldsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'organization_fields', label: 'Organization Fields' },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListOrganizationsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'organizations', label: 'Organizations', labelKey: 'name', listItems: organizationFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListProblemTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tickets', label: 'Tickets', labelKey: 'subject', listItems: ticketFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListSatisfactionRatingsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'satisfaction_ratings', label: 'Satisfaction Ratings' },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListSlaPoliciesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'sla_policies',
+ label: 'Sla Policies',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'description', label: 'Description' },
+ { key: 'position', label: 'Position', format: 'number' },
+ {
+ key: 'filter',
+ label: 'Filter',
+ children: [
+ { key: 'all', label: 'All' },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ {
+ key: 'policy_metrics',
+ label: 'Policy Metrics',
+ listItems: [
+ { key: 'priority', label: 'Priority' },
+ { key: 'metric', label: 'Metric' },
+ { key: 'target', label: 'Target', format: 'number' },
+ { key: 'business_hours', label: 'Business Hours', format: 'boolean' },
+ { key: 'target_in_seconds', label: 'Target In Seconds', format: 'number' },
+ ],
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'metric_settings', label: 'Metric Settings' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskListSuspendedTicketsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'suspended_tickets',
+ label: 'Suspended Tickets',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ {
+ key: 'author',
+ label: 'Author',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ ],
+ },
+ { key: 'subject', label: 'Subject' },
+ { key: 'content', label: 'Content' },
+ { key: 'cause', label: 'Cause' },
+ { key: 'cause_id', label: 'Cause ID', format: 'number' },
+ { key: 'error_messages', label: 'Error Messages' },
+ { key: 'message_id', label: 'Message ID', format: 'email' },
+ { key: 'ticket_id', label: 'Ticket ID' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ {
+ key: 'from',
+ label: 'From',
+ children: [
+ { key: 'address', label: 'Address', format: 'email' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ {
+ key: 'to',
+ label: 'To',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'address', label: 'Address', format: 'email' },
+ ],
+ },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'recipient', label: 'Recipient', format: 'email' },
+ { key: 'brand_id', label: 'Brand ID', format: 'number' },
+ { key: 'content_html', label: 'Content HTML' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListTicketFieldsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'ticket_fields',
+ label: 'Ticket Fields',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'title', label: 'Title' },
+ { key: 'raw_title', label: 'Raw Title' },
+ { key: 'description', label: 'Description' },
+ { key: 'raw_description', label: 'Raw Description' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'required', label: 'Required', format: 'boolean' },
+ { key: 'collapsed_for_agents', label: 'Collapsed For Agents', format: 'boolean' },
+ { key: 'regexp_for_validation', label: 'Regexp For Validation' },
+ { key: 'title_in_portal', label: 'Title In Portal' },
+ { key: 'raw_title_in_portal', label: 'Raw Title In Portal' },
+ { key: 'visible_in_portal', label: 'Visible In Portal', format: 'boolean' },
+ { key: 'editable_in_portal', label: 'Editable In Portal', format: 'boolean' },
+ { key: 'required_in_portal', label: 'Required In Portal', format: 'boolean' },
+ { key: 'agent_can_edit', label: 'Agent Can Edit', format: 'boolean' },
+ { key: 'tag', label: 'Tag' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'removable', label: 'Removable', format: 'boolean' },
+ { key: 'key', label: 'Key' },
+ { key: 'agent_description', label: 'Agent Description' },
+ { key: 'raw_agent_description', label: 'Raw Agent Description' },
+ {
+ key: 'system_field_options',
+ label: 'System Field Options',
+ labelKey: 'name',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'sub_type_id', label: 'Sub Type ID', format: 'number' },
+ {
+ key: 'custom_field_options',
+ label: 'Custom Field Options',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ { key: 'raw_name', label: 'Raw Name' },
+ { key: 'value', label: 'Value' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'allow_solving', label: 'Allow Solving', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'custom_statuses',
+ label: 'Custom Statuses',
+ labelKey: 'id',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'status_category', label: 'Status Category' },
+ { key: 'agent_label', label: 'Agent Label' },
+ { key: 'end_user_label', label: 'End User Label' },
+ { key: 'description', label: 'Description' },
+ { key: 'end_user_description', label: 'End User Description' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListTicketFormsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'ticket_forms',
+ label: 'Ticket Forms',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'raw_name', label: 'Raw Name' },
+ { key: 'raw_display_name', label: 'Raw Display Name' },
+ { key: 'end_user_visible', label: 'End User Visible', format: 'boolean' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'ticket_field_ids', label: 'Ticket Field IDs' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'in_all_brands', label: 'In All Brands', format: 'boolean' },
+ { key: 'restricted_brand_ids', label: 'Restricted Brand IDs' },
+ { key: 'end_user_conditions', label: 'End User Conditions' },
+ { key: 'agent_conditions', label: 'Agent Conditions' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'name', label: 'Name' },
+ { key: 'display_name', label: 'Display Name' },
+ { key: 'form_type', label: 'Form Type' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'deleted_at', label: 'Deleted At' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskListTicketTriggersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'triggers',
+ label: 'Triggers',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'conditions',
+ label: 'Conditions',
+ children: [
+ {
+ key: 'all',
+ label: 'All',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'operator', label: 'Operator' },
+ { key: 'value', label: 'Value', format: 'boolean' },
+ ],
+ },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ { key: 'description', label: 'Description' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'raw_title', label: 'Raw Title' },
+ { key: 'category_id', label: 'Category ID' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tickets', label: 'Tickets', labelKey: 'subject', listItems: ticketFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListUserFieldsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'user_fields', label: 'User Fields' },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'users', label: 'Users', labelKey: 'name', listItems: userFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskListViewsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'views',
+ label: 'Views',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'execution',
+ label: 'Execution',
+ children: [
+ { key: 'group_by', label: 'Group By' },
+ { key: 'group_order', label: 'Group Order' },
+ { key: 'sort_by', label: 'Sort By' },
+ { key: 'sort_order', label: 'Sort Order' },
+ {
+ key: 'group',
+ label: 'Group',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'title', label: 'Title' },
+ { key: 'filterable', label: 'Filterable', format: 'boolean' },
+ { key: 'sortable', label: 'Sortable', format: 'boolean' },
+ { key: 'order', label: 'Order' },
+ ],
+ },
+ {
+ key: 'sort',
+ label: 'Sort',
+ children: [
+ { key: 'id', label: 'ID' },
+ { key: 'title', label: 'Title' },
+ { key: 'filterable', label: 'Filterable', format: 'boolean' },
+ { key: 'sortable', label: 'Sortable', format: 'boolean' },
+ { key: 'order', label: 'Order' },
+ ],
+ },
+ {
+ key: 'columns',
+ label: 'Columns',
+ labelKey: 'title',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'title', label: 'Title' },
+ { key: 'filterable', label: 'Filterable', format: 'boolean' },
+ { key: 'sortable', label: 'Sortable', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'fields',
+ label: 'Fields',
+ labelKey: 'title',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'title', label: 'Title' },
+ { key: 'filterable', label: 'Filterable', format: 'boolean' },
+ { key: 'sortable', label: 'Sortable', format: 'boolean' },
+ ],
+ },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ ],
+ },
+ {
+ key: 'conditions',
+ label: 'Conditions',
+ children: [
+ {
+ key: 'all',
+ label: 'All',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'operator', label: 'Operator' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ { key: 'restriction', label: 'Restriction' },
+ { key: 'raw_title', label: 'Raw Title' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskMakeUserIdentityPrimaryOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'identities',
+ label: 'Identities',
+ labelKey: 'id',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'value', label: 'Value', format: 'email' },
+ { key: 'verified', label: 'Verified', format: 'boolean' },
+ { key: 'primary', label: 'Primary', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'verification_method', label: 'Verification Method' },
+ { key: 'verified_at', label: 'Verified At' },
+ { key: 'undeliverable_count', label: 'Undeliverable Count', format: 'number' },
+ { key: 'deliverable_state', label: 'Deliverable State' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskMakeCommentPrivateOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'comment_id', label: 'Comment ID', format: 'number' },
+ ],
+};
+
+export const zendeskGetCurrentUserOutputSchema: OutputSchema = { fields: userFields };
+
+export const zendeskCreateOrganizationMembershipOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'organization_id', label: 'Organization ID', format: 'number' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'organization_name', label: 'Organization Name' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'view_tickets', label: 'View Tickets', format: 'boolean' },
+ ],
+};
+
+export const zendeskMergeTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'job_type', label: 'Job Type' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'total', label: 'Total' },
+ { key: 'progress', label: 'Progress' },
+ { key: 'status', label: 'Status' },
+ { key: 'message', label: 'Message' },
+ { key: 'results', label: 'Results' },
+ ],
+};
+
+export const zendeskCreateOrUpdateOrganizationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'created', label: 'Created', format: 'boolean' },
+ { key: 'organization', label: 'Organization', children: organizationFields },
+ ],
+};
+
+export const zendeskPreviewMacroOnTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'ticket', label: 'Ticket', children: ticketFields },
+ ],
+};
+
+export const zendeskRecoverSuspendedTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tickets', label: 'Tickets', labelKey: 'subject', listItems: ticketFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskRedactCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ ],
+};
+
+export const zendeskSearchOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'result_type',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'result_type', label: 'Result Type' },
+ { key: 'url', label: 'API URL', format: 'url' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'total_count', label: 'Total Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_page', label: 'Next Page', format: 'number' },
+ ],
+};
+
+export const zendeskSearchAutomationsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'automations',
+ label: 'Automations',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'conditions',
+ label: 'Conditions',
+ children: [
+ {
+ key: 'all',
+ label: 'All',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'operator', label: 'Operator' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'raw_title', label: 'Raw Title' },
+ {
+ key: 'highlights',
+ label: 'Highlights',
+ children: [
+ { key: 'title', label: 'Title' },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskSearchMacrosOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'macros',
+ label: 'Macros',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ { key: 'restriction', label: 'Restriction' },
+ { key: 'raw_title', label: 'Raw Title' },
+ {
+ key: 'highlights',
+ label: 'Highlights',
+ children: [
+ { key: 'title', label: 'Title' },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_page', label: 'Next Page' },
+ ],
+};
+
+export const zendeskSearchOrganizationsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'organizations', label: 'Organizations', labelKey: 'name', listItems: organizationFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskSearchTicketTriggersOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'triggers',
+ label: 'Triggers',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ {
+ key: 'actions',
+ label: 'Actions',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'conditions',
+ label: 'Conditions',
+ children: [
+ {
+ key: 'all',
+ label: 'All',
+ listItems: [
+ { key: 'field', label: 'Field' },
+ { key: 'operator', label: 'Operator' },
+ { key: 'value', label: 'Value', format: 'boolean' },
+ ],
+ },
+ { key: 'any', label: 'Any' },
+ ],
+ },
+ { key: 'description', label: 'Description' },
+ { key: 'position', label: 'Position', format: 'number' },
+ { key: 'raw_title', label: 'Raw Title' },
+ {
+ key: 'highlights',
+ label: 'Highlights',
+ children: [
+ { key: 'title', label: 'Title' },
+ ],
+ },
+ { key: 'category_id', label: 'Category ID' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const zendeskSearchUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'users', label: 'Users', labelKey: 'name', listItems: userFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_page', label: 'Next Page' },
+ ],
+};
+
+export const zendeskGetTicketSlaMetricsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'policy_metrics', label: 'Policy Metrics' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const newGroupOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
+
+export const newOrganizationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'group_id', label: 'Group ID' },
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'shared_comments', label: 'Shared Comments', format: 'boolean' },
+ { key: 'shared_tickets', label: 'Shared Tickets', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
+
+export const newUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default_group_id', label: 'Default Group ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'id', label: 'ID' },
+ { key: 'organization_id', label: 'Organization ID' },
+ { key: 'role', label: 'Role' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
+
+export const tagAddedToUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'default_group_id', label: 'Default Group ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'id', label: 'ID' },
+ { key: 'organization_id', label: 'Organization ID' },
+ { key: 'role', label: 'Role' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'added_tags', label: 'Added Tags' },
+ ],
+};
+
+export const zendeskGetTicketMetricsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'group_stations', label: 'Group Stations', format: 'number' },
+ { key: 'assignee_stations', label: 'Assignee Stations', format: 'number' },
+ { key: 'reopens', label: 'Reopens', format: 'number' },
+ { key: 'replies', label: 'Replies', format: 'number' },
+ { key: 'assignee_updated_at', label: 'Assignee Updated At', format: 'datetime' },
+ { key: 'requester_updated_at', label: 'Requester Updated At', format: 'datetime' },
+ { key: 'status_updated_at', label: 'Status Updated At', format: 'datetime' },
+ { key: 'initially_assigned_at', label: 'Initially Assigned At', format: 'datetime' },
+ { key: 'assigned_at', label: 'Assigned At', format: 'datetime' },
+ { key: 'solved_at', label: 'Solved At' },
+ { key: 'latest_comment_added_at', label: 'Latest Comment Added At', format: 'datetime' },
+ {
+ key: 'reply_time_in_minutes',
+ label: 'Reply Time In Minutes',
+ children: [
+ { key: 'calendar', label: 'Calendar', format: 'number' },
+ { key: 'business', label: 'Business', format: 'number' },
+ ],
+ },
+ {
+ key: 'first_resolution_time_in_minutes',
+ label: 'First Resolution Time In Minutes',
+ children: [
+ { key: 'calendar', label: 'Calendar' },
+ { key: 'business', label: 'Business' },
+ ],
+ },
+ {
+ key: 'full_resolution_time_in_minutes',
+ label: 'Full Resolution Time In Minutes',
+ children: [
+ { key: 'calendar', label: 'Calendar' },
+ { key: 'business', label: 'Business' },
+ ],
+ },
+ {
+ key: 'agent_wait_time_in_minutes',
+ label: 'Agent Wait Time In Minutes',
+ children: [
+ { key: 'calendar', label: 'Calendar' },
+ { key: 'business', label: 'Business' },
+ ],
+ },
+ {
+ key: 'requester_wait_time_in_minutes',
+ label: 'Requester Wait Time In Minutes',
+ children: [
+ { key: 'calendar', label: 'Calendar' },
+ { key: 'business', label: 'Business' },
+ ],
+ },
+ {
+ key: 'on_hold_time_in_minutes',
+ label: 'On Hold Time In Minutes',
+ children: [
+ { key: 'calendar', label: 'Calendar', format: 'number' },
+ { key: 'business', label: 'Business', format: 'number' },
+ ],
+ },
+ { key: 'custom_status_updated_at', label: 'Custom Status Updated At', format: 'datetime' },
+ ],
+};
+
+export const zendeskCreateUserOutputSchema: OutputSchema = { fields: userFields };
+
+export const zendeskCreateOrUpdateUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'created', label: 'Created', format: 'boolean' },
+ { key: 'user', label: 'User', children: userFields },
+ ],
+};
+
+export const zendeskUpsertCustomObjectRecordOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'created', label: 'Created', format: 'boolean' },
+ {
+ key: 'custom_object_record',
+ label: 'Custom Object Record',
+ children: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'custom_object_key', label: 'Custom Object Key' },
+ { key: 'custom_object_fields', label: 'Custom Object Fields' },
+ { key: 'created_by_user_id', label: 'Created By User ID' },
+ { key: 'updated_by_user_id', label: 'Updated By User ID' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'external_id', label: 'External ID' },
+ { key: 'photo', label: 'Photo' },
+ ],
+ },
+ ],
+};
+
+export const addCommentToTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'ticket', label: 'Ticket', children: ticketFields },
+ {
+ key: 'audit',
+ label: 'Audit',
+ children: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ ],
+ },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'to', label: 'To' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ {
+ key: 'comment_details',
+ label: 'Comment Details',
+ children: [
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ { key: 'content_type', label: 'Content Type' },
+ ],
+ },
+ ],
+};
+
+export const deleteUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'user', label: 'User', children: userFields },
+ ],
+ },
+ { key: 'warning', label: 'Warning' },
+ { key: 'note', label: 'Note' },
+ ],
+};
+
+export const findAgentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'agent', label: 'Agent', children: userFields },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'role', label: 'Role' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ ],
+};
+
+export const findGroupOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ {
+ key: 'group',
+ label: 'Group',
+ children: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'default', label: 'Default', format: 'boolean' },
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
+
+export const findOrganizationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'results', label: 'Results', labelKey: 'name', listItems: organizationFields },
+ { key: 'facets', label: 'Facets' },
+ { key: 'next_page', label: 'Next Page' },
+ { key: 'previous_page', label: 'Previous Page' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+ },
+ { key: 'organizations', label: 'Organizations', labelKey: 'name', listItems: organizationFields },
+ {
+ key: 'search_criteria',
+ label: 'Search Criteria',
+ children: [
+ { key: 'type', label: 'Type' },
+ { key: 'query', label: 'Query' },
+ { key: 'sort_by', label: 'Sort By' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ { key: 'total_count', label: 'Total Count', format: 'number' },
+ { key: 'found_count', label: 'Found Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ ],
+};
+
+export const findTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'results', label: 'Results', labelKey: 'subject', listItems: ticketFields },
+ { key: 'facets', label: 'Facets' },
+ { key: 'next_page', label: 'Next Page' },
+ { key: 'previous_page', label: 'Previous Page' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+ },
+ { key: 'tickets', label: 'Tickets', labelKey: 'subject', listItems: ticketFields },
+ {
+ key: 'search_criteria',
+ label: 'Search Criteria',
+ children: [
+ { key: 'type', label: 'Type' },
+ { key: 'query', label: 'Query' },
+ { key: 'sort_by', label: 'Sort By' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ { key: 'total_count', label: 'Total Count', format: 'number' },
+ { key: 'found_count', label: 'Found Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ ],
+};
+
+export const findUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'results', label: 'Results', labelKey: 'name', listItems: userFields },
+ { key: 'facets', label: 'Facets' },
+ { key: 'next_page', label: 'Next Page' },
+ { key: 'previous_page', label: 'Previous Page' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+ },
+ { key: 'users', label: 'Users', labelKey: 'name', listItems: userFields },
+ {
+ key: 'search_criteria',
+ label: 'Search Criteria',
+ children: [
+ { key: 'type', label: 'Type' },
+ { key: 'query', label: 'Query' },
+ { key: 'sort_by', label: 'Sort By' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ { key: 'total_count', label: 'Total Count', format: 'number' },
+ { key: 'found_count', label: 'Found Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ ],
+};
+
+export const findLatestCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ {
+ key: 'comment',
+ label: 'Comment',
+ children: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'to', label: 'To' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ ],
+ },
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'is_public', label: 'Is Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments' },
+ ],
+};
+
+export const createOrganizationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'organization', label: 'Organization', children: organizationFields },
+ ],
+ },
+ ],
+};
+
+export const createTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'ticket', label: 'Ticket', children: ticketFields },
+ {
+ key: 'audit',
+ label: 'Audit',
+ children: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'value', label: 'Value' },
+ { key: 'field_name', label: 'Field Name' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ { key: 'body', label: 'Body' },
+ { key: 'html_body', label: 'HTML Body' },
+ { key: 'plain_body', label: 'Plain Body' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'attachments', label: 'Attachments' },
+ { key: 'audit_id', label: 'Audit ID', format: 'number' },
+ ],
+ },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'to', label: 'To' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const updateTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'ticket', label: 'Ticket', children: ticketFields },
+ {
+ key: 'audit',
+ label: 'Audit',
+ children: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'author_id', label: 'Author ID', format: 'number' },
+ {
+ key: 'metadata',
+ label: 'Metadata',
+ children: [
+ {
+ key: 'system',
+ label: 'System',
+ children: [
+ { key: 'client', label: 'Client' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'location', label: 'Location' },
+ { key: 'latitude', label: 'Latitude', format: 'number' },
+ { key: 'longitude', label: 'Longitude', format: 'number' },
+ ],
+ },
+ { key: 'custom', label: 'Custom' },
+ ],
+ },
+ {
+ key: 'events',
+ label: 'Events',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'value', label: 'Value' },
+ { key: 'field_name', label: 'Field Name' },
+ { key: 'previous_value', label: 'Previous Value' },
+ ],
+ },
+ {
+ key: 'via',
+ label: 'Via',
+ children: [
+ { key: 'channel', label: 'Channel' },
+ {
+ key: 'source',
+ label: 'Source',
+ children: [
+ { key: 'from', label: 'From' },
+ { key: 'to', label: 'To' },
+ { key: 'rel', label: 'Rel' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const addTagToTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'tags', label: 'Tags' },
+ ],
+ },
+ { key: 'added_tags', label: 'Added Tags' },
+ ],
+};
+
+export const removeTagFromTicketOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'tags', label: 'Tags' },
+ ],
+ },
+ { key: 'removed_tags', label: 'Removed Tags' },
+ ],
+};
+
+export const createUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'user', label: 'User', children: userFields },
+ ],
+ },
+ { key: 'user_role', label: 'User Role' },
+ { key: 'verification_email_sent', label: 'Verification Email Sent', format: 'boolean' },
+ ],
+};
+
+export const updateUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'user', label: 'User', children: userFields },
+ ],
+ },
+ ],
+};
+
+export const zendeskListViewTicketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'tickets', label: 'Tickets', labelKey: 'subject', listItems: ticketFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'next_cursor', label: 'Next Cursor' },
+ ],
+};
+
+export const zendeskGetSatisfactionRatingOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'url', label: 'API URL', format: 'url' },
+ { key: 'score', label: 'Score' },
+ { key: 'comment', label: 'Comment' },
+ { key: 'reason', label: 'Reason' },
+ { key: 'reason_code', label: 'Reason Code', format: 'number' },
+ { key: 'reason_id', label: 'Reason ID', format: 'number' },
+ { key: 'ticket_id', label: 'Ticket ID', format: 'number' },
+ { key: 'requester_id', label: 'Requester ID', format: 'number' },
+ { key: 'assignee_id', label: 'Assignee ID', format: 'number' },
+ { key: 'group_id', label: 'Group ID', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
diff --git a/packages/pieces/community/zendesk/src/lib/trigger/new-group.ts b/packages/pieces/community/zendesk/src/lib/trigger/new-group.ts
index aa61ae0d4b7..b043136be04 100644
--- a/packages/pieces/community/zendesk/src/lib/trigger/new-group.ts
+++ b/packages/pieces/community/zendesk/src/lib/trigger/new-group.ts
@@ -12,6 +12,7 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { newGroupOutputSchema } from '../output-schemas';
interface ZendeskGroup {
id: number;
@@ -52,6 +53,7 @@ const polling: Polling<ZendeskAuthValue, Record<string, never>> = {
export const newGroup = createTrigger({
name: 'new_group',
+ outputSchema: newGroupOutputSchema,
classification: 'READ',
displayName: 'New Group',
description: 'Fires when a new group is created.',
diff --git a/packages/pieces/community/zendesk/src/lib/trigger/new-organization.ts b/packages/pieces/community/zendesk/src/lib/trigger/new-organization.ts
index dadd4352cf6..9ad99625aae 100644
--- a/packages/pieces/community/zendesk/src/lib/trigger/new-organization.ts
+++ b/packages/pieces/community/zendesk/src/lib/trigger/new-organization.ts
@@ -8,6 +8,7 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { newOrganizationOutputSchema } from '../output-schemas';
const WEBHOOK_TRIGGER_KEY = 'zendesk_new_organization_webhook';
@@ -28,6 +29,7 @@ interface ZendeskOrganization {
export const newOrganization = createTrigger({
name: 'new_organization',
+ outputSchema: newOrganizationOutputSchema,
classification: 'READ',
displayName: 'New Organization',
description: 'Fires when a new organization record is created. Uses Zendesk event webhook (no Trigger needed).',
diff --git a/packages/pieces/community/zendesk/src/lib/trigger/new-ticket-in-view.ts b/packages/pieces/community/zendesk/src/lib/trigger/new-ticket-in-view.ts
index 108b0f83bbe..ede3bda137a 100644
--- a/packages/pieces/community/zendesk/src/lib/trigger/new-ticket-in-view.ts
+++ b/packages/pieces/community/zendesk/src/lib/trigger/new-ticket-in-view.ts
@@ -13,10 +13,12 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { zendeskCreateTicketOutputSchema } from '../output-schemas';
export const newTicketInView = createTrigger({
auth: zendeskAuth,
name: 'new_ticket_in_view',
+ outputSchema: zendeskCreateTicketOutputSchema,
classification: 'READ',
displayName: 'New ticket in view',
description: 'Triggers when a new ticket is created in a view',
diff --git a/packages/pieces/community/zendesk/src/lib/trigger/new-user.ts b/packages/pieces/community/zendesk/src/lib/trigger/new-user.ts
index 1d71700ae6a..7db2635f410 100644
--- a/packages/pieces/community/zendesk/src/lib/trigger/new-user.ts
+++ b/packages/pieces/community/zendesk/src/lib/trigger/new-user.ts
@@ -9,6 +9,7 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { newUserOutputSchema } from '../output-schemas';
const WEBHOOK_TRIGGER_KEY = 'zendesk_new_user_webhook';
@@ -60,6 +61,7 @@ interface ZendeskUser {
export const newUser = createTrigger({
name: 'new_user',
+ outputSchema: newUserOutputSchema,
classification: 'READ',
displayName: 'New User',
description: 'Fires when a new user is created. Uses Zendesk event webhook (no Trigger needed).',
diff --git a/packages/pieces/community/zendesk/src/lib/trigger/tag-added-to-user.ts b/packages/pieces/community/zendesk/src/lib/trigger/tag-added-to-user.ts
index eec8a07fc1f..52c839e9a37 100644
--- a/packages/pieces/community/zendesk/src/lib/trigger/tag-added-to-user.ts
+++ b/packages/pieces/community/zendesk/src/lib/trigger/tag-added-to-user.ts
@@ -8,6 +8,7 @@ import {
} from '@activepieces/pieces-common';
import { zendeskAuth } from '../auth';
import { getZendeskAuthentication, getZendeskBaseUrl } from '../common/client';
+import { tagAddedToUserOutputSchema } from '../output-schemas';
const WEBHOOK_TRIGGER_KEY = 'zendesk_tag_added_to_user_webhook';
@@ -41,6 +42,7 @@ interface ZendeskUser {
export const tagAddedToUser = createTrigger({
name: 'tag_added_to_user',
+ outputSchema: tagAddedToUserOutputSchema,
classification: 'READ',
displayName: 'Tag Added to User',
description: 'Triggers when one or more tags are added to a user.',