# Segment

Represents a segment that was detected for the user.

## Segment API

### `getAttributes()`

> ```java
> List<Attribute> getAttributes()
> ```
>
> Returns attributes pertaining to the segment.

### `getCategory()`

> ```java
> SegmentCategory getCategory()
> ```
>
> Returns the [category](/important-topics/sdk/api-reference/android/usercontext/segment/segmentcategory.md) of the segment.

### `getEndTime()`

> ```java
> @Nullable DateTime getEndTime()
> ```
>
> Returns the end time of the segment, if it has ended. Otherwise, returns null.

### `getSegmentId()`

> ```java
> int getSegmentId()
> ```
>
> Returns the unique ID of this segment.

### `getStartTime()`

> ```java
> DateTime getStartTime()
> ```
>
> Returns the start time of the segment.

### `getSubcategory()`

> ```java
> SegmentSubcategory getSubcategory()
> ```
>
> Returns the [subcategory](/important-topics/sdk/api-reference/android/usercontext/segment/segmentsubcategory.md) of the segment.

### `getType()`

> ```java
> SegmentType getType()
> ```
>
> Returns the [type](/important-topics/sdk/api-reference/android/usercontext/segment/segmenttype.md) of the segment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sentiance.com/important-topics/sdk/api-reference/android/usercontext/segment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
