Webhooks

Webhooks can be used as alerts to keep your systems and partner applications in sync with actions inside UniCourt.

UniCourt can send webhooks to any publicly accessible server. When an event in UniCourt triggers a webhook (e.g., when a case has an docket updates), UniCourt will attempt to send this notification to the endpoint you specify.

UniCourt only considers a notification delivered if it receives a timely response with a successful status code. In other words:

  • Your endpoint must be reachable.
  • Your endpoint must respond within 10 seconds
  • Your endpoint must respond with a 2XX status code. UniCourt does not follow redirects or consider them successful responses ( 302 status code ).

Best Practices

  • Webhooks can be retried or sent multiple times if the delivery status is considered failed. Please make sure your endpoint can receive the same notification multiple times and in the wrong order.

  • Notifications are never combined. For example if you have configured multiple scheduled searches to run at the same time then you will recieve a separate webhook call for each scheduled search run.

  • All webhook notifications are stored in our systems for 30 days and are available through the application console. The application console also provides details about failure reasons and the webhook call to your endpoint can be retired. Timestamp for webhooks are in UTC.


 

Receiving a webhook notification

Creating a webhook endpoint on your server is no different from creating any page on your website. With PHP, you might create a new .php file on your server; with a framework like Django, you would add a new route with the desired URL.

python:

import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def webhook_handler(request):

    # Optional if username and password is set in the Developers Integrations Dashboard 
    username = request.META.get("HTTP_UNICOURT_PASSWORD")
    password = request.META.get("HTTP_UNICOURT_USERNAME")
    # validate username and password

    webhook_data = request.POST.get('data', {})

    webhook_data_dict = json.loads(webhook_data)
    """
            Do something with the webhook data 
    """

    # return something so that UniCourt knows that the data is successfully posted 
    return HttpResponse(status=200)

Cross Site Request Forgery (CSRF) for web development frameworks

Many web development frameworks enable forgery protection. You must disable Cross Site Request Forgery (CSRF) for the action you setup to listen for changes from UniCourt

List of UniCourt Webhooks

Get Started Today

Sign Up Now