> ## 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.

# Forward CDP track events as ad-platform conversions

> Maps each supplied CDP track event to the network's server-side conversion shape (Meta Conversions API / Google offline conversions / TikTok Events API / LinkedIn Conversions API / Snapchat CAPI / Pinterest Conversions API / Reddit Conversions API). Every PII identifier is SHA-256-hashed before it leaves the process — cleartext is never persisted, logged, or sent; click / device-context tokens are passed through raw as the networks require. Events with no matchable identifier are skipped, never blind-sent. The payload is batched and dispatched to the network via Nango when a connection is wired. The run is appended to a capped forward history. Owner / admin / developer only.



## OpenAPI

````yaml /openapi.yaml post /api/v1/cdp/conversions/forward/{platform}
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
paths:
  /api/v1/cdp/conversions/forward/{platform}:
    post:
      tags:
        - CDP
      summary: Forward CDP track events as ad-platform conversions
      description: >-
        Maps each supplied CDP track event to the network's server-side
        conversion shape (Meta Conversions API / Google offline conversions /
        TikTok Events API / LinkedIn Conversions API / Snapchat CAPI / Pinterest
        Conversions API / Reddit Conversions API). Every PII identifier is
        SHA-256-hashed before it leaves the process — cleartext is never
        persisted, logged, or sent; click / device-context tokens are passed
        through raw as the networks require. Events with no matchable identifier
        are skipped, never blind-sent. The payload is batched and dispatched to
        the network via Nango when a connection is wired. The run is appended to
        a capped forward history. Owner / admin / developer only.
      parameters:
        - in: path
          name: platform
          required: true
          schema:
            type: string
            enum:
              - facebook
              - google
              - tiktok
              - linkedin
              - snapchat
              - pinterest
              - reddit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CdpConversionForwardRequest'
      responses:
        '200':
          description: The recorded forward run
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CdpConversionForward'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
        '409':
          description: Platform not enabled, or no destination_id configured
components:
  schemas:
    CdpConversionForwardRequest:
      type: object
      description: >-
        Conversion-forward request. `platform` comes from the URL param;
        `destination_id` and the `event_mappings` are resolved from the tenant's
        stored config, never the body.
      required:
        - events
      additionalProperties: false
      properties:
        events:
          type: array
          minItems: 1
          maxItems: 1000
          items:
            $ref: '#/components/schemas/CdpConversionEvent'
    CdpConversionForward:
      type: object
      description: >-
        A recorded conversion-forward run (counts only — never the events /
        digests).
      properties:
        id:
          type: string
          format: uuid
        ts:
          type: string
          format: date-time
        platform:
          type: string
          enum:
            - facebook
            - google
            - tiktok
            - linkedin
            - snapchat
            - pinterest
            - reddit
        requested:
          type: integer
        matched:
          type: integer
        skipped:
          type: integer
        batches:
          type: integer
        dispatched:
          type: integer
        dispatch_skipped:
          type: integer
        status:
          type: string
          enum:
            - ok
            - partial
            - failed
            - skipped
        error:
          type:
            - 'null'
            - string
    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
    CdpConversionEvent:
      type: object
      description: >-
        One conversion event — a CDP `track` call (e.g. "Order Completed")
        mapped to an ad-network conversion. `event_name` is the SOURCE event
        name; the stored `event_mappings` translate it to each network's
        conversion / action name.
      required:
        - event_name
        - user
      additionalProperties: false
      properties:
        event_name:
          type: string
          minLength: 1
          maxLength: 200
        event_time:
          type: integer
          minimum: 0
          description: Unix epoch SECONDS. Omitted ⇒ the server stamps the current time.
        event_id:
          type: string
          minLength: 1
          maxLength: 200
          description: Dedup id shared with the browser pixel event.
        value:
          type: number
          minimum: 0
          description: Monetary value of the conversion.
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: ISO-4217 currency (e.g. `USD`).
        order_id:
          type: string
          minLength: 1
          maxLength: 200
          description: Merchant order / transaction id.
        action_source:
          type: string
          minLength: 1
          maxLength: 40
          description: 'Where it happened (Meta `action_source`): website | app | …'
        event_source_url:
          type: string
          minLength: 1
          maxLength: 2000
          description: Page URL the conversion fired on (Meta `event_source_url`).
        user:
          $ref: '#/components/schemas/CdpConversionUser'
    CdpConversionUser:
      type: object
      description: >-
        One conversion event's identifiers. At least one MATCHABLE key (email,
        phone, external id, mobile advertising id, or a click id) is required.
        PII fields (email … external_id) are SHA-256-hashed server-side before
        they leave the process; the click + context fields (fbc … user_agent)
        are passed through RAW because the networks match them unhashed.
        Cleartext is never persisted, logged, or dispatched.
      additionalProperties: false
      properties:
        email:
          type: string
          minLength: 3
          maxLength: 320
        phone:
          type: string
          minLength: 3
          maxLength: 40
          description: SHOULD be E.164 (e.g. `+14155550123`).
        first_name:
          type: string
          minLength: 1
          maxLength: 100
        last_name:
          type: string
          minLength: 1
          maxLength: 100
        city:
          type: string
          minLength: 1
          maxLength: 100
        state:
          type: string
          minLength: 1
          maxLength: 100
        zip:
          type: string
          minLength: 1
          maxLength: 20
        country:
          type: string
          minLength: 2
          maxLength: 56
          description: ISO 3166-1 alpha-2 code (`us`, `gb`).
        external_id:
          type: string
          minLength: 1
          maxLength: 200
          description: Stable first-party user id (hashed before upload).
        madid:
          type: string
          minLength: 8
          maxLength: 64
          description: Mobile advertising id (IDFA / GAID) — matched RAW, never hashed.
        fbc:
          type: string
          minLength: 1
          maxLength: 400
          description: Meta click id cookie (`_fbc`) — raw.
        fbp:
          type: string
          minLength: 1
          maxLength: 400
          description: Meta browser id cookie (`_fbp`) — raw.
        gclid:
          type: string
          minLength: 1
          maxLength: 400
          description: Google click id — raw.
        ttclid:
          type: string
          minLength: 1
          maxLength: 400
          description: TikTok click id — raw.
        ttp:
          type: string
          minLength: 1
          maxLength: 400
          description: TikTok cookie id (`_ttp`) — raw.
        ip:
          type: string
          minLength: 3
          maxLength: 64
          description: Caller's IP — raw (Meta `client_ip_address` / TikTok `ip`).
        user_agent:
          type: string
          minLength: 1
          maxLength: 1000
          description: Caller's user agent — raw.
  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_*)

````