Ango Hub Docs
Open Ango HubContact iMerit
  • Ango Hub Documentation
  • Video Guides
  • Changelog
  • FAQs & Troubleshooting
  • All Keyboard and Mouse Shortcuts
  • Core Concepts
    • Assets
    • Attachments
    • Batches
    • Benchmarks
    • Category Schema (Ontologies)
    • Frame Interpolation
    • Geofencing
    • Idle Time Detection & Time Tracking
    • Instructions
    • Issues
      • Issue Error Codes
    • Label Validation
    • Labeler Performance
    • Labeling
    • Labeling Queue
    • Multiple Classification
    • Notifications
    • Organizations
    • Projects
    • Requeuing
    • Reviewing
    • Review Queue
    • Skipping
    • Stage History
    • Tasks
    • Usage
    • User Roles
    • Workflow
      • Complete
      • Consensus
      • Hold
      • Label
      • Logic
      • Plugin
      • Review
      • Start
      • Webhook
  • Labeling
    • Managing Users in Projects
      • Profile Page
    • Managing the Project Ontology
    • Labeling Editor Interface
      • Audio Labeling Editor
      • Image Labeling Editor
      • Video Labeling Editor
      • DICOM Labeling Editor
      • Medical Labeling Editor
        • 3D Bounding Box
        • Fill Between Slices
        • Island Tools
        • Line (Tape Measure)
        • Smoothing
      • PDF Labeling Editor
      • Text (NER) Labeling Editor
      • LLM Chat Labeling Editor
      • Markdown Labeling Editor
      • 3D Multi-Sensor Fusion Labeling Editor
    • Labeling Classes
      • Tools
        • Bounding Box
        • Brush
        • Entity
        • Message
        • Nested Classifications
        • PCT
        • PDF Tool
        • Point
        • Polygon
        • Polyline
        • Rotated Bounding Box
        • Segmentation
        • Spline
        • Voxel Brush
      • Classification
        • Checkbox
        • Multiple Dropdown
        • Radio
        • Rank
        • Single Dropdown
        • Text
        • Tree Dropdown Tools (Single and Multiple Selection)
      • Relation
        • Single Relation
        • Group Relation
    • Magnetic Lasso
    • Performance & Compatibility Considerations
  • Data
    • Data in Ango Hub
      • Embedding Private Bucket Files in MD Assets
    • Importing Assets
      • Asset Builder
      • Bundled Assets
        • Importing Multiple Images as One Multi-Page Asset
        • Importing Multiple Single-Frame DICOM Files as One Multi-Page Asset
        • Importing multiple DICOM files to be annotated and displayed at once
        • Importing Multiple Single-Frame DICOM Files as a DICOM Series
        • Importing Multiple Markdown Files as One Multi-Page Asset
      • File Explorer
      • Supported Asset File Types & Codecs
      • Importing Cloud (Remote) Assets
      • Importing From Local Machine
      • Creating and Importing LLM Chat Assets
      • Importing Data in the 3D Multi-Sensor Fusion Labeling Tool
      • Bulk Importing Markdown/HTML Assets
      • Importing Attachments during Asset Import
      • Importing Annotations during Asset Import
      • contextData: Adding Extra Data to Assets
      • Importing Reference Images as Overlay
      • Importing Reference Medical Data During Asset Import
    • Importing and Exporting Annotations
      • Importing Annotations
        • Ango Import Format
        • Importing Brush Traces
        • Importing NRRD Annotations
      • Exporting Annotations
        • Ango Export Format
          • Asset
            • Task
              • Tools
              • Classifications
              • Relations
          • Stage History
    • Adding and Managing LLMs
    • Storages
      • Set up a storage integration with Azure
      • Set up a storage integration with AWS S3
      • Set up a storage integration with MinIO and S3-compatible custom storage services
      • Set up a storage integration with GCP (Google Cloud Platform)
      • Set up CORS
      • Validating Storage Integrations
    • Purging Data from Ango Hub
  • Plugins
    • Overview of Plugins in Ango Hub
      • Installing Plugins
      • Plugin Setting Presets
      • Monitoring Plugin Progress
    • First-Party Plugins
      • Ango Export Converter Plugins
      • Asset Converter Plugins
      • Ango to Mask Converter
      • Batch Assignment
      • ChatGPT
      • Column-Agnostic Markdown Generator
      • CSV Export for Classification
      • DALL-E
      • DALL-E (Model Plugin)
      • File Explorer Plugin
      • General Object Detector
      • General Object Segmenter
      • Markdown Generator
      • One-Click Segmentation
      • Open World Object Detection
      • Optical Character Recognition
      • TPT Export
      • YOLO | Instance Segmentation
      • YOLO | Pose Estimation
      • YOLO | Object Detection
      • YOLO | Image Classification
    • Plugin Developer Documentation
      • Export Plugins
      • Batch Model Plugins
      • Model Plugins
      • File Explorer Plugins
      • Markdown Generator Plugins
      • Plugin Logger
      • [WIP] Deploying your Plugin
      • Plugin 'Host' Information
  • SDK
    • SDK Documentation
      • Project Level SDK Functions
        • add_members_to_project
        • assign_batches
        • assign_task
        • create_attachment
        • create_batch
        • create_issue
        • create_label_set
        • create_project
        • delete_issue
        • export
        • exportV3
        • get_assets
        • get_batches
        • get_issues
        • get_metrics
        • get_project
        • get_project_performance
        • get_task
        • get_tasks
        • get_task_history
        • import_labels
        • list_projects
        • requeue_tasks
        • rerun_webhook
        • update_workflow_stages
        • upload_files
        • upload_files_cloud
        • upload_files_with_asset_builder
        • upload_chat_assets
      • Organization Level SDK Functions
        • create_storage
        • delete_organization_invites
        • delete_organization_members
        • delete_storage
        • get_organization_invites
        • get_organization_members
        • get_storages
        • invite_members_to_org
        • update_organization_members_role
    • SDK - Useful Snippets
    • SDK Changelog
  • API
    • API Documentation
  • How-To
    • Add Members
      • Add multiple users to a project
    • Annotate
      • Annotate 3D Point Cloud Files on Ango Hub
      • Perform targeted OCR on images
    • Export Data
      • Automatically send Ango Hub Webhook contents to Google Sheets, Email, Slack, and more with Zapier
      • Download a JSON of your project ontology
      • Download DICOM Segmentation Masks
      • Download your annotations in the COCO, KITTI, or YOLO format
      • Download your Segmentation Masks
      • Get your export as separate JSON files for each asset
    • Manage a Project
      • Get your API Key
      • Get your Organization ID
      • Mute your notifications
      • Open an asset provided the Asset ID
      • Pre-label assets
      • Share a filtered view of the Tasks table with others
      • Transfer project ontologies between projects
      • Transfer project workflows between projects
    • Perform Model Evaluation on Ango Hub
  • Troubleshooting
    • I get a "0 Tasks Labeled" alert when trying to pre-label tasks
    • I get a 'The data couldn't be loaded properly' error when opening certain assets
    • I get a "Unknown Classification" warning when opening a task
  • Feature Availability Status for projects of the 3D Multi-Sensor Fusion type
  • Comparison between QuickServe and Ango Hub
  • Changes from Ango Hub Legacy
  • Video V2 Breaking Changes and Transition
  • Data Access, Storage, and Security
  • Two-Factor Authentication
  • Single Sign-On (SSO) Support
  • Customer Support
  • Ango Hub Status Page
Powered by GitBook
On this page

Last updated 1 month ago

Fires a webhook every time a task is passed as input. Returns the same task as output.

Settings

URL. The url where to send the webhook. Secret. The secret to pass along with the webhook. Logs. Whenever a task enters the Webhook stage and a webhook is fired or an error occurs, this is logged. Clicking on Logs allows you to scrutinize logs for all webhooks, with the format: [Date][Status] external_id

Webhook Content

Sample Webhook Output

Sample Webhook Output

Differences between Webhook Output and Export

Webhook Errors

In case the webhook cannot be sent (e.g. Ango Hub does not receive a 200 response), Ango Hub will keep the task in the Webhook stage and display a visual warning in the Workflow editor:

To view the tasks the webhooks of which were not sent, navigate to the Tasks tab and filter by stage from the left-hand side.

To attempt to send the webhook again, click on the Webhook stage, then click on the three dots on the top right of its settings panel, and click on Re-run.

Set Up a Sample Webhook Server

This sample is a minimum server setup you can use to test whether your webhook configuration is working or not.

  1. Run this Python script, changing your_secret_key with a secret key of your choice.

Sample Webhook Python Script
  1. Once ngrok is installed, from the command line/terminal, run ngrok http 127.0.0.1:5000

  2. You will see a screen like the following. Copy the URL highlighted in red.

  1. Go to your Ango Hub project and set up your workflow to have a Webhook stage plugged in. In this case, for example, the Webhook stage will fire every time a labeler submits a task in the Label stage:

  1. Click on the Webhook plugin to open its settings.

  2. In the URL field, paste the URL we copied before, adding /hook at the end. For example, if the URL provided by ngrok was https://47f2-88-243-68-208.ngrok.io, you will paste it and add /hook at the end, forming https://47f2-88-243-68-208.ngrok.io/hook.

  3. In the Secret field, type the secret key you entered in the Python script during step 1.

  4. Save your workflow.

  5. In your project, perform an action which would trigger a webhook. In our example above, it would be submitting a tasl from the Label stage.

If the webhook worked correctly, you will see a 200 OK code in the ngrok window:

And the webhook content will be sent to your server where you ran the Python script. If you ran it in PyCharm, for example, you will see the webhook contents in the Run tab:

Export
Webhook

Install ngrok on your system. Instructions on installing ngrok can be found .

{
  "projectId": "67a3be4088cb6f0f7976327b",
  "categorySchema": {
    "tools": [
      {
        "title": "",
        "tool": "bounding-box",
        "required": false,
        "schemaId": "d3fb304c505050a0631e201",
        "ocrEnabled": false,
        "classifications": [],
        "multiple": false,
        "color": "#f44336",
        "shortcutKey": "1"
      }
    ],
    "classifications": [],
    "relations": []
  },
  "asset": "https://angohub-test-assets.s3.eu-central-1.amazonaws.com/67a3be4088cb6f0f7976327b/assets/9a02ef5e-1281-48a6-902e-c959c1e1b201.png",
  "assetId": "67a3beaf88cb6f0f797634ff",
  "dataset": [],
  "overlay": [],
  "externalId": "task5.png",
  "metadata": {
    "width": 1001,
    "height": 1001
  },
  "batches": [
    "67a3beb088cb6f0f79763515",
    "67a3beb088cb6f0f79763516"
  ],
  "batchNames": [
    "batch-1",
    "batch-2"
  ],
  "task": {
    "type": "default",
    "taskId": "67a3beb088cb6f0f79763514",
    "stage": "08960214-cb68-4109-ac75-33ed521e9cac",
    "stageId": "08960214-cb68-4109-ac75-33ed521e9cac",
    "stageName": "Webhook",
    "updatedAt": "2025-02-06T10:13:28.709Z",
    "updatedBy": "lorenzo@imerit.net",
    "duration": 0,
    "blurDuration": 0,
    "idleDuration": 0,
    "totalDuration": 3549,
    "totalBlurDuration": 0,
    "totalIdleDuration": 0,
    "tools": [
      {
        "bounding-box": {
          "x": 401.2628984836038,
          "y": 398.68154506437764,
          "height": 200.2,
          "width": 201.91845493562232
        },
        "objectId": "49c2c2d71cccba94e471625",
        "classifications": [],
        "metadata": {
          "createdAt": "2025-02-06T10:13:27.625Z",
          "createdBy": "lorenzo@imerit.net",
          "createdIn": "Label"
        },
        "schemaId": "d3fb304c505050a0631e201",
        "title": ""
      }
    ],
    "classifications": [],
    "relations": [],
    "stageHistory": [
      {
        "stageId": "Start",
        "duration": 0,
        "idleDuration": 0,
        "blurDuration": 0,
        "completedAt": "2025-02-05T19:40:32.305Z",
        "isSkipped": false,
        "_id": "67a3beb088cb6f0f79763577"
      },
      {
        "stageId": "Label",
        "duration": 3549,
        "idleDuration": 0,
        "blurDuration": 0,
        "completedAt": "2025-02-06T10:13:28.745Z",
        "taskHistory": "67a48b48a31195645b7a257b",
        "completedBy": "lorenzo@imerit.net",
        "submittedBy": "lorenzo@imerit.net",
        "isSkipped": false,
        "_id": "67a48b48a31195645b7a257d"
      },
      {
        "stageId": "fd4b3696-96ef-49aa-8e2d-c545db740f61",
        "duration": 0,
        "idleDuration": 0,
        "blurDuration": 0,
        "completedAt": "2025-02-06T10:14:08.803Z",
        "taskHistory": "67a48b70a31195645b7a2acf",
        "consensusId": null,
        "isSkipped": false,
        "_id": "67a48b70a31195645b7a2ae1"
      }
    ],
    "brushDataUrl": null,
    "medicalBrushDataUrl": null
  }
}

The batches property provides batches as names.

 "batches": [
    "Le Croissànt"
  ]

The batches property provides batches as IDs.

 "batches": [
    "651521e299f4bf0015872c91"
  ]

In the webhook output, batch names are provided in the batchNames property.

stageHistory field contains label contents.

stageHistory field only contains metadata, no label contents.

import json
from flask import request, Flask, Response
import hmac
import hashlib

secret = b'your_secret_key'  # Secret Key you entered while adding the integration
app = Flask(__name__)

@app.route('/hook', methods=['POST'])  # Custom Endpoint
def hook():
    computed_signature = hmac.new(secret, msg=request.data, digestmod=hashlib.sha1).hexdigest()
    if request.headers["X-Hub-Signature"] != computed_signature:
        return Response("Invalid signature", status=400)
    else:
        print(json.dumps(request.get_json(), indent=2))
        return "ok"

if __name__ == '__main__':
    app.run(debug=True)
  1. Core Concepts
  2. Workflow

Webhook

PreviousStartNextManaging Users in Projects
  • Settings
  • Webhook Content
  • Sample Webhook Output
  • Differences between Webhook Output and Export
  • Webhook Errors
  • Set Up a Sample Webhook Server
here