# Zendesk

> Manage Zendesk support tickets, comments, users and organizations, and search across all of them.

App · Help Desk · 20 actions. Web page: https://docs.lodol.com/docs/integrations/zendesk

## Actions

### Add ticket comment

Add a reply or an internal note to an existing ticket. A public comment is visible to the requester; a private one is not.

**Inputs**

- Ticket (`ticket_id`, number, required): The ticket's numeric id, for example 12345.
- Comment (`comment`, text, required): The text to add to the ticket.
- Visible to the requester (`public`, true/false): On posts a public reply the requester can see. Off leaves an internal note for agents only. Default: `true`.

**Outputs**

- `public` (true/false)
- `status` (text): Status of the action execution ("success" on success).
- `ticket` (object)
- `ticket_id` (number)
- `url` (text)

**Example output**

```json
{
  "public": true,
  "status": "success",
  "ticket": {
    "id": 12345,
    "status": "open",
    "subject": "Printer on fire"
  },
  "ticket_id": 12345,
  "url": "https://acme.zendesk.com/agent/tickets/12345"
}
```

### Create organization

Create an organization to group users by company. The name must be unique across the account.

**Inputs**

- Name (`name`, text, required): The organization's name. Must be unique in the account.
- Email domains (`domain_names`, list): Email domains that automatically place new users in this organization, for example acme.com.
- Details (`details`, text): Details about the organization, visible to agents.
- Notes (`notes`, text): Internal notes about the organization.
- Tags (`tags`, list): Tags to put on the new organization.

**Outputs**

- `organization` (object)
- `organization_id` (number)
- `status` (text): Status of the action execution ("success" on success).

**Example output**

```json
{
  "organization": {
    "id": 24680,
    "name": "Acme Corp"
  },
  "organization_id": 24680,
  "status": "success"
}
```

### Create ticket

Create a Zendesk ticket with a subject and description, and optionally set the requester, priority, type, status, tags, assignee and group.

**Inputs**

- Subject (`subject`, text, required): One line summarising the issue.
- Description (`description`, text, required): The body of the request. This becomes the ticket's first comment.
- Requester email (`requester_email`, text): Email address of the person the ticket is for. Zendesk creates the user if it does not recognise the address. Leave empty to file the ticket under the connected account.
- Requester name (`requester_name`, text): Name to give a requester Zendesk has not seen before. Needs a requester email as well.
- Priority (`priority`, text): How urgent the ticket is. One of: `low`, `normal`, `high`, `urgent`.
- Type (`ticket_type`, text): What kind of work the ticket represents. One of: `problem`, `incident`, `question`, `task`.
- Status (`status`, text): Status to open the ticket in. Defaults to New. One of: `new`, `open`, `pending`, `hold` (On hold), `solved`, `closed`.
- Tags (`tags`, list): Tags to put on the new ticket.
- Assignee (`assignee_id`, number): Numeric id of the agent to assign. Use Search users to find one. Leave empty to leave the ticket unassigned.
- Group (`group_id`, text): Assign the ticket to this agent group. Leave empty to keep it as is.

**Outputs**

- `status` (text): Status of the action execution ("success" on success).
- `ticket` (object)
- `ticket_id` (number)
- `url` (text)

**Example output**

```json
{
  "status": "success",
  "ticket": {
    "id": 12345,
    "status": "open",
    "subject": "Printer on fire"
  },
  "ticket_id": 12345,
  "url": "https://acme.zendesk.com/agent/tickets/12345"
}
```

### Create user

Add an end user, agent or admin to Zendesk. Only a name is required.

**Inputs**

- Name (`name`, text, required): The person's full name.
- Email (`email`, text): Their email address. Must be unique in the account.
- Role (`role`, text): What the person can do in Zendesk. Defaults to End user. One of: `end-user` (End user), `agent`, `admin`.
- Phone (`phone`, text): A contact phone number.
- Organization (`organization_id`, number): Numeric id of the organization to file them under. Use List organizations to find one.
- Tags (`tags`, list): Tags to put on the new user.
- Notes (`notes`, text): Internal notes about this person, visible to agents.

**Outputs**

- `status` (text): Status of the action execution ("success" on success).
- `user` (object)
- `user_id` (number)

**Example output**

```json
{
  "status": "success",
  "user": {
    "email": "sam@example.com",
    "id": 67890,
    "name": "Sam Rivera"
  },
  "user_id": 67890
}
```

### Delete organization

Permanently delete an organization from Zendesk.

**Inputs**

- Organization (`organization_id`, number, required): The organization's numeric id. Use List organizations to find one.

**Outputs**

- `deleted` (true/false)
- `organization_id` (number)
- `status` (text): Status of the action execution ("success" on success).

**Example output**

```json
{
  "deleted": true,
  "organization_id": 24680,
  "status": "success"
}
```

### Delete ticket

Delete a ticket. It moves to Zendesk's deleted-tickets list, where an admin can still restore it.

**Inputs**

- Ticket (`ticket_id`, number, required): The ticket's numeric id, for example 12345.

**Outputs**

- `deleted` (true/false)
- `status` (text): Status of the action execution ("success" on success).
- `ticket_id` (number)

**Example output**

```json
{
  "deleted": true,
  "status": "success",
  "ticket_id": 12345
}
```

### Delete user

Deactivate a user. Zendesk refuses if the person is the requester of any existing ticket.

**Inputs**

- User (`user_id`, number, required): The user's numeric id. Use Search users to find one.

**Outputs**

- `deleted` (true/false)
- `status` (text): Status of the action execution ("success" on success).
- `user` (object)
- `user_id` (number)

**Example output**

```json
{
  "deleted": true,
  "status": "success",
  "user": {
    "active": false,
    "id": 67890
  },
  "user_id": 67890
}
```

### Get connected account

Show which Zendesk account this connection acts as, and what role it has. Useful for checking a connection works.

**Inputs**: None.

**Outputs**

- `email` (text)
- `name` (text)
- `role` (text)
- `status` (text): Status of the action execution ("success" on success).
- `user` (object)
- `user_id` (number)

**Example output**

```json
{
  "email": "sam@example.com",
  "name": "Sam Rivera",
  "role": "admin",
  "status": "success",
  "user": {
    "id": 67890,
    "name": "Sam Rivera"
  },
  "user_id": 67890
}
```

### Get organization

Retrieve every field of a single Zendesk organization.

**Inputs**

- Organization (`organization_id`, number, required): The organization's numeric id. Use List organizations to find one.

**Outputs**

- `organization` (object)
- `organization_id` (number)
- `status` (text): Status of the action execution ("success" on success).

**Example output**

```json
{
  "organization": {
    "id": 24680,
    "name": "Acme Corp"
  },
  "organization_id": 24680,
  "status": "success"
}
```

### Get ticket

Retrieve every field of a single Zendesk ticket.

**Inputs**

- Ticket (`ticket_id`, number, required): The ticket's numeric id, for example 12345.

**Outputs**

- `status` (text): Status of the action execution ("success" on success).
- `ticket` (object)
- `ticket_id` (number)
- `url` (text)

**Example output**

```json
{
  "status": "success",
  "ticket": {
    "id": 12345,
    "status": "open",
    "subject": "Printer on fire"
  },
  "ticket_id": 12345,
  "url": "https://acme.zendesk.com/agent/tickets/12345"
}
```

### Get user

Retrieve every field of a single Zendesk user.

**Inputs**

- User (`user_id`, number, required): The user's numeric id. Use Search users to find one.

**Outputs**

- `status` (text): Status of the action execution ("success" on success).
- `user` (object)
- `user_id` (number)

**Example output**

```json
{
  "status": "success",
  "user": {
    "email": "sam@example.com",
    "id": 67890,
    "name": "Sam Rivera"
  },
  "user_id": 67890
}
```

### List groups

List the agent groups tickets can be assigned to, with their numeric ids.

**Inputs**

- How many (`per_page`, number): How many records to return (1-100). Leave it out and you get the first 25, so set 100 when a list or digest should show everything that matches. From 1 to 100. Default: `25`.
- Hide deleted groups (`exclude_deleted`, true/false): Leave on to list only groups still in use. Default: `true`.

**Outputs**

- `count` (number)
- `groups` (list)
- `status` (text): Status of the action execution ("success" on success).

**Example output**

```json
{
  "count": 1,
  "groups": [
    {
      "id": 360001,
      "name": "Support"
    }
  ],
  "status": "success"
}
```

### List organizations

List the account's organizations.

**Inputs**

- How many (`per_page`, number): How many records to return (1-100). Leave it out and you get the first 25, so set 100 when a list or digest should show everything that matches. From 1 to 100. Default: `25`.

**Outputs**

- `count` (number)
- `organizations` (list)
- `status` (text): Status of the action execution ("success" on success).

**Example output**

```json
{
  "count": 1,
  "organizations": [
    {
      "id": 24680,
      "name": "Acme Corp"
    }
  ],
  "status": "success"
}
```

### List ticket comments

Read the full conversation on a ticket, oldest first by default.

**Inputs**

- Ticket (`ticket_id`, number, required): The ticket's numeric id, for example 12345.
- How many (`per_page`, number): How many records to return (1-100). Leave it out and you get the first 25, so set 100 when a list or digest should show everything that matches. From 1 to 100. Default: `25`.
- Order (`sort_order`, text): Which end of the list to start from. One of: `asc` (Oldest first), `desc` (Newest first).

**Outputs**

- `comments` (list)
- `count` (number)
- `status` (text): Status of the action execution ("success" on success).
- `ticket_id` (number)

**Example output**

```json
{
  "comments": [
    {
      "body": "Thanks for reporting.",
      "id": 1,
      "public": true
    }
  ],
  "count": 1,
  "status": "success",
  "ticket_id": 12345
}
```

### List tickets

List the account's tickets, newest or oldest first.

**Inputs**

- How many (`per_page`, number): How many records to return (1-100). Leave it out and you get the first 25, so set 100 when a list or digest should show everything that matches. From 1 to 100. Default: `25`.
- Sort by (`sort_by`, text): Which field to order the tickets by. One of: `assignee`, `created_at` (Created), `group`, `id` (Ticket id), `requester`, `status`, `subject`, `updated_at` (Last updated).
- Order (`sort_order`, text): Which end of the list to start from. One of: `asc` (Oldest first), `desc` (Newest first).

**Outputs**

- `count` (number)
- `status` (text): Status of the action execution ("success" on success).
- `tickets` (list)

**Example output**

```json
{
  "count": 1,
  "status": "success",
  "tickets": [
    {
      "id": 12345,
      "subject": "Printer on fire"
    }
  ]
}
```

### Search users

Find users by name, email address or external id: the usual way to turn an email address into a Zendesk user id.

**Inputs**

- Search terms (`query`, text, required): A name, an email address, or part of one.
- How many (`per_page`, number): How many records to return (1-100). Leave it out and you get the first 25, so set 100 when a list or digest should show everything that matches. From 1 to 100. Default: `25`.

**Outputs**

- `count` (number)
- `returned` (number)
- `status` (text): Status of the action execution ("success" on success).
- `users` (list)

**Example output**

```json
{
  "count": 1,
  "returned": 1,
  "status": "success",
  "users": [
    {
      "id": 67890,
      "name": "Sam Rivera"
    }
  ]
}
```

### Search Zendesk

Search tickets, users, organizations and groups with Zendesk search syntax, for example 'type:ticket status:open'.

**Inputs**

- Search terms (`query`, text, required): What to look for. Zendesk search syntax works here, such as type:ticket status:open priority:urgent. To look back from now, write the time with no spaces, such as created>30minutes or updated>2days.
- Sort by (`sort_by`, text): Which field to order results by. Defaults to relevance. One of: `updated_at` (Last updated), `created_at` (Created), `priority`, `status`, `ticket_type` (Type).
- Order (`sort_order`, text): Which end of the list to start from. One of: `asc` (Oldest first), `desc` (Newest first).
- Page (`page`, number): Which page of results to read. Zendesk returns at most 1,000 results, so pages run from 1 to 10. From 1 to 10.
- How many (`per_page`, number): How many records to return (1-100). Leave it out and you get the first 25, so set 100 when a list or digest should show everything that matches. From 1 to 100. Default: `25`.

**Outputs**

- `count` (number)
- `results` (list)
- `returned` (number)
- `status` (text): Status of the action execution ("success" on success).

**Example output**

```json
{
  "count": 1,
  "results": [
    {
      "id": 12345,
      "result_type": "ticket",
      "subject": "Printer on fire"
    }
  ],
  "returned": 1,
  "status": "success"
}
```

### Update organization

Change an organization's name, email domains, details, notes or tags. Only the fields you set are changed.

**Inputs**

- Organization (`organization_id`, number, required): The organization's numeric id. Use List organizations to find one.
- Name (`name`, text): Replace the organization's name.
- Email domains (`domain_names`, list): Replace the organization's email domains. This replaces the existing list rather than adding to it.
- Details (`details`, text): Replace the details shown to agents.
- Notes (`notes`, text): Replace the internal notes.
- Tags (`tags`, list): Tags to set. This replaces the existing tags rather than adding to them.

**Outputs**

- `organization` (object)
- `organization_id` (number)
- `status` (text): Status of the action execution ("success" on success).

**Example output**

```json
{
  "organization": {
    "id": 24680,
    "name": "Acme Corp"
  },
  "organization_id": 24680,
  "status": "success"
}
```

### Update ticket

Change a ticket's subject, status, priority, type, assignee, group or tags. Only the fields you set are changed.

**Inputs**

- Ticket (`ticket_id`, number, required): The ticket's numeric id, for example 12345.
- Subject (`subject`, text): Replace the ticket's subject.
- Status (`status`, text): Move the ticket to this status. One of: `new`, `open`, `pending`, `hold` (On hold), `solved`, `closed`.
- Priority (`priority`, text): Change how urgent the ticket is. One of: `low`, `normal`, `high`, `urgent`.
- Type (`ticket_type`, text): Change what kind of work the ticket represents. One of: `problem`, `incident`, `question`, `task`.
- Assignee (`assignee_id`, number): Numeric id of the agent to assign. Use Search users to find one. Leave empty to leave the ticket unassigned.
- Group (`group_id`, text): Assign the ticket to this agent group. Leave empty to keep it as is.
- Tags (`tags`, list): Tags to set. This replaces the existing tags rather than adding to them.

**Outputs**

- `status` (text): Status of the action execution ("success" on success).
- `ticket` (object)
- `ticket_id` (number)
- `ticket_status` (text)
- `url` (text)

**Example output**

```json
{
  "status": "success",
  "ticket": {
    "id": 12345,
    "status": "open",
    "subject": "Printer on fire"
  },
  "ticket_id": 12345,
  "ticket_status": "open",
  "url": "https://acme.zendesk.com/agent/tickets/12345"
}
```

### Update user

Change a user's name, email, role, phone, organization, tags or notes. Only the fields you set are changed.

**Inputs**

- User (`user_id`, number, required): The user's numeric id. Use Search users to find one.
- Name (`name`, text): Replace the person's name.
- Email (`email`, text): Replace their email address.
- Role (`role`, text): Change what the person can do in Zendesk. One of: `end-user` (End user), `agent`, `admin`.
- Phone (`phone`, text): Replace their phone number.
- Organization (`organization_id`, number): Numeric id of the organization to move them to.
- Tags (`tags`, list): Tags to set on the user. This replaces the existing tags rather than adding to them.
- Notes (`notes`, text): Replace the internal notes about this person.

**Outputs**

- `status` (text): Status of the action execution ("success" on success).
- `user` (object)
- `user_id` (number)

**Example output**

```json
{
  "status": "success",
  "user": {
    "email": "sam@example.com",
    "id": 67890,
    "name": "Sam Rivera"
  },
  "user_id": 67890
}
```
