Skip to main content
Records many messages in one call. Use this when backfilling an existing transcript, syncing a buffered queue, or recording a multi-turn exchange after it completes. Each entry in messages follows the same shape as the arguments to record_message.

Parameters

List[Dict[str, Any]]
required
List of message dicts. Each dict supports the following keys:
  • conversation_id (str, required): conversation identifier; must be a valid UUID registered via record_message
  • role (str, required): must be "user" or "assistant"
  • content (str, required): message text
  • user_id (str, optional): external user id
  • customer_id (str, optional): external customer id; required on B2B, auto-resolved on B2C (B2C vs B2B)
  • session_id (str, optional): session identifier
  • metadata (dict, optional): free-form metadata
Unlike record_message, user_id and customer_id are optional in batch mode. If omitted, the entry is recorded without explicit user/customer attribution.

Returns

A dict summarising the batch outcome.
int
Number of messages submitted.
int
Number of messages accepted.
int
Number of messages rejected.
List[Dict[str, Any]]
Per-message results in submission order. Successful entries include message_id and recorded_at; failed entries include an error field.

Example

Raises

  • InvalidInputError: when an entry is missing required keys or role is invalid.
  • AuthenticationError: when the API key is missing or invalid.
  • NetworkError: when the SDK cannot reach Synap.

See also