client.api.ask.userHistory

User history APIs, available as client.api.ask.userHistory, for the current user's past conversation threads.

Instance methods

client.api.ask.userHistory.deleteAllThreads([options])

Delete all of the user's threads.

Parameter Type Description
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.deleteThread(threadId, [options])

Delete a thread.

Parameter Type Description
threadId string
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.deleteThreads(payload, [options])

Delete multiple threads.

Parameter Type Description
payload Object
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.dismissNotifications([options])

Dismiss all notifications.

Parameter Type Description
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.favoriteThread(threadId, [payload], [options])

Star or unstar a thread. This sets the star to the given state instead of toggling it, so retries and repeated calls are safe.

Parameter Type Description
threadId string
payload Object Optional.
payload.favorite boolean true to star the thread, false to unstar it. Default true. Optional.
options Object Request options. Optional.

Returns Promise<Object>: The thread's star state: { thread_id, favorite, favorited_at }.

client.api.ask.userHistory.getNotifications([options])

Get notifications of updates to the user's threads.

Parameter Type Description
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.getThread(threadId, [payload], [options])

Get a thread, with the IDs of its questions.

Parameter Type Description
threadId string
payload Object Optional.
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.getThreads(payload, [options])

List the user's threads.

Parameter Type Description
payload Object
payload.favorite boolean Omit to list all threads, true for starred threads only, false for unstarred threads only. Optional.
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.markThreadAsRead(threadId, [options])

Mark a thread as read, dismissing its notifications.

Parameter Type Description
threadId string
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.subscribeThread(threadId, [options])

Subscribe to updates of a thread.

Parameter Type Description
threadId string
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.unsubscribeThread(threadId, [options])

Unsubscribe from updates of a thread.

Parameter Type Description
threadId string
options Object Request options. Optional.

Returns Promise<Object>.

client.api.ask.userHistory.updateThread(threadId, payload, [options])

Update a thread, such as its title.

Parameter Type Description
threadId string
payload Object
options Object Request options. Optional.

Returns Promise<Object>.