---
title: "Add segment to contact"
method: POST
path: "/orgs/contacts/{contact_id}/segments/{segment_id}"
tags: ["Contacts"]
---

# Add segment to contact

`POST /orgs/contacts/{contact_id}/segments/{segment_id}`

## Request

- Base URL: `https://api.useinvent.com`
- URL: `https://api.useinvent.com/orgs/contacts/{contact_id}/segments/{segment_id}`
- Auth: HTTP bearer

Add a segment to a contact.

## Path parameters

- `contact_id` string, required
- `segment_id` string, required

## Response `200`

- ContactSchema: Schema for the contact
  - `id` string, required
  - `name` string, nullable, required
  - `blocked` boolean, required
  - `blocked_at` string, date-time
  - `unsubscribed` boolean, required
  - `unsubscribed_at` string, date-time
  - `unsubscribe_reason` string
  - `unsubscribe_feedback` string
  - `ai_replies` boolean, required
  - `ai_replies_at` string, date-time
  - `is_admin` boolean, required
  - `channels` ContactChannelSchema[], required
    - `id` string, required
    - `type` 'internal' | 'org' | 'agent' | 'custom' | 'whatsapp_bot' | 'messenger_bot' | 'instagram_dm' | 'tiktok_dm' | 'telegram_bot' | 'slack_bot' | 'teams_bot' | 'gmail' | 'outlook' | 'twilio' | 'telnyx' | 'email' | 'smpp', required: The channel type
    - `user_id` string, required: The unique identifier for the contact channel, e.g Phone Number or User ID
    - `avatar` string, nullable, required: The avatar for the contact channel, e.g X Avatar URL
    - `name` string, nullable, required: The name for the contact channel, e.g Full Name
    - `username` string, nullable, required: The username for the contact channel, e.g Username
    - `email` string, nullable, required: The email for the contact channel, e.g Email
    - `phone` string, nullable, required: The phone number for the contact channel, e.g Phone Number
    - `country` string, nullable, required: The country code associated with the contact channel, e.g US for United States
    - `agent` string, nullable, required: The user agent associated with the contact channel
    - `ip` string, nullable, required: The IP address associated with the contact channel
    - `language` string, nullable, required: The language code associated with the contact channel, e.g en for English
    - `link` string: A link to the contact channel, e.g a link to the social media profile
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `segments` SegmentLimitedSchema[], required
    - `id` string, required
    - `name` string, required
    - `color` 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'neutral', required: Accent color, by name
    - `contacts_count` number, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `fields` object, required: Map of contact field key → value.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

---

[API](https://skmtc.dev/useinvent/apis/invent-api.md) · [All operations](https://skmtc.dev/useinvent/apis/invent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useinvent/apis/invent-api/revisions/98824f3fde82?raw)
