---
title: "Create Webhook"
description: "How to call Create Webhook (POST /api/webhooks) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/reference/create_webhook"
revision: "2026-10-15"
operationId: "create_webhook"
method: "POST"
endpoint: "https://a.klaviyo.com/api/webhooks"
authentication: "privateKey"
scopes: ["webhooks:write"]
rateLimits: {"burst":"1/s","steady":"15/m"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
openApi: "https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_webhook.json"
jsonApi: {"fields":{"webhook":["created_at","description","enabled","endpoint_url","id","name","updated_at"]}}
related: ["https://developers.klaviyo.com/en/reference/webhooks/llms.txt","https://developers.klaviyo.com/en/reference/get_webhooks.md","https://developers.klaviyo.com/en/reference/get_webhook.md","https://developers.klaviyo.com/en/reference/update_webhook.md","https://developers.klaviyo.com/en/reference/delete_webhook.md","https://developers.klaviyo.com/en/reference/get_webhook_topics.md","https://developers.klaviyo.com/en/reference/get_webhook_topic.md"]
---

# Create Webhook

> This is the Markdown version of https://developers.klaviyo.com/en/reference/create_webhook

```http
POST https://a.klaviyo.com/api/webhooks
```

Create a new Webhook

- Revision header: `revision: 2026-10-15` (required)
- Scopes: `webhooks:write`
- Rate limits: Burst: `1/s`, Steady: `15/m`
- OpenAPI: [Download this endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_webhook.json)

## Example request

### curl

```bash
curl --request POST \
     --url 'https://a.klaviyo.com/api/webhooks' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-10-15' \
     --header 'content-type: application/vnd.api+json' \
     --data '{
  "data": {
    "type": "webhook",
    "attributes": {
      "name": "My Webhook",
      "description": "A webhook for sms events",
      "endpoint_url": "https://www.example.com/example/path",
      "secret_key": "INSERT_SECRET_KEY"
    },
    "relationships": {
      "webhook-topics": {}
    }
  }
}'
```

### CLI

```bash
klaviyo webhooks create \
  -d '{
  "data": {
    "type": "webhook",
    "attributes": {
      "name": "My Webhook",
      "description": "A webhook for sms events",
      "endpoint_url": "https://www.example.com/example/path",
      "secret_key": "INSERT_SECRET_KEY"
    },
    "relationships": {
      "webhook-topics": {}
    }
  }
}'
```

Sign in first with `klaviyo auth login`. [Install the Klaviyo CLI](https://developers.klaviyo.com/en/docs/klaviyo_cli.md)

### Python

```python
from klaviyo_api import KlaviyoAPI

klaviyo = KlaviyoAPI("your-private-api-key")

response = klaviyo.Webhooks.create_webhook(
    {
        "data": {
            "type": "webhook",
            "attributes": {
                "name": "My Webhook",
                "description": "A webhook for sms events",
                "endpoint_url": "https://www.example.com/example/path",
                "secret_key": "INSERT_SECRET_KEY",
            },
            "relationships": {
                "webhook-topics": {},
            },
        },
    },
)
```

Install it with `pip install klaviyo-api`. [The Python SDK on GitHub](https://github.com/klaviyo/klaviyo-api-python)

### Node.js

```javascript
import { ApiKeySession, WebhooksApi } from 'klaviyo-api'

const session = new ApiKeySession('your-private-api-key')
const webhooksApi = new WebhooksApi(session)

const response = await webhooksApi.createWebhook(
  {
    data: {
      type: 'webhook',
      attributes: {
        name: 'My Webhook',
        description: 'A webhook for sms events',
        endpointUrl: 'https://www.example.com/example/path',
        secretKey: 'INSERT_SECRET_KEY',
      },
      relationships: {
        webhookTopics: {},
      },
    },
  },
)
```

Install it with `npm install klaviyo-api`. [The Node.js SDK on GitHub](https://github.com/klaviyo/klaviyo-api-node)

### Ruby

```ruby
require 'klaviyo-api-sdk'

KlaviyoAPI.configure do |config|
  config.api_key['Klaviyo-API-Key'] = 'Klaviyo-API-Key your-private-api-key'
end

response = KlaviyoAPI::Webhooks.create_webhook(
  {
    data: {
      type: 'webhook',
      attributes: {
        name: 'My Webhook',
        description: 'A webhook for sms events',
        endpoint_url: 'https://www.example.com/example/path',
        secret_key: 'INSERT_SECRET_KEY',
      },
      relationships: {
        'webhook-topics' => {},
      },
    },
  },
)
```

Install it with `gem install klaviyo-api-sdk`. [The Ruby SDK on GitHub](https://github.com/klaviyo/klaviyo-api-ruby)

### PHP

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

use KlaviyoAPI\KlaviyoAPI;

$klaviyo = new KlaviyoAPI('your-private-api-key');

$response = $klaviyo->Webhooks->createWebhook(
    [
        'data' => [
            'type' => 'webhook',
            'attributes' => [
                'name' => 'My Webhook',
                'description' => 'A webhook for sms events',
                'endpoint_url' => 'https://www.example.com/example/path',
                'secret_key' => 'INSERT_SECRET_KEY',
            ],
            'relationships' => [
                'webhook-topics' => new \stdClass(),
            ],
        ],
    ],
);
```

Install it with `composer require klaviyo/api`. [The PHP SDK on GitHub](https://github.com/klaviyo/klaviyo-api-php)

## Query parameters

- `fields[webhook]` (string[]): For more information please visit [API overview](https://developers.klaviyo.com/en/reference.md) Allowed values: `created_at`, `description`, `enabled`, `endpoint_url`, `id`, `name`, `updated_at`

## Headers

- `revision` (string, required): API endpoint revision (format: YYYY-MM-DD[.suffix]) Default: `2026-10-15`

## Request body

Content type: `application/vnd.api+json` (required)

- `data` (object, required)
  - `type` (string, required): Allowed values: `webhook`
  - `attributes` (object, required)
    - `name` (string, required): A name for the webhook. Example: `My Webhook`
    - `description` (string, nullable): A description for the webhook. Example: `A webhook for sms events`
    - `endpoint_url` (string, required): A url to send webhook calls to. Must be https. Example: `https://www.example.com/example/path`
    - `secret_key` (string, required): A secret key, that will be used for webhook request signing. Example: `INSERT_SECRET_KEY`
  - `relationships` (object, required)
    - `webhook-topics` (object, required)
      - `data` (object[]): Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_webhook.json).

### Example request body

```json
{
  "data": {
    "type": "webhook",
    "attributes": {
      "name": "My Webhook",
      "description": "A webhook for sms events",
      "endpoint_url": "https://www.example.com/example/path",
      "secret_key": "INSERT_SECRET_KEY"
    },
    "relationships": {
      "webhook-topics": {}
    }
  }
}
```

## Responses

### 201: Success

Content type: `application/vnd.api+json`

- `data` (object, required)
  - `type` (string, required): Allowed values: `webhook`
  - `id` (string, required): The ID of the webhook. Example: `01HF7AYTK76RHR4F17G6DGTRGF`
  - `attributes` (object, required)
    - `name` (string, required): A name for the webhook. Example: `My Webhook`
    - `description` (string, nullable): A description for the webhook. Example: `A webhook for sms events`
    - `endpoint_url` (string, required): The url to send webhook requests to, truncated for security. Example: `https://www.example.com`
    - `enabled` (boolean, required): Is the webhook enabled.
    - `created_at` (string<date-time>, nullable): Date and time when the webhook was created, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm) Example: `2022-11-08T01:23:45+00:00`
    - `updated_at` (string<date-time>, nullable): Date and time when the webhook was last updated, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm) Example: `2022-11-08T01:23:45+00:00`
  - `relationships` (object)
    - `webhook-topics` (object)
      - `data` (object[]): Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_webhook.json).
      - `links` (object): Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_webhook.json).
  - `links` (object, required)
    - `self` (string<uri>, required)
- `links` (ObjectLinks): Same fields as the first ObjectLinks above.
- `meta` (object): Response-level metadata
  - `agent_hints` (object): Optional hints emitted by the API for agent callers
    - `next_steps` (string[]): Suggested follow-up actions for agents to take after this response

#### Example response body

```json
{
  "data": {
    "type": "webhook",
    "id": "01HF7AYTK76RHR4F17G6DGTRGF",
    "attributes": {
      "name": "My Webhook",
      "description": "A webhook for sms events",
      "endpoint_url": "https://www.example.com",
      "enabled": true,
      "created_at": "2022-11-08T01:23:45+00:00",
      "updated_at": "2022-11-08T01:23:45+00:00"
    },
    "relationships": {
      "webhook-topics": {
        "data": [
          {
            "type": "webhook-topic",
            "id": "event:klaviyo.sent_sms"
          }
        ],
        "links": {
          "self": "https://www.example.com",
          "related": "https://www.example.com"
        }
      }
    },
    "links": {
      "self": "https://www.example.com"
    }
  },
  "links": {
    "self": "https://www.example.com"
  },
  "meta": {
    "agent_hints": {
      "next_steps": [
        "string"
      ]
    }
  }
}
```

### 4XX: Client Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
