# Zendesk Sell schema ERD

Table and field reference for the Fivetran Zendesk Sell connector.

## Table & Field Reference

### lead_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| owner_id | Long | FK |
| source_id | Long | FK |
| unqualified_reason_id | Long | FK |
| created_at | Instant |  |
| description | String |  |
| email | String |  |
| facebook | String |  |
| fax | String |  |
| first_name | String |  |
| industry | String |  |
| last_name | String |  |
| linkedin | String |  |
| mobile | String |  |
| organization_name | String |  |
| phone | String |  |
| skype | String |  |
| status | String |  |
| title | String |  |
| twitter | String |  |
| updated_at | Instant |  |
| website | String |  |
| address_** |  |  |

### text_message_associated_deal

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| text_message_id | Long | PK, FK |
| deal_id | Long | FK |

### note_tag

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| note_id | Long | PK, FK |
| name | String |  |

### product

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| active | Boolean |  |
| cost | Double |  |
| cost_currency | String |  |
| created_at | Instant |  |
| description | String |  |
| max_discount | Long |  |
| max_markup | Long |  |
| name | String |  |
| sku | String |  |
| updated_at | Instant |  |

### product_price

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| product_id | Long | PK, FK |
| amount | Double |  |
| currency | String |  |

### tag

| Column | Type | Keys |
| --- | --- | --- |
| name | String | PK |
| resource_id | Long | PK |
| resource_type | String | PK |

### collaboration

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| collaborator_id | Long |  |
| created_at | Instant |  |
| resource_id | Long |  |
| resource_type | String |  |
| updated_at | Instant |  |

### deal_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| contact_id | Long | FK |
| creator_id | Long | FK |
| last_stage_change_by_id | Long | FK |
| loss_reason_id | Long | FK |
| organization_id | Long | FK |
| owner_id | Long | FK |
| source_id | Long | FK |
| stage_id | Long | FK |
| unqualified_reason_id | Long | FK |
| added_at | Instant |  |
| created_at | Instant |  |
| currency | String |  |
| customized_win_likelihood | Int |  |
| dropbox_email | String |  |
| estimated_close_date | String |  |
| hot | Boolean |  |
| last_activity_at | Instant |  |
| last_stage_change_at | String |  |
| name | String |  |
| updated_at | Instant |  |
| value | String |  |

### visit_outcome

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| created_at | Instant |  |
| name | String |  |
| updated_at | Instant |  |

### call

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| outcome_id | Long | FK |
| user_id | Long | FK |
| created_at | Instant |  |
| duration | Long |  |
| external_id | String |  |
| incoming | Boolean |  |
| made_at | Instant |  |
| missed | Boolean |  |
| phone_number | String |  |
| recording_url | String |  |
| resource_id | Long |  |
| resource_type | String |  |
| summary | String |  |
| updated_at | Instant |  |

### lead_conversion

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| deal_id | Long | FK |
| individual_id | Long | FK |
| lead_id | Long | FK |
| organization_id | Long | FK |
| created_at | Instant |  |

### unqualified_reason

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| created_at | Instant |  |
| name | String |  |
| updated_at | Instant |  |

### associated_contact

| Column | Type | Keys |
| --- | --- | --- |
| contact_id | Long | PK, FK |
| deal_id | Long | PK, FK |
| created_at | Instant |  |
| role | String |  |
| updated_at | Instant |  |

### visit

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| outcome_id | Long | FK |
| created_at | Instant |  |
| rep_location_verification_status | String |  |
| resource_address | String |  |
| resource_id | Long |  |
| resource_type | String |  |
| summary | String |  |
| updated_at | Instant |  |
| visited_at | Instant |  |

### call_associated_deal

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| call_id | Long | PK, FK |
| deal_id | Long | FK |

### sequence_step

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| sequence_id | Long | PK, FK |
| action_properties_email_template_id | Long |  |
| action_properties_is_reply | Boolean |  |
| action_properties_task_content | String |  |
| action_type | String |  |
| delay_from_previous_step | Int |  |
| delay_from_previous_step_unit | String |  |
| position | Int |  |

### task

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| owner_id | Long | FK |
| completed | Boolean |  |
| completed_at | Instant |  |
| content | String |  |
| created_at | Instant |  |
| due_date | Instant |  |
| overdue | Boolean |  |
| remind_at | Instant |  |
| resource_id | Long |  |
| resource_type | String |  |
| updated_at | Instant |  |

### stage

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| pipeline_id | Long | PK, FK |
| active | Boolean |  |
| category | String |  |
| created_at | Instant |  |
| likelihood | Long |  |
| name | String |  |
| position | Long |  |
| updated_at | Instant |  |

### note

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| content | String |  |
| created_at | Instant |  |
| is_important | Boolean |  |
| resource_id | Long |  |
| resource_type | String |  |
| type | String |  |
| updated_at | Instant |  |

### loss_reason

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| created_at | Instant |  |
| name | String |  |
| updated_at | Instant |  |

### user

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| reports_to | Long | FK |
| confirmed | Boolean |  |
| created_at | Instant |  |
| deleted_at | Instant |  |
| email | String |  |
| group_id | Long |  |
| group_name | String |  |
| identity_type | String |  |
| invited | Boolean |  |
| name | String |  |
| phone_number | String |  |
| role | String |  |
| status | String |  |
| team_name | String |  |
| timezone | String |  |
| updated_at | Instant |  |
| zendesk_user_id | String |  |

### line_item

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| order_id | Long | FK |
| product_id | Long | FK |
| created_at | Instant |  |
| currency | String |  |
| description | String |  |
| name | String |  |
| price | Double |  |
| quantity | Long |  |
| sku | String |  |
| updated_at | Instant |  |
| value | Double |  |
| variation | Double |  |

### contact_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| contact_id | Long | FK |
| creator_id | Long | FK |
| owner_id | Long | FK |
| parent_organization_id | Long | FK |
| created_at | Instant |  |
| customer_status | String |  |
| description | String |  |
| email | String |  |
| facebook | String |  |
| fax | String |  |
| first_name | String |  |
| industry | String |  |
| is_organization | Boolean |  |
| last_name | String |  |
| linkedin | String |  |
| mobile | String |  |
| name | String |  |
| phone | String |  |
| prospect_status | String |  |
| skype | String |  |
| title | String |  |
| twitter | String |  |
| updated_at | Instant |  |
| website | String |  |
| address_** |  |  |
| billing_address_** |  |  |
| shipping_address_** |  |  |

### order

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| deal_id | Long | FK |
| created_at | Instant |  |
| discount | Long |  |
| updated_at | Instant |  |

### sequence

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| created_at | Instant |  |
| name | String |  |
| steps_total | Long |  |
| unsubscribe_settings_enabled | Boolean |  |
| unsubscribe_settings_locale | String |  |
| updated_at | Instant |  |

### text_message

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| content | String |  |
| created_at | Instant |  |
| incoming | Boolean |  |
| resource_id | Long |  |
| resource_phone_number | String |  |
| resource_type | String |  |
| sent_at | Instant |  |
| updated_at | Instant |  |
| user_id | Long |  |
| user_phone_number | String |  |

### user_role

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| user_id | Long | PK, FK |
| role | String |  |

### pipeline

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| created_at | Instant |  |
| disabled | Boolean |  |
| name | String |  |
| updated_at | Instant |  |

### document

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| resource_id | Long | PK |
| resource_type | String | PK |
| creator_id | Long | FK |
| content_type | String |  |
| created_at | Instant |  |
| download_url | String |  |
| name | String |  |
| size | Long |  |
| updated_at | Instant |  |

### call_outcome

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| created_at | Instant |  |
| name | String |  |
| updated_at | Instant |  |

### source

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| creator_id | Long | FK |
| created_at | Instant |  |
| name | String |  |
| updated_at | Instant |  |

## Relationships

- lead_history(creator_id) → user(id)
- lead_history(owner_id) → user(id)
- lead_history(source_id) → source(id)
- lead_history(unqualified_reason_id) → unqualified_reason(id)
- text_message_associated_deal(text_message_id) → text_message(id)
- text_message_associated_deal(deal_id) → deal_history(id)
- note_tag(note_id) → note(id)
- product_price(product_id) → product(id)
- collaboration(creator_id) → user(id)
- deal_history(creator_id) → user(id)
- deal_history(owner_id) → user(id)
- deal_history(stage_id) → stage(id)
- deal_history(source_id) → source(id)
- deal_history(loss_reason_id) → loss_reason(id)
- deal_history(unqualified_reason_id) → unqualified_reason(id)
- deal_history(last_stage_change_by_id) → user(id)
- deal_history(contact_id) → contact_history(id)
- deal_history(organization_id) → contact_history(id)
- call(outcome_id) → call_outcome(id)
- call(user_id) → user(id)
- lead_conversion(lead_id) → lead_history(id)
- lead_conversion(individual_id) → contact_history(id)
- lead_conversion(organization_id) → contact_history(id)
- lead_conversion(deal_id) → deal_history(id)
- lead_conversion(creator_id) → user(id)
- unqualified_reason(creator_id) → user(id)
- associated_contact(deal_id) → deal_history(id)
- associated_contact(contact_id) → contact_history(id)
- visit(outcome_id) → visit_outcome(id)
- visit(creator_id) → user(id)
- call_associated_deal(call_id) → call(id)
- call_associated_deal(deal_id) → deal_history(id)
- sequence_step(sequence_id) → sequence(id)
- task(creator_id) → user(id)
- task(owner_id) → user(id)
- stage(pipeline_id) → pipeline(id)
- note(creator_id) → user(id)
- loss_reason(creator_id) → user(id)
- user(reports_to) → user(id)
- line_item(product_id) → product(id)
- line_item(order_id) → order(id)
- contact_history(creator_id) → user(id)
- contact_history(owner_id) → user(id)
- contact_history(contact_id) → contact_history(id)
- contact_history(parent_organization_id) → contact_history(id)
- order(deal_id) → deal_history(id)
- sequence(creator_id) → user(id)
- user_role(user_id) → user(id)
- document(creator_id) → user(id)
- call_outcome(creator_id) → user(id)
- source(creator_id) → user(id)
