Skip to content

node-zendesk • Docs


node-zendesk / clients/core/macros / Macros

Class: Macros ​

The Macros class provides methods for interacting with the Zendesk Macros API.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/ Zendesk Macros API

Extends ​

Constructors ​

new Macros() ​

new Macros(options): Macros

Parameters ​

• options: any

Returns ​

Macros

Overrides ​

Client.constructor

Defined in ​

clients/core/macros.d.ts:89

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/macros.d.ts:90


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


apply() ​

apply(macroID): Promise<object>

Applies a macro to a ticket.

Parameters ​

• macroID: number

The ID of the macro.

Returns ​

Promise<object>

  • A promise that resolves to the applied macro's result.
response ​

response: object

result ​

result: object

result.ticket ​

ticket: Partial<object>

Type declaration ​
allow_attachments ​

allow_attachments: Partial<boolean>

  • Permission for agents to add add attachments to a comment. Defaults to true
allow_channelback ​

allow_channelback: Partial<boolean>

  • Is false if channelback is disabled, true otherwise. Only applicable for channels framework ticket
assignee_email? ​

optional assignee_email: string

  • Write only. The email address of the agent to assign the ticket to
assignee_id? ​

optional assignee_id: number

  • The agent currently assigned to the ticket
attribute_value_ids? ​

optional attribute_value_ids: number[]

  • Write only. An array of the IDs of attribute values to be associated with the ticket
brand_id? ​

optional brand_id: number

  • Enterprise only. The id of the brand this ticket is associated with
collaborator_ids? ​

optional collaborator_ids: number[]

  • The ids of users currently CC'ed on the ticket
collaborators? ​

optional collaborators: object[]

  • POST requests only. Users to add as cc's when creating a ticket. See Setting Collaborators
comment? ​

optional comment: Partial<object>

  • Write only. An object that adds a comment to the ticket. See Ticket comments. To include an attachment with the comment, see Attaching files
Type declaration ​
attachments? ​

optional attachments: Partial<object>[]

  • Attachments, if any. See Attachment
audit_id ​

audit_id: number

  • The id of the ticket audit record. See Show Audit
author_id ​

author_id: number

  • The id of the comment author. See Author id
body ​

body: string

  • The comment string. See Bodies
created_at ​

created_at: string

  • The time the comment was created
html_body ​

html_body: string

  • The comment formatted as HTML. See Bodies
id ​

id: number

  • Automatically assigned when the comment is created
metadata? ​

optional metadata: object

  • System information (web client, IP address, etc.) and comment flags, if any. See Comment flags
plain_body ​

plain_body: string

  • The comment presented as plain text. See Bodies
public ​

public: Partial<boolean>

  • true if a public comment; false if an internal note. The initial value set on ticket creation persists for any additional comment unless you change it
type ​

type: string

  • Comment or VoiceComment. The JSON object for adding voice comments to tickets is different. See Adding voice comments to tickets
uploads? ​

optional uploads: string[]

  • List of tokens received from uploading files for comment attachments. The files are attached by creating or updating tickets with the tokens. See Attaching files in Tickets
via? ​

optional via: Partial<object>

  • Describes how the object was created. See the Via object reference
Type declaration ​
channel? ​

optional channel: string

  • How the ticket or event was created expressed as a via type or via id
source ​

source: object

  • For some channels a source object gives more information about how or why the ticket or event was created
created_at ​

created_at: string

  • When this record was created
custom_fields? ​

optional custom_fields: Partial<object>[]

  • Custom fields for the ticket. See Setting custom field values
custom_status_id? ​

optional custom_status_id: number

  • The custom ticket status id of the ticket. See custom ticket statuses
description ​

description: string

  • Read-only first comment on the ticket. When creating a ticket, use comment to set the description. See Description and first comment
due_at? ​

optional due_at: string

  • If this is a ticket of type "task" it has a due date. Due date format uses ISO 8601 format.
email_cc_ids? ​

optional email_cc_ids: number[]

  • The ids of agents or end users currently CC'ed on the ticket. See CCs and followers resources in the Support Help Center
email_ccs? ​

optional email_ccs: object

  • Write only. An array of objects that represent agent or end users email CCs to add or delete from the ticket. See Setting email CCs
external_id? ​

optional external_id: string

  • An id you can use to link Zendesk Support tickets to local records
follower_ids? ​

optional follower_ids: number[]

  • The ids of agents currently following the ticket. See CCs and followers resources
followers? ​

optional followers: object

  • Write only. An array of objects that represent agent followers to add or delete from the ticket. See Setting followers
followup_ids ​

followup_ids: number[]

  • The ids of the followups created from this ticket. Ids are only visible once the ticket is closed
forum_topic_id? ​

optional forum_topic_id: number

  • The topic in the Zendesk Web portal this ticket originated from, if any. The Web portal is deprecated
from_messaging_channel ​

from_messaging_channel: Partial<boolean>

  • If true, the ticket's via type is a messaging channel.
group_id? ​

optional group_id: number

  • The group this ticket is assigned to
has_incidents ​

has_incidents: Partial<boolean>

  • Is true if a ticket is a problem type and has one or more incidents linked to it. Otherwise, the value is false.
id ​

id: number

  • Automatically assigned when the ticket is created
is_public ​

is_public: Partial<boolean>

  • Is true if any comments are public, false otherwise
macro_id? ​

optional macro_id: number

  • Write only. A macro ID to be recorded in the ticket audit
macro_ids? ​

optional macro_ids: number[]

  • POST requests only. List of macro IDs to be recorded in the ticket audit
metadata? ​

optional metadata: object

  • Write only. Metadata for the audit. In the audit object, the data is specified in the custom property of the metadata object. See Setting Metadata
organization_id? ​

optional organization_id: number

  • The organization of the requester. You can only specify the ID of an organization associated with the requester. See Organization Memberships
priority? ​

optional priority: Partial<Priority>

  • The urgency with which the ticket should be addressed. Allowed values are "urgent", "high", "normal", or "low".
problem_id? ​

optional problem_id: number

  • For tickets of type "incident", the ID of the problem the incident is linked to
raw_subject? ​

optional raw_subject: string

  • The dynamic content placeholder, if present, or the "subject" value, if not. See Dynamic Content Items
recipient? ​

optional recipient: string

  • The original recipient e-mail address of the ticket. Notification emails for the ticket are sent from this address
requester? ​

optional requester: object

  • Write only. See Creating a ticket with a new requester
requester_id ​

requester_id: number

  • The user who requested this ticket
safe_update? ​

optional safe_update: Partial<boolean>

  • Write only. Optional boolean. When true and an update_stamp date is included, protects against ticket update collisions and returns a message to let you know if one occurs. See Protecting against ticket update collisions. A value of false has the same effect as true. Omit the property to force the updates to not be safe
satisfaction_rating? ​

optional satisfaction_rating: object

  • The satisfaction rating of the ticket, if it exists, or the state of satisfaction, "offered" or "unoffered". The value is null for plan types that don't support CSAT
sharing_agreement_ids? ​

optional sharing_agreement_ids: number[]

  • The ids of the sharing agreements used for this ticket
status? ​

optional status: Partial<Status>

  • The state of the ticket. If your account has activated custom ticket statuses, this is the ticket's status category. See custom ticket statuses. Allowed values are "new", "open", "pending", "hold", "solved", or "closed".
subject? ​

optional subject: string

  • The value of the subject field for this ticket
submitter_id? ​

optional submitter_id: number

  • The user who submitted the ticket. The submitter always becomes the author of the first comment on the ticket
tags? ​

optional tags: string[]

  • The array of tags applied to this ticket
ticket_form_id? ​

optional ticket_form_id: number

  • Enterprise only. The id of the ticket form to render for the ticket
type? ​

optional type: Partial<Type>

  • The type of this ticket. Allowed values are "problem", "incident", "question", or "task".
updated_at ​

updated_at: string

  • When this record last got updated
updated_stamp? ​

optional updated_stamp: string

  • Write only. Datetime of last update received from API. See the safe_update property
url ​

url: string

  • The API url of this ticket
via? ​

optional via: Partial<object>

  • For more information, see the Via object reference
Type declaration ​
channel? ​

optional channel: string

  • How the ticket or event was created expressed as a via type or via id
source ​

source: object

  • For some channels a source object gives more information about how or why the ticket or event was created
via_followup_source_id? ​

optional via_followup_source_id: number

  • POST requests only. The id of a closed ticket when creating a follow-up ticket. See Creating a follow-up ticket
via_id? ​

optional via_id: number

  • Write only. For more information, see the Via object reference
voice_comment? ​

optional voice_comment: object

  • Write only. See Creating voicemail ticket

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#show-macro-replica

Example ​

ts
const result = await client.macros.apply(12345);

Defined in ​

clients/core/macros.d.ts:159


applyTicket() ​

applyTicket(ticketID, macroID): Promise<object>

Creates a macro representation derived from a ticket.

Parameters ​

• ticketID: number

The ID of the ticket from which to build a macro replica.

• macroID: number

The ID of the macro.

Returns ​

Promise<object>

  • A promise that resolves to the macro replica.
response ​

response: object

result ​

result: object

result.ticket ​

ticket: Partial<object>

Type declaration ​
allow_attachments ​

allow_attachments: Partial<boolean>

  • Permission for agents to add add attachments to a comment. Defaults to true
allow_channelback ​

allow_channelback: Partial<boolean>

  • Is false if channelback is disabled, true otherwise. Only applicable for channels framework ticket
assignee_email? ​

optional assignee_email: string

  • Write only. The email address of the agent to assign the ticket to
assignee_id? ​

optional assignee_id: number

  • The agent currently assigned to the ticket
attribute_value_ids? ​

optional attribute_value_ids: number[]

  • Write only. An array of the IDs of attribute values to be associated with the ticket
brand_id? ​

optional brand_id: number

  • Enterprise only. The id of the brand this ticket is associated with
collaborator_ids? ​

optional collaborator_ids: number[]

  • The ids of users currently CC'ed on the ticket
collaborators? ​

optional collaborators: object[]

  • POST requests only. Users to add as cc's when creating a ticket. See Setting Collaborators
comment? ​

optional comment: Partial<object>

  • Write only. An object that adds a comment to the ticket. See Ticket comments. To include an attachment with the comment, see Attaching files
Type declaration ​
attachments? ​

optional attachments: Partial<object>[]

  • Attachments, if any. See Attachment
audit_id ​

audit_id: number

  • The id of the ticket audit record. See Show Audit
author_id ​

author_id: number

  • The id of the comment author. See Author id
body ​

body: string

  • The comment string. See Bodies
created_at ​

created_at: string

  • The time the comment was created
html_body ​

html_body: string

  • The comment formatted as HTML. See Bodies
id ​

id: number

  • Automatically assigned when the comment is created
metadata? ​

optional metadata: object

  • System information (web client, IP address, etc.) and comment flags, if any. See Comment flags
plain_body ​

plain_body: string

  • The comment presented as plain text. See Bodies
public ​

public: Partial<boolean>

  • true if a public comment; false if an internal note. The initial value set on ticket creation persists for any additional comment unless you change it
type ​

type: string

  • Comment or VoiceComment. The JSON object for adding voice comments to tickets is different. See Adding voice comments to tickets
uploads? ​

optional uploads: string[]

  • List of tokens received from uploading files for comment attachments. The files are attached by creating or updating tickets with the tokens. See Attaching files in Tickets
via? ​

optional via: Partial<object>

  • Describes how the object was created. See the Via object reference
Type declaration ​
channel? ​

optional channel: string

  • How the ticket or event was created expressed as a via type or via id
source ​

source: object

  • For some channels a source object gives more information about how or why the ticket or event was created
created_at ​

created_at: string

  • When this record was created
custom_fields? ​

optional custom_fields: Partial<object>[]

  • Custom fields for the ticket. See Setting custom field values
custom_status_id? ​

optional custom_status_id: number

  • The custom ticket status id of the ticket. See custom ticket statuses
description ​

description: string

  • Read-only first comment on the ticket. When creating a ticket, use comment to set the description. See Description and first comment
due_at? ​

optional due_at: string

  • If this is a ticket of type "task" it has a due date. Due date format uses ISO 8601 format.
email_cc_ids? ​

optional email_cc_ids: number[]

  • The ids of agents or end users currently CC'ed on the ticket. See CCs and followers resources in the Support Help Center
email_ccs? ​

optional email_ccs: object

  • Write only. An array of objects that represent agent or end users email CCs to add or delete from the ticket. See Setting email CCs
external_id? ​

optional external_id: string

  • An id you can use to link Zendesk Support tickets to local records
follower_ids? ​

optional follower_ids: number[]

  • The ids of agents currently following the ticket. See CCs and followers resources
followers? ​

optional followers: object

  • Write only. An array of objects that represent agent followers to add or delete from the ticket. See Setting followers
followup_ids ​

followup_ids: number[]

  • The ids of the followups created from this ticket. Ids are only visible once the ticket is closed
forum_topic_id? ​

optional forum_topic_id: number

  • The topic in the Zendesk Web portal this ticket originated from, if any. The Web portal is deprecated
from_messaging_channel ​

from_messaging_channel: Partial<boolean>

  • If true, the ticket's via type is a messaging channel.
group_id? ​

optional group_id: number

  • The group this ticket is assigned to
has_incidents ​

has_incidents: Partial<boolean>

  • Is true if a ticket is a problem type and has one or more incidents linked to it. Otherwise, the value is false.
id ​

id: number

  • Automatically assigned when the ticket is created
is_public ​

is_public: Partial<boolean>

  • Is true if any comments are public, false otherwise
macro_id? ​

optional macro_id: number

  • Write only. A macro ID to be recorded in the ticket audit
macro_ids? ​

optional macro_ids: number[]

  • POST requests only. List of macro IDs to be recorded in the ticket audit
metadata? ​

optional metadata: object

  • Write only. Metadata for the audit. In the audit object, the data is specified in the custom property of the metadata object. See Setting Metadata
organization_id? ​

optional organization_id: number

  • The organization of the requester. You can only specify the ID of an organization associated with the requester. See Organization Memberships
priority? ​

optional priority: Partial<Priority>

  • The urgency with which the ticket should be addressed. Allowed values are "urgent", "high", "normal", or "low".
problem_id? ​

optional problem_id: number

  • For tickets of type "incident", the ID of the problem the incident is linked to
raw_subject? ​

optional raw_subject: string

  • The dynamic content placeholder, if present, or the "subject" value, if not. See Dynamic Content Items
recipient? ​

optional recipient: string

  • The original recipient e-mail address of the ticket. Notification emails for the ticket are sent from this address
requester? ​

optional requester: object

  • Write only. See Creating a ticket with a new requester
requester_id ​

requester_id: number

  • The user who requested this ticket
safe_update? ​

optional safe_update: Partial<boolean>

  • Write only. Optional boolean. When true and an update_stamp date is included, protects against ticket update collisions and returns a message to let you know if one occurs. See Protecting against ticket update collisions. A value of false has the same effect as true. Omit the property to force the updates to not be safe
satisfaction_rating? ​

optional satisfaction_rating: object

  • The satisfaction rating of the ticket, if it exists, or the state of satisfaction, "offered" or "unoffered". The value is null for plan types that don't support CSAT
sharing_agreement_ids? ​

optional sharing_agreement_ids: number[]

  • The ids of the sharing agreements used for this ticket
status? ​

optional status: Partial<Status>

  • The state of the ticket. If your account has activated custom ticket statuses, this is the ticket's status category. See custom ticket statuses. Allowed values are "new", "open", "pending", "hold", "solved", or "closed".
subject? ​

optional subject: string

  • The value of the subject field for this ticket
submitter_id? ​

optional submitter_id: number

  • The user who submitted the ticket. The submitter always becomes the author of the first comment on the ticket
tags? ​

optional tags: string[]

  • The array of tags applied to this ticket
ticket_form_id? ​

optional ticket_form_id: number

  • Enterprise only. The id of the ticket form to render for the ticket
type? ​

optional type: Partial<Type>

  • The type of this ticket. Allowed values are "problem", "incident", "question", or "task".
updated_at ​

updated_at: string

  • When this record last got updated
updated_stamp? ​

optional updated_stamp: string

  • Write only. Datetime of last update received from API. See the safe_update property
url ​

url: string

  • The API url of this ticket
via? ​

optional via: Partial<object>

  • For more information, see the Via object reference
Type declaration ​
channel? ​

optional channel: string

  • How the ticket or event was created expressed as a via type or via id
source ​

source: object

  • For some channels a source object gives more information about how or why the ticket or event was created
via_followup_source_id? ​

optional via_followup_source_id: number

  • POST requests only. The id of a closed ticket when creating a follow-up ticket. See Creating a follow-up ticket
via_id? ​

optional via_id: number

  • Write only. For more information, see the Via object reference
voice_comment? ​

optional voice_comment: object

  • Write only. See Creating voicemail ticket

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#show-macro-replica

Example ​

ts
const replica = await client.macros.applyTicket(12345, 67890);

Defined in ​

clients/core/macros.d.ts:175


categories() ​

categories(): Promise<object[]>

Lists all macro categories available to the current user.

Returns ​

Promise<object[]>

  • A promise that resolves to a list of macro categories.

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-macro-categories

Example ​

ts
const macroCategories = await client.macros.categories();

Defined in ​

clients/core/macros.d.ts:216


create() ​

create(macro): Promise<object>

Creates a new macro.

Parameters ​

• macro

The macro object containing necessary values.

• macro.actions: object[]

List of actions that the macro will perform.

• macro.active?: boolean

Whether the macro is active.

• macro.description?: string

The description of the macro.

• macro.title: string

The title of the macro.

Returns ​

Promise<object>

  • A promise that resolves to the created macro.
response ​

response: object

result ​

result: object

result.macro ​

macro: Macro

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#create-macro

Example ​

ts
const newMacro = await client.macros.create({
  title: "Test Macro",
  actions: [{ field: "status", value: "solved" }]
});

Defined in ​

clients/core/macros.d.ts:197


delete() ​

delete(macroID): Promise<void>

Deletes a specified macro.

Parameters ​

• macroID: number

The ID of the macro to delete.

Returns ​

Promise<void>

  • A promise indicating successful deletion.

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#delete-macro

Example ​

ts
await client.macros.delete(12345);

Overrides ​

Client.delete

Defined in ​

clients/core/macros.d.ts:244


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<Macro[]>

Lists all shared and personal macros available to the current user.

Returns ​

Promise<Macro[]>

Returns a promise that resolves to an array of macros.

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-macros Zendesk List Macros API

Example ​

ts
const macros = await client.macros.list();

Defined in ​

clients/core/macros.d.ts:99


listActive() ​

listActive(): Promise<object>

Lists all active macros.

Returns ​

Promise<object>

  • A promise that resolves to a list of active macros.
response ​

response: object

result ​

result: Macro[][]

Throws ​

Throws an error if the request fails.

See ​

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

Example ​

ts
const activeMacros = await client.macros.listActive();

Defined in ​

clients/core/macros.d.ts:136


listByParams() ​

listByParams(parameters): Promise<Macro[]>

Lists macros based on provided parameters.

Parameters ​

• parameters: object

The filtering parameters.

Returns ​

Promise<Macro[]>

  • A promise that resolves to a list of macros.

Throws ​

Throws an error if the request fails.

See ​

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

Example ​

ts
const macros = await client.macros.listByParams({ active: true });

Defined in ​

clients/core/macros.d.ts:149


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


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(query): Promise<object>

Searches for macros based on provided query.

Parameters ​

• query: string

The search query string.

Returns ​

Promise<object>

  • A promise that resolves to a list of matched macros.
response ​

response: object

result ​

result: object[]

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#search-macros

Example ​

ts
const matchedMacros = await client.macros.search("priority:urgent");

Defined in ​

clients/core/macros.d.ts:124


setSideLoad() ​

setSideLoad(array): void

Parameters ​

• array: any

Returns ​

void

Inherited from ​

Client.setSideLoad

Defined in ​

clients/client.d.ts:61


show() ​

show(macroID): Promise<object>

Retrieves details of a specific macro.

Parameters ​

• macroID: number

The ID of the macro to retrieve.

Returns ​

Promise<object>

Returns a promise that resolves to the macro's details.

response ​

response: object

result ​

result: object

result.macro ​

macro: Macro

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#show-macro Zendesk Show Macro API

Example ​

ts
const macroDetails = await client.macros.show(123);

Defined in ​

clients/core/macros.d.ts:109


update() ​

update(macroID, macro): Promise<object>

Updates an existing macro.

Parameters ​

• macroID: number

The ID of the macro to update.

• macro: object

The updates to apply to the macro.

Returns ​

Promise<object>

  • A promise that resolves to the updated macro.
response ​

response: object

result ​

result: object

Throws ​

Throws an error if the request fails.

See ​

https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#update-macro

Example ​

ts
const updatedMacro = await client.macros.update(12345, {
  title: "Updated Macro Title"
});

Defined in ​

clients/core/macros.d.ts:231


updateMany() ​

updateMany(macrosUpdates): Promise<object>

Updates multiple macros.

Parameters ​

• macrosUpdates: object[]

An array of macro update objects.

Returns ​

Promise<object>

  • A promise that resolves to an array of updated macros.
response ​

response: object

result ​

result: object[]

Throws ​

Throws an error if the request fails.

See ​

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

Example ​

ts
const updatedMacros = await client.macros.updateMany([
  { id: 12345, title: "Updated Macro One" },
  { id: 67890, title: "Updated Macro Two" }
]);

Defined in ​

clients/core/macros.d.ts:257

Released under the MIT License.