# Integration Specifications

## Integration Overview

The Daasity Zendesk integration allows merchants to glean broad and deep insights into Zendesk support tickets, including ticket tags and comments as well as response and resolution times. Untransformed Zendesk data gathered through the extractor is then joined together in a stand-alone model that gives merchants the ability to explore data related to tickets, users, tags, etc. That model is then used to populate the out-of-the-box Zendesk dashboard.&#x20;

This document provides context on what kind of data is being gathered through this extractor, which endpoints that data is coming from, and how the extracted tables relate to each other.&#x20;

## **Integration Availability**

This integration is available for:

* Enterprise

## API Endpoints

The Daasity Zendesk extractor is built based on this [Zendesk API documentation](https://developer.zendesk.com/api-reference/).  The following endpoints are used by Daasity to replicate data from Zendesk:

* [Tickets](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/)
* [Ticket Comments](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/)
* [Ticket Fields](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/)
* [Ticket Tags](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/)
* [Ticket Metrics](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_metrics/)
* [Users](https://developer.zendesk.com/api-reference/ticketing/users/users/)
* [Organizations](https://developer.zendesk.com/api-reference/ticketing/organizations/organizations/)
* [Brands](https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/)

## Entity Relationship Diagram (ERD)

[Click here to view the ERD for the Daasity Zendesk integration](https://lucid.app/documents/embedded/5dc6be33-1d83-4642-a008-e825e336128a) illustrating the different tables and keys to join across tables.

## Zendesk Schema

The Daasity Zendesk extractor creates these tables using the endpoints and replication methods listed.  The data is mapped from source API endpoint to the table based on the mapping logic outlined in each table.

* [Tickets](#tickets)
* [Ticket Comments](#ticket-comments)
* [Ticket Custom Fields](#ticket-custom-fields)
* [Ticket Tags](#ticket-tags)
* [Ticket Metrics](#ticket-metrics)
* [Users](#users)
* [Organizations](#organizations)
* [Organization Domain Names](#organization-domain-names)
* [Brands](#brands)

### **Tickets**

* Endpoint: [Tickets](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/)
* Update Method: UPSERT
* Table Name: \[`zendesk.tickets`]

| JSON Element                           | Database Column               |
| -------------------------------------- | ----------------------------- |
| id                                     | id                            |
| external\_id                           | external\_id                  |
| type                                   | type                          |
| subject                                | subject                       |
| priority                               | priority                      |
| status                                 | status                        |
| recipient                              | recipient                     |
| requester\_id                          | requester\_id                 |
| submitter\_id                          | submitter\_id                 |
| assignee\_id                           | assignee\_id                  |
| organization\_id                       | organization\_id              |
| due\_at                                | due\_at                       |
| satisfaction\_rating::score            | satisfaction\_rating\_score   |
| via::channel                           | via\_channel                  |
| via::source::from::address             | via\_source\_address          |
| via::source::from::formatted\_phone    | via\_source\_phone            |
| via::source::From::name                | via\_source\_name\_from       |
| via::source::from::profile\_url        | via\_source\_profile\_url     |
| satisfaction\_rating::comment          | satisfaction\_rating\_comment |
| brand\_id                              | brand\_id                     |
| created\_at                            | created\_at                   |
| updated\_at                            | updated\_at                   |
| Daasity: unique id for the account     | account\_id                   |
| Daasity: timestamp when loaded into DB | \_synced\_at                  |

### **Ticket Comments**

* Endpoint: [Ticket Comments](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/)
* Update Method: UPSERT
* Table Name: \[`zendesk.ticket_comments`]

| JSON Element                           | Database Column                   |
| -------------------------------------- | --------------------------------- |
| ticket\_id                             | ticket\_id                        |
| ticket\_id::id                         | ticket\_comment\_id               |
| comment::type                          | type                              |
| comment::author\_id                    | author\_id                        |
| comment::plain\_body::body             | body                              |
| comment::via::channel                  | channel                           |
| comment::data::location                | voice\_location                   |
| comment::data::transcription\_text     | voice\_transcription\_text        |
| comment::data::answered\_by\_id        | voice\_answered\_by\_id           |
| comment::via::source::rel              | via\_source\_rel                  |
| comment::via::source::from::phone      | via\_source\_from\_phone          |
| comment::via::source::from::name       | via\_source\_from\_name           |
| comment::via::source::from::address    | via\_source\_from\_email\_address |
| comment::via::source::to::phone        | via\_source\_to\_phone            |
| comment::via::source::to::name         | via\_source\_to\_name             |
| comment::via::source::to::address      | via\_source\_to\_email\_address   |
| comment::metadata::system::location    | location                          |
| comment::metadata::system::latitude    | latitude                          |
| comment::metadata::system::longitude   | longitude                         |
| comment::metadata::system::client      | web\_client                       |
| comment::metadata::system::ip\_address | web\_ip\_address                  |
| comment::created\_at                   | created\_at                       |
| MD5(ticket\_id + ':' + id)             | key                               |
| Daasity: unique id for the account     | \_account\_id                     |
| Daasity: timestamp when loaded into DB | \_\_synced\_at                    |

### **Ticket Custom Fields**

* Endpoint: [Ticket Fields](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/)
* Update Method: UPSERT
* Table Name: \[`zendesk.ticket_custom_fields`]

| JSON Element                           | Database Column |
| -------------------------------------- | --------------- |
| MD5(ticket\_id +  ':' + id)            | key             |
| ticket\_id                             | ticket\_id      |
| id                                     | id              |
| value                                  | value           |
| Daasity: unique id for the account     | account\_id     |
| Daasity: timestamp when loaded into DB | \_synced\_at    |

### **Ticket Tags**

* Endpoint: [Ticket Tags](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/)
* Update Method: UPSERT
* Table Name: \[`zendesk.ticket_tags`]

| JSON Element                           | Database Column |
| -------------------------------------- | --------------- |
| MD5(ticket\_id +  ':' + t)             | key             |
| ticket\_id                             | ticket\_id      |
| t                                      | tag\_name       |
| Daasity: unique id for the account     | account\_id     |
| Daasity: timestamp when loaded into DB | \_synced\_at    |

### **Ticket Metrics**

* Endpoint: [Tickets Metrics](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_metrics/)
* Update Method: UPSERT
* Table Name: \[`zendesk.ticket_metrics`]

| JSON Element                                   | Database Column                                  |
| ---------------------------------------------- | ------------------------------------------------ |
| MD5(ticket\_id +  ':' + id)                    | key                                              |
| ticket\_metric\_id                             | id                                               |
| ticket\_id                                     | ticket\_id                                       |
| reopens                                        | reopens                                          |
| replies                                        | replies                                          |
| assignee\_updated\_at                          | assignee\_updated\_at                            |
| requester\_updated\_at                         | requester\_updated\_at                           |
| status\_updated\_at                            | status\_updated\_at                              |
| initially\_assigned\_at                        | initially\_assigned\_at                          |
| assigned\_at                                   | assigned\_at                                     |
| solved\_at                                     | solved\_at                                       |
| latest\_comment\_added\_at                     | latest\_comment\_added\_at                       |
| reply\_time\_in\_minutes::calendar             | reply\_time\_in\_minutes\_\_calendar             |
| reply\_time\_in\_minutes::business             | reply\_time\_in\_minutes\_\_business             |
| first\_resolution\_time\_in\_minutes::calendar | first\_resolution\_time\_in\_minutes\_\_calendar |
| first\_resolution\_time\_in\_minutes::business | first\_resolution\_time\_in\_minutes\_\_business |
| full\_resolution\_time\_in\_minutes::calendar  | full\_resolution\_time\_in\_minutes\_\_calendar  |
| full\_resolution\_time\_in\_minutes::business  | full\_resolution\_time\_in\_minutes\_\_business  |
| agent\_wait\_time\_in\_minutes::calendar       | agent\_wait\_time\_in\_minutes\_\_calendar       |
| agent\_wait\_time\_in\_minutes::business       | agent\_wait\_time\_in\_minutes\_\_business       |
| requester\_wait\_time\_in\_minutes::calendar   | requester\_wait\_time\_in\_minutes\_\_calendar   |
| requester\_wait\_time\_in\_minutes::business   | requester\_wait\_time\_in\_minutes\_\_business   |
| on\_hold\_time\_in\_minutes::calendar          | on\_hold\_time\_in\_minutes\_\_calendar          |
| on\_hold\_time\_in\_minutes::business          | on\_hold\_time\_in\_minutes\_\_business          |
| created\_at                                    | created\_at                                      |
| updated\_at                                    | updated\_at                                      |
| Daasity: unique id for the account             | \_account\_id                                    |
| Daasity: timestamp when loaded into D          | \_\_synced\_at                                   |

### **Users**

* Endpoint: [Users](https://developer.zendesk.com/api-reference/ticketing/users/users/)
* Update Method: UPSERT
* Table Name: \[`zendesk.users`]

| JSON Element                           | Database Column |
| -------------------------------------- | --------------- |
| id                                     | id              |
| name                                   | name            |
| role                                   | role            |
| email                                  | email           |
| phone                                  | phone           |
| time\_zone                             | time\_zone      |
| last\_login\_at                        | last\_login\_at |
| active                                 | active          |
| created\_at                            | created\_at     |
| updated\_at                            | updated\_at     |
| Daasity: unique id for the account     | \_account\_id   |
| Daasity: timestamp when loaded into DB | \_\_synced\_at  |

### **Organizations**

* Endpoint: [Organizations](https://developer.zendesk.com/api-reference/ticketing/organizations/organizations/)
* Update Method: UPSERT
* Table Name: \[`zendesk.organizations`]

| JSON Element                           | Database Column |
| -------------------------------------- | --------------- |
| id                                     | id              |
| external\_id                           | external\_id    |
| name                                   | name            |
| created\_at                            | created\_at     |
| updated\_at                            | updated\_at     |
| Daasity: unique id for the account     | \_account\_id   |
| Daasity: timestamp when loaded into DB | \_\_synced\_at  |

### **Organization Domain Names**

* Endpoint: [Organizations](https://developer.zendesk.com/api-reference/ticketing/organizations/organizations/)
* Update Method: UPSERT
* Table Name: \[`zendesk.organization_domain_names`]

| JSON Element                            | Database Column  |
| --------------------------------------- | ---------------- |
| MD5(organization\_id + ':' + subdomain) | key              |
| organization\_id                        | organization\_id |
| domain\_name                            | domain\_name     |
| Daasity: unique id for the account      | \_account\_id    |
| Daasity: timestamp when loaded into DB  | \_\_synced\_at   |

### **Brands**

* Endpoint: [Brands](https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/)
* Update Method: UPSERT
* Table Name: \[`zendesk.brands`]

| JSON Element                           | Database Column |
| -------------------------------------- | --------------- |
| id                                     | id              |
| name                                   | name            |
| brand\_url                             | brand\_url      |
| active                                 | is\_active      |
| subdomain                              | subdomain       |
| created\_at                            | created\_at     |
| updated\_at                            | updated\_at     |
| Daasity: unique id for the account     | \_account\_id   |
| Daasity: timestamp when loaded into DB | \_\_synced\_at  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.daasity.com/core-concepts/data-integrations/setup-guides/digital-integrations/zendesk/integration-specifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
