Skip to main content

Check out Port for yourself ➜ 

Zapier

Custom Ocean integration

This integration was created using the custom Ocean integration builder.
Please note that:

  1. This integration will not be listed in the Data sources page of your Port application, and must be installed manually using the instructions on this page.
  2. This integration will not create components (e.g. blueprints, mapping, etc.) in your portal automatically, you will need to create them manually using the instructions on this page.

Port's Zapier integration lets you ingest Zapier apps and zaps into your software catalog using the Ocean Custom Integration framework.

Overview

This guide shows how to ingest Zapier apps and zaps into Port.

Supported resources

This integration ingests the following resources:

  • zapierApp from the GET /v2/apps endpoint.
  • zap from the GET /v2/zaps endpoint.

It is possible to reference any field that appears in the API responses linked above in the mapping configuration.

Prerequisites

To use this integration, make sure you have:

  • A Zapier account with API access.
  • A Port client ID and client secret.
  • Permission to create blueprints and data-source mappings in Port.

Authentication

Zapier allows two authentication methods for this setup:

  1. OAuth 2.0 Authorization Code flow (rolling refresh tokens).
  2. Client id passed as a query parameter.

User access token authentication

Refresh token rotation

Zapier refresh tokens rotate: every refresh request can return a new refresh token and immediately invalidate the old one.

To keep sync working, you need an external workflow that refreshes tokens and updates the new refresh token in your Port secrets every time it changes.

Automate token refresh with GitHub Actions

You can use this scheduled GitHub Actions workflow to refresh your Zapier token and update repository secrets.

  1. Add these repository secrets: ZAPIER_CLIENT_ID, ZAPIER_CLIENT_SECRET, ZAPIER_OAUTH_REFRESH_TOKEN, and GH_ADMIN_TOKEN.
  2. Set GH_ADMIN_TOKEN to a GitHub personal access token with permission to update repository secrets.
  3. Reference ZAPIER_OAUTH_ACCESS_TOKEN in your integration runtime.
GitHub Actions workflow example (Click to expand)
name: Refresh Zapier OAuth token

on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:

jobs:
refresh-token:
runs-on: ubuntu-latest
steps:
- name: Refresh Zapier access token
id: refresh
env:
CLIENT_ID: ${{ secrets.ZAPIER_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.ZAPIER_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.ZAPIER_OAUTH_REFRESH_TOKEN }}
run: |
response=$(curl -sS -X POST "https://api.zapier.com/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=refresh_token" \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET" \
--data-urlencode "refresh_token=$REFRESH_TOKEN")

access_token=$(echo "$response" | jq -r '.access_token')
refresh_token=$(echo "$response" | jq -r '.refresh_token')

if [ -z "$access_token" ] || [ "$access_token" = "null" ]; then
echo "Failed to refresh token: $response"
exit 1
fi

echo "access_token=$access_token" >> "$GITHUB_OUTPUT"
echo "refresh_token=$refresh_token" >> "$GITHUB_OUTPUT"

- name: Update GitHub secrets
env:
GH_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
ACCESS_TOKEN: ${{ steps.refresh.outputs.access_token }}
REFRESH_TOKEN: ${{ steps.refresh.outputs.refresh_token }}
run: |
gh secret set ZAPIER_OAUTH_ACCESS_TOKEN --body "$ACCESS_TOKEN"
gh secret set ZAPIER_OAUTH_REFRESH_TOKEN --body "$REFRESH_TOKEN"

Client ID Authentication

The GET /v2/apps endpoint requires a client_id query parameter and does not require OAuth.

In Ocean custom integration mappings, query params are typically not backed by Port secrets. Treat client_id as configuration and avoid placing sensitive values directly in mapping fields.

Set up data model

Before data can sync, create the required blueprints in Port:

  1. Open the Builder page.
  2. Create blueprints for zapierApp and zap.
  3. Copy and paste each blueprint JSON from the sections below.
  4. Click Save.
Zapier app blueprint (Click to expand)
{
"identifier": "zapierApp",
"title": "Zapier App",
"icon": "Zapier",
"schema": {
"properties": {
"description": {
"title": "Description",
"type": "string"
},
"image": {
"title": "Image",
"type": "string",
"format": "url"
},
"hex_color": {
"title": "Hex Color",
"type": "string"
},
"action_types": {
"title": "Action Types",
"type": "array"
},
"categories": {
"title": "Categories",
"type": "array"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
Zap blueprint (Click to expand)
{
"identifier": "zap",
"title": "Zap",
"icon": "Zapier",
"schema": {
"properties": {
"state": {
"title": "State",
"type": "string"
},
"url": {
"title": "Zap URL",
"type": "string",
"format": "url"
},
"modified_at": {
"title": "Modified At",
"type": "string",
"format": "date-time"
},
"trigger_app": {
"title": "Trigger App",
"type": "string"
},
"action_apps": {
"title": "Action Apps",
"type": "array"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}

Installation

Choose one of the following installation methods to deploy the Ocean custom integration:

Prerequisites

  • A Kubernetes cluster - the integration's container chart will be deployed to this cluster.

  • kubectl and helm must be installed on your machine. Your kubectl CLI must be connected to the Kubernetes cluster where you plan to install the integration.

Installation

  1. Add Port's Helm repo and install the Ocean custom integration.
Replace placeholders

Remember to replace the placeholders for YOUR_PORT_CLIENT_ID, YOUR_PORT_CLIENT_SECRET, and YOUR_ZAPIER_OAUTH_ACCESS_TOKEN.

helm repo add --force-update port-labs https://port-labs.github.io/helm-charts
helm upgrade --install my-ocean-zapier-integration port-labs/port-ocean \
--set port.clientId="YOUR_PORT_CLIENT_ID" \
--set port.clientSecret="YOUR_PORT_CLIENT_SECRET" \
--set port.baseUrl="https://api.getport.io" \
--set initializePortResources=false \
--set scheduledResyncInterval=60 \
--set integration.identifier="my-ocean-zapier-integration" \
--set integration.type="custom" \
--set integration.eventListener.type="POLLING" \
--set integration.config.baseUrl="https://api.zapier.com" \
--set integration.config.authType="bearer_token" \
--set integration.config.apiToken="YOUR_ZAPIER_OAUTH_ACCESS_TOKEN" \
--set integration.config.paginationType="link" \
--set integration.config.nextLinkPath="links.next"
Selecting a Port API URL by account region

The port_region, port.baseUrl, portBaseUrl, port_base_url and OCEAN__PORT__BASE_URL parameters select which Port API instance to use:

Configuration parameters

ParameterDescriptionExampleRequired
port.clientIdYour Port client id.
port.clientSecretYour Port client secret.
port.baseUrlYour Port API URL - https://api.getport.io for EU, https://api.us.getport.io for US.
integration.config.baseUrlZapier API base URL.https://api.zapier.com
integration.config.authTypeThe authentication type for the API. Use bearer_token when you authenticate with an OAuth access token.bearer_token
integration.config.apiTokenZapier OAuth access token to use in Authorization: Bearer <token>.
integration.config.paginationTypePagination strategy. Use link to follow the next URL in Zapier responses.link
integration.config.nextLinkPathPath to the next page URL in the response body for link pagination.links.next
integration.eventListener.typeThe event listener type. Read more about event listeners.POLLING
integration.typeThe integration type (must be custom for Ocean custom integration).custom
integration.identifierUnique identifier for the integration instance.my-ocean-zapier-integration
scheduledResyncIntervalThe number of minutes between each resync. When not set the integration will resync for each event listener resync event. Read more about scheduledResyncInterval.60
initializePortResourcesWhen set to true the integration will create default blueprints and mapping automatically. For this guide, you set it to false and create blueprints and mappings manually.false
sendRawDataExamplesEnable sending raw data examples from the third party API to Port for testing and managing the integration mapping. Default is true.true

Advanced integration configuration

For advanced configuration such as proxies or self-signed certificates, click here.

Resource mappings

Use the mappings below to ingest Zapier apps and zaps.

Zapier apps

resources:
- kind: /v2/apps
selector:
query: 'true'
data_path: '.data'
query_params:
client_id: "<YOUR_CLIENT_ID>"
port:
entity:
mappings:
identifier: .id
title: .title
blueprint: '"zapierApp"'
properties:
description: .description
image: .image
hex_color: .hex_color
action_types: .action_types
categories: '[.categories[].slug]'

Zaps

resources:
- kind: /v2/zaps
selector:
query: 'true'
data_path: '.data'
port:
entity:
mappings:
identifier: .id
title: .title
blueprint: '"zap"'
properties:
state: .is_enabled
url: .links.html_editor
modified_at: .updated_at
trigger_app: '[.steps[] | select(.type_of == "read")] | first | .app.title'
action_apps: '[.steps[] | select(.type_of == "write") | .app.title]'

Configuration

After installation, configure mappings in Port so Ocean can transform Zapier API responses into Port entities.

The mapping resources[].kind must match the endpoint path you want to call, relative to your OCEAN__INTEGRATION__CONFIG__BASE_URL.

You can use JQ expressions in mappings to filter, reshape, and enrich Zapier data before sync.

Next step

Once you pick your exact Zapier endpoints and blueprint schema, update the resources[] mappings to match the real request and response payloads from your Zapier account.

References