webhook parameter. If this parameter is specified by an endpoint that can accept POST requests, LangSmith will send a request at the completion of a run.
When working with LangSmith, you may want to use webhooks to receive updates after an API call completes. Webhooks are useful for triggering actions in your service once a run has finished processing. To implement this, you need to expose an endpoint that can accept POST requests and pass this endpoint as a webhook parameter in your API request.
Currently, the SDK does not provide built-in support for defining webhook endpoints, but you can specify them manually using API requests.
Supported endpoints
The following API endpoints accept awebhook parameter:
| Operation | HTTP Method | Endpoint |
|---|---|---|
| Create Run | POST | /thread/{thread_id}/runs |
| Create Thread Cron | POST | /thread/{thread_id}/runs/crons |
| Stream Run | POST | /thread/{thread_id}/runs/stream |
| Wait Run | POST | /thread/{thread_id}/runs/wait |
| Create Cron | POST | /runs/crons |
| Stream Run Stateless | POST | /runs/stream |
| Wait Run Stateless | POST | /runs/wait |
Set up your assistant and thread
Before making API calls, set up your assistant and thread.- Python
- JavaScript
- CURL
Use a webhook with a graph run
To use a webhook, specify thewebhook parameter in your API request. When the run completes, LangSmith sends a POST request to the specified webhook URL.
For example, if your server listens for webhook events at https://my-server.app/my-webhook-endpoint, include this in your request:
- Python
- JavaScript
- CURL
Webhook payload
LangSmith sends webhook notifications in the format of a Run. The request payload includes run input, configuration, and other metadata in thekwargs field. In addition to the standard run fields, the webhook payload also includes values, webhook_sent_at, and error fields.
The full webhook payload contains the following fields:
| Field | Type | Description |
|---|---|---|
run_id | string (UUID) | Unique identifier for the run. |
thread_id | string (UUID) | Identifier for the thread the run belongs to. |
assistant_id | string | Identifier for the assistant that executed the run. |
status | string | Final status of the run (e.g., "success", "error"). |
created_at | string (datetime) | Timestamp when the run was created. |
updated_at | string (datetime) | Timestamp when the run was last updated. |
run_started_at | string (datetime) | Timestamp when the run began executing. |
run_ended_at | string (datetime) | Timestamp when the run finished. Omitted if the run has not ended. |
webhook_sent_at | string (datetime) | Timestamp when the webhook request was sent. |
metadata | JSON object | Custom metadata associated with the run. |
kwargs | JSON object | Run input, configuration, and other invocation parameters. |
values | JSON object | The state values from the latest checkpoint of the thread. Only present for stateful runs. |
multitask_strategy | string | The multitask strategy used for the run. |
error | JSON object | null | Present only if the run failed. Contains error (error type) and message (detail) fields. |
error field contains details about the failure:
Secure webhooks
To ensure only authorized requests hit your webhook endpoint, consider adding a security token as a query parameter:Add headers to webhook requests
Available in
langgraph-api>=0.5.36.webhooks.headers configuration to your langgraph.json file:
Use environment variables in headers
To include secrets or environment-specific values without checking them into your configuration file, use the${{ env.VAR }} template syntax:
LG_WEBHOOK_ can be referenced by default. This prevents accidentally leaking unrelated environment variables. You can customize this prefix using env_prefix:
Missing required environment variables will block server startup, ensuring you don’t deploy with incomplete configuration.
Restrict webhook destinations
Available in
langgraph-api>=0.5.36.webhooks.url configuration:
| Option | Description |
|---|---|
allowed_domains | Hostname allowlist. Supports wildcards for subdomains (e.g., *.mycompany.com). |
require_https | Reject http:// URLs when true. |
allowed_ports | Explicit port allowlist. Defaults to 443 (https) and 80 (http). |
disable_loopback | Disallow relative URLs (internal loopback calls) when true. |
max_url_length | Maximum permitted URL length in characters. |
Disable webhooks
As oflanggraph-api>=0.2.78, developers can disable webhooks in the langgraph.json file:
Test webhooks
You can test your webhook using online services like:- Beeceptor – Quickly create a test endpoint and inspect incoming webhook payloads.
- Webhook.site – View, debug, and log incoming webhook requests in real time.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

