LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithresourcesprompt_webhooksPromptWebhooksResourcecreate
Method●Since v0.14

create

Copy
create(
  self,
  *,
  url: str,
  id: Optional[str]
View source on GitHub
|
Omit
=
omit
,
exclude_prompts
:
Optional
[
SequenceNotStr
[
str
]
]
|
Omit
=
omit
,
headers
:
Optional
[
Dict
[
str
,
object
]
]
|
Omit
=
omit
,
include_prompts
:
Optional
[
SequenceNotStr
[
str
]
]
|
Omit
=
omit
,
triggers
:
List
[
Literal
[
'commit'
,
'tag:create'
,
'tag:update'
]
]
|
Omit
=
omit
,
extra_headers
:
Headers
|
None
=
None
,
extra_query
:
Query
|
None
=
None
,
extra_body
:
Body
|
None
=
None
,
timeout
:
float
|
httpx
.
Timeout
|
None
|
NotGiven
=
not_given
)
->
PromptWebhook

Parameters

NameTypeDescription
url*str

URL that receives a POST request with the prompt event payload.

idOptional[str] | Omit
Default:omit

ID to assign to the webhook. Generated when omitted.

exclude_promptsOptional[SequenceNotStr[str]] | Omit
Default:omit
headersOptional[Dict[str, object]] | Omit
Default:omit
include_promptsOptional[SequenceNotStr[str]] | Omit
Default:omit
triggersList[Literal['commit', 'tag:create', 'tag:update']] | Omit
Default:omit
extra_headersHeaders | None
Default:None
extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

Create a new prompt webhook.

LangSmith sends a POST request to the webhook URL for each event listed in triggers on the prompts it matches. A workspace can have one prompt webhook unless its limit was raised; creating one past the limit returns 400.

IDs of prompts whose events never fire the webhook.

HTTP headers sent with each request, for example an Authorization header. Values are stored encrypted and are masked in responses to callers who cannot update prompts.

IDs of the prompts whose events fire the webhook. When empty, events from every prompt in the workspace fire it.

Events that fire the webhook: commit (a new prompt commit), tag:create, and tag:update. A webhook with no triggers never fires.

Send extra headers

Add additional query parameters to the request

Add additional JSON properties to the request

Override the client-level default timeout for this request, in seconds