---
ref: tool:segment/track-event
name: Track an event
company: company:segment
workflows: []
access: [api]
tags: [capability:track-events, category:cdp, has:api]
docs: https://www.twilio.com/docs/segment/connections/sources/catalog/libraries/server/http-api#track
updated: 2026-09-27
---

# Track an event

Records one action a user took, such as Signed Up, with its properties and routes it to the source's destinations.

Note: A request can be up to 32 KB. Segment deduplicates on `messageId`, so give every event a unique one under 100 characters.

## Set up

Use the first option your agent supports.

### API (official)

- Base URL: https://api.segment.io
- Endpoint: `POST /v1/track`
- Auth: send the header `Authorization: Basic $SEGMENT_API_KEY`
- Get a key: https://www.twilio.com/docs/segment/connections/find-writekey
- Docs: https://www.twilio.com/docs/segment/connections/sources/catalog/libraries/server/http-api

Note: `SEGMENT_API_KEY` holds the base64 of `<write key>:`. EU workspaces send to `https://events.eu1.segmentapis.com` instead.

Before anything else, confirm access with the cheapest read-only call, like a list or a search. Never send or change anything to test access.

## Rules

- Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
- Never print API keys.
