---
title: kapacitor define-topic-handler
description: The kapacitor define-topic-handler command creates or updates a handler.
url: https://docs.influxdata.com/kapacitor/v1/reference/cli/kapacitor/define-topic-handler/
estimated_tokens: 109
product: Kapacitor
version: v1
publisher: InfluxData
canonical: https://docs.influxdata.com/kapacitor/v1/reference/cli/kapacitor/define-topic-handler/
date: '2023-10-03T10:49:57-06:00'
lastmod: '2023-10-03T10:49:57-06:00'
---

The `kapacitor define-topic-handler` command creates or updates a handler.
Handlers are defined using a JSON or YAML file.

## Usage

```sh
kapacitor define-topic-handler <handler-spec-file>
```

## Arguments

* **handler-spec-file**: Filepath of the handler specification file.
  Supports JSON or YAML files.

## Examples

##### Define a handler using the slack.yaml file

```sh
kapacitor define-topic-handler /path/to/slack.yaml
```
