bots.purgeBotMemory
POST
/v1/bots/{botId}/memory/purge
const url = 'https://example.com/v1/bots/example/memory/purge';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"tag":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/bots/example/memory/purge \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "tag": "example" }'Removes every entry with one tag of OpenBot, like from:<userId> or chat:<id>, without showing them. It needs bots.write on a Bot that is not linked.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”botId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
tag
required
string
Example generated
{ "tag": "example"}Responses
Section titled “Responses”Success
Media typeapplication/json
object
removed
required
integer
Example generated
{ "removed": 1}BotInvalid | OrganizationRequired
AuthenticationRequired
Media typeapplication/json
object
_tag
required
string
Example
{ "_tag": "AuthenticationRequired"}@nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin
BotNotFound
Media typeapplication/json
object
_tag
required
string
bot
required
string
Example
{ "_tag": "BotNotFound"}@nmnmcc/ability/Authorizer/Pending | BotConflict
RateLimited
Media typeapplication/json
object
_tag
required
string
retryAfterSeconds
required
integer
Example
{ "_tag": "RateLimited"}BotStorageUnavailable | AuthenticationUnavailable | RequestFailed