{"id":19924376,"url":"https://github.com/kontent-ai/integration-zapier-typescript","last_synced_at":"2025-09-19T04:32:40.737Z","repository":{"id":44577414,"uuid":"239580632","full_name":"kontent-ai/integration-zapier-typescript","owner":"kontent-ai","description":"A native Zapier CLI integration for creating integrations between Kontent.ai and other Zapier applications","archived":false,"fork":false,"pushed_at":"2024-10-31T02:01:48.000Z","size":4115,"stargazers_count":1,"open_issues_count":8,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-12T22:17:08.938Z","etag":null,"topics":["kontent-ai","kontent-ai-tool","zapier","zapier-cli"],"latest_commit_sha":null,"homepage":"https://zapier.com/apps/kontentai/integrations","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hejtmii/kc-zapierapp","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kontent-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-10T18:16:57.000Z","updated_at":"2024-10-30T00:54:46.000Z","dependencies_parsed_at":"2023-02-19T06:25:19.029Z","dependency_job_id":"2d02b62a-d81a-40d1-af0e-023efba05a29","html_url":"https://github.com/kontent-ai/integration-zapier-typescript","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fintegration-zapier-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fintegration-zapier-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fintegration-zapier-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fintegration-zapier-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kontent-ai","download_url":"https://codeload.github.com/kontent-ai/integration-zapier-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233551794,"owners_count":18693033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kontent-ai","kontent-ai-tool","zapier","zapier-cli"],"created_at":"2024-11-12T22:17:11.940Z","updated_at":"2025-09-19T04:32:40.354Z","avatar_url":"https://github.com/kontent-ai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-ASK%20NOW-FE7A16.svg?logo=stackoverflow\u0026logoColor=white)](https://stackoverflow.com/tags/kontent-ai)\n\n# Zapier CLI Integration\n\nSource code for the Zapier integration with Kontent.ai: https://zapier.com/apps/kentico-kontent/integrations.\n\n## Integrations\n\nThis integration contains 4 triggers, 4 actions, and 4 searches:\n\n- [__Triggers__](#triggers)\n    - Variant workflow step change\n    - Variant published status change\n    - Variant created or deleted\n    - Taxonomy group changed\n- [__Actions__](#actions)\n    - Create content item\n    - Change variant workflow step\n    - Update language variant\n    - Delete language variant\n- [__Searches__](#searches)\n    - Find content item\n    - Find workflow step\n    - Find language\n    - Find asset\n\n## Triggers\n\nUsing the Kontent.ai integration, you only need to configure the Zap in Zapier. The creation of the webhook in Kontent.ai is handled automatically by the integration; the webhook will be created when you turn on the Zap, and deleted when you turn it off.\n\nThe output of a trigger in Zapier is exactly what [Kontent.ai's webhook](https://kontent.ai/learn/reference/webhooks-reference) POSTs to Zapier. It will look something like this:\n\n```js\n{\n  data: {\n    items: [\n      {\n        item: {\n          id: '42c21e82-0772-4d79-a6b3-c916e51b24ff'\n        },\n        language: {\n          id: '00000000-0000-0000-0000-000000000000'\n        }\n      }\n    ]\n  },\n  message: {\n    id: 'a268da50-b3c5-4d09-9b36-6587c8dea500',\n    project_id: '11a3492b-cd32-0054-51d2-8234ec4244a6',\n    type: 'content_item_variant',\n    operation: 'restore',\n    api_name: 'content_management',\n    created_timestamp: '2019-07-18T10:52:33.1059256Z',\n    webhook_url: 'https://hooks.zapier.com/hooks/standard/47991d003732'\n  }\n}\n```\n\nIn each trigger, you have the option to provide a language ID. If you do, the Zap will be halted at this step if the content item is not in the provided language. If you leave it empty, the Zap will proceed for all languages.\n\nThere is also another optional field called __Content Type For Samples__. If you choose a content type, the trigger will attempt to output a content item ID of that type. This allows you to test the Zap more efficiently, and has no effect on the functionality of the trigger.\n\n### Creating a trigger in Zapier\n\n1. Create a new Zap: https://zapier.com/app/zaps.\n2. In the _Choose App \u0026 Event_ field, search for `Kentico Kontent` then choose your trigger.\n\n![step 1](./images/chooseapp.png)\n\n3. Click __Continue__ then __Sign in to Kentico Kontent__ on the next screen. You can find the credentials on the _API Keys_ page in Kontent.ai.\n\n![sign in](./images/authenticate.png)\n\n4. Configure the conditions for your trigger. Most triggers have multiple events that can be \"listened\" to, and you can select multiple options or leave the field empty for all events.\n\n5. Click __Test and Review__ to get a sample item from your Kontent.ai project. This allows you to configure later steps using fields from your content items.\n\nThe output of the triggers will be the payload sent from Kontent.ai, which you can read more about in [webhooks reference](https://kontent.ai/learn/reference/webhooks-reference). To find additional data about the item which triggered the webhook, you can use the __Find Content Item__ action.\n\n## Actions\n\nThe integration contains actions to upsert/delete variants, create a content item, and change a variant's workflow step. For many of these steps, you are required to enter data in a particular format that Kontent.ai will understand, e.g. in a __Linked items__ element.\n\nYou can find descriptions of formats that Zapier expects in fields [here](https://zapier.com/help/create/basics/different-field-types-in-zaps). As for the Kontent.ai integration, here's some examples of the data to provide action steps:\n\n- __Linked items__:  \n![linked items](./images/linkeditems.png)\n\nAcceptable values are content item IDs and external IDs. These can be used in any combination- for multiple linked items, some can be item IDs and some can be external IDs.  You can use the __Find Content Item__ action if you need to locate items for this field.\nYou can add a single value to each line, or multiple values separated by comma. For example, the output of a previous step might be an array like \"external_item_1, external_item_2.\" You can refer to this output in the linked item field on a single line.\n\n- __Taxonomy__:  \n![taxonomy](./images/taxonomy.png)\n\nThis field accepts taxonomy IDs or codenames. Similar to linked items, you can provide one value per line or comma-separated values on a single line.\n\n- __Assets__:  \n![asset](./images/asset.png)\n\nLike taxonomy fields, you can provide the asset ID or codename of an asset, and values can be added on a single line separated by commas, or multiple lines. You can use the __Find Asset__ action to locate assets in your project.\n\n- __Dates and times__\n![dates](./images/datetime.png)\n\nThis follows the [formats specified by Zapier](https://zapier.com/help/create/basics/different-field-types-in-zaps#what-formats-are-supported). You can also pass a value obtained from a previous step as in the screenshot above. Some examples of acceptable datetimes are:\n  - 11/11/2011\n  - 11/11/2011 4PM CST\n  - next friday at 7pm\n  - 2019-03-27T13:10:01.791Z\n\n## Searches\n\nBecause the webhook notification from Kontent.ai only contains basic information such as a content item ID and language ID, you may need to search your project for more information. For example, to load all data about a content item you can use a __Find Content Item__ action. You can search for an item based on the `id`, `codename`, `external_id`, or any of the content type's elements.\n\nAnother useful example would be to translate language or workflow step IDs into codenames. The webhook notification contains IDs, but if you need to compare a language codename (\"en-US\") later on in the Zap, or if you're writing values to a Google Sheet and want to add the user-friendly name, you could add a __Find language__ step. You can search for the language via ID, and in the output you will find all the details of the language:\n\n```js\n{\n  id: '1c37a40c-9158-031d-9d2d-adf65a568cd6',\n  name: 'Czech',\n  codename: 'cz-CZ',\n  external_id: 'lang_czech',\n  is_active: true,\n  is_default: false,\n  fallback_language: {\n    id: '00000000-0000-0000-0000-000000000000'\n  }\n}\n```\n\n## Example - Google calendar\n\nLet's say your company manages events for a client. At this point, you've been using Kontent.ai to store information about the events, but you've been manually creating the event in Google Calendar and emailing the attendees. We can now use Zapier to do this for us whenever a new event is published.\n\nThe final Zap will look something like this:\n\n![finished zap](./images/steps.png)\n\n### Content types in Kontent.ai\n\nTo start, we should have an __Event__ content type with fields for basic event information, and a __Linked items__ element which can only contain items from your __Contact__ content type:\n\n![event details](./images/eventdetails.png)\n\nThe __Contact__ content type can contain whatever information you'd like, but should at least have an `email` element:\n\n![contact type](./images/contact.png)\n\nCreate some Contact content items and publish them, then create an Event and leave it in Draft step.\n\n### Creating the Zap\n\nTo reduce the amount of manual work that needs to be done, we want Zapier to create a calendar item and send emails whenever an Event is published in Kontent.ai. \n\n#### Step 1\n\nOf course, we start with the trigger. For the __Trigger event__ choose _Variant Published Status Changed_. In the configuration of the step, set the following:\n\n![variant published step](./images/variantpublished.png)\n\nUnder __Webhook Name__ you can enter any value you'd like such as \"Google Calendar Event Creation\" which will appear in Kontent.ai's Webhooks page, or you can leave it empty to use the default \"Variant published status changed (Zapier).\"\n\n#### Step 2\n\nThe trigger will fire when any variant is published, but we only want to continue if it is an Event item. We can use the `type` value from the trigger and a __Filter by Zapier__ action to stop the Zap if the type is not \"event:\"\n\n![filter step](./images/filter.png)\n\n#### Step 3\n\nTo get information about the event, we need to add a __Find Content Item__ action. In this step, you can search for an item by ID, external ID or codename. Since the trigger output contains the item ID, you can load that value in the __Search value__ field:\n\n![content item search](./images/itemsearch.png)\n\n#### Step 4\n\nTo send emails to the event attendees, we will need to get the contacts stored in the `attendees_list` element. The value of this element will be an array of content item IDs which correspond with the items in step 3's `modular_content` output. So, we can use a __Code by Zapier__ step to get the email addresses of the attendees for the next step.\n\nIf you're not familiar with the basics of code steps, please read [Zapier's documentation](https://zapier.com/apps/code/help). In the __Input data__ field we can load some values from the content item to use in javascript:\n\n- __json__: The raw JSON of the modular content from step 3.\n- __attendees__: The value of the `attendee_list` element, which contains the IDs of the linked items.\n\n![input data](./images/inputdata.png)\n\nIn the code of the step, use JSON to parse the `json` variable, then use `Object.values()` to create an array. Filter the array so that only contacts from the `attendees` variable remain, then `map` the email addresses to a new array. Then, output the emails:\n\n```js\nconst email = Object.values(JSON.parse(inputData.json) || {})\n        .filter(m =\u003e inputData.attendees.includes(m.system.id))\n        .map(m =\u003e m.elements.email);\n\nreturn [{emails: emails}];\n```\n\n#### Step 5\n\nNow we can create the Google Calendar event. In __Choose App \u0026 Event__ select _Google Calendar_ and _Create Detailed Event_. On the next screen, you'll need to authorize a Google Account which has access to the calendar you wish to modify.\n\nOn the __Customize Detailed Event__ screen, select your calendar then use data from step 3 to populate these fields:\n\n![calendar details](./images/calendardetails.png)\n\nIn the event's __Attendees__ field you can load the list of emails from step 4. Google will automatically email the attendees when the event is created.\n\n![attendees](./images/attendees.png)\n\n#### Testing\n\nWe're pretty much done. Turn on the Zap to create the webhook in Kontent.ai. If the On/Off switch is greyed-out in Zapier, you most likely need to test one of the steps (or, choose __Skip test__). All steps should have a green check mark in the top-left corner.\n\nWhen the Zap is turned on, you should see this in Kontent.ai:\n\n![webhook](./images/webhook.png)\n\nThe endpoint and secret are automatically generated by the Zapier integration and will start to work immediately. __Do not change the secret!__ Webhook signatures are automatically validated by the integration for your security, but it relies on using this exact secret which is generated by hashing several values.\n\nYou can now test the Zap by publishing an Event content item in Kontent.ai which has some Contacts linked as attendees. After a short time, you should see the \"dot\" next to the webhook turn green indicating that the POST was sent to Zapier. In Zapier, you can check __Task History__ in the right sidebar to check whether the Zap executed successfully:\n\n![history](./images/history.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontent-ai%2Fintegration-zapier-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkontent-ai%2Fintegration-zapier-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontent-ai%2Fintegration-zapier-typescript/lists"}