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

# Update a platform event-stream sink config

> Merge a partial configuration into one sink `kind`. Only the fields you send are written; worker-owned `last_run_*` run-status fields are never accepted. The request body is discriminated on the path `kind`: an `http_batch` sink takes `destination.url` (https-only, SSRF-checked) and an optional `max_batch_size`; a `kafka` sink takes `destination.topic` plus `brokers`, `sasl_mechanism`, and `sasl_username`. A `destination.kind` must equal the path `kind`. Send `credentials` to store the encrypted secret (Kafka SASL password or HTTP bearer token); send an empty string to clear it. Requires an owner, admin, or developer role; every write is audit-logged (key names only, never the credential).



## OpenAPI

````yaml /openapi.yaml patch /api/v1/developer/event-sinks/{kind}
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/developer/event-sinks/{kind}:
    patch:
      tags:
        - Webhooks
      summary: Update a platform event-stream sink config
      description: >-
        Merge a partial configuration into one sink `kind`. Only the fields you
        send are written; worker-owned `last_run_*` run-status fields are never
        accepted. The request body is discriminated on the path `kind`: an
        `http_batch` sink takes `destination.url` (https-only, SSRF-checked) and
        an optional `max_batch_size`; a `kafka` sink takes `destination.topic`
        plus `brokers`, `sasl_mechanism`, and `sasl_username`. A
        `destination.kind` must equal the path `kind`. Send `credentials` to
        store the encrypted secret (Kafka SASL password or HTTP bearer token);
        send an empty string to clear it. Requires an owner, admin, or developer
        role; every write is audit-logged (key names only, never the
        credential).
      parameters:
        - schema:
            type: string
            enum:
              - kafka
              - http_batch
          in: path
          name: kind
          required: true
          description: Sink transport to update. One of `kafka` or `http_batch`.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/EventSinkKafkaPatch'
                - $ref: '#/components/schemas/EventSinkHttpBatchPatch'
      responses:
        '200':
          description: Resulting sink configuration after the merge.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  data:
                    $ref: '#/components/schemas/EventSinkRead'
                  meta:
                    type: object
                    properties:
                      request_id:
                        type: string
                      timestamp:
                        type: string
                        format: date-time
        '400':
          description: >-
            Invalid body, mismatched `destination.kind`, or rejected collector
            URL.
        '404':
          description: Unknown sink kind (not `kafka` or `http_batch`).
components:
  schemas:
    EventSinkKafkaPatch:
      type: object
      additionalProperties: false
      description: PATCH body for a `kafka` sink. Only the fields you send are merged.
      properties:
        enabled:
          type: boolean
        events:
          type: array
          maxItems: 200
          items:
            type: string
            minLength: 1
            maxLength: 120
        destination:
          $ref: '#/components/schemas/EventSinkKafkaDestination'
        credentials:
          type: string
          maxLength: 4096
          description: >-
            Kafka SASL password, encrypted at rest. Send an empty string to
            clear.
        brokers:
          type: array
          minItems: 1
          maxItems: 16
          items:
            type: string
            description: Bootstrap broker as `host:port` (no scheme, no path).
        sasl_mechanism:
          type: string
          enum:
            - plain
            - scram-sha-256
            - scram-sha-512
        sasl_username:
          type: string
          minLength: 1
          maxLength: 256
    EventSinkHttpBatchPatch:
      type: object
      additionalProperties: false
      description: >-
        PATCH body for an `http_batch` sink. Only the fields you send are
        merged.
      properties:
        enabled:
          type: boolean
        events:
          type: array
          maxItems: 200
          items:
            type: string
            minLength: 1
            maxLength: 120
        destination:
          $ref: '#/components/schemas/EventSinkHttpBatchDestination'
        credentials:
          type: string
          maxLength: 4096
          description: HTTP bearer token, encrypted at rest. Send an empty string to clear.
    EventSinkRead:
      type: object
      additionalProperties: true
      description: >-
        Current configuration for one event-stream sink. The plaintext
        credential is never returned — only the `credentials_configured`
        presence flag. The `last_run_*` fields are worker-owned run status,
        surfaced read-only.
      properties:
        kind:
          type: string
          enum:
            - kafka
            - http_batch
        enabled:
          type: boolean
          description: Whether the worker should stream events to this sink.
        credentials_configured:
          type: boolean
          description: >-
            True when an encrypted secret credential is stored. The secret
            itself is never returned.
        events:
          type: array
          items:
            type: string
          description: >-
            Platform event filter — same semantics as a webhook endpoint's
            `events`. Empty or a single `*` member ⇒ every event; otherwise an
            exact type (`message.sent`) or a `<prefix>.*` glob (`message.*`).
        destination:
          oneOf:
            - $ref: '#/components/schemas/EventSinkKafkaDestination'
            - $ref: '#/components/schemas/EventSinkHttpBatchDestination'
        brokers:
          type: array
          items:
            type: string
          description: Kafka bootstrap brokers as `host:port` (kafka kind only).
        sasl_mechanism:
          type: string
          enum:
            - plain
            - scram-sha-256
            - scram-sha-512
          description: Kafka SASL mechanism (kafka kind only).
        sasl_username:
          type: string
          description: >-
            Kafka SASL username (kafka kind only). The password is the encrypted
            credential.
        last_run_at:
          type:
            - 'null'
            - string
          format: date-time
        last_run_status:
          type:
            - 'null'
            - string
          enum:
            - ok
            - failed
            - null
        last_produced_count:
          type:
            - 'null'
            - integer
        last_error:
          type:
            - 'null'
            - string
        last_error_at:
          type:
            - 'null'
            - string
          format: date-time
        consecutive_failures:
          type:
            - 'null'
            - integer
    EventSinkKafkaDestination:
      type: object
      required:
        - kind
        - topic
      properties:
        kind:
          type: string
          enum:
            - kafka
        topic:
          type: string
          minLength: 1
          maxLength: 249
          description: >-
            Kafka topic name. Matches `[A-Za-z0-9._-]`, 1–249 chars; cannot be
            `.` or `..`.
        partition_key_path:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            Dot-path into the event envelope used to derive the partition key so
            every event for one contact/conversation lands on the same
            partition. Defaults to contact → conversation → message → call → to
            → id.
        headers:
          type: object
          additionalProperties:
            type: string
            maxLength: 1024
          description: Static string→string headers attached to every produced record.
    EventSinkHttpBatchDestination:
      type: object
      required:
        - kind
        - url
      properties:
        kind:
          type: string
          enum:
            - http_batch
        url:
          type: string
          format: uri
          maxLength: 2048
          description: >-
            HTTPS collector URL. SSRF-validated on write (no private/metadata
            hosts).
        max_batch_size:
          type: integer
          minimum: 1
          maximum: 1000
          description: >-
            Maximum number of event envelopes per POST body. The worker flushes
            at this count.
        headers:
          type: object
          additionalProperties:
            type: string
            maxLength: 1024
          description: Static string→string headers attached to every batch POST.
  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_*)

````