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

# Chats

## GET /api/v1/chats

> Retrieves multiple chats.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/chats":{"get":{"description":"Retrieves multiple chats.","tags":["Chats"],"parameters":[{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"channelIds","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["widget","widget-test","waha","whatsapp","instagram","telegram","api"]}},{"type":"string","enum":["widget","widget-test","waha","whatsapp","instagram","telegram","api"]}],"default":["widget","widget-test","waha","whatsapp","instagram","telegram","api"]},"required":false,"name":"channelTypes","in":"query"},{"schema":{"type":"string","nullable":true,"format":"date-time"},"required":false,"name":"lastChatMessageCreatedAtEnd","in":"query"},{"schema":{"type":"string","nullable":true,"format":"date-time"},"required":false,"name":"lastChatMessageCreatedAtStart","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"ownerIds","in":"query"},{"schema":{"type":"number","minimum":1,"default":1,"description":"The page number."},"required":false,"description":"The page number.","name":"pageNumber","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"The page size."},"required":false,"description":"The page size.","name":"pageSize","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"responderIds","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"responderVersionIds","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"responses":{"200":{"description":"Retrieves all chats for the workspace.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"isRemoved":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"},"channelId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"conversationVersion":{"type":"integer","minimum":0},"currentResponderId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"lastActivityAt":{"type":"string","format":"date-time"},"lastChatMessageCreatedAt":{"type":"string","nullable":true,"format":"date-time"},"ownerId":{"type":"string","format":"uuid","description":"The super identity ID of the chat owner. Can refer to users.superIdentityId or externalUsers.superIdentityId."},"privateMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"publicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"responderId":{"type":"string","format":"uuid","description":"The super identity ID of the current chat responder. Can refer to agents.superIdentityId or squads.superIdentityId."},"title":{"type":"string","nullable":true},"workspaceId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},"required":["createdAt","id","isRemoved","updatedAt","channelId","conversationVersion","currentResponderId","lastActivityAt","lastChatMessageCreatedAt","ownerId","privateMemory","publicMemory","responderId","title","workspaceId"]}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## POST /api/v1/chats

> Creates a new chat.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/chats":{"post":{"description":"Creates a new chat.","tags":["Chats"],"parameters":[{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channelId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"ownerId":{"type":"string","format":"uuid","description":"The super identity ID of the chat owner. Can refer to users.superIdentityId or externalUsers.superIdentityId."},"privateMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"default":{}},"publicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"default":{}},"title":{"type":"string","nullable":true}},"required":["channelId","ownerId","title"]}}}},"responses":{"200":{"description":"The chat was created.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"isRemoved":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"},"channelId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"conversationVersion":{"type":"integer","minimum":0},"currentResponderId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"lastActivityAt":{"type":"string","format":"date-time"},"lastChatMessageCreatedAt":{"type":"string","nullable":true,"format":"date-time"},"ownerId":{"type":"string","format":"uuid","description":"The super identity ID of the chat owner. Can refer to users.superIdentityId or externalUsers.superIdentityId."},"privateMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"publicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"responderId":{"type":"string","format":"uuid","description":"The super identity ID of the current chat responder. Can refer to agents.superIdentityId or squads.superIdentityId."},"title":{"type":"string","nullable":true},"workspaceId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},"required":["createdAt","id","isRemoved","updatedAt","channelId","conversationVersion","currentResponderId","lastActivityAt","lastChatMessageCreatedAt","ownerId","privateMemory","publicMemory","responderId","title","workspaceId"]}}}},"400":{"description":"Invalid data provided.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Channel or responder not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## GET /api/v1/chats/{id}

> Retrieves a chat.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/chats/{id}":{"get":{"description":"Retrieves a chat.","tags":["Chats"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"id","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"responses":{"200":{"description":"Retrieves a chat.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"isRemoved":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"},"channelId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"conversationVersion":{"type":"integer","minimum":0},"currentResponderId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"lastActivityAt":{"type":"string","format":"date-time"},"lastChatMessageCreatedAt":{"type":"string","nullable":true,"format":"date-time"},"ownerId":{"type":"string","format":"uuid","description":"The super identity ID of the chat owner. Can refer to users.superIdentityId or externalUsers.superIdentityId."},"privateMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"publicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"responderId":{"type":"string","format":"uuid","description":"The super identity ID of the current chat responder. Can refer to agents.superIdentityId or squads.superIdentityId."},"title":{"type":"string","nullable":true},"workspaceId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"tags":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"activeTicketCount":{"type":"integer","minimum":0,"description":"The number of distinct pending or ongoing tickets linked to this tag via ticket_tags or chat_tags."},"color":{"type":"string","enum":["default","gray","red","orange","yellow","green","blue","purple","pink","brown"],"description":"The color of the tag."},"description":{"type":"string","minLength":3,"maxLength":250,"description":"The description of the tag."},"name":{"type":"string","minLength":3,"maxLength":50,"description":"The display name of the tag."},"workspaceId":{"type":"string","format":"uuid","description":"The workspace that owns this tag."}},"required":["createdAt","id","updatedAt","activeTicketCount","color","description","name","workspaceId"]}}},"required":["createdAt","id","isRemoved","updatedAt","channelId","conversationVersion","currentResponderId","lastActivityAt","lastChatMessageCreatedAt","ownerId","privateMemory","publicMemory","responderId","title","workspaceId","tags"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Chat not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## DELETE /api/v1/chats/{id}

> Removes a chat.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/chats/{id}":{"delete":{"description":"Removes a chat.","tags":["Chats"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"id","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"responses":{"200":{"description":"The chat was removed.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"An informative message for a call that has no effective result to be returned."}},"required":["message"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Chat not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## PATCH /api/v1/chats/{id}

> Updates a chat.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/chats/{id}":{"patch":{"description":"Updates a chat.","tags":["Chats"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"id","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lastChatMessageCreatedAt":{"type":"string","nullable":true,"format":"date-time"},"privateMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"publicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"title":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"The chat was updated.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"isRemoved":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"},"channelId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"conversationVersion":{"type":"integer","minimum":0},"currentResponderId":{"type":"string","nullable":true,"format":"uuid","description":"A UUID v4 string that identifies an entity."},"lastActivityAt":{"type":"string","format":"date-time"},"lastChatMessageCreatedAt":{"type":"string","nullable":true,"format":"date-time"},"ownerId":{"type":"string","format":"uuid","description":"The super identity ID of the chat owner. Can refer to users.superIdentityId or externalUsers.superIdentityId."},"privateMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"publicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"responderId":{"type":"string","format":"uuid","description":"The super identity ID of the current chat responder. Can refer to agents.superIdentityId or squads.superIdentityId."},"title":{"type":"string","nullable":true},"workspaceId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},"required":["createdAt","id","isRemoved","updatedAt","channelId","conversationVersion","currentResponderId","lastActivityAt","lastChatMessageCreatedAt","ownerId","privateMemory","publicMemory","responderId","title","workspaceId"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"The chat was not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```
