List conversations
Lists the agency's WhatsApp conversations, newest last message first. Pass nextCursor as cursor to read the next page; stop when nextCursor is null.
https://api.alia.cx/api/v1/ agencies/ {agencyId}/ conversationsPath parameters
agencyIdstringRequiredAgency ID from
GET /me, such asagy_9f2c4e1a7b3d4c5e8f60a1b2c3d4e5f6.
Query parameters
pageSizeintegerConversations per page, from 1 to 100. Default 50.
min 1max 100default 50
cursorstringnextCursorfrom the previous page. Leave it out to read the first page.searchstringFilter by contact phone number or name, such as
Marieor0470. Three or more digits match part of a phone number; three or more letters match part of a name.
Responses
conversationsarray of objectsRequiredConversations, newest last message first.
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.
nextCursorstring or nullRequiredPass as
cursorto read the next page. Null when there are no more conversations.pageSizeintegerRequiredThe page size used for this page.
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
Get your integration and agenciesGET
Returns the integration your API key belongs to, the agencies it may access and its scopes. Call it first: every other path needs the id of one of these agencies.
Look up conversationsPOST
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.