CRMax icon

CRMax

CRMax CRM - Gestão de Leads via WhatsApp

Session → Get by Contact

AI-generated

Summary

Retrieves the session(s) associated with a given contact ID, with optional filtering by status, channel, and limit, and optionally returning only the most recent session.

Inputs

  • contactId (required) — UUID of the contact (not the phone number).
  • status — Which sessions to return based on their status; options: Any (empty), Closed, Open. Defaults to Open.
  • channelId — Optional channel (WhatsApp instance) UUID to filter sessions for a specific channel.
  • latestOnly — If true, return only the most recent session; otherwise return a list of sessions. Defaults to true.
  • limit — Maximum number of sessions to return when latestOnly is false. Minimum 1, maximum 500, default 50.

Output shape

When latestOnly is true: a single session object; when false: an array of session objects (up to limit). The exact fields correspond to the CRMax session resource (e.g., id, contactId, channelId, status, timestamps). If no sessions match, returns an empty array (or null for latestOnly true).

Returned data is taken directly from the CRMax API response; no additional transformation is performed by the node.

Links

Discussion