Teams error 404 ActivityNotFoundInConversation: ActivityNotFoundInConversation - message missing or deleted
Last verified against Microsoft Learn - Status codes from bot conversational APIs
Conversation not found.What error 404 ActivityNotFoundInConversation means
The conversation exists, but the activity (message) ID you referenced inside it does not. The status table documents ActivityNotFoundInConversation - confusingly with the same literal message text "Conversation not found." as its sibling - and explains: "The message ID provided couldn't be found in the conversation. Message doesn't exist or it is deleted." Retry is No; the action is "Check if message ID sent is an expected value. Remove the ID if it was cached."
You hit this updating or deleting a previously sent message (PUT/DELETE /v3/conversations/{conversationId}/activities/{activityId}) after a user or admin deleted it first, or when replying into a channel thread whose root message was removed. Bots that edit cards in place - approval flows, live status cards - must expect it routinely: any card a human can delete will eventually be deleted mid-flow. Distinguish from ConversationNotFound by the code string, never the message text.
What it looks like
{
"error": {
"code": "ActivityNotFoundInConversation",
"message": "Conversation not found."
}
}Why it happens
- The activity was deleted by the user, a channel moderator, or a retention policy before your update or delete arrived.
- The cached activity ID belongs to a different conversation than the one in the request path.
- A reply targets a channel thread root (;messageid=...) that was removed.
- The update path replays an activity ID from a previous card version that was itself replaced.
How to fix Teams error 404 ActivityNotFoundInConversation
- 1Branch on the error code string, not the message text, to separate this from ConversationNotFound.
- 2Evict the cached activity ID as documented and degrade gracefully - send a fresh message instead of editing the missing one.
- 3For threaded channel replies, fall back to posting a new conversation thread when the root is gone.
- 4Keep the mapping conversationId -> activityId consistent: store both at send time, atomically.
How to stop it recurring
Design card-update flows to tolerate deletion: treat the stored activity ID as a hint, and on 404 recreate rather than crash. Do not let workflows depend on a message surviving - humans can always delete it. Time-bound your edits; a card that stops being updated after its flow completes gives users less reason to prune it.
Official reference: Microsoft Learn - Status codes from bot conversational APIs. See all Teams error codes or the Teams limits and quotas.
Related codes
- 404 ConversationNotFound: ConversationNotFound - conversation missing or deletedConversation not found.
- 412 PreconditionFailed: PreconditionFailed - concurrent operations on one conversationPrecondition failed, please try again.
- 403 NotEnoughPermissions: NotEnoughPermissions - operation requires rights the bot lacks*scenario specific
Error 404 ActivityNotFoundInConversation - quick answers
What does Teams error 404 ActivityNotFoundInConversation mean?
The conversation exists, but the activity (message) ID you referenced inside it does not. The status table documents ActivityNotFoundInConversation - confusingly with the same literal message text "Conversation not found." as its sibling - and explains: "The message ID provided couldn't be found in the conversation.
How do I fix Teams error 404 ActivityNotFoundInConversation?
1. Branch on the error code string, not the message text, to separate this from ConversationNotFound. 2. Evict the cached activity ID as documented and degrade gracefully - send a fresh message instead of editing the missing one. 3. For threaded channel replies, fall back to posting a new conversation thread when the root is gone. 4. Keep the mapping conversationId -> activityId consistent: store both at send time, atomically.
Should I retry after error 404 ActivityNotFoundInConversation?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Teams by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.