CRADDevelopers
English

Search retained messages

Before going live — check deployed capabilities, grants and your integration’s readiness.

Check deployed capabilities, key grants and business readiness in your environment. HTTP examples were captured in isolated tests; their local-unreleased provenance neither says the API is offline nor certifies your integration. Customer self-service uses the business-configured WhatsApp authentication template; SMS is not supported. Authorized admin contact recording is a separate action without a code.

GET/v1/management/conversations/{conversationId}/messages/search

Behavior

Search 2–200 characters of trimmed text within one retained thread. Maximum 40 results per page. Keep the opaque cursor, search and integration together; a changed stored conversation binding invalidates that cursor. Returned content can include bounded interactive_id and reply_to_id for button recovery; the search itself remains text-based. This does not import more history, mark messages read or authorize an order action.

Authentication

ManagementCredential

Credential rules

One server-only owner-issued wbm_ API key can carry both management and integration permissions. Additional permissions require an explicit owner-issued grant. GET /v1/management returns the management discovery view, which may be empty for a booking-only key. For credentials with appointments:read, this discovery view omits whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write to preserve calendar-client compatibility. Discover these grants through GET /v1/management/messaging-capabilities. Template/profile command authorization still uses the stored grants. Server-only owner-issued Management authority with explicit application permissions. Calling this API does not expand a credential's grants. contacts:read/write/block/sync/fields:read/fields:write are separate approvals for canonical business contacts; fields also require current typed owner grants. contacts:record remains contact recording/recovery only. These grants create no customer phone proof, booking authority, messaging consent or automatic synchronization. Hours/blocks retain their independent resource grants. booking-policy:read/write separately delegate whole-business booking settings, without schedule/provider grants; write requires read. They preserve existing appointments and create no duration-rewrite authority. Provider duration policy additionally requires explicit provider-booking-policy:read/write and exact current providerIds; booking-duration:rewrite is separately approved and does not itself grant policy read/write. Service catalogue requires explicit services:read/write, independent of provider/calendar/schedule resources; write requires read. These operations do not expand an existing credential's grants. Public presentation and reviewed service selection require explicit website-content:read/write; write requires read, independently from services:* and provider resources. Existing provider metadata/activity/assignment additionally requires providers:read/write and a nonempty explicit current providerIds grant; write requires read. This grants no provider creation, deletion, login, invitation or schedule authority. WhatsApp template/profile management requires separate whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write application scopes. Write requires its matching read scope. These grants require explicit owner approval; Meta OAuth permissions remain separate.

Required application permissions

conversations:read

Explicit whole-business conversation access. Provider selections do not narrow it; customer, calendar or sending scopes do not grant it. Keep the Management key on your backend. Inbox enablement remains separate.

Request

  • conversationIdpath · stringRequired

    CRAD identifier returned by the corresponding authorized API.

    Format and constraints
    conversationId schema
    {
      "type": "string",
      "format": "uuid"
    }
  • searchquery · stringRequired

    Required search text; at least two characters after trimming surrounding whitespace.

    Format and constraints
    search schema
    {
      "type": "string",
      "minLength": 2,
      "maxLength": 200
    }
  • limitquery · integerOptional

    Maximum page size.

    Format and constraints
    limit schema
    {
      "type": "integer",
      "minimum": 1,
      "maximum": 40,
      "default": 40
    }
  • cursorquery · stringOptional

    Opaque nextCursor from this same query; omit initially.

    Format and constraints
    cursor schema
    {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048,
      "pattern": "^[A-Za-z0-9_-]+$"
    }

Successful responses

200 · BusinessConversationSearch

Current authorized result.

Cache-Control
Cache-Control schema
{
  "const": "no-store"
}

application/json · BusinessConversationSearch

  • itemsarrayRequired

    maxItems: 40

    View nested fields
    • []objectArray item

      Retained CRAD message metadata and safe text content. No provider credentials, provider media/message IDs or download URL. Media download and message sending are not introduced by these operations. liveReceivedAt is present only for verified live customer arrivals.

      View nested fields
      • idstring · uuidRequired
      • sourcestringRequired

        Allowed values: ["api","phone","history"]

      • directionstringRequired

        Allowed values: ["inbound","outbound"]

      • kindstringRequired

        maxLength: 64

      • textanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1stringSchema branch

          maxLength: 16384

        • anyOf 2nullSchema branch
      • contentobjectRequired
        View nested fields
        • mime_typestringOptional

          maxLength: 1024

        • filenamestringOptional

          maxLength: 1024

        • template_namestringOptional

          maxLength: 1024

        • template_languagestringOptional

          maxLength: 1024

        • captionstringOptional

          maxLength: 4096

        • interactive_titlestringOptional

          maxLength: 4096

        • voicebooleanOptional
        • content_unavailablebooleanOptional
        • text_truncatedbooleanOptional
        • interactive_idstringOptional

          Retained incoming button/list payload, when supplied by the provider. Use a verified callback sender and business plus a server-owned opaque action token to authorize an action; text or this value alone is not authority.

          maxLength: 1024

        • reply_to_idstringOptional

          Provider context message ID, when available. Compare with a reliably mapped original provider message ID; do not depend on asynchronous status mapping being available before the first valid click.

          maxLength: 1024

        • additionalPropertiesno value allowedSchema rule
      • statusstringRequired

        Allowed values: ["received","pending","sent","delivered","read","played","failed","unknown"]

      • sentAtanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1string · date-timeSchema branch
        • anyOf 2nullSchema branch
      • receivedAtstring · date-timeRequired
      • liveReceivedAtanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1string · date-timeSchema branch
        • anyOf 2nullSchema branch
      • dispatchStatestring | nullRequired

        Allowed values: ["pending","accepted","rejected","unknown",null]

      • requiresReviewbooleanRequired
      • clientRequestIdanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1string · uuidSchema branch
        • anyOf 2nullSchema branch
      • additionalPropertiesno value allowedSchema rule
  • nextCursoranyOf (string | null)Required

    At least one of these variants must match.

    View nested fields
    • anyOf 1stringSchema branch

      minLength: 1maxLength: 2048pattern: "^[A-Za-z0-9_-]+$"

    • anyOf 2nullSchema branch
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "items": {
      "type": "array",
      "maxItems": 40,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "enum": [
              "api",
              "phone",
              "history"
            ]
          },
          "direction": {
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "kind": {
            "type": "string",
            "maxLength": 64
          },
          "text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16384
              },
              {
                "type": "null"
              }
            ]
          },
          "content": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "mime_type": {
                "type": "string",
                "maxLength": 1024
              },
              "filename": {
                "type": "string",
                "maxLength": 1024
              },
              "template_name": {
                "type": "string",
                "maxLength": 1024
              },
              "template_language": {
                "type": "string",
                "maxLength": 1024
              },
              "caption": {
                "type": "string",
                "maxLength": 4096
              },
              "interactive_title": {
                "type": "string",
                "maxLength": 4096
              },
              "voice": {
                "type": "boolean"
              },
              "content_unavailable": {
                "type": "boolean"
              },
              "text_truncated": {
                "type": "boolean"
              },
              "interactive_id": {
                "type": "string",
                "maxLength": 1024,
                "description": "Retained incoming button/list payload, when supplied by the provider. Use a verified callback sender and business plus a server-owned opaque action token to authorize an action; text or this value alone is not authority."
              },
              "reply_to_id": {
                "type": "string",
                "maxLength": 1024,
                "description": "Provider context message ID, when available. Compare with a reliably mapped original provider message ID; do not depend on asynchronous status mapping being available before the first valid click."
              }
            },
            "required": []
          },
          "status": {
            "enum": [
              "received",
              "pending",
              "sent",
              "delivered",
              "read",
              "played",
              "failed",
              "unknown"
            ]
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          },
          "liveReceivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dispatchState": {
            "enum": [
              "pending",
              "accepted",
              "rejected",
              "unknown",
              null
            ]
          },
          "requiresReview": {
            "type": "boolean"
          },
          "clientRequestId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "source",
          "direction",
          "kind",
          "text",
          "content",
          "status",
          "sentAt",
          "receivedAt",
          "liveReceivedAt",
          "dispatchState",
          "requiresReview",
          "clientRequestId"
        ],
        "description": "Retained CRAD message metadata and safe text content. No provider credentials, provider media/message IDs or download URL. Media download and message sending are not introduced by these operations. liveReceivedAt is present only for verified live customer arrivals."
      }
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "items",
    "nextCursor"
  ]
}

Errors and recovery

Error responses declared in the contract (7)

The preview contract shares generic error definitions across operations. This list is not an exhaustive list of runtime errors.

401 · Missing or invalid Management credential.
Cache-Control
Cache-Control schema
{
  "const": "no-store"
}

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
403 · Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.
Cache-Control
Cache-Control schema
{
  "const": "no-store"
}

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
404 · CONVERSATION_NOT_FOUND: no accessible current thread for this identifier.
Cache-Control
Cache-Control schema
{
  "const": "no-store"
}

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
405 · Unsupported method.
Cache-Control
Cache-Control schema
{
  "const": "no-store"
}

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
422 · Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.
Cache-Control
Cache-Control schema
{
  "const": "no-store"
}

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
429 · Request quota exceeded; honor Retry-After.
Cache-Control
Cache-Control schema
{
  "const": "no-store"
}
Retry-After · If present, wait this many seconds before the next read/check. This does not authorize a new command.
Retry-After schema
{
  "type": "integer",
  "minimum": 1
}

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
503 · Temporary read failure; retry this read after any Retry-After.
Cache-Control
Cache-Control schema
{
  "const": "no-store"
}
Retry-After · If present, wait this many seconds before the next read/check. This does not authorize a new command.
Retry-After schema
{
  "type": "integer",
  "minimum": 1
}

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}