Directus / @directus/sdk / rest / createWebhook
Function: createWebhook() ​
createWebhook<
Schema
,TQuery
>(item
,query
?):RestCommand
<IfAny
<Schema
,Record
<string
,any
>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, Object, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : Object>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, Object, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : Object>>, FieldsWildcard<UnpackList<IfAny<Schema, Object, (...) extends (...) ? (...) : (...)>>, Exclude<UnpackList<Mutable<(...)>>, PickRelationalFields<(...)> extends never ? never : AllKeys<(...)>>>, FF extends Record<string, string> ? FF<FF> : Record<string, string>> : never, PickRelationalFields<UnpackList<Mutable<TQuery["fields"]>>> extends never ? never : { [Field in string | number | symbol]: Field extends keyof UnpackList<IfAny<(...), (...), (...)>> ? Extract<(...)[(...)], ItemType<(...)>> extends RelatedCollection ? IsNullable<(...)[(...)], (...) | (...), (...) extends (...) ? (...) : (...)> : never : never }>[K] }>,Schema
>
Create a new webhook.
Type Parameters ​
• Schema
• TQuery extends Query
<Schema
, DirectusWebhook
<Schema
>>
Parameters ​
• item: Partial
<DirectusWebhook
<Schema
>>
The webhook to create
• query?: TQuery
Optional return data query
Returns ​
RestCommand
<IfAny
<Schema
, Record
<string
, any
>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, Object, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : Object>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, Object, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : Object>>, FieldsWildcard<UnpackList<IfAny<Schema, Object, (...) extends (...) ? (...) : (...)>>, Exclude<UnpackList<Mutable<(...)>>, PickRelationalFields<(...)> extends never ? never : AllKeys<(...)>>>, FF extends Record<string, string> ? FF<FF> : Record<string, string>> : never, PickRelationalFields<UnpackList<Mutable<TQuery["fields"]>>> extends never ? never : { [Field in string | number | symbol]: Field extends keyof UnpackList<IfAny<(...), (...), (...)>> ? Extract<(...)[(...)], ItemType<(...)>> extends RelatedCollection ? IsNullable<(...)[(...)], (...) | (...), (...) extends (...) ? (...) : (...)> : never : never }>[K] }>, Schema
>
Returns the webhook object for the created webhook.