Skip to content

node-zendeskDocs


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

Automations

Overrides

Client.constructor

Defined in

clients/core/automations.d.ts:9

Properties

_transporter

_transporter: Transporter

Inherited from

Client._transporter

Defined in

clients/client.d.ts:42


eventTarget

eventTarget: CustomEventTarget

Event target to handle custom events.

Inherited from

Client.eventTarget

Defined in

clients/client.d.ts:40


jsonAPINames

jsonAPINames: string[]

Array to hold names used in the JSON API.

Overrides

Client.jsonAPINames

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

Client.options

Defined in

clients/client.d.ts:34


sideLoad

sideLoad: any[]

Array to handle side-loaded resources.

Inherited from

Client.sideLoad

Defined in

clients/client.d.ts:37


useDotJson

useDotJson: boolean

Flag to indicate if the API endpoint should use '.json' ending.

Inherited from

Client.useDotJson

Defined in

clients/client.d.ts:39

Accessors

transporter

Get Signature

get transporter(): Transporter

Returns

Transporter

Transporter for making requests.

Inherited from

Client.transporter

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

Client._rawRequest

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

https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#bulk-delete-automation

Example

ts
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

ts
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

ts
await client.automations.delete(12345);

Overrides

Client.delete

Defined in

clients/core/automations.d.ts:87


emit()

emit(eventType, eventData): void

Parameters

eventType: any

eventData: any

Returns

void

Inherited from

Client.emit

Defined in

clients/client.d.ts:43


get()

get(resource): Promise<NodeModule>

Parameters

resource: any

Returns

Promise<NodeModule>

Inherited from

Client.get

Defined in

clients/client.d.ts:62


getAll()

getAll(resource): Promise<any[]>

Parameters

resource: any

Returns

Promise<any[]>

Inherited from

Client.getAll

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

ts
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

https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#list-active-automations

Example

ts
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

Client.on

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

Client.patch

Defined in

clients/client.d.ts:68


post()

post(resource, body): Promise<NodeModule>

Parameters

resource: any

body: any

Returns

Promise<NodeModule>

Inherited from

Client.post

Defined in

clients/client.d.ts:70


put()

put(resource, body): Promise<NodeModule>

Parameters

resource: any

body: any

Returns

Promise<NodeModule>

Inherited from

Client.put

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

ts
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

Client.request

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

Client.requestAll

Defined in

clients/client.d.ts:97


requestUpload()

requestUpload(uri, file): Promise<any>

Parameters

uri: any

file: any

Returns

Promise<any>

Inherited from

Client.requestUpload

Defined in

clients/client.d.ts:98


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

ts
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

Client.setSideLoad

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

ts
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

ts
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

https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#update-many-automation

Example

ts
const status = await client.automations.updateMany([{id: 123, position: 1}, {id: 124, position: 2}]);

Defined in

clients/core/automations.d.ts:75

Released under the MIT License.