Analytics & Data
Basic Auth
Segment REST API
Customer data platform API for collecting and routing data
Segment is a customer data platform that collects, cleans, and routes user event data to analytics tools and data warehouses. The API allows developers to send tracking events, identify users, manage workspaces and sources, and control data pipelines programmatically. It's widely used for implementing unified customer data infrastructure across web, mobile, and server-side applications.
Base URL
https://api.segment.io/v1
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /track | Track user actions and events with custom properties |
| POST | /identify | Identify users and record their traits |
| POST | /page | Record page views with associated properties |
| POST | /screen | Record mobile screen views |
| POST | /group | Associate individual users with a group or account |
| POST | /alias | Merge user identities across different IDs |
| POST | /batch | Send multiple events in a single API call |
| GET | /workspaces | List all workspaces in your account |
| GET | /workspaces/{workspace_id}/sources | List all sources in a workspace |
| POST | /workspaces/{workspace_id}/sources | Create a new source in a workspace |
| GET | /workspaces/{workspace_id}/destinations | List all destinations connected to a workspace |
| PUT | /workspaces/{workspace_id}/destinations/{destination_id} | Update destination configuration and settings |
| GET | /catalog/sources | Get the catalog of available source types |
| GET | /catalog/destinations | Get the catalog of available destination types |
| GET | /tracking-plans/{tracking_plan_id} | Retrieve a specific tracking plan and its schema |
Code Examples
curl -X POST https://api.segment.io/v1/track \
-u YOUR_WRITE_KEY: \
-H 'Content-Type: application/json' \
-d '{
"userId": "user123",
"event": "Product Purchased",
"properties": {
"product_id": "prod_abc123",
"price": 49.99,
"currency": "USD"
},
"context": {
"ip": "8.8.8.8"
},
"timestamp": "2024-01-15T10:30:00Z"
}'
Connect Segment to AI
Deploy a Segment MCP server on IOX Cloud and connect it to Claude, ChatGPT, Cursor, or any AI client. Your AI assistant gets direct access to Segment through these tools:
track_event
Track user events with custom properties for analytics and data routing
identify_user
Identify users and update their traits across all connected destinations
batch_events
Send multiple tracking events in a single batch for efficiency
manage_sources
List, create, and configure data sources in Segment workspaces
query_destinations
Retrieve and manage destination configurations and data flow settings
Deploy in 60 seconds
Describe what you need, AI generates the code, and IOX deploys it globally.
Deploy Segment MCP Server →