Skip to contents

Retrieves the Cassidy API thread_id associated with a saved conversation. This is the bridge between your locally saved conversations and the Cassidy API functions.

Usage

cassidy_get_thread_id(conv_id)

Arguments

conv_id

Character. The local conversation ID from cassidy_list_conversations() (e.g., "conv_20260131_1234").

Value

Character. The Cassidy API thread_id, or NULL if the conversation has no thread_id. Returns NULL with a warning if the conversation doesn't exist.

Details

Why You Need This Function

The cassidyr package uses two different ID systems:

  1. Conversation IDs (local): Generated by the cassidyr app when you save conversations. Format: "conv_YYYYMMDD_HHMMSS_RAND". Used with:

  2. Thread IDs (API): Generated by Cassidy's servers when you create a thread. Format: UUID-like string from Cassidy. Used with:

This function converts from local conversation IDs to API thread IDs.

See also

Examples

if (FALSE) { # \dontrun{
  # List your saved conversations
  convs <- cassidy_list_conversations()
  print(convs)  # Shows both id and thread_id columns

  # Get thread_id from conversation_id
  conv_id <- convs$id[1]  # e.g., "conv_20260131_1234"
  thread_id <- cassidy_get_thread_id(conv_id)

  # Now use it with API functions
  if (!is.null(thread_id)) {
    thread <- cassidy_get_thread(thread_id)
    print(thread)
  }

  # Or skip the conversion - thread_id is in the table!
  thread_id <- convs$thread_id[1]
  thread <- cassidy_get_thread(thread_id)
} # }