List the Message Threads of the Connection Scope
/api/v1/message-threadsmessages.readOne conversation per booking that has at least one message, on the Properties of the Connection Scope, latest message first and paged with next_cursor. Each gives the booking, its Property and Sales Channel, a preview of the latest message GET /bookings/{booking_id}/messages lists (a Scheduled Message not sent yet is left out) and its author, the number of unread messages and whether the conversation is closed.
The author never carries the guest email or phone: those stay under guests.read on GET /bookings. The preview is the message text as written, so it holds whatever the guest or the host typed.
Incremental sync: read every page, keep next_updated_since, and pass it as updated_since next time. A new message, a message read or unread in ZenHost, or a closed or reopened conversation brings the thread back. A thread whose latest message changes while you page through may move ahead of your cursor: the next poll returns it. Some threads may come twice: upsert them by booking_id.
Paramètres
Paramètres de requête
property_id[]string (uuid)[]Only these Properties (repeat the parameter, at most 100). Each must be in the Connection Scope. Leave it out to list the whole Connection Scope, page by page.
au plus 100 éléments
updated_sincestring (date-time)Only Message Threads changed at or after this instant. Use
next_updated_sinceof your previous listing.cursorstringnext_cursorof the previous page.limitintegerPage size.
min 1 · max 500 · par défaut 100
Réponses
200One page of Message Threads.
application/jsonMessageThreadList
dataMessageThread[]obligatoireAfficher 7 attributs enfantsMasquer les attributs enfants
booking_idstring (uuid)obligatoireThe booking of the conversation; a booking has at most one Message Thread.
property_idstring (uuid)obligatoiresales_channelobjectobligatoireWhere the booking was made.
Afficher 2 attributs enfantsMasquer les attributs enfants
codestringobligatoiredirect,website,other, or the Sales Channel shortcode, as onGET /bookings.namestringobligatoire
latest_messageLatestMessageobligatoireThe latest message of the conversation.
Afficher 5 attributs enfantsMasquer les attributs enfants
idstring (uuid)obligatoirepreviewstringobligatoireFirst 200 characters of the message text.
authorMessageAuthorobligatoireWho wrote the message. Never carries a guest email or phone, nor the name of the team member.
Afficher 2 attributs enfantsMasquer les attributs enfants
typestringobligatoireguest(inbound),host(the host or a team member),zenny(written by Zenny, the ZenHost assistant),automation(a Scheduled Message) orapp(an App, seeapp_name). Version 1 may add values.Parmi :
guesthostzennyautomationappapp_namestringName of the App that sent the message, when
typeisapp.
created_atstring (date-time)obligatoireattachments_countintegerobligatoiremin 0
unread_countintegerobligatoireMessages of the conversation not read in ZenHost yet.
min 0
is_closedbooleanobligatoireIn ZenHost a conversation is closed once its latest message is read; a new guest message reopens it.
updated_atstring (date-time)obligatoireLast change of the conversation: a message added, changed or removed, or its read state.
next_cursorstring | nullobligatoirePass it as
cursor, with the same filters, to read the next page;nullon the last page.next_updated_sincestring (date-time)obligatoireOnce the last page is read, pass it as
updated_sinceto receive every Message Thread changed since this listing began. Some may come again: upsert them bybooking_id.
401Error code: unauthorized, connection_revoked.
Codes d’erreur
unauthorizedLe jeton d’accès est absent, inconnu, expiré ou révoqué, ou a été émis avant que le compte ne reconnecte l’App. Rafraîchissez-le ; si le rafraîchissement échoue, demandez au propriétaire de reconnecter l’App.connection_revokedLe propriétaire a révoqué la connexion d’App (ou votre App a révoqué son propre jeton de rafraîchissement). Cessez les appels pour ce compte et supprimez ses jetons.
402Error code: subscription_blocked.
Codes d’erreur
subscription_blockedL’abonnement ZenHost du compte est bloqué (impayé, résilié…). La connexion est conservée : prévenez votre client, les appels refonctionnent dès que l’abonnement est rétabli.
403Error code: app_suspended, forbidden_permission.
Codes d’erreur
app_suspendedZenHost a suspendu votre App, ou ne l’autorise plus sur ce compte. Cessez les appels et contactez ZenHost.forbidden_permissionVotre App n’a pas reçu la permission que cet endpoint exige.
422Error code: property_out_of_scope, validation_failed.
Codes d’erreur
property_out_of_scopeUn logement demandé est hors du périmètre de connexion ;details.property_idsles liste.validation_failedLa requête, les en-têtes ou le corps sont invalides ;details.issuesdésigne chaque problème (path,message, etmaximumquand une valeur ou une liste est trop grande).
429Error code: rate_limited.
En-tête Retry-After — Seconds to wait before the next call is allowed. Limits per App Connection: 60 reads (GET), 10 writes (other POST) and 30 messages sent to guests per minute.
Codes d’erreur
rate_limitedTrop d’appels sur cette connexion d’App. Attendez le nombre de secondes indiqué dansRetry-After.
500Error code: internal_error.
Codes d’erreur
internal_errorZenHost n’a pas pu répondre. Réessayez plus tard avec un délai croissant.