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

# Create Webhook

> Register a new webhook endpoint.

## Basic Usage

```bash theme={null}
curl -X POST "https://api.flowiq.live/set-webhooks" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-server.com/webhook", "type": "message_received"}'
```

***

## Request Body

| Field      | Required | Description                                                                                                                             |
| ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `url`      | Yes      | HTTPS endpoint to receive events                                                                                                        |
| `type`     | Yes      | Event type: `message_received`, `message_sent`, `sent_message`, `message_delivered`, `message_read`, `message_failed`, `call`, or `all` |
| `platform` | No       | Defaults to `whatsapp`                                                                                                                  |

```json theme={null}
{
  "url": "https://your-server.com/webhook",
  "type": "message_received"
}
```

***

## Response

```json theme={null}
{
  "success": true,
  "message": "Webhook created successfully",
  "webhook": {
    "id": "0df9d480-f181-466b-ae8d-85216c16e8dd",
    "url": "https://your-server.com/webhook",
    "type": "message_received",
    "platform": "whatsapp",
    "created_at": "2026-03-08T00:00:00.000+02:00"
  }
}
```

***

<Tip>
  Use `type: "all"` to receive every event type through a single webhook subscription.
</Tip>


## OpenAPI

````yaml POST /set-webhooks
openapi: 3.1.0
info:
  title: FlowIQ Conversations API
  version: 1.0.0
  description: >-
    Complete WhatsApp Conversations API for retrieving messages, contacts, and
    conversation history.


    ## Authentication

    All endpoints require a Bearer token in the header:

    ```

    Authorization: Bearer YOUR_BEARER_TOKEN

    ```


    ## Example API Call

    ```bash

    curl -X GET
    "https://api.flowiq.live/conversations?whatsappNumber=27123456789&limit=10"
    \
      -H "Authorization: Bearer YOUR_BEARER_TOKEN"
    ```


    **Response:**

    ```json

    {
      "success": true,
      "messages": [...],
      "pagination": {
        "currentPage": 1,
        "totalPages": 5,
        "hasNextPage": true
      },
      "count": 10
    }

    ```
  contact:
    name: FlowIQ Support
    email: dev@flowapt.com
servers:
  - url: https://api.flowiq.live
    description: FlowIQ Production API
security:
  - BearerAuth: []
tags:
  - name: Endpoints
    description: Conversation and contact management API endpoints
  - name: Webhooks
    description: Webhook registration and management
paths:
  /set-webhooks:
    post:
      tags:
        - Webhooks
      summary: Create Webhook
      description: Register a new webhook endpoint.
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - type
              properties:
                url:
                  type: string
                  description: HTTPS endpoint to receive events
                  example: https://your-server.com/webhook
                type:
                  type: string
                  description: Event type to subscribe to
                  enum:
                    - message_received
                    - message_sent
                    - sent_message
                    - message_delivered
                    - message_read
                    - message_failed
                    - call
                    - all
                  example: message_received
                platform:
                  type: string
                  description: Platform (defaults to `whatsapp`)
                  example: whatsapp
      responses:
        '200':
          description: Webhook created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  webhook:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      url:
                        type: string
                      type:
                        type: string
                      platform:
                        type: string
                      created_at:
                        type: string
                        format: date-time
              example:
                success: true
                message: Webhook created successfully
                webhook:
                  id: 0df9d480-f181-466b-ae8d-85216c16e8dd
                  url: https://your-server.com/webhook
                  type: message_received
                  platform: whatsapp
                  created_at: '2026-03-08T00:00:00.000+02:00'
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Bearer token for authentication. Format: `Bearer YOUR_BEARER_TOKEN`'
      bearerFormat: JWT

````