Connect Segment to Toolspoke
Inspect a Segment workspace: sources, destinations, tracking plans, warehouses, and functions. Toolspoke gives your agents 10 of its actions, and you decide which ones each project allows.
- Connection
- Provider REST API
- Authentication
- Public API token
- Actions exposed
- 10
- What a call bills
- Nothing
- Adapter
- Maintained by Toolspoke
- Category
- Analytics
Connected in three steps
Install Segment
Open the marketplace in your workspace, add Segment to the project your agents work in, and it appears on the gateway immediately.
Connect the credential
Provide the credential Segment asks for. Where to get it, and what it has to be able to reach, is the next section.
Give it to an agent
Describe the job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. It can use every Segment action the project leaves on.
Where the agent answers
Slack
Ask it in a channel or a thread, and it replies in the thread it was asked in.
Email
Email it. Each write waits for a person's go-ahead unless that action is allowed in advance.
GitHub
Mention it on a pull request, and it answers there.
Schedule
A routine wakes it on a schedule, or when a new item matches.
Any agent in the project can use Segment, and only the actions the project leaves on.
What Segment asks for
Public API token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- Public API tokenRequired
- Segment → Settings → Workspace settings → Access Management → Tokens → Create token. A token belongs to one workspace; give it read-only access unless you have a reason not to.
- sgp_…
- Regional API hostOptional
- Leave blank for the US region. An EU workspace is served from https://eu1.api.segmentapis.com, and a US token will not work against it.
- https://api.segmentapis.com
What an agent can do in Segment
10 actions, each one declared by name in the connector. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.
10 read, none write, none destructive
Reads
10Fetches data and changes nothing.
get_workspaceReturn the workspace this token belongs to, with its id, name and slug. Segment has no endpoint that lists workspaces, a Public API token opens exactly one, and this is how you find out which. Call it first when you do not know what the connection reaches, and treat it as the connection test: it costs nothing, needs no arguments, and a token that fails here is wrong rather than under-scoped.
list_sourcesList the sources in the workspace, the websites, apps, servers and cloud integrations that send data in, with each one's id, name, slug, enabled state and metadata. This is the usual second call after get_workspace and the way to find the source id every other source operation takes. It returns configuration, not events: nothing here reads what a source has collected.
get_sourceFetch one source by id, with its full settings, its metadata and the id of the tracking plan connected to it. Ids come from list_sources. Use list_connected_destinations to see where this source's data goes.
list_destinationsList every destination in the workspace, the tools data is forwarded to, with each one's id, name, enabled state and the source it is attached to. Use it to answer "where does our data end up" across the whole workspace; use list_connected_destinations when the question is about one source. Destination settings frequently contain the API keys of other products, so treat what comes back as configuration that names secrets even where their values are masked.
get_destinationFetch one destination by id, with its full settings and the source it is attached to. Ids come from list_destinations or from list_connected_destinations. This is the call that explains why a destination is or is not receiving something.
list_tracking_plansList the tracking plans in the workspace with their ids, names and types. A tracking plan is the contract for what events a source is allowed to send and what shape they take, so this is where a question about expected event schemas starts. Requires the Protocols feature on the workspace, without it this fails whatever the token's scopes say, which reads as a permission error and is not one.
get_tracking_plan_rulesReturn the rules of one tracking plan: the JSON Schema for every event it governs, with each event's name, type and property definitions. This is the schema surface an agent actually wants, it says what a valid event looks like without reading a single real event. Ids come from list_tracking_plans. Segment rate-limits this route harder than the rest of the Public API, at 200 requests a minute, so page through it rather than looping it tightly.
list_warehousesList the warehouses the workspace loads into, with each one's id, metadata, enabled state and settings. Use it to find out where Segment data lands for analysis, the answer is usually the same database a BigQuery, Snowflake or Postgres connection on this gateway already reaches, and this is how you confirm it is the same one.
list_connected_destinationsList the destinations one source is connected to. This is the per-source view of the data flow, and the call to make when the question is "where does this website's data go". Note the asymmetry: the route is named connected-destinations and the payload comes back under `destinations`, which is Segment's shape rather than a mistake here. Source ids come from list_sources.
list_functionsList the functions in the workspace, the custom code Segment runs to shape data on the way in or out, with each one's id, display name, description and code preview. IMPORTANT: `resource_type` is required and there is no call that returns all of them at once. Segment lists functions one kind at a time, so ask for SOURCE, DESTINATION, INSERT_SOURCE, INSERT_DESTINATION or INSERT_TRANSFORMATION separately and combine the answers yourself. Omitting it returns an error that reads like a bad request rather than a missing filter. Requires the Functions feature on the workspace.
What it will not do
The gateway enforces each of these, so they can be stated flatly.
- It cannot call anything else
- The 10 actions above are the whole of it. A call to any other name is refused before it reaches Segment rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
- It only reads
- Every action here reads. Nothing this connector can do changes anything in Segment.
- It reaches no further than your credential
- Toolspoke holds no access to Segment of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
- It never hears from Segment
- Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Segment. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around Segment's own rate limits. A call that Segment refuses comes back to the agent as a failed call.
Before you connect it
What can an agent do in Segment?
10 named actions: 10 that only read. They include get_workspace, list_sources and get_source. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.
What credentials does the Segment connector need?
Public API token. The connector asks for public api token, and optionally regional api host. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.
How does an agent get to use Segment?
Install Segment in a project and every agent in that project can use the actions the project leaves on. Describe a job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. The agent answers when someone asks it in Slack, emails it or mentions it on a GitHub pull request, or when its routine wakes it.
What does the Segment connector not do?
The 10 actions above are the whole of it. A call to any other name is refused before it reaches Segment rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Every action here reads. Nothing this connector can do changes anything in Segment. Toolspoke holds no access to Segment of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Segment. An agent has to ask. Toolspoke does not retry, queue or back off around Segment's own rate limits. A call that Segment refuses comes back to the agent as a failed call.
Can I limit which actions an agent can call?
Yes, in two places. The project switches Segment's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.
What gets recorded when an agent calls Segment?
Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and what the call cost in sandbox time and model tokens. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.