> For the complete documentation index, see [llms.txt](https://api-docs.myhappyforce.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.myhappyforce.com/docs/api-reference/chat.md).

# Chat

## GET /api/v1/employee/chat/{employeeId}/history/{type}

> Get's the historic chat messages for a given employee

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"employeeAPISessionId":[]}],"components":{"securitySchemes":{},"schemas":{"ChatType":{"type":"string","description":"Type of chat context","enum":["PERSONAL_CHAT"]},"PaginableGenericListResultChatItemDTO":{"type":"object","properties":{"from":{"type":"integer","format":"int32"},"to":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int32"},"noContent":{"type":"boolean"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ChatItemDTO"}}}},"ChatItemDTO":{"type":"object","description":"Chat item: type (OBJECT or TEXT), ownership, content, timestamp, and optional commands.","properties":{"type":{"$ref":"#/components/schemas/ChatItemType","description":"Item type: OBJECT or TEXT"},"isOwn":{"type":"boolean","description":"Whether the message is from the current user"},"content":{"description":"Message content (object or text)"},"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the message"},"commands":{"type":"array","description":"Optional commands for this item","items":{"$ref":"#/components/schemas/ChatCommandDTO"}}}},"ChatItemType":{"type":"string","description":"Chat item type: OBJECT or TEXT","enum":["OBJECT","TEXT"]},"ChatCommandDTO":{"type":"object","description":"Chat command: label, command identifier, optional expiry, and parameters.","properties":{"label":{"type":"string","description":"Display label for the command"},"command":{"type":"string","description":"Command identifier"},"expiresMs":{"type":"integer","format":"int64","description":"Expiration time in milliseconds (optional)"},"params":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional key-value parameters for the command"}}}}},"paths":{"/api/v1/employee/chat/{employeeId}/history/{type}":{"get":{"tags":["Chat"],"description":"Get's the historic chat messages for a given employee","operationId":"getChatHistoryMessages","parameters":[{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ChatType"}},{"name":"from","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"to","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginableGenericListResultChatItemDTO"}}}}}}}}}
```
