> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hellocobi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Segment Recommendation Model

> The segment recommendation model represents recommendations for a specific customer segment in the Cobi system.

## Schema

```json theme={null}
{
  "type": "object",
  "required": ["recommendation_id", "name", "segment_id", "offers", "type"],
  "properties": {
    "recommendation_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the recommendation"
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for the segment"
    },
    "segment_id": {
      "type": "string",
      "description": "Unique identifier for the customer segment"
    },
    "offers": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Array of offer UUIDs that are recommended for the segment"
    },
    "type": {
      "type": "string",
      "enum": ["SELF", "SEGMENT"],
      "description": "Type of recommendation - SELF for individual customer recommendations, SEGMENT for segment-based recommendations"
    }
  }
}
```

## Field Descriptions

### Required Fields

| Field               | Type   | Format | Description                                |
| ------------------- | ------ | ------ | ------------------------------------------ |
| `recommendation_id` | string | UUID   | Unique identifier for the recommendation   |
| `name`              | string | -      | Human-readable name for the segment        |
| `segment_id`        | string | -      | Unique identifier for the customer segment |
| `offers`            | array  | -      | Array of offer UUIDs that are recommended  |
| `type`              | string | enum   | Type of recommendation (SELF or SEGMENT)   |

## Example

```json theme={null}
{
  "recommendation_id": "00000000-1234-5678-9abc-def012345678",
  "name": "Early Twenties",
  "segment_id": "cmcapwfrl01zk3m2t0axbh05e",
  "offers": [
    "00000000-aaca-4844-9cb0-54af8f897322",
    "00000001-c020-4d37-8d6e-4e4e30ff5671",
    "00000002-5fe2-466c-b58a-5ac8db631334"
  ],
  "type": "SEGMENT"
}
```

## Best Practices

1. **UUID Format**: Ensure all offer IDs are valid UUID v4 format
2. **Data Validation**: Validate that all offer IDs exist in your system before using them
3. **Caching**: Consider caching segment recommendations as they change less frequently than individual customer recommendations
4. **Error Handling**: Handle cases where the offers array might be empty

Need help? Contact our support team at [support@hellocobi.com](mailto:support@hellocobi.com)
