---
title: How to chain annotation projects with webhooks
description: A complete tutorial that shows how to use webhooks to monitor actions such as label creation. Chain your annotation projects with webhooks on Kili.
image: https://blog.kili-technology.com/hubfs/Imported_Blog_Media/websockets-3.gif
---

![](https://cdn2.hubspot.net/hub/1598866/hubfs/logo-psdtohubspot.png?width=201&name=logo-psdtohubspot.png)

- Menu Item 1 
    - Sub-menu Item 1 
          - Another Item
    - Sub-menu Item 2
- Menu Item 2 
    - Yet Another Item
- Menu Item 3
- Menu Item 4

![](https://cdn2.hubspot.net/hub/459002/hubfs/Inbound_blog_.png?t=1471851895760&width=1440&name=Inbound_blog_.png)

# Hubspot Card Based Blog

Add Blog Subtitle's.

## Latest Stories

Search this site on Google

S

[Paul Graffan](https://blog.kili-technology.com/author/paul-graffan)

Jan 20, 2021

## [How To Monitor Machine Learning Model...](https://blog.kili-technology.com/blog/how-to-monitor-machine-learning-models-in-production)

[Non classé](https://blog.kili-technology.com/topic/non-classé)

<https://blog.kili-technology.com/blog/how-to-monitor-machine-learning-models-in-production>

[pierremarcenac](https://blog.kili-technology.com/author/pierremarcenac)

Dec 09, 2020

## [How Kili Technology and AutoML Helped...](https://blog.kili-technology.com/blog/automl-helped-scale-email-classification-for-customer-services)

[Non classé](https://blog.kili-technology.com/topic/non-classé)

<https://blog.kili-technology.com/blog/automl-helped-scale-email-classification-for-customer-services>

[Edouard](https://blog.kili-technology.com/author/edouard)

Dec 01, 2020

## [How to build a state of the art Machi...](https://blog.kili-technology.com/blog/how-to-build-a-state-of-the-art-machine-learning-platform-in-2021)

[Non classé](https://blog.kili-technology.com/topic/non-classé)

<https://blog.kili-technology.com/blog/how-to-build-a-state-of-the-art-machine-learning-platform-in-2021>

[Paul Graffan](https://blog.kili-technology.com/author/paul-graffan)

Sep 25, 2020

## [What is the best image segmentation t...](https://blog.kili-technology.com/blog/what-is-the-best-segmentation-tool)

[Non classé](https://blog.kili-technology.com/topic/non-classé)

<https://blog.kili-technology.com/blog/what-is-the-best-segmentation-tool>

## Featured Stories

Filter By Categories

- [Non classé](https://blog.kili-technology.com/topic/non-classé)
- [labeling](https://blog.kili-technology.com/topic/labeling)
- [kili](https://blog.kili-technology.com/topic/kili)
- [python](https://blog.kili-technology.com/topic/python)
- [API](https://blog.kili-technology.com/topic/api)

![](https://cdn2.hubspot.net/hubfs/459002/Author_Blog.png)

 By

[Philippe de Saint-Chamas](https://blog.kili-technology.com/author/philippe-de-saint-chamas)

 May 23, 2020

<https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fblog.kili-technology.com%2Fblog%2Fwebhooks> <http://www.linkedin.com/shareArticle?mini=true&url=https://blog.kili-technology.com/blog/webhooks> <https://www.twitter.com/share?url=https%3A%2F%2Fblog.kili-technology.com%2Fblog%2Fwebhooks> <https://plus.google.com/share?url=https%3A%2F%2Fblog.kili-technology.com%2Fblog%2Fwebhooks>

## [How to chain annotation projects with webhooks on Kili](https://blog.kili-technology.com/blog/webhooks)

  [API](https://blog.kili-technology.com/topic/api) [graphql](https://blog.kili-technology.com/topic/graphql) [Non classé](https://blog.kili-technology.com/topic/non-classé) [kili](https://blog.kili-technology.com/topic/kili) [webhooks](https://blog.kili-technology.com/topic/webhooks) [labeling](https://blog.kili-technology.com/topic/labeling) [callback](https://blog.kili-technology.com/topic/callback) [subscription](https://blog.kili-technology.com/topic/subscription) [python](https://blog.kili-technology.com/topic/python)

# Kili Tutorial: How to chain annotation projects with webhooks on Kili

In this tutorial, we will show how to use webhooks to monitor actions in Kili, such as a label creation. The goal of this tutorial is to illustrate some basic components and concepts of Kili in a simple way, but also to dive into the actual process of iteratively developing real applications in Kili.

Additionally:

For an overview of Kili, visit [kili-technology.com](https://kili-technology.com/) You can also check out the Kili documentation [https://cloud.kili-technology.com/docs](https://cloud.kili-technology.com/docs). Our goal is to export labels that can predict whether an image contains a Porsche or a Tesla.

The tutorial is divided into two parts:

1. Why use webhooks?
2. Using Kili’s webhook in Python

## 1. Why use webhooks?

Webhooks allow to react to particular action in Kili’s database by triggering a callback whenever an action is completed. For instance, here, every time a label is created in frontend (upper panel), the label can be logged in Python (lower right panel):

```
from IPython.display import Image
with open('https://raw.githubusercontent.com/kili-technology/kili-playground/e8623b9a6e1de273da6494b5cb1c89f7b8005a9a/recipes/img/websockets.gif','rb') as f:
display(Image(data=f.read(), format='png'))
```

![png](https://static.hsstatic.net/BlogImporterAssetsUI/ex/missing-image.png) ![png](https://blog.kili-technology.com/hubfs/Imported_Blog_Media/websockets-2.gif)

## 2. Using Kili’s webhook in Python

Kili Playground exposes a method `label_created_or_updated` that allows to listen for all actions on labels:

- creation of a new label
- update of an existing label

First of all, you need to authenticate:

```
import os

!pip install kili
from kili.authentication import KiliAuth
from kili.playground import Playground

email = os.getenv('KILI_EMAIL')
password = os.getenv('KILI_PASSWORD')
api_endpoint = 'https://cloud.kili-technology.com/api/label/graphql'

kauth = KiliAuth(email, password, api_endpoint)
playground = Playground(kauth)
```

Then you can define a callback that will be triggered each time a label gets created/updated:

```
project_id = 'CHANGE_ME_FOR_YOUR_PROJECT_ID'

def callback(id, data):
print(f'New data: {data}\n')

playground.label_created_or_updated(
project_id=project_id, callback=callback)
```

## Summary

In this tutorial, we accomplished the following:

We introduced the concept of webhook and we used `label_created_or_updated` to trigger a webhook.

You can also visit the Kili website or Kili documentation for more info!

![](https://static.hubspot.com/final/img/content/email-template-images/placeholder_200x200.png)

### Popular Stories

<https://blog.kili-technology.com/blog/chatbot-training-datasets>

[36 Best Machine Learning Datasets for Chatbot Training](https://blog.kili-technology.com/blog/chatbot-training-datasets) Jul 07, 2020

<https://blog.kili-technology.com/blog/create-dataset-for-machine-learning>

[How to Create a Dataset to Train Your Machine Learning Applications](https://blog.kili-technology.com/blog/create-dataset-for-machine-learning) Feb 14, 2020

<https://blog.kili-technology.com/blog/dicom-medical-images-annotation>

[How to read & label dicom medical images on Kili](https://blog.kili-technology.com/blog/dicom-medical-images-annotation) May 27, 2020

### Popular Tags

[Non classé](https://blog.kili-technology.com/topic/non-classé) [labeling](https://blog.kili-technology.com/topic/labeling) [kili](https://blog.kili-technology.com/topic/kili) [python](https://blog.kili-technology.com/topic/python) [API](https://blog.kili-technology.com/topic/api) [Video annotation tool](https://blog.kili-technology.com/topic/video-annotation-tool) [annotating video datasets](https://blog.kili-technology.com/topic/annotating-video-datasets) [autoML](https://blog.kili-technology.com/topic/automl) [automatic video labelling](https://blog.kili-technology.com/topic/automatic-video-labelling) [callback](https://blog.kili-technology.com/topic/callback) [chatbot](https://blog.kili-technology.com/topic/chatbot) [computer vision applications](https://blog.kili-technology.com/topic/computer-vision-applications) [counterfactual](https://blog.kili-technology.com/topic/counterfactual) [data augmentation](https://blog.kili-technology.com/topic/data-augmentation) [data generation](https://blog.kili-technology.com/topic/data-generation) [dicom](https://blog.kili-technology.com/topic/dicom) [fast image annotation](https://blog.kili-technology.com/topic/fast-image-annotation) [fast text annotation](https://blog.kili-technology.com/topic/fast-text-annotation) [graphql](https://blog.kili-technology.com/topic/graphql) [how to create a dataset to train your machine lear](https://blog.kili-technology.com/topic/how-to-create-a-dataset-to-train-your-machine-lear) [how to create datasets](https://blog.kili-technology.com/topic/how-to-create-datasets) [how to train dataset](https://blog.kili-technology.com/topic/how-to-train-dataset) [image annotation categories](https://blog.kili-technology.com/topic/image-annotation-categories) [image annotation tools](https://blog.kili-technology.com/topic/image-annotation-tools) [image annotation types](https://blog.kili-technology.com/topic/image-annotation-types) [machine learning](https://blog.kili-technology.com/topic/machine-learning) [natural language processing](https://blog.kili-technology.com/topic/natural-language-processing) [nlp](https://blog.kili-technology.com/topic/nlp) [pneumonia](https://blog.kili-technology.com/topic/pneumonia) [pydicom](https://blog.kili-technology.com/topic/pydicom) [subscription](https://blog.kili-technology.com/topic/subscription) [text annotation](https://blog.kili-technology.com/topic/text-annotation) [text annotation example](https://blog.kili-technology.com/topic/text-annotation-example) [text annotation tools](https://blog.kili-technology.com/topic/text-annotation-tools) [text annotation worksheet](https://blog.kili-technology.com/topic/text-annotation-worksheet) [video annotation for deep learning](https://blog.kili-technology.com/topic/video-annotation-for-deep-learning) [webhooks](https://blog.kili-technology.com/topic/webhooks) [what is deep learning](https://blog.kili-technology.com/topic/what-is-deep-learning) [what is image annotation](https://blog.kili-technology.com/topic/what-is-image-annotation) [what is text annotation](https://blog.kili-technology.com/topic/what-is-text-annotation)

![](https://cdn2.hubspot.net/hub/2432204/hubfs/Quint-Assets/cta-banner.png?width=320&name=cta-banner.png "cta-banner.png")

![](https://cdn2.hubspot.net/hub/2432204/hubfs/Quint-Assets/cta-banner.png?width=320&name=cta-banner.png "cta-banner.png")

[Tweets by @inboundplace](https://twitter.com/inboundplace)

> Lorem Ipsum is a simple dummy text used as a dummy text contents. Lorem ipsum will be replaced. Lorem Ipsum is a simple dummy text used as a dummy text contents. Lorem ipsum will be replaced.Lorem Ipsum is a simple dummy text used as a dummy text contents. Lorem ipsum will be replaced.

[Previous Post](https://blog.kili-technology.com/blog/automl-fast-labeling)

##### [AutoML for fast annotation](https://blog.kili-technology.com/blog/automl-fast-labeling)

[Next Post](https://blog.kili-technology.com/blog/dicom-medical-images-annotation)

##### [How to read & label dicom medical images on Kili](https://blog.kili-technology.com/blog/dicom-medical-images-annotation)

[BUY *On* HUBSPOT](https://marketplace.hubspot.com/products/psdtohubspot/card-based-blog)

[![psdtohubspot](https://cdn2.hubspot.net/hub/1598866/hubfs/logo-psdtohubspot.png?t=1471851895760&width=201&name=logo-psdtohubspot.png "psdtohubspot")](http://www.psdtohubspot.com/)

©All Rights Reserved