Skip to the documentation
API

Chats

Every operation in this group: what it accepts, what it returns and the errors it can answer with.

Operations

The conversations held with the assistant in the app, as the Chats page lists them. Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an app reaches the chats of the person who connected it. A key or an app limited to particular addresses or domains is a 422 capability_unsupported.

GET/chats

List the assistant chats

Scopesthreads:readReads

Your chats, newest first, a page at a time, each with its title, how many messages it holds and when it last changed. q searches the titles and sort orders them. Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an app reaches the chats of the person who connected it. A key or an app limited to particular addresses or domains is a 422 capability_unsupported.

Requires the threads:read scope.

Query parameters

qstring

Search the titles.

Up to 200 characters
sortstring

newest and oldest order by the last change, and title alphabetically.

One of"newest""oldest""title"Default"newest"
limitinteger

Rows per page, 1 to 100.

At least 1At most 100Default25
cursorstring

The previous page's nextCursor, passed back as it came. It is opaque: it holds where the last row sat in this list's order, so a row deleted or edited between pages never breaks the walk, and the next page starts at the first row that sorts after it. A value this list did not hand out is a 400 invalid_cursor.

Returns

A page of chats.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.chats.list()nextmail.chats.listAll()nextmail.chats.iterate()
Python
chats.list()chats.list_all()chats.iterate()
Ruby
chats.listchats.list_allchats.iterate
PHP
chats->listchats->listAllchats->iterate
Go
Chats.ListChats.ListAllChats.Iterate
Java
chats().listchats().listAllchats().iterate
C#
Chats.ListAsyncChats.ListAllAsyncChats.IterateAsync
CLI
openemail chats list
MCP
listChats

GET/chats/{id}

Retrieve a chat

Scopesthreads:readReads

One chat by id. Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an app reaches the chats of the person who connected it. A key or an app limited to particular addresses or domains is a 422 capability_unsupported.

Requires the threads:read scope.

Path parameters

idstringRequired

The chat id from GET /chats.

Returns

200Chat

The chat.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.chats.get()
Python
chats.get()
Ruby
chats.get
PHP
chats->get
Go
Chats.Get
Java
chats().get
C#
Chats.GetAsync
CLI
openemail chats get
MCP
getChat

PATCH/chats/{id}

Rename a chat

Scopesthreads:writeChanges data

Gives the chat a new title. Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an app reaches the chats of the person who connected it. A key or an app limited to particular addresses or domains is a 422 capability_unsupported.

Requires the threads:write scope.

Path parameters

idstringRequired

The chat id from GET /chats.

Request body

titlestringRequired
1 to 120 characters

Returns

200Chat

The chat with its new title.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.chats.rename()
Python
chats.rename()
Ruby
chats.rename
PHP
chats->rename
Go
Chats.Rename
Java
chats().rename
C#
Chats.RenameAsync
CLI
openemail chats rename
MCP
renameChat

DELETE/chats/{id}

Delete a chat

Scopesthreads:writeDeletes

Deletes the chat and every message in it, for good. Nothing it did in the mailbox is undone. Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an app reaches the chats of the person who connected it. A key or an app limited to particular addresses or domains is a 422 capability_unsupported.

Requires the threads:write scope.

Path parameters

idstringRequired

The chat id from GET /chats.

Returns

Deleted.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.chats.delete()
Python
chats.delete()
Ruby
chats.delete
PHP
chats->delete
Go
Chats.Delete
Java
chats().delete
C#
Chats.DeleteAsync
CLI
openemail chats delete
MCP
deleteChat

Objects

Chatobject

objectstringRequired
One of"chat"
idstringRequired
titlestringRequired
kindstringRequired
One of"chat"
messageCountintegerRequired
At least 0
updatedAtstringRequired

When a message last arrived in it.

Formatdate-time

ChatListobject

objectstring
One of"list"
dataChat[]
hasMoreboolean

True when another page follows. Pass nextCursor back as cursor to read it.

nextCursorstring

An opaque cursor for the next page, or null on the last page. Pass it back unchanged.

Can be null

DeletedChatobject

objectstring
One of"chat"
idstring
deletedboolean
One oftrue