If your business runs a website or an app, you probably have the same customer showing up in five different tools: analytics, email marketing, ads, support, and a data warehouse. Each one wants its own tracking code, each one has a slightly different picture of who the customer is, and none of them agree. Twilio Segment exists to fix that. You record what customers do once, and Segment cleans it up and sends it to all of those tools. It does this through APIs. An API is a way for your software, or an AI assistant working for you, to send information to Segment or ask it questions directly. I keep a profile of Segment on APIs.io, and this is what it lets you get done.
What Twilio Segment does
Segment is a customer data platform, often shortened to CDP: a system that collects, cleans, and routes customer data to downstream tools for analytics, marketing, and data warehousing. It covers event collection, where your site or app reports things like “page viewed” or “order placed,” plus identity resolution (working out that the person on your phone app and the person on your website are the same customer), audiences, tracking-plan governance, and syncing data from your warehouse back out to other tools. Segment is now part of Twilio, and its documentation lives on twilio.com. You can read more on the Segment website.
What you can get done
Product telemetry instrumentation
“Telemetry” just means the record of what people do in your product. These are the calls your website, app, or server makes to tell Segment something happened, and Segment then forwards it to every tool you have connected.
POST /trackrecords an event, such as a signup or a purchase.POST /pagerecords a page view on your website.POST /screenrecords a screen view in a mobile app.
Customer data management
Once Segment has stitched a customer’s activity together, you can look that customer up. This is useful for personalizing a website, briefing a support agent, or deciding which offer to show.
GET /collections/users/profiles/{externalId}/traitsreturns what Segment knows about a person, such as plan or location.GET /collections/users/profiles/{externalId}/eventsreturns the things that person has done.GET /collections/users/profiles/{externalId}/external_idsreturns the other IDs the same person goes by, like an email address or app ID.GET /collections/accounts/profiles/{externalId}/traitsreturns the same kind of profile for a business account.
Telemetry quality and governance
Data is only useful if it is consistent. A “tracking plan” is the agreed list of events and what each one should contain, so that “Order Completed” means the same thing everywhere. These calls let you manage those plans.
GET /tracking-planslists your tracking plans.POST /tracking-planscreates a new one.GET /tracking-plans/{trackingPlanId}returns a single plan.PATCH /tracking-plans/{trackingPlanId}updates it.
Privacy and data protection management
When a customer asks you to delete their data or stop collecting it, you need to honor that across every tool. Segment calls these requests “regulations.”
POST /regulationsfiles a request, such as deleting a customer’s data.GET /regulationslists the requests you have filed.
Getting started
Segment is a paid product. For plans, see the Pricing section of the Segment profile. The Public API documentation covers managing your workspace, the HTTP Tracking API guide explains how to send events in, and the Profile API guide explains how to look customers up.
On APIs.io you can browse the Segment profile and individual APIs such as the Identify API, the Events API, the Destinations API and the Batch API.
If you are adding the same tracking code to your site for the fifth time, start by sending your key events to Segment’s track call and let it fan them out for you.
