# nodes

node_type: n8n-nodes-base.Xero
name: Xero
display_name: Xero
description: Consume Xero API
category: output
icon: file:xero.svg
code_hash: aba95b820352106355fa38f55f10b5075b9568611f3b9bb24eb9473d6bbe146b
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.xero
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:41
updated_at: 2025-06-08 09:18:41
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Xero = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const InvoiceDescription_1 = require("./InvoiceDescription");
  const ContactDescription_1 = require("./ContactDescription");
  class Xero {
      constructor() {
          this.description = {
              displayName: 'Xero',
              name: 'xero',
              icon: 'file:xero.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Xero API',
              defaults: {
                  name: 'Xero',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'xeroOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                      ],
                      default: 'invoice',
                  },
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...InvoiceDescription_1.invoiceOperations,
                  ...InvoiceDescription_1.invoiceFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getItemCodes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Items: items } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/items', {
                          organizationId,
                      });
                      for (const item of items) {
                          const itemName = item.Description;
                          const itemId = item.Code;
                          returnData.push({
                              name: itemName,
                              value: itemId,
                          });
                      }
                      return returnData;
                  },
                  async getAccountCodes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Accounts: accounts } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Accounts', {
                          organizationId,
                      });
                      for (const account of accounts) {
                          const accountName = account.Name;
                          const accountId = account.Code;
                          returnData.push({
                              name: accountName,
                              value: accountId,
                          });
                      }
                      return returnData;
                  },
                  async getTenants() {
                      const returnData = [];
                      const tenants = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '', {}, {}, 'https://api.xero.com/connections');
                      for (const tenant of tenants) {
                          const tenantName = tenant.tenantName;
                          const tenantId = tenant.tenantId;
                          returnData.push({
                              name: tenantName,
                              value: tenantId,
                          });
                      }
                      return returnData;
                  },
                  async getBrandingThemes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { BrandingThemes: themes } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/BrandingThemes', { organizationId });
                      for (const theme of themes) {
                          const themeName = theme.Name;
                          const themeId = theme.BrandingThemeID;
                          returnData.push({
                              name: themeName,
                              value: themeId,
                          });
                      }
                      return returnData;
                  },
                  async getCurrencies() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Currencies: currencies } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Currencies', {
                          organizationId,
                      });
                      for (const currency of currencies) {
                          const currencyName = currency.Code;
                          const currencyId = currency.Description;
                          returnData.push({
                              name: currencyName,
                              value: currencyId,
                          });
                      }
                      return returnData;
                  },
                  async getTrakingCategories() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { TrackingCategories: categories } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/TrackingCategories', { organizationId });
                      for (const category of categories) {
                          const categoryName = category.Name;
                          const categoryId = category.TrackingCategoryID;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'invoice') {
                      if (operation === 'create') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const type = this.getNodeParameter('type', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const lineItemsValues = this.getNodeParameter('lineItemsUi', i)
                              .lineItemsValues;
                          const body = {
                              organizationId,
                              Type: type,
                              Contact: { ContactID: contactId },
                          };
                          if (lineItemsValues) {
                              const lineItems = [];
                              for (const lineItemValue of lineItemsValues) {
                                  const lineItem = {
                                      Tracking: [],
                                  };
                                  lineItem.AccountCode = lineItemValue.accountCode;
                                  lineItem.Description = lineItemValue.description;
                                  lineItem.DiscountRate = lineItemValue.discountRate;
                                  lineItem.ItemCode = lineItemValue.itemCode;
                                  lineItem.LineAmount = lineItemValue.lineAmount;
                                  lineItem.Quantity = lineItemValue.quantity.toString();
                                  lineItem.TaxAmount = lineItemValue.taxAmount;
                                  lineItem.TaxType = lineItemValue.taxType;
                                  lineItem.UnitAmount = lineItemValue.unitAmount;
                                  lineItems.push(lineItem);
                              }
                              body.LineItems = lineItems;
                          }
                          if (additionalFields.brandingThemeId) {
                              body.BrandingThemeID = additionalFields.brandingThemeId;
                          }
                          if (additionalFields.currency) {
                              body.CurrencyCode = additionalFields.currency;
                          }
                          if (additionalFields.currencyRate) {
                              body.CurrencyRate = additionalFields.currencyRate;
                          }
                          if (additionalFields.date) {
                              body.Date = additionalFields.date;
                          }
                          if (additionalFields.dueDate) {
                              body.DueDate = additionalFields.dueDate;
                          }
                          if (additionalFields.dueDate) {
                              body.DueDate = additionalFields.dueDate;
                          }
                          if (additionalFields.expectedPaymentDate) {
                              body.ExpectedPaymentDate = additionalFields.expectedPaymentDate;
                          }
                          if (additionalFields.invoiceNumber) {
                              body.InvoiceNumber = additionalFields.invoiceNumber;
                          }
                          if (additionalFields.lineAmountType) {
                              body.LineAmountTypes = additionalFields.lineAmountType;
                          }
                          if (additionalFields.plannedPaymentDate) {
                              body.PlannedPaymentDate = additionalFields.plannedPaymentDate;
                          }
                          if (additionalFields.reference) {
                              body.Reference = additionalFields.reference;
                          }
                          if (additionalFields.sendToContact) {
                              body.SentToContact = additionalFields.sendToContact;
                          }
                          if (additionalFields.status) {
                              body.Status = additionalFields.status;
                          }
                          if (additionalFields.url) {
                              body.Url = additionalFields.url;
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', '/Invoices', body);
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'update') {
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              organizationId,
                          };
                          if (updateFields.lineItemsUi) {
                              const lineItemsValues = updateFields.lineItemsUi
                                  .lineItemsValues;
                              if (lineItemsValues) {
                                  const lineItems = [];
                                  for (const lineItemValue of lineItemsValues) {
                                      const lineItem = {
                                          Tracking: [],
                                      };
                                      lineItem.AccountCode = lineItemValue.accountCode;
                                      lineItem.Description = lineItemValue.description;
                                      lineItem.DiscountRate = lineItemValue.discountRate;
                                      lineItem.ItemCode = lineItemValue.itemCode;
                                      lineItem.LineAmount = lineItemValue.lineAmount;
                                      lineItem.Quantity = lineItemValue.quantity.toString();
                                      lineItem.TaxAmount = lineItemValue.taxAmount;
                                      lineItem.TaxType = lineItemValue.taxType;
                                      lineItem.UnitAmount = lineItemValue.unitAmount;
                                      lineItems.push(lineItem);
                                  }
                                  body.LineItems = lineItems;
                              }
                          }
                          if (updateFields.type) {
                              body.Type = updateFields.type;
                          }
                          if (updateFields.Contact) {
                              body.Contact = { ContactID: updateFields.contactId };
                          }
                          if (updateFields.brandingThemeId) {
                              body.BrandingThemeID = updateFields.brandingThemeId;
                          }
                          if (updateFields.currency) {
                              body.CurrencyCode = updateFields.currency;
                          }
                          if (updateFields.currencyRate) {
                              body.CurrencyRate = updateFields.currencyRate;
                          }
                          if (updateFields.date) {
                              body.Date = updateFields.date;
                          }
                          if (updateFields.dueDate) {
                              body.DueDate = updateFields.dueDate;
                          }
                          if (updateFields.dueDate) {
                              body.DueDate = updateFields.dueDate;
                          }
                          if (updateFields.expectedPaymentDate) {
                              body.ExpectedPaymentDate = updateFields.expectedPaymentDate;
                          }
                          if (updateFields.invoiceNumber) {
                              body.InvoiceNumber = updateFields.invoiceNumber;
                          }
                          if (updateFields.lineAmountType) {
                              body.LineAmountTypes = updateFields.lineAmountType;
                          }
                          if (updateFields.plannedPaymentDate) {
                              body.PlannedPaymentDate = updateFields.plannedPaymentDate;
                          }
                          if (updateFields.reference) {
                              body.Reference = updateFields.reference;
                          }
                          if (updateFields.sendToContact) {
                              body.SentToContact = updateFields.sendToContact;
                          }
                          if (updateFields.status) {
                              body.Status = updateFields.status;
                          }
                          if (updateFields.url) {
                              body.Url = updateFields.url;
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', `/Invoices/${invoiceId}`, body);
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', `/Invoices/${invoiceId}`, {
                              organizationId,
                          });
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'getAll') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.statuses) {
                              qs.statuses = options.statuses.join(',');
                          }
                          if (options.orderBy) {
                              qs.order = `${options.orderBy} ${options.sortOrder === undefined ? 'DESC' : options.sortOrder}`;
                          }
                          if (options.where) {
                              qs.where = options.where;
                          }
                          if (options.createdByMyApp) {
                              qs.createdByMyApp = options.createdByMyApp;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.xeroApiRequestAllItems.call(this, 'Invoices', 'GET', '/Invoices', { organizationId }, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Invoices', { organizationId }, qs);
                              responseData = responseData.Invoices;
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const addressesUi = additionalFields.addressesUi;
                          const phonesUi = additionalFields.phonesUi;
                          const body = {
                              Name: name,
                          };
                          if (additionalFields.accountNumber) {
                              body.AccountNumber = additionalFields.accountNumber;
                          }
                          if (additionalFields.bankAccountDetails) {
                              body.BankAccountDetails = additionalFields.bankAccountDetails;
                          }
                          if (additionalFields.contactNumber) {
                              body.ContactNumber = additionalFields.contactNumber;
                          }
                          if (additionalFields.contactStatus) {
                              body.ContactStatus = additionalFields.contactStatus;
                          }
                          if (additionalFields.defaultCurrency) {
                              body.DefaultCurrency = additionalFields.defaultCurrency;
                          }
                          if (additionalFields.emailAddress) {
                              body.EmailAddress = additionalFields.emailAddress;
                          }
                          if (additionalFields.firstName) {
                              body.FirstName = additionalFields.firstName;
                          }
                          if (additionalFields.lastName) {
                              body.LastName = additionalFields.lastName;
                          }
                          if (additionalFields.purchasesDefaultAccountCode) {
                              body.PurchasesDefaultAccountCode =
                                  additionalFields.purchasesDefaultAccountCode;
                          }
                          if (additionalFields.salesDefaultAccountCode) {
                              body.SalesDefaultAccountCode = additionalFields.salesDefaultAccountCode;
                          }
                          if (additionalFields.skypeUserName) {
                              body.SkypeUserName = additionalFields.skypeUserName;
                          }
                          if (additionalFields.taxNumber) {
                              body.taxNumber = additionalFields.taxNumber;
                          }
                          if (additionalFields.xeroNetworkKey) {
                              body.xeroNetworkKey = additionalFields.xeroNetworkKey;
                          }
                          if (phonesUi) {
                              const phoneValues = phonesUi === null || phonesUi === void 0 ? void 0 : phonesUi.phonesValues;
                              if (phoneValues) {
                                  const phones = [];
                                  for (const phoneValue of phoneValues) {
                                      const phone = {};
                                      phone.PhoneType = phoneValue.phoneType;
                                      phone.PhoneNumber = phoneValue.phoneNumber;
                                      phone.PhoneAreaCode = phoneValue.phoneAreaCode;
                                      phone.PhoneCountryCode = phoneValue.phoneCountryCode;
                                      phones.push(phone);
                                  }
                                  body.Phones = phones;
                              }
                          }
                          if (addressesUi) {
                              const addressValues = addressesUi === null || addressesUi === void 0 ? void 0 : addressesUi.addressesValues;
                              if (addressValues) {
                                  const addresses = [];
                                  for (const addressValue of addressValues) {
                                      const address = {};
                                      address.AddressType = addressValue.type;
                                      address.AddressLine1 = addressValue.line1;
                                      address.AddressLine2 = addressValue.line2;
                                      address.City = addressValue.city;
                                      address.Region = addressValue.region;
                                      address.PostalCode = addressValue.postalCode;
                                      address.Country = addressValue.country;
                                      address.AttentionTo = addressValue.attentionTo;
                                      addresses.push(address);
                                  }
                                  body.Addresses = addresses;
                              }
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', '/Contacts', {
                              organizationId,
                              Contacts: [body],
                          });
                          responseData = responseData.Contacts;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', `/Contacts/${contactId}`, {
                              organizationId,
                          });
                          responseData = responseData.Contacts;
                      }
                      if (operation === 'getAll') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.includeArchived) {
                              qs.includeArchived = options.includeArchived;
                          }
                          if (options.orderBy) {
                              qs.order = `${options.orderBy} ${options.sortOrder === undefined ? 'DESC' : options.sortOrder}`;
                          }
                          if (options.where) {
                              qs.where = options.where;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.xeroApiRequestAllItems.call(this, 'Contacts', 'GET', '/Contacts', { organizationId }, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Contacts', { organizationId }, qs);
                              responseData = responseData.Contacts;
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const addressesUi = updateFields.addressesUi;
                          const phonesUi = updateFields.phonesUi;
                          const body = {};
                          if (updateFields.accountNumber) {
                              body.AccountNumber = updateFields.accountNumber;
                          }
                          if (updateFields.name) {
                              body.Name = updateFields.name;
                          }
                          if (updateFields.bankAccountDetails) {
                              body.BankAccountDetails = updateFields.bankAccountDetails;
                          }
                          if (updateFields.contactNumber) {
                              body.ContactNumber = updateFields.contactNumber;
                          }
                          if (updateFields.contactStatus) {
                              body.ContactStatus = updateFields.contactStatus;
                          }
                          if (updateFields.defaultCurrency) {
                              body.DefaultCurrency = updateFields.defaultCurrency;
                          }
                          if (updateFields.emailAddress) {
                              body.EmailAddress = updateFields.emailAddress;
                          }
                          if (updateFields.firstName) {
                              body.FirstName = updateFields.firstName;
                          }
                          if (updateFields.lastName) {
                              body.LastName = updateFields.lastName;
                          }
                          if (updateFields.purchasesDefaultAccountCode) {
                              body.PurchasesDefaultAccountCode = updateFields.purchasesDefaultAccountCode;
                          }
                          if (updateFields.salesDefaultAccountCode) {
                              body.SalesDefaultAccountCode = updateFields.salesDefaultAccountCode;
                          }
                          if (updateFields.skypeUserName) {
                              body.SkypeUserName = updateFields.skypeUserName;
                          }
                          if (updateFields.taxNumber) {
                              body.taxNumber = updateFields.taxNumber;
                          }
                          if (updateFields.xeroNetworkKey) {
                              body.xeroNetworkKey = updateFields.xeroNetworkKey;
                          }
                          if (phonesUi) {
                              const phoneValues = phonesUi === null || phonesUi === void 0 ? void 0 : phonesUi.phonesValues;
                              if (phoneValues) {
                                  const phones = [];
                                  for (const phoneValue of phoneValues) {
                                      const phone = {};
                                      phone.PhoneType = phoneValue.phoneType;
                                      phone.PhoneNumber = phoneValue.phoneNumber;
                                      phone.PhoneAreaCode = phoneValue.phoneAreaCode;
                                      phone.PhoneCountryCode = phoneValue.phoneCountryCode;
                                      phones.push(phone);
                                  }
                                  body.Phones = phones;
                              }
                          }
                          if (addressesUi) {
                              const addressValues = addressesUi === null || addressesUi === void 0 ? void 0 : addressesUi.addressesValues;
                              if (addressValues) {
                                  const addresses = [];
                                  for (const addressValue of addressValues) {
                                      const address = {};
                                      address.AddressType = addressValue.type;
                                      address.AddressLine1 = addressValue.line1;
                                      address.AddressLine2 = addressValue.line2;
                                      address.City = addressValue.city;
                                      address.Region = addressValue.region;
                                      address.PostalCode = addressValue.postalCode;
                                      address.Country = addressValue.country;
                                      address.AttentionTo = addressValue.attentionTo;
                                      addresses.push(address);
                                  }
                                  body.Addresses = addresses;
                              }
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', `/Contacts/${contactId}`, {
                              organizationId,
                              Contacts: [body],
                          });
                          responseData = responseData.Contacts;
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Xero = Xero;
  //# sourceMappingURL=Xero.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Xero node documentation
  description: Learn how to use the Xero node in n8n. Follow technical documentation to integrate Xero node into your workflows.
  contentType: [integration, reference]
  ---

  # Xero node

  Use the Xero node to automate work in Xero, and integrate Xero with other applications. n8n has built-in support for a wide range of Xero features, including creating, updating, and getting contacts and invoices. 

  On this page, you'll find a list of operations the Xero node supports and links to more resources.

  /// note | Credentials
  Refer to [Xero credentials](/integrations/builtin/credentials/xero.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Contact
      * Create a contact
      * Get a contact
      * Get all contacts
      * Update a contact
  * Invoice
      * Create a invoice
      * Get a invoice
      * Get all invoices
      * Update a invoice

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'xero') ]]

  ## Related resources

  Refer to [Xero's API documentation](https://developer.xero.com/documentation/api/accounting/overview){:target=_blank .external-link} for more information about the service.

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"c724060a-d951-4784-ac88-7ee2d511cdc9","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"834e5d4f0d5061fa1fd73e6036d5c39c33dc2a3c7003e470b44edd888bfebd1c"}}


node_type: n8n-nodes-base.Zammad
name: Zammad
display_name: Zammad
description: Consume the Zammad API
category: input
icon: file:zammad.svg
code_hash: e36ae4ec17e8db702c4d105e9179bc5068a484ceaf7033667c28278b5edf87b8
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.zammad
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:42
updated_at: 2025-06-08 09:18:42
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zammad = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Zammad {
      constructor() {
          this.description = {
              displayName: 'Zammad',
              name: 'zammad',
              icon: 'file:zammad.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Zammad API',
              defaults: {
                  name: 'Zammad',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zammadBasicAuthApi',
                      required: true,
                      testedBy: 'zammadBasicAuthApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['basicAuth'],
                          },
                      },
                  },
                  {
                      name: 'zammadTokenAuthApi',
                      required: true,
                      testedBy: 'zammadTokenAuthApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['tokenAuth'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Basic Auth',
                              value: 'basicAuth',
                          },
                          {
                              name: 'Token Auth',
                              value: 'tokenAuth',
                          },
                      ],
                      default: 'tokenAuth',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Group',
                              value: 'group',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Ticket',
                              value: 'ticket',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'user',
                  },
                  ...descriptions_1.groupDescription,
                  ...descriptions_1.organizationDescription,
                  ...descriptions_1.ticketDescription,
                  ...descriptions_1.userDescription,
              ],
          };
          this.methods = {
              loadOptions: {
                  async loadGroupCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getGroupCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadOrganizationCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getOrganizationCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadUserCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getUserCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadTicketCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getTicketCustomFields)(allFields).map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadGroupFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getGroupFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadOrganizationFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getOrganizationFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadTicketFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getTicketFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadUserFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getUserFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadGroupNames() {
                      const groups = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/groups'));
                      return groups.map((i) => ({ name: i.name, value: i.name }));
                  },
                  async loadOrganizationNames() {
                      const orgs = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/organizations'));
                      return orgs.filter(GenericFunctions_1.isNotZammadFoundation).map((i) => ({ name: i.name, value: i.name }));
                  },
                  async loadCustomerEmails() {
                      const users = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users'));
                      return users.filter(GenericFunctions_1.isCustomer).map((i) => ({ name: i.email, value: i.email }));
                  },
                  async loadGroups() {
                      const groups = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/groups'));
                      return groups.map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadOrganizations() {
                      const orgs = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/organizations'));
                      return orgs.filter(GenericFunctions_1.isNotZammadFoundation).map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadUsers() {
                      const users = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users'));
                      return users.filter(GenericFunctions_1.doesNotBelongToZammad).map((i) => ({ name: i.login, value: i.id }));
                  },
              },
              credentialTest: {
                  async zammadBasicAuthApiTest(credential) {
                      const credentials = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(credentials.baseUrl);
                      const options = {
                          method: 'GET',
                          uri: `${baseUrl}/api/v1/users/me`,
                          json: true,
                          rejectUnauthorized: !credentials.allowUnauthorizedCerts,
                          auth: {
                              user: credentials.username,
                              pass: credentials.password,
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
                  async zammadTokenAuthApiTest(credential) {
                      const credentials = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(credentials.baseUrl);
                      const options = {
                          method: 'GET',
                          uri: `${baseUrl}/api/v1/users/me`,
                          json: true,
                          rejectUnauthorized: !credentials.allowUnauthorizedCerts,
                          headers: {
                              Authorization: `Token token=${credentials.accessToken}`,
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const body = {
                              firstname: this.getNodeParameter('firstname', i),
                              lastname: this.getNodeParameter('lastname', i),
                          };
                          const { addressUi, customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressDetails);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/users', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { addressUi, customFieldsUi, ...rest } = updateFields;
                          Object.assign(body, addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressDetails);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/users/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/users/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/users/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const { sortUi, ...rest } = this.getNodeParameter('filters', i);
                          Object.assign(qs, sortUi === null || sortUi === void 0 ? void 0 : sortUi.sortDetails);
                          Object.assign(qs, rest);
                          qs.query || (qs.query = '');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems
                              .call(this, 'GET', '/users/search', {}, qs, limit)
                              .then((response) => {
                              return response.map((user) => {
                                  const { _preferences, ...data } = user;
                                  return data;
                              });
                          });
                      }
                      else if (operation === 'getSelf') {
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users/me');
                      }
                  }
                  else if (resource === 'organization') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/organizations', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { customFieldsUi, ...rest } = updateFields;
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/organizations/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/organizations/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/organizations/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/organizations', {}, {}, limit);
                      }
                  }
                  else if (resource === 'group') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/groups', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { customFieldsUi, ...rest } = updateFields;
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/groups/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/groups/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/groups/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/groups', {}, {}, limit);
                      }
                  }
                  else if (resource === 'ticket') {
                      if (operation === 'create') {
                          const body = {
                              article: {},
                              title: this.getNodeParameter('title', i),
                              group: this.getNodeParameter('group', i),
                              customer: this.getNodeParameter('customer', i),
                          };
                          const article = this.getNodeParameter('article', i);
                          if (!Object.keys(article).length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Article is required', { itemIndex: i });
                          }
                          const { articleDetails: { visibility, ...rest }, } = article;
                          body.article = {
                              ...rest,
                              internal: visibility === 'internal',
                          };
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/tickets', body);
                          const { id } = responseData;
                          responseData.articles = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/ticket_articles/by_ticket/${id}`);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/tickets/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/tickets/${id}`);
                          responseData.articles = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/ticket_articles/by_ticket/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/tickets', {}, {}, limit);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zammad = Zammad;
  //# sourceMappingURL=Zammad.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Zammad node documentation
  description: Learn how to use the Zammad node in n8n. Follow technical documentation to integrate Zammad node into your workflows.
  contentType: [integration, reference]
  ---

  # Zammad node

  Use the Zammad node to automate work in Zammad, and integrate Zammad with other applications. n8n has built-in support for a wide range of Zammad features, including creating, retrieving, and deleting groups and organizations.

  On this page, you'll find a list of operations the Zammad node supports and links to more resources.

  /// note | Credentials
  Refer to [Zammad credentials](/integrations/builtin/credentials/zammad.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Group
      * Create
      * Delete
      * Get
      * Get many
      * Update
  * Organization
      * Create
      * Delete
      * Get
      * Get many
      * Update
  * Ticket
      * Create
      * Delete
      * Get
      * Get many
  * User
      * Create
      * Delete
      * Get
      * Get many
  	* Get self
      * Update

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'zammad') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"eb690d2b-e21e-4c1c-9ec2-ad8bed480089","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"9acaf16a6bab4a9099ed7d1f23e22b9135cc7c06d689e0041d720d6750362d0a"}}


node_type: n8n-nodes-base.Zendesk
name: Zendesk
display_name: Zendesk
description: Consume Zendesk API
category: output
icon: file:zendesk.svg
code_hash: 88e68de64c851f4c26efadf449ffbca89eabfb9b4ccda678908be23fbabe14b8
documentation_url: https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.zendesktrigger
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:42
updated_at: 2025-06-08 09:18:42
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zendesk = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const TicketDescription_1 = require("./TicketDescription");
  const TicketFieldDescription_1 = require("./TicketFieldDescription");
  const UserDescription_1 = require("./UserDescription");
  const OrganizationDescription_1 = require("./OrganizationDescription");
  class Zendesk {
      constructor() {
          this.description = {
              displayName: 'Zendesk',
              name: 'zendesk',
              icon: 'file:zendesk.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Zendesk API',
              defaults: {
                  name: 'Zendesk',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zendeskApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                  },
                  {
                      name: 'zendeskOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'API Token',
                              value: 'apiToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'apiToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Ticket',
                              value: 'ticket',
                              description: 'Tickets are the means through which your end users (customers) communicate with agents in Zendesk Support',
                          },
                          {
                              name: 'Ticket Field',
                              value: 'ticketField',
                              description: 'Manage system and custom ticket fields',
                          },
                          {
                              name: 'User',
                              value: 'user',
                              description: 'Manage users',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                              description: 'Manage organizations',
                          },
                      ],
                      default: 'ticket',
                  },
                  ...TicketDescription_1.ticketOperations,
                  ...TicketDescription_1.ticketFields,
                  ...TicketFieldDescription_1.ticketFieldOperations,
                  ...TicketFieldDescription_1.ticketFieldFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
                  ...OrganizationDescription_1.organizationOperations,
                  ...OrganizationDescription_1.organizationFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomFields() {
                      const returnData = [];
                      const customFields = [
                          'text',
                          'textarea',
                          'date',
                          'integer',
                          'decimal',
                          'regexp',
                          'multiselect',
                          'tagger',
                      ];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields');
                      for (const field of fields) {
                          if (customFields.includes(field.type)) {
                              const fieldName = field.title;
                              const fieldId = field.id;
                              returnData.push({
                                  name: fieldName,
                                  value: fieldId,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getGroups() {
                      const returnData = [];
                      const groups = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'groups', 'GET', '/groups');
                      for (const group of groups) {
                          const groupName = group.name;
                          const groupId = group.id;
                          returnData.push({
                              name: groupName,
                              value: groupId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'tags', 'GET', '/tags');
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.name;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getLocales() {
                      const returnData = [];
                      const locales = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'locales', 'GET', '/locales');
                      for (const locale of locales) {
                          const localeName = `${locale.locale} - ${locale.name}`;
                          const localeId = locale.locale;
                          returnData.push({
                              name: localeName,
                              value: localeId,
                          });
                      }
                      return returnData;
                  },
                  async getUserFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'user_fields', 'GET', '/user_fields');
                      for (const field of fields) {
                          const fieldName = field.title;
                          const fieldId = field.key;
                          returnData.push({
                              name: fieldName,
                              value: fieldId,
                          });
                      }
                      return returnData;
                  },
                  async getOrganizationFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organization_fields', 'GET', '/organization_fields');
                      for (const field of fields) {
                          const fieldName = field.title;
                          const fieldId = field.key;
                          returnData.push({
                              name: fieldName,
                              value: fieldId,
                          });
                      }
                      return returnData;
                  },
                  async getOrganizations() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organizations', 'GET', '/organizations', {}, {});
                      for (const field of fields) {
                          returnData.push({
                              name: field.name,
                              value: field.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'ticket') {
                      if (operation === 'create') {
                          const description = this.getNodeParameter('description', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const comment = {
                              body: description,
                          };
                          const body = {
                              comment,
                          };
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.type) {
                                  body.type = additionalFields.type;
                              }
                              if (additionalFields.externalId) {
                                  body.external_id = additionalFields.externalId;
                              }
                              if (additionalFields.subject) {
                                  body.subject = additionalFields.subject;
                              }
                              if (additionalFields.status) {
                                  body.status = additionalFields.status;
                              }
                              if (additionalFields.recipient) {
                                  body.recipient = additionalFields.recipient;
                              }
                              if (additionalFields.group) {
                                  body.group_id = additionalFields.group;
                              }
                              if (additionalFields.tags) {
                                  body.tags = additionalFields.tags;
                              }
                              if (additionalFields.customFieldsUi) {
                                  body.custom_fields = additionalFields.customFieldsUi
                                      .customFieldsValues;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/tickets', { ticket: body });
                          responseData = responseData.ticket;
                      }
                      if (operation === 'update') {
                          const ticketId = this.getNodeParameter('id', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const body = {};
                          if (jsonParameters) {
                              const updateFieldsJson = this.getNodeParameter('updateFieldsJson', i);
                              if (updateFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(updateFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(updateFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const updateFields = this.getNodeParameter('updateFields', i);
                              if (updateFields.type) {
                                  body.type = updateFields.type;
                              }
                              if (updateFields.externalId) {
                                  body.external_id = updateFields.externalId;
                              }
                              if (updateFields.subject) {
                                  body.subject = updateFields.subject;
                              }
                              if (updateFields.status) {
                                  body.status = updateFields.status;
                              }
                              if (updateFields.recipient) {
                                  body.recipient = updateFields.recipient;
                              }
                              if (updateFields.group) {
                                  body.group_id = updateFields.group;
                              }
                              if (updateFields.tags) {
                                  body.tags = updateFields.tags;
                              }
                              if (updateFields.customFieldsUi) {
                                  body.custom_fields = updateFields.customFieldsUi
                                      .customFieldsValues;
                              }
                              if (updateFields.assigneeEmail) {
                                  body.assignee_email = updateFields.assigneeEmail;
                              }
                              if (updateFields.internalNote) {
                                  const comment = {
                                      html_body: updateFields.internalNote,
                                      public: false,
                                  };
                                  body.comment = comment;
                              }
                              if (updateFields.publicReply) {
                                  const comment = {
                                      body: updateFields.publicReply,
                                      public: true,
                                  };
                                  body.comment = comment;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/tickets/${ticketId}`, {
                              ticket: body,
                          });
                          responseData = responseData.ticket;
                      }
                      if (operation === 'get') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const ticketId = this.getNodeParameter('id', i);
                          const endpoint = ticketType === 'regular' ? `/tickets/${ticketId}` : `/suspended_tickets/${ticketId}`;
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', endpoint, {});
                          responseData = responseData.ticket || responseData.suspended_ticket;
                      }
                      if (operation === 'getAll') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          qs.query = 'type:ticket';
                          if (options.query) {
                              qs.query += ` ${options.query}`;
                          }
                          if (options.status) {
                              qs.query += ` status:${options.status}`;
                          }
                          if (options.group) {
                              qs.query += ` group:${options.group}`;
                          }
                          if (options.sortBy) {
                              qs.sort_by = options.sortBy;
                          }
                          if (options.sortOrder) {
                              qs.sort_order = options.sortOrder;
                          }
                          const endpoint = ticketType === 'regular' ? '/search' : '/suspended_tickets';
                          const property = ticketType === 'regular' ? 'results' : 'suspended_tickets';
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, property, 'GET', endpoint, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.results || responseData.suspended_tickets;
                          }
                      }
                      if (operation === 'delete') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const ticketId = this.getNodeParameter('id', i);
                          const endpoint = ticketType === 'regular' ? `/tickets/${ticketId}` : `/suspended_tickets/${ticketId}`;
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', endpoint, {});
                          responseData = { success: true };
                      }
                      if (operation === 'recover') {
                          const ticketId = this.getNodeParameter('id', i);
                          try {
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/suspended_tickets/${ticketId}/recover`, {});
                              responseData = responseData.ticket;
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                  }
                  if (resource === 'ticketField') {
                      if (operation === 'get') {
                          const ticketFieldId = this.getNodeParameter('ticketFieldId', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/ticket_fields/${ticketFieldId}`, {});
                          responseData = responseData.ticket_field;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields', {}, qs);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, additionalFields);
                          if (body.userFieldsUi) {
                              const userFieldsUI = body.userFieldsUi
                                  .userFieldValues;
                              if (userFieldsUI) {
                                  body.user_fields = {};
                                  for (const userField of userFieldsUI) {
                                      body.user_fields[userField.field] = userField.value;
                                  }
                                  delete body.userFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/users', { user: body });
                          responseData = responseData.user;
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('id', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          if (body.userFieldsUi) {
                              const userFieldsUI = body.userFieldsUi
                                  .userFieldValues;
                              if (userFieldsUI) {
                                  body.user_fields = {};
                                  for (const userField of userFieldsUI) {
                                      body.user_fields[userField.field] = userField.value;
                                  }
                                  delete body.userFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/users/${userId}`, {
                              user: body,
                          });
                          responseData = responseData.user;
                      }
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}`, {});
                          responseData = responseData.user;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('filters', i);
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'users', 'GET', '/users', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/users', {}, qs);
                              responseData = responseData.users;
                          }
                      }
                      if (operation === 'getOrganizations') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}/organizations`, {});
                          responseData = responseData.organizations;
                      }
                      if (operation === 'search') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('filters', i);
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'users', 'GET', '/users/search', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/users/search', {}, qs);
                              responseData = responseData.users;
                          }
                      }
                      if (operation === 'delete') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', `/users/${userId}`, {});
                          responseData = responseData.user;
                      }
                      if (operation === 'getRelatedData') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}/related`, {});
                          responseData = responseData.user_related;
                      }
                  }
                  if (resource === 'organization') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          const { organizationFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, rest);
                          if (organizationFieldsUi === null || organizationFieldsUi === void 0 ? void 0 : organizationFieldsUi.organizationFieldValues.length) {
                              const organizationFieldsUI = organizationFieldsUi.organizationFieldValues;
                              if (organizationFieldsUI.length) {
                                  body.organization_fields = {};
                                  for (const organizationField of organizationFieldsUI) {
                                      body.organization_fields[organizationField.field] = organizationField.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/organizations', {
                              organization: body,
                          });
                          responseData = responseData.organization;
                      }
                      if (operation === 'delete') {
                          const organizationId = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', `/organizations/${organizationId}`, {});
                          responseData = { success: true };
                      }
                      if (operation === 'count') {
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/organizations/count', {});
                          responseData = responseData.count;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/organizations/${organizationId}`, {});
                          responseData = responseData.organization;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organizations', 'GET', '/organizations', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/organizations', {}, qs);
                              responseData = responseData.organizations;
                          }
                      }
                      if (operation === 'getRelatedData') {
                          const organizationId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/organizations/${organizationId}/related`, {});
                          responseData = responseData.organization_related;
                      }
                      if (operation === 'update') {
                          const organizationId = this.getNodeParameter('id', i);
                          const body = {};
                          const { organizationFieldsUi, ...rest } = this.getNodeParameter('updateFields', i);
                          Object.assign(body, rest);
                          if (organizationFieldsUi === null || organizationFieldsUi === void 0 ? void 0 : organizationFieldsUi.organizationFieldValues.length) {
                              const organizationFieldsUI = organizationFieldsUi.organizationFieldValues;
                              if (organizationFieldsUI.length) {
                                  body.organization_fields = {};
                                  for (const organizationField of organizationFieldsUI) {
                                      body.organization_fields[organizationField.field] = organizationField.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/organizations/${organizationId}`, { organization: body });
                          responseData = responseData.organization;
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zendesk = Zendesk;
  //# sourceMappingURL=Zendesk.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Zendesk Trigger node documentation
  description: Learn how to use the Zendesk Trigger node in n8n. Follow technical documentation to integrate Zendesk Trigger node into your workflows.
  contentType: [integration, reference]
  ---

  # Zendesk Trigger node

  [Zendesk](https://www.zendesk.com/){:target=_blank .external-link} is a support ticketing system, designed to help track, prioritize, and solve customer support interactions. More than just a help desk, Zendesk Support helps nurture customer relationships with personalized, responsive support across any channel.

  /// note | Credentials
  You can find authentication information for this node [here](/integrations/builtin/credentials/zendesk.md).
  ///

  ///  note  | Examples and templates
  For usage examples and templates to help you get started, refer to n8n's [Zendesk Trigger integrations](https://n8n.io/integrations/zendesk-trigger/){:target=_blank .external-link} page.
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"47eba632-89d4-4984-9671-1fe75632fc4e","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e04dfd1eaa302d064717171f270d8fd507ea7eb6e00336649054af9ef13ffd04"}}


node_type: n8n-nodes-base.Yourls
name: Yourls
display_name: Yourls
description: Consume Yourls API
category: input
icon: file:yourls.png
code_hash: f151d26502f0f4c7287ac076071905adcc0d2dded190cf040d5bebe6d06a2cf9
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.yourls
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:42
updated_at: 2025-06-08 09:18:42
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Yourls = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const UrlDescription_1 = require("./UrlDescription");
  class Yourls {
      constructor() {
          this.description = {
              displayName: 'Yourls',
              name: 'yourls',
              icon: 'file:yourls.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Yourls API',
              defaults: {
                  name: 'Yourls',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'yourlsApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'URL',
                              value: 'url',
                          },
                      ],
                      default: 'url',
                  },
                  ...UrlDescription_1.urlOperations,
                  ...UrlDescription_1.urlFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'url') {
                      if (operation === 'shorten') {
                          const url = this.getNodeParameter('url', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs.url = url;
                          qs.action = 'shorturl';
                          Object.assign(qs, additionalFields);
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                      }
                      if (operation === 'expand') {
                          const shortUrl = this.getNodeParameter('shortUrl', i);
                          qs.shorturl = shortUrl;
                          qs.action = 'expand';
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                      }
                      if (operation === 'stats') {
                          const shortUrl = this.getNodeParameter('shortUrl', i);
                          qs.shorturl = shortUrl;
                          qs.action = 'url-stats';
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                          responseData = responseData.link;
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Yourls = Yourls;
  //# sourceMappingURL=Yourls.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Yourls node documentation
  description: Learn how to use the Yourls node in n8n. Follow technical documentation to integrate Yourls node into your workflows.
  contentType: [integration, reference]
  ---

  # Yourls node

  Use the Yourls node to automate work in Yourls, and integrate Yourls with other applications. n8n has built-in support for a wide range of Yourls features, including expanding and shortening URLs. 

  On this page, you'll find a list of operations the Yourls node supports and links to more resources.

  /// note | Credentials
  Refer to [Yourls credentials](/integrations/builtin/credentials/yourls.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * URL
      * Expand a URL
      * Shorten a URL
      * Get stats about one short URL

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'yourls') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f816a4ca-da0f-46da-827d-4b1a85f82b81","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"55eefa6fb76c9a41d00a1a48e14110ab2709d6155d1cae3131fa7a2f77508b13"}}


node_type: n8n-nodes-base.Zoom
name: Zoom
display_name: Zoom
description: Consume Zoom API
category: input
icon: file:zoom.svg
code_hash: 3e25ea570d229e7c9f4e48f3ac95cff39b47a344bf1b3113609fd838b9d42038
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.zoom
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:42
updated_at: 2025-06-08 09:18:42
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zoom = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const MeetingDescription_1 = require("./MeetingDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Zoom {
      constructor() {
          this.description = {
              displayName: 'Zoom',
              name: 'zoom',
              group: ['input'],
              version: 1,
              description: 'Consume Zoom API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Zoom',
              },
              icon: 'file:zoom.svg',
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zoomApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'zoomOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Meeting',
                              value: 'meeting',
                          },
                      ],
                      default: 'meeting',
                  },
                  ...MeetingDescription_1.meetingOperations,
                  ...MeetingDescription_1.meetingFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTimezones() {
                      const returnData = [];
                      for (const timezone of moment_timezone_1.default.tz.names()) {
                          const timezoneName = timezone;
                          const timezoneId = timezone;
                          returnData.push({
                              name: timezoneName,
                              value: timezoneId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  qs = {};
                  if (resource === 'meeting') {
                      if (operation === 'get') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.showPreviousOccurrences) {
                              qs.show_previous_occurrences = additionalFields.showPreviousOccurrences;
                          }
                          if (additionalFields.occurrenceId) {
                              qs.occurrence_id = additionalFields.occurrenceId;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          if (filters.type) {
                              qs.type = filters.type;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zoomApiRequestAllItems.call(this, 'meetings', 'GET', '/users/me/meetings', {}, qs);
                          }
                          else {
                              qs.page_size = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'GET', '/users/me/meetings', {}, qs);
                              responseData = responseData.meetings;
                          }
                      }
                      if (operation === 'delete') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.scheduleForReminder) {
                              qs.schedule_for_reminder = additionalFields.scheduleForReminder;
                          }
                          if (additionalFields.occurrenceId) {
                              qs.occurrence_id = additionalFields.occurrenceId;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'DELETE', `/meetings/${meetingId}`, {}, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {};
                          if (additionalFields.settings) {
                              const settingValues = {};
                              const settings = additionalFields.settings;
                              if (settings.cnMeeting) {
                                  settingValues.cn_meeting = settings.cnMeeting;
                              }
                              if (settings.inMeeting) {
                                  settingValues.in_meeting = settings.inMeeting;
                              }
                              if (settings.joinBeforeHost) {
                                  settingValues.join_before_host = settings.joinBeforeHost;
                              }
                              if (settings.muteUponEntry) {
                                  settingValues.mute_upon_entry = settings.muteUponEntry;
                              }
                              if (settings.watermark) {
                                  settingValues.watermark = settings.watermark;
                              }
                              if (settings.audio) {
                                  settingValues.audio = settings.audio;
                              }
                              if (settings.alternativeHosts) {
                                  settingValues.alternative_hosts = settings.alternativeHosts;
                              }
                              if (settings.participantVideo) {
                                  settingValues.participant_video = settings.participantVideo;
                              }
                              if (settings.hostVideo) {
                                  settingValues.host_video = settings.hostVideo;
                              }
                              if (settings.autoRecording) {
                                  settingValues.auto_recording = settings.autoRecording;
                              }
                              if (settings.registrationType) {
                                  settingValues.registration_type = settings.registrationType;
                              }
                              body.settings = settingValues;
                          }
                          body.topic = this.getNodeParameter('topic', i);
                          if (additionalFields.type) {
                              body.type = additionalFields.type;
                          }
                          if (additionalFields.startTime) {
                              if (additionalFields.timeZone) {
                                  body.start_time = (0, moment_timezone_1.default)(additionalFields.startTime).format('YYYY-MM-DDTHH:mm:ss');
                              }
                              else {
                                  body.start_time = moment_timezone_1.default
                                      .tz(additionalFields.startTime, this.getTimezone())
                                      .format();
                              }
                          }
                          if (additionalFields.duration) {
                              body.duration = additionalFields.duration;
                          }
                          if (additionalFields.scheduleFor) {
                              body.schedule_for = additionalFields.scheduleFor;
                          }
                          if (additionalFields.timeZone) {
                              body.timezone = additionalFields.timeZone;
                          }
                          if (additionalFields.password) {
                              body.password = additionalFields.password;
                          }
                          if (additionalFields.agenda) {
                              body.agenda = additionalFields.agenda;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'POST', '/users/me/meetings', body, qs);
                      }
                      if (operation === 'update') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.settings) {
                              const settingValues = {};
                              const settings = updateFields.settings;
                              if (settings.cnMeeting) {
                                  settingValues.cn_meeting = settings.cnMeeting;
                              }
                              if (settings.inMeeting) {
                                  settingValues.in_meeting = settings.inMeeting;
                              }
                              if (settings.joinBeforeHost) {
                                  settingValues.join_before_host = settings.joinBeforeHost;
                              }
                              if (settings.muteUponEntry) {
                                  settingValues.mute_upon_entry = settings.muteUponEntry;
                              }
                              if (settings.watermark) {
                                  settingValues.watermark = settings.watermark;
                              }
                              if (settings.audio) {
                                  settingValues.audio = settings.audio;
                              }
                              if (settings.alternativeHosts) {
                                  settingValues.alternative_hosts = settings.alternativeHosts;
                              }
                              if (settings.participantVideo) {
                                  settingValues.participant_video = settings.participantVideo;
                              }
                              if (settings.hostVideo) {
                                  settingValues.host_video = settings.hostVideo;
                              }
                              if (settings.autoRecording) {
                                  settingValues.auto_recording = settings.autoRecording;
                              }
                              if (settings.registrationType) {
                                  settingValues.registration_type = settings.registrationType;
                              }
                              body.settings = settingValues;
                          }
                          if (updateFields.topic) {
                              body.topic = updateFields.topic;
                          }
                          if (updateFields.type) {
                              body.type = updateFields.type;
                          }
                          if (updateFields.startTime) {
                              body.start_time = updateFields.startTime;
                          }
                          if (updateFields.duration) {
                              body.duration = updateFields.duration;
                          }
                          if (updateFields.scheduleFor) {
                              body.schedule_for = updateFields.scheduleFor;
                          }
                          if (updateFields.timeZone) {
                              body.timezone = updateFields.timeZone;
                          }
                          if (updateFields.password) {
                              body.password = updateFields.password;
                          }
                          if (updateFields.agenda) {
                              body.agenda = updateFields.agenda;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'PATCH', `/meetings/${meetingId}`, body, qs);
                          responseData = { success: true };
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = {
                          json: {},
                          error: error.message,
                          itemIndex: i,
                      };
                      returnData.push(executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zoom = Zoom;
  //# sourceMappingURL=Zoom.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Zoom node documentation
  description: Learn how to use the Zoom node in n8n. Follow technical documentation to integrate Zoom node into your workflows.
  contentType: [integration, reference]
  ---

  # Zoom node

  Use the Zoom node to automate work in Zoom, and integrate Zoom with other applications. n8n has built-in support for a wide range of Zoom features, including creating, retrieving, deleting, and updating meetings. 

  On this page, you'll find a list of operations the Zoom node supports and links to more resources.

  /// note | Credentials
  Refer to [Zoom credentials](/integrations/builtin/credentials/zoom.md) for guidance on setting up authentication. 
  ///

  --8<-- "_snippets/integrations/builtin/app-nodes/ai-tools.md"

  ## Operations

  * Meeting
      * Create a meeting
      * Delete a meeting
      * Retrieve a meeting
      * Retrieve all meetings
      * Update a meeting

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'zoom') ]]

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"2aa0f2c7-5876-4550-b003-339657979ecc","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"daa46d60892b08e9268e031dbf951e9f5cef47b1494cb587e1aba9f7081f3a1d"}}


node_type: n8n-nodes-base.Xml
name: Xml
display_name: XML
description: Convert data from and to XML
category: transform
icon: fa:file-code
code_hash: 09aee64eeb21c4566e8cd0c36ea6ba97e480c62938dc579228fb1b60c842f65b
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.xml
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:42
updated_at: 2025-06-08 09:18:42
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Xml = void 0;
  const xml2js_1 = require("xml2js");
  const n8n_workflow_1 = require("n8n-workflow");
  class Xml {
      constructor() {
          this.description = {
              displayName: 'XML',
              name: 'xml',
              icon: 'fa:file-code',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["mode"]==="jsonToxml" ? "JSON to XML" : "XML to JSON"}}',
              description: 'Convert data from and to XML',
              defaults: {
                  name: 'XML',
                  color: '#333377',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      options: [
                          {
                              name: 'JSON to XML',
                              value: 'jsonToxml',
                              description: 'Converts data from JSON to XML',
                          },
                          {
                              name: 'XML to JSON',
                              value: 'xmlToJson',
                              description: 'Converts data from XML to JSON',
                          },
                      ],
                      default: 'xmlToJson',
                      description: 'From and to what format the data should be converted',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['jsonToxml'],
                          },
                      },
                      default: 'data',
                      required: true,
                      description: 'Name of the property to which to contains the converted XML data',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              mode: ['jsonToxml'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Allow Surrogate Chars',
                              name: 'allowSurrogateChars',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to allow using characters from the Unicode surrogate blocks',
                          },
                          {
                              displayName: 'Attribute Key',
                              name: 'attrkey',
                              type: 'string',
                              default: '$',
                              description: 'Prefix that is used to access the attributes',
                          },
                          {
                              displayName: 'Cdata',
                              name: 'cdata',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to wrap text nodes in &lt;![CDATA[ ... ]]&gt; instead of escaping when necessary. Does not add &lt;![CDATA[ ... ]]&gt; if it is not required.',
                          },
                          {
                              displayName: 'Character Key',
                              name: 'charkey',
                              type: 'string',
                              default: '_',
                              description: 'Prefix that is used to access the character content',
                          },
                          {
                              displayName: 'Headless',
                              name: 'headless',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to omit the XML header',
                          },
                          {
                              displayName: 'Root Name',
                              name: 'rootName',
                              type: 'string',
                              default: 'root',
                              description: 'Root element name to be used',
                          },
                      ],
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['xmlToJson'],
                          },
                      },
                      default: 'data',
                      required: true,
                      description: 'Name of the property which contains the XML data to convert',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              mode: ['xmlToJson'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Attribute Key',
                              name: 'attrkey',
                              type: 'string',
                              default: '$',
                              description: 'Prefix that is used to access the attributes',
                          },
                          {
                              displayName: 'Character Key',
                              name: 'charkey',
                              type: 'string',
                              default: '_',
                              description: 'Prefix that is used to access the character content',
                          },
                          {
                              displayName: 'Explicit Array',
                              name: 'explicitArray',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to always put child nodes in an array if true; otherwise an array is created only if there is more than one',
                          },
                          {
                              displayName: 'Explicit Root',
                              name: 'explicitRoot',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to set this if you want to get the root node in the resulting object',
                          },
                          {
                              displayName: 'Ignore Attributes',
                              name: 'ignoreAttrs',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to ignore all XML attributes and only create text nodes',
                          },
                          {
                              displayName: 'Merge Attributes',
                              name: 'mergeAttrs',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object. This option is ignored if ignoreAttrs is true.',
                          },
                          {
                              displayName: 'Normalize',
                              name: 'normalize',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to trim whitespaces inside text nodes',
                          },
                          {
                              displayName: 'Normalize Tags',
                              name: 'normalizeTags',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to normalize all tag names to lowercase',
                          },
                          {
                              displayName: 'Trim',
                              name: 'trim',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to trim the whitespace at the beginning and end of text nodes',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const mode = this.getNodeParameter('mode', 0);
          const dataPropertyName = this.getNodeParameter('dataPropertyName', 0);
          const options = this.getNodeParameter('options', 0, {});
          let item;
          const returnData = [];
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  item = items[itemIndex];
                  if (mode === 'xmlToJson') {
                      const parserOptions = Object.assign({
                          mergeAttrs: true,
                          explicitArray: false,
                      }, options);
                      const parser = new xml2js_1.Parser(parserOptions);
                      if (item.json[dataPropertyName] === undefined) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Item has no JSON property called "${dataPropertyName}"`, { itemIndex });
                      }
                      const json = await parser.parseStringPromise(item.json[dataPropertyName]);
                      returnData.push({ json: (0, n8n_workflow_1.deepCopy)(json) });
                  }
                  else if (mode === 'jsonToxml') {
                      const builder = new xml2js_1.Builder(options);
                      returnData.push({
                          json: {
                              [dataPropertyName]: builder.buildObject(items[itemIndex].json),
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${mode}" is not known!`, {
                          itemIndex,
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      items[itemIndex] = {
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      };
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Xml = Xml;
  //# sourceMappingURL=Xml.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: XML
  description: Documentation for the XML node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
  contentType: [integration, reference]
  priority: medium
  ---

  # XML

  Use the XML node to convert data from and to XML.

  /// note | Binary files
  If your XML is within a binary file, use the [Extract from File](/integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile.md) node to convert it to text first.
  ///

  ## Node parameters

  - **Mode**: The format the data should be converted from and to.
  	- **JSON to XML**: Converts data from JSON to XML.
      - **XML to JSON**: Converts data from XML to JSON.
  - **Property Name**: Enter the name of the property which contains the data to convert.

  ## Node options

  These options are available regardless of the **Mode** you select:

  - **Attribute Key**: Enter the prefix used to access the attributes. Default is `$`.
  - **Character Key**: Enter the prefix used to access the character content. Default is `_`.

  All other options depend on the selected **Mode**.

  ### JSON to XML options

  These options only appear if you select **JSON to XML** as the **Mode**:

  - **Allow Surrogate Chars**: Set whether to allow using characters from the Unicode surrogate blocks (turned on) or not (turned off).
  - **Cdata**: Set whether to wrap text nodes in `<![CDATA[ ... ]]>` instead of escaping when it's required (turned on) or not (turned off).
      * Turning this option on doesn't add `<![CDATA[ ... ]]>` if it's not required.
  - **Headless**: Set whether to omit the XML header (turned on) or include it (turned off).
  - **Root Name**: Enter the root element name to use.

  ### XML to JSON options

  These options only appear if you select **XML to JSON** as the **Mode**:

  - **Explicit Array**: Set whether to put child nodes in an array (turned on) or create an array only if there's more than one child node (turned off).
  - **Explicit Root**: Set whether to get the root node in the resulting object (turned on) or not (turned off).
  - **Ignore Attributes**: Set whether to ignore all XML attributes and only create text nodes (turned on) or not (turned off).
  - **Merge Attributes**: Set whether to merge attributes and child elements as properties of the parent (turned on) or key attributes off a child attribute object (turned off). This option is ignored if **Ignore Attribute** is turned on.
  - **Normalize**: Set whether to trim whitespaces inside the text nodes (turned on) or not to trim them (turned off).
  - **Normalize Tags**: Set whether to normalize all tag names to lowercase (turned on) or keep tag names as-is (turned off).
  - **Trim**: Set whether to trim the whitespace at the beginning and end of text nodes (turned on) or to leave the whitespace as-is (turned off).

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'xml') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"0421b175-6f8a-444c-9919-3a5c576989e9","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"789e119beb0994eb66b8b7ef2ee6186396bd3fe50ce93ea07ee18f91400f471f"}}


node_type: n8n-nodes-base.Zulip
name: Zulip
display_name: Zulip
description: Consume Zulip API
category: output
icon: file:zulip.svg
code_hash: 1b814052a8925706b11e31e9ba04beb7adf7197e26060dedcbad6187f2c9159b
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.zulip
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-08 09:18:42
updated_at: 2025-06-08 09:18:42
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zulip = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const MessageDescription_1 = require("./MessageDescription");
  const change_case_1 = require("change-case");
  const StreamDescription_1 = require("./StreamDescription");
  const UserDescription_1 = require("./UserDescription");
  class Zulip {
      constructor() {
          this.description = {
              displayName: 'Zulip',
              name: 'zulip',
              icon: 'file:zulip.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Zulip API',
              defaults: {
                  name: 'Zulip',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zulipApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                          },
                          {
                              name: 'Stream',
                              value: 'stream',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'message',
                  },
                  ...MessageDescription_1.messageOperations,
                  ...MessageDescription_1.messageFields,
                  ...StreamDescription_1.streamOperations,
                  ...StreamDescription_1.streamFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getStreams() {
                      const returnData = [];
                      const { streams } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/streams');
                      for (const stream of streams) {
                          const streamName = stream.name;
                          const streamId = stream.stream_id;
                          returnData.push({
                              name: streamName,
                              value: streamId,
                          });
                      }
                      return returnData;
                  },
                  async getTopics() {
                      const streamId = this.getCurrentNodeParameter('stream');
                      const returnData = [];
                      const { topics } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/users/me/${streamId}/topics`);
                      for (const topic of topics) {
                          const topicName = topic.name;
                          const topicId = topic.name;
                          returnData.push({
                              name: topicName,
                              value: topicId,
                          });
                      }
                      return returnData;
                  },
                  async getUsers() {
                      const returnData = [];
                      const { members } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users');
                      for (const member of members) {
                          const memberName = member.full_name;
                          const memberId = member.email;
                          returnData.push({
                              name: memberName,
                              value: memberId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'message') {
                      if (operation === 'sendPrivate') {
                          const to = this.getNodeParameter('to', i).join(',');
                          const content = this.getNodeParameter('content', i);
                          const body = {
                              type: 'private',
                              to,
                              content,
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/messages', body);
                      }
                      if (operation === 'sendStream') {
                          const stream = this.getNodeParameter('stream', i);
                          const topic = this.getNodeParameter('topic', i);
                          const content = this.getNodeParameter('content', i);
                          const body = {
                              type: 'stream',
                              to: stream,
                              topic,
                              content,
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/messages', body);
                      }
                      if (operation === 'update') {
                          const messageId = this.getNodeParameter('messageId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.content) {
                              body.content = updateFields.content;
                          }
                          if (updateFields.propagateMode) {
                              body.propagat_mode = (0, change_case_1.snakeCase)(updateFields.propagateMode);
                          }
                          if (updateFields.topic) {
                              body.topic = updateFields.topic;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/messages/${messageId}`, body);
                      }
                      if (operation === 'get') {
                          const messageId = this.getNodeParameter('messageId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/messages/${messageId}`);
                      }
                      if (operation === 'delete') {
                          const messageId = this.getNodeParameter('messageId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/messages/${messageId}`);
                      }
                      if (operation === 'updateFile') {
                          const credentials = await this.getCredentials('zulipApi');
                          const dataBinaryProperty = this.getNodeParameter('dataBinaryProperty', i);
                          const binaryData = this.helpers.assertBinaryData(i, dataBinaryProperty);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, dataBinaryProperty);
                          const formData = {
                              file: {
                                  value: binaryDataBuffer,
                                  options: {
                                      filename: binaryData.fileName,
                                      contentType: binaryData.mimeType,
                                  },
                              },
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/user_uploads', {}, {}, undefined, { formData });
                          responseData.uri = `${credentials.url}${responseData.uri}`;
                      }
                  }
                  if (resource === 'stream') {
                      const body = {};
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.includePublic) {
                              body.include_public = additionalFields.includePublic;
                          }
                          if (additionalFields.includeSubscribed) {
                              body.include_subscribed = additionalFields.includeSubscribed;
                          }
                          if (additionalFields.includeAllActive) {
                              body.include_all_active = additionalFields.includeAllActive;
                          }
                          if (additionalFields.includeDefault) {
                              body.include_default = additionalFields.includeDefault;
                          }
                          if (additionalFields.includeOwnersubscribed) {
                              body.include_owner_subscribed = additionalFields.includeOwnersubscribed;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/streams', body);
                          responseData = responseData.streams;
                      }
                      if (operation === 'getSubscribed') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.includeSubscribers) {
                              body.include_subscribers = additionalFields.includeSubscribers;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users/me/subscriptions', body);
                          responseData = responseData.subscriptions;
                      }
                      if (operation === 'create') {
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const subscriptions = this.getNodeParameter('subscriptions', i);
                          body.subscriptions = JSON.stringify(subscriptions.properties);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              body.subscriptions = JSON.stringify(subscriptions.properties);
                              if (additionalFields.inviteOnly) {
                                  body.invite_only = additionalFields.inviteOnly;
                              }
                              if (additionalFields.principals) {
                                  const principals = [];
                                  additionalFields.principals.properties.map((principal) => {
                                      principals.push(principal.email);
                                  });
                                  body.principals = JSON.stringify(principals);
                              }
                              if (additionalFields.authorizationErrorsFatal) {
                                  body.authorization_errors_fatal =
                                      additionalFields.authorizationErrorsFatal;
                              }
                              if (additionalFields.historyPublicToSubscribers) {
                                  body.history_public_to_subscribers =
                                      additionalFields.historyPublicToSubscribers;
                              }
                              if (additionalFields.streamPostPolicy) {
                                  body.stream_post_policy = additionalFields.streamPostPolicy;
                              }
                              if (additionalFields.announce) {
                                  body.announce = additionalFields.announce;
                              }
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/users/me/subscriptions', body);
                      }
                      if (operation === 'delete') {
                          const streamId = this.getNodeParameter('streamId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/streams/${streamId}`, {});
                      }
                      if (operation === 'update') {
                          const streamId = this.getNodeParameter('streamId', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.description) {
                                  body.description = JSON.stringify(additionalFields.description);
                              }
                              if (additionalFields.newName) {
                                  body.new_name = JSON.stringify(additionalFields.newName);
                              }
                              if (additionalFields.isPrivate) {
                                  body.is_private = additionalFields.isPrivate;
                              }
                              if (additionalFields.isAnnouncementOnly) {
                                  body.is_announcement_only = additionalFields.isAnnouncementOnly;
                              }
                              if (additionalFields.streamPostPolicy) {
                                  body.stream_post_policy = additionalFields.streamPostPolicy;
                              }
                              if (additionalFields.historyPublicToSubscribers) {
                                  body.history_public_to_subscribers =
                                      additionalFields.historyPublicToSubscribers;
                              }
                              responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/streams/${streamId}`, body);
                          }
                      }
                  }
                  if (resource === 'user') {
                      const body = {};
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.clientGravatar) {
                              body.client_gravatar = additionalFields.client_gravatar;
                          }
                          if (additionalFields.includeCustomProfileFields) {
                              body.include_custom_profile_fields =
                                  additionalFields.includeCustomProfileFields;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/users/${userId}`, body);
                      }
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.clientGravatar) {
                              body.client_gravatar = additionalFields.client_gravatar;
                          }
                          if (additionalFields.includeCustomProfileFields) {
                              body.include_custom_profile_fields =
                                  additionalFields.includeCustomProfileFields;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users', body);
                          responseData = responseData.members;
                      }
                      if (operation === 'create') {
                          body.email = this.getNodeParameter('email', i);
                          body.password = this.getNodeParameter('password', i);
                          body.full_name = this.getNodeParameter('fullName', i);
                          body.short_name = this.getNodeParameter('shortName', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/users', body);
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('userId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fullName) {
                              body.full_name = JSON.stringify(additionalFields.fullName);
                          }
                          if (additionalFields.isAdmin) {
                              body.is_admin = additionalFields.isAdmin;
                          }
                          if (additionalFields.isGuest) {
                              body.is_guest = additionalFields.isGuest;
                          }
                          if (additionalFields.role) {
                              body.role = additionalFields.role;
                          }
                          if (additionalFields.profileData) {
                              body.profile_data = additionalFields.profileData.properties;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/users/${userId}`, body);
                      }
                      if (operation === 'deactivate') {
                          const userId = this.getNodeParameter('userId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/users/${userId}`, body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zulip = Zulip;
  //# sourceMappingURL=Zulip.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Zulip node documentation
  description: Learn how to use the Zulip node in n8n. Follow technical documentation to integrate Zulip node into your workflows.
  contentType: [integration, reference]
  ---

  # Zulip node

  Use the Zulip node to automate work in Zulip, and integrate Zulip with other applications. n8n has built-in support for a wide range of Zulip features, including creating, deleting, and getting users and streams, as well as sending messages. 

  On this page, you'll find a list of operations the Zulip node supports and links to more resources.

  /// note | Credentials
  Refer to [Zulip credentials](/integrations/builtin/credentials/zulip.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Message
      * Delete a message
      * Get a message
      * Send a private message
      * Send a message to stream
      * Update a message
      * Upload a file
  * Stream
      * Create a stream.
      * Delete a stream.
      * Get all streams.
      * Get subscribed streams.
      * Update a stream.
  * User
      * Create a user.
      * Deactivate a user.
      * Get a user.
      * Get all users.
      * Update a user.

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'zulip') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"cb99aece-3555-48bb-ac04-8ad8928e2b95","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"b4546f1fcfebc60d206c9bdfd79dbfc648e08b5f7b139600c91612f094383568"}}


