Segment

Data Access token

Manage Segment sources, destinations, tracking plans, warehouses and workspace permissions from any Windmill script, flow or app.

Set up in 3 steps

1

Create an access token

In Segment, open Settings then Workspace access, then Tokens, and create a Public API token with the access your scripts need.

2

Add the resource in Windmill

Open Resources, add a resource of type segment. Set baseUrl to https://api.segmentapis.com for a US workspace, https://eu1.api.segmentapis.com for an EU one.

3

Run your first script

Fork any script below and read before writing anything. There are hundreds here, so search by the verb you need.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Update Warehouse

Script segment Verified

Update User Group

Script segment Verified

Update Transformation

Script segment Verified

Update Tracking Plan

Script segment Verified

Update Source

Script segment Verified

Update Selective Sync for Warehouse

Script segment Verified

Update Schema Settings in Source

Script segment Verified

Update Rules in Tracking Plan

Script segment Verified

Update Function

Script segment Verified

Update Filter for Destination

Script segment Verified

Update Destination

Script segment Verified

Replace Users in User Group

Script segment Verified

Replace Rules in Tracking Plan

Script segment Verified

Replace Permissions for User Group

Script segment Verified

Replace Permissions for User

Script segment Verified

Replace Labels in Source

Script segment Verified

Replace Advanced Sync Schedule for Warehouse

Script segment Verified

Remove Write Key from Source

Script segment Verified

Remove Users from User Group

Script segment Verified

Remove Subscription from Destination

Script segment Verified

Remove Source from Tracking Plan

Script segment Verified

Remove Source Connection from Warehouse

Script segment Verified

Remove Rules from Tracking Plan

Script segment Verified

Remove Profiles Warehouse from Space

Script segment Verified

Remove Filter from Destination

Script segment Verified

Remove Computed Trait from Space

Script segment Verified

Remove Audience from Space

Script segment Verified

Preview Destination Filter

Script segment Verified

List Workspace Regulations

Script segment Verified

List Warehouses

Script segment Verified

Resource type

segment — the shape of the credential every script on this page expects.

View raw schema →
FieldTypeRequiredWhat it is
baseUrlstringYeshttps://api.segmentapis.com for US workspace and https://eu1.api.segmentapis.com for EU workspace.
tokenstringYesAccess token generated using the OAuth flow.

Questions

Which baseUrl do I need?

The one for your workspace's region. An EU workspace only answers on the eu1 host, and a wrong host looks like an authentication failure.

Is this the tracking API?

No. These scripts configure a workspace — sources, destinations, tracking plans. Sending events is a different API with a write key.

Is my token stored on the hub?

Never. It lives only in your own Windmill workspace, encrypted at rest.