Enable Unify in the Segment workspace and note the Space ID from the Unify settings page.
Authenticate using HTTP Basic Authentication with a Profile API access token as the username and an empty string as the password.
Query a user's traits by sending GET https://profiles.segment.com/v1/spaces/{space_id}/collections/users/profiles/{id_type}:{id_value}/traits — where id_type can be user_id, anonymous_id, or a custom external ID.
Use the include query parameter (e.g., ?include=email,plan) to request only the specific traits you need, improving latency; append ?limit=200 to retrieve up to 200 traits in one response.
Parse the traits object from the response; if a trait is absent, the user profile exists but that trait has not been set.
Known gotchas
The Profiles API is intended for server-side use only — embedding the access token in client-side code exposes all user profile data.
Profile resolution depends on the identity graph configured in Unify; the same external ID may resolve differently depending on merge rules.
Segment reports p95 response times under 200 ms for the /traits endpoint in-region; cross-region requests will be slower.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp