tellcasey
APIAPI Reference

Webhook Events

Event payloads delivered to your webhook endpoints.

When events occur in Casey (e.g., a conversation starts or completes), we send HTTP POST requests to your configured webhook endpoints. Each event includes a standard envelope with event-specific data.

Envelope format

All webhook events follow this structure:

{
  "event_type": "conversation.started",
  "event_id": "evt_1234567890",
  "timestamp": "2024-01-15T10:30:00Z",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": { ... }
}
FieldTypeDescription
event_typestringOne of: conversation.started, conversation.completed, conversation.abandoned, test.event
event_idstringUnique identifier for idempotency
timestampstring (ISO 8601)When the event occurred
organization_idstring (UUID)Organization that owns the resource
dataobjectEvent-specific payload (see below)

conversation.started

Fired when a conversation begins.

{
  "event_type": "conversation.started",
  "event_id": "evt_1234567890",
  "timestamp": "2024-01-15T10:30:00Z",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "conversation_id": "660e8400-e29b-41d4-a716-446655440001",
    "project_id": "770e8400-e29b-41d4-a716-446655440002",
    "agent_id": "880e8400-e29b-41d4-a716-446655440003",
    "participant_user_id": "990e8400-e29b-41d4-a716-446655440004",
    "connection_code": "ABC123",
    "started_at": "2024-01-15T10:30:00Z",
    "session_properties": {},
    "path_taken": null,
    "participant_profile": {
      "id": "990e8400-e29b-41d4-a716-446655440004",
      "email": "user@example.com",
      "first_name": "Jane",
      "last_name": "Doe",
      "organization_name": null,
      "organization_domain": null,
      "avatar_url": null
    }
  }
}

Data fields

FieldTypeDescription
conversation_idstring (UUID)Unique identifier for the conversation
project_idstring (UUID)Project the conversation belongs to
agent_idstring (UUID)Agent handling the conversation
participant_user_idstring | nullUser ID of the participant (if authenticated)
connection_codestring | nullConnection code used to join
started_atstring (ISO 8601)When the conversation started
session_propertiesobjectCustom session properties set at conversation start
path_takenarray | nullSections visited during the conversation
participant_profileobject | nullParticipant profile details (if available)

conversation.completed

Fired when a conversation finishes successfully. Includes duration and turn count metrics.

{
  "event_type": "conversation.completed",
  "event_id": "evt_1234567891",
  "timestamp": "2024-01-15T10:45:00Z",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "conversation_id": "660e8400-e29b-41d4-a716-446655440001",
    "project_id": "770e8400-e29b-41d4-a716-446655440002",
    "agent_id": "880e8400-e29b-41d4-a716-446655440003",
    "participant_user_id": "990e8400-e29b-41d4-a716-446655440004",
    "started_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:45:00Z",
    "duration_seconds": 900,
    "turn_count": 24,
    "transcript_markdown": "## Conversation Transcript\n\n**Agent:** Hello!...",
    "session_properties": {},
    "path_taken": [
      { "id": "section-1", "label": "Introduction", "section_type": "intro" }
    ],
    "participant_profile": {
      "id": "990e8400-e29b-41d4-a716-446655440004",
      "email": "user@example.com",
      "first_name": "Jane",
      "last_name": "Doe"
    }
  }
}

Data fields

Includes all fields from conversation.started, plus:

FieldTypeDescription
completed_atstring (ISO 8601)When the conversation completed
duration_secondsintegerTotal duration in seconds
turn_countintegerNumber of conversation turns
transcript_markdownstring | nullFull transcript in markdown format

conversation.abandoned

Fired when a conversation is abandoned before completion.

{
  "event_type": "conversation.abandoned",
  "event_id": "evt_1234567892",
  "timestamp": "2024-01-15T10:35:00Z",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "conversation_id": "660e8400-e29b-41d4-a716-446655440001",
    "project_id": "770e8400-e29b-41d4-a716-446655440002",
    "agent_id": "880e8400-e29b-41d4-a716-446655440003",
    "participant_user_id": null,
    "started_at": "2024-01-15T10:30:00Z",
    "abandoned_at": "2024-01-15T10:35:00Z",
    "reason": "disconnect"
  }
}

Data fields

FieldTypeDescription
conversation_idstring (UUID)Unique identifier for the conversation
project_idstring (UUID)Project the conversation belongs to
agent_idstring (UUID)Agent that was handling the conversation
participant_user_idstring | nullUser ID of the participant (if authenticated)
started_atstring (ISO 8601)When the conversation started
abandoned_atstring (ISO 8601)When the conversation was abandoned
reasonstringOne of: timeout, disconnect, user_left, error

test.event

Test event for verifying webhook endpoint connectivity. Sent via POST /webhooks/test.

{
  "event_type": "test.event",
  "event_id": "test_1705318200000",
  "timestamp": "2024-01-15T10:30:00Z",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "test": true,
    "message": "This is a test webhook from Casey"
  }
}

Data fields

FieldTypeDescription
testbooleanAlways true for test events
messagestringTest message from Casey

On this page