> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbit.devotel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tail and filter recent CDP events (Source Debugger)

> Live Source Debugger for validating instrumentation as you ship it: tail the raw `cdp_events` stream with per-field filters (type, event_name, source, user_id, anonymous_id, contact_id, message_id, spillover_status) plus a free-text `q` substring search across the identity columns and the properties/context JSONB. Poll for strictly-newer events by echoing the returned `after_cursor`, and back-paginate to older events with `before_cursor`. Because each row carries the full properties/context JSONB (which can hold PII), the caller must hold the `contacts:read` scope in addition to an owner / admin / developer role. A malformed cursor returns `400 INVALID_CURSOR`.



## OpenAPI

````yaml /openapi.yaml get /api/v1/cdp/events/debug
openapi: 3.1.0
info:
  title: Devotel CPaaS API
  description: Orbit by Devotel — Communications Platform as a Service API
  version: 1.0.0
  contact:
    name: Devotel
    url: https://devotel.io
    email: support@devotel.io
  license:
    name: Proprietary
servers:
  - url: https://api.orbit.devotel.io
    description: Production
security:
  - Bearer: []
  - ApiKey: []
tags:
  - name: Messages
    description: >-
      Send and manage messages across all channels (SMS, WhatsApp, RCS, Email,
      Viber, etc.)
  - name: Fax
    description: >-
      List and track fax (MMS/T.38) transmissions on Telnyx-backed fax numbers
      (sending flows through the Messaging API)
  - name: Agents
    description: AI agent creation, configuration, and execution
  - name: Voice
    description: Voice calls, IVR, conferencing, and SIP trunking
  - name: OnCall
    description: On-call rotations and escalation policy planning for incident alerting
  - name: Webhooks
    description: Webhook endpoint management and delivery logs
  - name: Numbers
    description: Phone number search, provisioning, and configuration
  - name: Brand Identity
    description: >-
      Unified cross-channel brand trust posture (10DLC, toll-free, WhatsApp,
      RCS, branded calling, number KYC)
  - name: Contacts
    description: Contact management, segmentation, and lifecycle tracking
  - name: Campaigns
    description: Marketing campaign orchestration and analytics
  - name: Flows
    description: Automation flow builder and execution engine
  - name: Templates
    description: Message template management and approval workflows
  - name: Settings
    description: Organization, channel, and user preference settings
  - name: Verify
    description: OTP generation and verification across channels
  - name: Push
    description: Push notification delivery via FCM and APNs
  - name: Integrations
    description: Third-party service connections and OAuth management
  - name: CDP
    description: >-
      Customer Data Platform — activation surface (CRM object sync, streaming
      destinations, ad-audience activation)
  - name: Files
    description: >-
      Server-to-server media upload, listing, retrieval, and deletion
      (signed-URL backed)
  - name: Commerce
    description: >-
      Omnichannel conversational-commerce — persistent cart + checkout state
      machine, channel-agnostic hosted pay-by-link, native WhatsApp checkout,
      and AP2-style agent payment mandates.
  - name: Sync
    description: >-
      Real-time shared-state primitive (Twilio Sync parity) — Documents, Maps,
      Lists, and ephemeral Streams, with change events relayed over the
      /api/v1/ws/sync WebSocket gateway
  - name: Risk
    description: >-
      Unified cross-channel Trust & Fraud risk scoring — fuses SMS-pumping,
      URL-reputation, Verify Fraud Guard, and Voice Biometrics signals into one
      composite verdict queryable before a send or a call.
  - name: Orby
    description: >-
      In-dashboard Orby operator assistant: streamed assistant turns,
      conversation threads, product knowledge-base search, and the tool-action
      approval gate. Available to signed-in operators only (dashboard session
      auth — API-key requests are rejected).
paths:
  /api/v1/cdp/events/debug:
    get:
      tags:
        - CDP
      summary: Tail and filter recent CDP events (Source Debugger)
      description: >-
        Live Source Debugger for validating instrumentation as you ship it: tail
        the raw `cdp_events` stream with per-field filters (type, event_name,
        source, user_id, anonymous_id, contact_id, message_id, spillover_status)
        plus a free-text `q` substring search across the identity columns and
        the properties/context JSONB. Poll for strictly-newer events by echoing
        the returned `after_cursor`, and back-paginate to older events with
        `before_cursor`. Because each row carries the full properties/context
        JSONB (which can hold PII), the caller must hold the `contacts:read`
        scope in addition to an owner / admin / developer role. A malformed
        cursor returns `400 INVALID_CURSOR`.
      parameters:
        - schema:
            type: string
          in: query
          name: type
          required: false
          description: Filter by event kind (e.g. `track`, `identify`).
        - schema:
            type: string
          in: query
          name: event_name
          required: false
        - schema:
            type: string
          in: query
          name: source
          required: false
        - schema:
            type: string
          in: query
          name: user_id
          required: false
        - schema:
            type: string
          in: query
          name: anonymous_id
          required: false
        - schema:
            type: string
          in: query
          name: contact_id
          required: false
        - schema:
            type: string
          in: query
          name: message_id
          required: false
        - schema:
            type: string
            enum:
              - inline
              - spilled
              - spillover_failed
          in: query
          name: spillover_status
          required: false
        - schema:
            type: string
          in: query
          name: q
          required: false
          description: >-
            Free-text substring match across identity columns and the
            properties/context JSONB.
        - schema:
            type: string
            format: date-time
          in: query
          name: after
          required: false
          description: >-
            Legacy bare cursor — return only events strictly newer than this
            timestamp.
        - schema:
            type: string
            format: date-time
          in: query
          name: before
          required: false
        - schema:
            type: string
          in: query
          name: after_cursor
          required: false
          description: >-
            Composite keyset cursor for live-tailing — echo the previous
            response's `after_cursor`.
        - schema:
            type: string
          in: query
          name: before_cursor
          required: false
          description: >-
            Composite keyset cursor for loading older events — echo the previous
            response's `before_cursor`.
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          in: query
          name: limit
          required: false
      responses:
        '200':
          description: A page of matching events plus tail cursors and bot-filter counts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      data:
                        type: array
                        description: >-
                          Matching events, newest first (received_at DESC, id
                          DESC).
                        items:
                          $ref: '#/components/schemas/CdpEventRow'
                      latest_cursor:
                        type:
                          - 'null'
                          - string
                        description: >-
                          The newest row's received_at, for legacy `after`-based
                          polling.
                      after_cursor:
                        type:
                          - 'null'
                          - string
                        description: >-
                          Echo as `?after_cursor=` to poll for strictly-newer
                          events.
                      before_cursor:
                        type:
                          - 'null'
                          - string
                        description: >-
                          Echo as `?before_cursor=` to load older events; only
                          present on a full page.
                      bot_filter_counts:
                        type: object
                        description: Bot/IVT filter counts over the recent window.
                        properties:
                          total:
                            type: integer
                          bot:
                            type: integer
                          excluded:
                            type: integer
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
        '400':
          description: The supplied pagination cursor is malformed (INVALID_CURSOR).
components:
  schemas:
    CdpEventRow:
      type: object
      description: >-
        One ingested CDP event as persisted in `cdp_events`: its identity
        columns, event name/type, the raw `properties` and `context` JSONB the
        SDK sent, and ingest/spillover bookkeeping. The JSONB blobs can carry
        contact PII, so surfaces returning this row require the `contacts:read`
        scope.
      properties:
        id:
          type: string
        type:
          type:
            - 'null'
            - string
          description: Event kind — e.g. `track`, `identify`, `page`, `group`.
        message_id:
          type:
            - 'null'
            - string
          description: Client-supplied idempotency key for the event.
        user_id:
          type:
            - 'null'
            - string
        anonymous_id:
          type:
            - 'null'
            - string
        contact_id:
          type:
            - 'null'
            - string
          description: >-
            Internal contact id the event resolved to, when identity resolution
            matched one.
        event_name:
          type:
            - 'null'
            - string
        properties:
          type:
            - 'null'
            - object
          additionalProperties: true
          description: Event properties the SDK sent (may contain PII).
        context:
          type:
            - 'null'
            - object
          additionalProperties: true
          description: Delivery/context envelope (page, campaign, device, IP) the SDK sent.
        received_at:
          type: string
          format: date-time
        processed_at:
          type:
            - 'null'
            - string
          format: date-time
        source:
          type:
            - 'null'
            - string
          description: Source key the event was ingested from.
        gcs_uri:
          type:
            - 'null'
            - string
          description: When the payload was spilled to object storage, its GCS URI.
        spilled_bytes:
          type:
            - 'null'
            - integer
        spillover_status:
          type:
            - 'null'
            - string
          enum:
            - inline
            - spilled
            - spillover_failed
        created_at:
          type: string
          format: date-time
    ResponseMeta:
      type: object
      required:
        - request_id
        - timestamp
      additionalProperties: false
      properties:
        request_id:
          type: string
          description: Unique request identifier (also returned as X-Request-Id header)
        timestamp:
          type: string
          format: date-time
        docs_url:
          type: string
          format: uri
          nullable: true
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Dashboard JWT token from Clerk
    ApiKey:
      type: apiKey
      name: X-API-Key
      in: header
      description: Server-to-server API key (dv_live_sk_*)

````