diff --git a/app/views/api/v1/conversations/partials/_conversation.json.jbuilder b/app/views/api/v1/conversations/partials/_conversation.json.jbuilder index 4cb13f543..6036d91e0 100644 --- a/app/views/api/v1/conversations/partials/_conversation.json.jbuilder +++ b/app/views/api/v1/conversations/partials/_conversation.json.jbuilder @@ -3,8 +3,12 @@ # Everywhere else we use conversation builder in partials folder json.meta do - json.sender do - json.partial! 'api/v1/models/contact', formats: [:json], resource: conversation.contact + if conversation.contact + json.sender do + json.partial! 'api/v1/models/contact', formats: [:json], resource: conversation.contact + end + else + json.sender nil end json.channel conversation.inbox.try(:channel_type) if conversation.assigned_entity.is_a?(AgentBot)