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

# Trigger Workflow via Event Webhook

> Receives an event from an external service via the Event Hub. The event is stored and routed to subscribed agents. Supports verification challenges for Slack and Facebook/Instagram.

Sends an event to a workflow via its Event Hub webhook URL.

## Usage

Event webhooks allow external services (Telegram, Slack, Stripe, GitHub, etc.) to trigger workflow execution:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://app.splox.io/api/v1/events/{webhook_id} \
    -H "Content-Type: application/json" \
    -H "X-Webhook-Secret: your-secret" \
    -d '{"key": "value"}'
  ```

  ```python Python theme={null}
  from splox import SploxClient

  client = SploxClient()  # No API key required for webhooks
  result = client.events.send(
      webhook_id="WEBHOOK_ID",
      payload={"key": "value"},
      secret="your-secret",  # optional
  )
  print(result.ok, result.event_id)
  ```

  ```typescript Node.js theme={null}
  import Splox from "splox";

  const client = new Splox();  // No API key required for webhooks
  const result = await client.events.send({
    webhookId: "WEBHOOK_ID",
    payload: { key: "value" },
    secret: "your-secret",  // optional
  });
  console.log(result.ok, result.event_id);
  ```

  ```go Go theme={null}
  client := splox.NewClient("")  // No API key required for webhooks
  result, err := client.Events.Send(ctx, splox.SendEventParams{
      WebhookID: "WEBHOOK_ID",
      Payload:   map[string]any{"key": "value"},
      Secret:    "your-secret",  // optional
  })
  fmt.Println(result.OK, result.EventID)
  ```
</CodeGroup>

## Authentication

Webhooks can optionally validate a secret header:

* **No secret**: Any request is accepted
* **Secret validation**: Requires the correct value in the `X-Webhook-Secret` header

## Payload

Send any JSON payload — it will be stored as an event and routed to subscribed agents. The raw payload becomes the entry node's output, accessible via variable mappings like `{{ start.field_name }}`.

**Payload limit:** 10MB

## Verification Challenges

The endpoint automatically handles verification challenges from:

* **Slack** — responds to `url_verification` type with the challenge token
* **Facebook/Instagram** — responds to `hub.mode=subscribe` GET requests with `hub.challenge`

## Response

Returns the event ID:

```json theme={null}
{
  "ok": true,
  "event_id": "uuid-of-the-stored-event"
}
```


## OpenAPI

````yaml POST /events/{webhook_id}
openapi: 3.1.0
info:
  title: Splox API
  description: >-
    Run workflows, manage chats, receive events, and monitor execution via the
    Splox API
  version: 1.0.0
  contact:
    name: Splox Support
    email: support@splox.io
    url: https://community.splox.io
servers:
  - url: https://app.splox.io/api/v1
    description: Production API
security: []
tags:
  - name: MCP
    description: Discover MCP servers, manage connections, and execute MCP tools
  - name: Workflows
    description: List, get, and inspect workflows, versions, and nodes
  - name: Workflow Requests
    description: Run workflows, monitor execution, and retrieve results
  - name: Events
    description: Receive external events via Event Hub webhooks
  - name: Chats
    description: Manage chat sessions for workflow interactions
paths:
  /events/{webhook_id}:
    post:
      tags:
        - Events
      summary: Send Event via Webhook
      description: >-
        Receives an event from an external service via the Event Hub. The event
        is stored and routed to subscribed agents. Supports verification
        challenges for Slack and Facebook/Instagram.
      operationId: sendEvent
      parameters:
        - name: webhook_id
          in: path
          required: true
          description: Event webhook ID (UUID format)
          schema:
            type: string
            format: uuid
      requestBody:
        description: >-
          Any JSON payload from the external service. Stored as-is and routed to
          subscribed agents.
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
      responses:
        '200':
          description: Event received and stored successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    description: Whether the event was stored successfully
                  event_id:
                    type: string
                    format: uuid
                    description: ID of the stored event
              example:
                ok: true
                event_id: 0199f456-a12b-3c4d-5e6f-789012abcdef
        '401':
          description: Invalid webhook secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Webhook is disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Webhook not found
        '410':
          description: Webhook has expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message

````