node-zendesk • Docs
node-zendesk / clients/core/automations / Automations
Class: Automations
The Automations class provides methods for interacting with the Zendesk Automation API. See the Zendesk API documentation for more details.
Extends
Constructors
new Automations()
new Automations(
options
):Automations
Parameters
• options: any
Returns
Overrides
Defined in
clients/core/automations.d.ts:9
Properties
_transporter
_transporter:
Transporter
Inherited from
Defined in
clients/client.d.ts:42
eventTarget
eventTarget:
CustomEventTarget
Event target to handle custom events.
Inherited from
Defined in
clients/client.d.ts:40
jsonAPINames
jsonAPINames:
string
[]
Array to hold names used in the JSON API.
Overrides
Defined in
clients/core/automations.d.ts:10
options
options:
ZendeskClientOptions
&object
Configuration options for the client.
Type declaration
get()
get: (
key
) =>any
Parameters
• key: string
Returns
any
Inherited from
Defined in
clients/client.d.ts:34
sideLoad
sideLoad:
any
[]
Array to handle side-loaded resources.
Inherited from
Defined in
clients/client.d.ts:37
useDotJson
useDotJson:
boolean
Flag to indicate if the API endpoint should use '.json' ending.
Inherited from
Defined in
clients/client.d.ts:39
Accessors
transporter
Get Signature
get transporter():
Transporter
Returns
Transporter for making requests.
Inherited from
Defined in
clients/client.d.ts:41
Methods
_rawRequest()
_rawRequest(
method
,uri
, ...arguments_
):Promise
<object
>
Parameters
• method: any
• uri: any
• ...arguments_: any
[]
Returns
Promise
<object
>
response
response:
any
result
result:
object
Inherited from
Defined in
clients/client.d.ts:78
bulkDelete()
bulkDelete(
ids
):Promise
<void
>
Bulk delete automations.
Parameters
• ids: number
[]
Array of automation IDs to be deleted.
Returns
Promise
<void
>
See
Example
await client.automations.bulkDelete([12345, 67890]);
Defined in
clients/core/automations.d.ts:96
create()
create(
automationData
):Promise
<object
>
Create a new automation.
Parameters
• automationData: object
Data for the new automation.
Returns
Promise
<object
>
Returns the created automation.
response
response:
object
result
result:
object
See
https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#create-automation
Example
const automation = await client.automations.create({
title: "Roger Wilco",
conditions: { ... },
actions: { ... }
});
Defined in
clients/core/automations.d.ts:48
delete()
delete(
automationID
):Promise
<void
>
Delete an automation.
Parameters
• automationID: number
ID of the automation to be deleted.
Returns
Promise
<void
>
See
https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#delete-automation
Example
await client.automations.delete(12345);
Overrides
Defined in
clients/core/automations.d.ts:87
emit()
emit(
eventType
,eventData
):void
Parameters
• eventType: any
• eventData: any
Returns
void
Inherited from
Defined in
clients/client.d.ts:43
get()
get(
resource
):Promise
<NodeModule
>
Parameters
• resource: any
Returns
Promise
<NodeModule
>
Inherited from
Defined in
clients/client.d.ts:62
getAll()
getAll(
resource
):Promise
<any
[]>
Parameters
• resource: any
Returns
Promise
<any
[]>
Inherited from
Defined in
clients/client.d.ts:77
list()
list():
Promise
<any
[]>
List all automations.
Returns
Promise
<any
[]>
Returns a list of automations.
See
https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#list-automations
Example
const automations = await client.automations.list();
Defined in
clients/core/automations.d.ts:17
listActive()
listActive():
Promise
<any
[]>
List all active automations.
Returns
Promise
<any
[]>
Returns a list of active automations.
See
Example
const activeAutomations = await client.automations.listActive();
Defined in
clients/core/automations.d.ts:24
on()
on(
eventType
,callback
):void
Parameters
• eventType: any
• callback: any
Returns
void
Inherited from
Defined in
clients/client.d.ts:44
patch()
patch(...
arguments_
):Promise
<void
|object
>
Patches a resource.
Parameters
• ...arguments_: any
[]
The resources or parts of the resource path followed by the body.
Returns
Promise
<void
| object
>
- Either void or response object
Inherited from
Defined in
clients/client.d.ts:68
post()
post(
resource
,body
):Promise
<NodeModule
>
Parameters
• resource: any
• body: any
Returns
Promise
<NodeModule
>
Inherited from
Defined in
clients/client.d.ts:70
put()
put(
resource
,body
):Promise
<NodeModule
>
Parameters
• resource: any
• body: any
Returns
Promise
<NodeModule
>
Inherited from
Defined in
clients/client.d.ts:69
reorder()
reorder(
automationIDs
):Promise
<object
>
Reorder the list of automations.
Parameters
• automationIDs: number
[]
Array of automation IDs in the desired order.
Returns
Promise
<object
>
Returns the status of the reorder.
Example
const status = await client.automations.reorder([67890, 12345]);
Deprecated
This may now be deprecated, please notify developers if you find this to be the case.
Defined in
clients/core/automations.d.ts:113
request()
request<
T
>(method
,uri
, ...arguments_
):Promise
<NodeModule
>
Request method that handles various HTTP methods.
Type Parameters
• T
Parameters
• method: string
HTTP method (e.g., 'GET', 'POST').
• uri: string
The URI for the request.
• ...arguments_: any
[]
Additional arguments for the request.
Returns
Promise
<NodeModule
>
- The API response.
Inherited from
Defined in
clients/client.d.ts:96
requestAll()
requestAll(
method
,uri
, ...arguments_
):Promise
<any
[]>
Parameters
• method: any
• uri: any
• ...arguments_: any
[]
Returns
Promise
<any
[]>
Inherited from
Defined in
clients/client.d.ts:97
requestUpload()
requestUpload(
uri
,file
):Promise
<any
>
Parameters
• uri: any
• file: any
Returns
Promise
<any
>
Inherited from
Defined in
clients/client.d.ts:98
search()
search(
searchQuery
):Promise
<any
[]>
Search automations by with query.
Parameters
• searchQuery: object
The parameters to search for ['active', 'include', 'query', 'sort_by', 'sort_order'].
Returns
Promise
<any
[]>
Returns automations matching the search query.
See
https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#search-automation
Example
const foundAutomations = await client.automations.search('close');
Defined in
clients/core/automations.d.ts:104
setSideLoad()
setSideLoad(
array
):void
Parameters
• array: any
Returns
void
Inherited from
Defined in
clients/client.d.ts:61
show()
show(
automationID
):Promise
<object
>
Get details of a specific automation by ID.
Parameters
• automationID: number
The ID of the automation.
Returns
Promise
<object
>
Returns details of the automation.
response
response:
object
result
result:
object
See
https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#show-automation
Example
const automationDetails = await client.automations.show(123456);
Defined in
clients/core/automations.d.ts:32
update()
update(
automationID
,updatedData
):Promise
<object
>
Update an existing automation.
Parameters
• automationID: number
ID of the automation to update.
• updatedData: object
Updated data for the automation.
Returns
Promise
<object
>
Returns the updated automation.
response
response:
object
result
result:
object
See
https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#update-automation
Example
const updatedAutomation = await client.automations.update(12345, {
title: "Updated Automation"
});
Defined in
clients/core/automations.d.ts:63
updateMany()
updateMany(
automations
):Promise
<object
>
Update many automations in bulk.
Parameters
• automations: object
[]
Array of automation data with their IDs to be updated.
Returns
Promise
<object
>
Returns the status of the bulk update.
response
response:
object
result
result:
object
See
Example
const status = await client.automations.updateMany([{id: 123, position: 1}, {id: 124, position: 2}]);
Defined in
clients/core/automations.d.ts:75