Look up conversations
Returns the conversation summary for each phone number you send, up to 100, in the same order. A number with no conversation gets conversation: null. Use it to show WhatsApp status next to a list of contacts; read messages with List messages. It only reads, so it needs conversations:read.
https://api.alia.cx/api/v1/ agencies/ {agencyId}/ conversations/ lookupPath parameters
agencyIdstringRequiredAgency ID from
GET /me, such asagy_9f2c4e1a7b3d4c5e8f60a1b2c3d4e5f6.
Request body
application/jsonphoneNumbersarray of stringsRequiredPhone numbers to look up, from 1 to 100.
min items 1max items 100
Responses
resultsarray of objectsRequiredOne result per phone number, in the order you sent them.
Show 2 child fieldsHide child fields
phoneNumberstringRequiredThe phone number exactly as you sent it.
conversationobject or nullRequiredThe conversation with this contact. Null when there is none.
Show 17 child fieldsHide child fields
phoneNumberstringRequiredContact phone number in E.164 format.
contactNamestring or nullRequiredContact name, when known.
lastMessageAtstring or nullRequiredTime of the last message, in either direction.
lastMessagePreviewstring or nullRequiredStart of the last message text.
lastMessageDirectionstring or nullRequiredDirection of the last message:
inbound(from the contact) oroutbound.totalMessagesintegerRequiredNumber of messages in the conversation.
failedMessagesintegerRequiredOutbound messages that failed, went undelivered or carry an error code.
activeFlowsintegerRequiredAlia flows now running for this contact.
completedFlowsintegerRequiredAlia flows this contact has finished.
latestFlowStatusstring or nullRequiredStatus of the most recently updated flow, such as
active,waiting,completed,cancelled,failedortimeout.lastInboundAtstring or nullRequiredTime of the last message from the contact.
windowExpiresAtstring or nullRequiredWhen the WhatsApp 24-hour window closes: 24 hours after the last message from the contact. Null when the contact has never written. After this time a send is queued, not sent.
aiEnabledbooleanRequiredTrue when the AI may reply to this contact.
queuedMessagesintegerRequiredMessages waiting for the contact to reopen the WhatsApp window.
isUnlinkedbooleanRequiredTrue when no agency owns this conversation.
visibilityobjectRequiredWhy this agency can see the conversation.
Show 3 child fieldsHide child fields
reasonstringRequiredWhy the agency sees this conversation.
focus: the agency owns it.unlinked: no agency owns it.tagged: the agency sees it through an agency tag.unknown: none of these.One of
focusunlinkedtaggedunknownisSharedbooleanRequiredTrue when other agencies may also see this conversation.
isVisibleThroughAgencyTagbooleanRequiredTrue when the agency sees it through an agency tag.
cursorstring or nullRequiredOpaque position of this row in the list. Pass it as
cursorto read the rows after it. Null in lookup results.
Errors
- 400Bad request
PartnerBadRequestThe request is not valid. - 401Unauthorized
PartnerUnauthorizedThe bearer token is missing or not valid. - 403Forbidden
PartnerForbiddenThe key may not do this. - 500Server error
PartnerInternalErrorAlia failed to handle the request.
Every error body is JSON with the same two fields: _tag names the error and message explains it. How errors work
List conversationsGET
Lists the agency's WhatsApp conversations, newest last message first. Pass nextCursor as cursor to read the next page; stop when nextCursor is null.
Get a conversationGET
Returns one conversation, its AI and window state, any queued text and its newest messages. Use it to check whether a send would go out now or be queued.