# Put target book segments `PUT` `/api/v1/crm-connections/{crm_connection_id}/target-books/{target_book_id}/segments` Segments with id are updated, segments without id are created, and existing segments not in the request are deleted. ## Path parameters | Name | Type | Required | Description | |------|------|----------|-------------| | crm_connection_id | string | yes | UUID of the CRM connection | | target_book_id | string | yes | Salesforce ID of the target book | ## Request body `application/json` | Field | Type | Required | Description | |-------|------|----------|-------------| | segments | array[object] | yes | — | | segments.maximum_capacity | integer | no | — | | segments.name | string | yes | — | | segments.conditions_operator | string | yes | — | | segments.custom_condition_logic | string | no | — | | segments.conditions | array[object] | yes | — | | segments.conditions.id | string | no | Salesforce ID; present = update existing, absent = create new | | segments.conditions.field | string | yes | Salesforce field API name | | segments.conditions.operator | string | yes | Comparison operator | | segments.conditions.value | string | yes | Value to compare against | | segments.is_locked | boolean | no | — | | segments.id | string | no | Salesforce ID; present = update existing, absent = create new | ## Response `200 OK` — `application/json` | Field | Type | Description | |-------|------|-------------| | id | string | Salesforce ID of the target book record | | name | string | Target book name | | status | string | Status: Active or Deleted | | maximum_capacity | number | Maximum account capacity | | ownership_field | string | Salesforce ownership field API name | | created_at | string | ISO-8601 creation timestamp | | updated_at | string | ISO-8601 last-updated timestamp | | activity_threshold | object | Assigned activity threshold (if any) | | activity_threshold.id | string | Salesforce ID of the threshold definition | | activity_threshold.name | string | Name of the activity threshold | | segments | array[object] | Segments with their conditions (present when include_segments=true) | | reps | array[object] | Active assigned reps (present when include_reps=true) | ## Errors | Status | Description | |--------|-------------| | 400 | Bad Request | | 403 | Forbidden | | 404 | Not Found | | 422 | Unprocessable Entity | | 502 | Bad Gateway |