# Freshdesk schema ERD

Table and field reference for the Fivetran Freshdesk connector.

## Table & Field Reference

### group

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| business_hour_id | Long | FK |
| escalate_to | Long | FK |
| auto_ticket_assign | Long |  |
| created_at | Instant |  |
| description | String |  |
| group_type | String |  |
| name | String |  |
| unassigned_for | String |  |
| updated_at | Instant |  |

### company

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| account_tier | String |  |
| created_at | Instant |  |
| description | String |  |
| health_score | String |  |
| industry | String |  |
| name | String |  |
| note | String |  |
| org_company_id | String |  |
| renewal_date | Instant |  |
| updated_at | Instant |  |

### sla_policy

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| active | Boolean |  |
| created_at | Instant |  |
| description | String |  |
| is_default | Boolean |  |
| name | String |  |
| position | Long |  |
| updated_at | Instant |  |

### solution_article

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| language_code | String | PK |
| agent_id | Long | FK |
| category_id | Long | FK |
| folder_id | Long | FK |
| attachments | Json |  |
| cloud_files | Json |  |
| created_at | Instant |  |
| description | String |  |
| description_text | String |  |
| feedback_count | Long |  |
| hierarchy | Json |  |
| hits | Long |  |
| outdated | Boolean |  |
| seo_data | Json |  |
| seo_meta_description | String |  |
| seo_meta_keywords | Json |  |
| seo_meta_title | String |  |
| status | Long |  |
| status_label | String |  |
| suggested | Long |  |
| tags | Json |  |
| thumbs_down | Long |  |
| thumbs_up | Long |  |
| title | String |  |
| type | Long |  |
| updated_at | Instant |  |

### role

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

### advanced_survey

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| description | String |  |
| header_message | String |  |
| language | String |  |
| state | String |  |
| title | String |  |

### company_domain

| Column | Type | Keys |
| --- | --- | --- |
| domain | String | PK |
| company_id | Long | PK, FK |

### ticket_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| company_id | Long | FK |
| email_config_id | Long | FK |
| group_id | Long | FK |
| priority | Long | FK |
| product_id | Long | FK |
| responder_id | Long | FK |
| source | Long | FK |
| status | Long | FK |
| association_type | Int |  |
| created_at | Instant |  |
| deleted | Boolean |  |
| description | String |  |
| description_text | String |  |
| due_by | Instant |  |
| fr_due_by | Instant |  |
| fr_escalated | Boolean |  |
| is_escalated | Boolean |  |
| requester_id | Long |  |
| spam | Boolean |  |
| subject | String |  |
| type | String |  |
| updated_at | Instant |  |
| stats_** |  |  |

### solution_category

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| language_code | String | PK |
| created_at | Instant |  |
| description | String |  |
| name | String |  |
| updated_at | Instant |  |
| visible_in_portals | Json |  |
| icon_** |  |  |

### automation_action

| Column | Type | Keys |
| --- | --- | --- |
| fivetran_id | String | PK |
| automation_id | Long | PK, FK |
| anchor_type | String |  |
| auth_header | Json |  |
| content | Json |  |
| content_layout | Long |  |
| content_type | String |  |
| email_body | String |  |
| email_subject | String |  |
| email_to | String |  |
| field_name | String |  |
| field_type | String |  |
| note_body | String |  |
| notify_agents | Json |  |
| request_type | String |  |
| show_inherit_properties_toggle | Boolean |  |
| thread_body | String |  |
| ticket_body | String |  |
| ticket_subject | String |  |
| url | String |  |
| value | Json |  |

### sla_policy_applicable_to

| Column | Type | Keys |
| --- | --- | --- |
| applicable_to | String | PK |
| value | String | PK |
| sla_policy_id | Long | PK, FK |

### product

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

### sla_policy_escalation_resolution

| Column | Type | Keys |
| --- | --- | --- |
| resolution_level | Long | PK |
| agent_id | Long | PK, FK |
| sla_policy_id | Long | PK, FK |
| escalation_time | Long |  |

### priority_lookup

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| priority | String |  |

### agent

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| available | Boolean |  |
| available_since | Instant |  |
| created_at | Instant |  |
| deactivated | Boolean |  |
| focus_mode | Boolean |  |
| freshchat_agent | Boolean |  |
| occasional | Boolean |  |
| signature | String |  |
| ticket_scope | Long |  |
| type | String |  |
| updated_at | Instant |  |
| contact_** |  |  |

### conversation

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| ticket_id | Long | PK |
| contact_id | Long | FK |
| body | String |  |
| body_text | String |  |
| created_at | Instant |  |
| from_email | String |  |
| incoming | Boolean |  |
| private | Boolean |  |
| source | Long |  |
| support_email | String |  |
| updated_at | Instant |  |

### conversation_cc_email

| Column | Type | Keys |
| --- | --- | --- |
| email | String | PK |
| conversation_id | Long | PK, FK |

### business_hour

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| created_at | Instant |  |
| description | String |  |
| is_default | Boolean |  |
| name | String |  |
| time_zone | String |  |
| updated_at | Instant |  |

### ticket_reply_cc_email

| Column | Type | Keys |
| --- | --- | --- |
| email | String | PK |
| ticket_id | Long | PK |

### survey

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_at | Instant |  |
| title | String |  |
| updated_at | Instant |  |

### automation_performer_member

| Column | Type | Keys |
| --- | --- | --- |
| automation_id | Long | PK, FK |
| member_id | Long | PK, FK |

### sla_policy_escalation_reminder_response

| Column | Type | Keys |
| --- | --- | --- |
| agent_id | Long | PK, FK |
| sla_policy_id | Long | PK, FK |
| escalation_time | Long |  |

### automation_event

| Column | Type | Keys |
| --- | --- | --- |
| fivetran_id | String | PK |
| automation_id | Long | PK, FK |
| field_name | String |  |
| from | String |  |
| related_conditions | Json |  |
| to | String |  |
| to_nested_field | Json |  |
| value | String |  |

### ticket_to_email

| Column | Type | Keys |
| --- | --- | --- |
| email | String | PK |
| ticket_id | Long | PK |

### ticket_field

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| created_at | Instant |  |
| customers_can_edit | Boolean |  |
| customers_can_filter | Boolean |  |
| description | String |  |
| displayed_to_customers | Boolean |  |
| is_default | Boolean |  |
| label | String |  |
| label_for_customers | String |  |
| name | String |  |
| portal_cc | Boolean |  |
| portal_cc_to | String |  |
| position | Long |  |
| required_for_agents | Boolean |  |
| required_for_closure | Boolean |  |
| required_for_customers | Boolean |  |
| type | String |  |
| updated_at | Instant |  |

### discussion_category

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

### sla_policy_escalation_reminder_resolution

| Column | Type | Keys |
| --- | --- | --- |
| agent_id | Long | PK, FK |
| sla_policy_id | Long | PK, FK |
| escalation_time | Long |  |

### source_lookup

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| source | String |  |

### automation_condition

| Column | Type | Keys |
| --- | --- | --- |
| fivetran_id | String | PK |
| automation_id | Long | PK, FK |
| match_type | String |  |
| name | String |  |

### sla_policy_target

| Column | Type | Keys |
| --- | --- | --- |
| priority | Long | PK |
| sla_policy_id | Long | PK, FK |
| business_hours | Boolean |  |
| escalation_enabled | Boolean |  |
| next_respond_within | Long |  |
| resolve_within | Long |  |
| respond_within | Long |  |

### satisfaction_rating_value

| Column | Type | Keys |
| --- | --- | --- |
| satisfaction_rating_id | String | PK, FK |
| survey_question_id | String | PK, FK |
| value | String |  |

### advanced_survey_response

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| agent_id | Long | FK |
| contact_id | Long | FK |
| group_id | Long | FK |
| survey_id | String | FK |
| ticket_id | Long | FK |
| created_at | Instant |  |
| status | String |  |
| survey_version_id | String |  |
| updated_at | Instant |  |

### ticket_tag

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| ticket_id | Long | PK |
| tag | String |  |

### sla_policy_escalation_response

| Column | Type | Keys |
| --- | --- | --- |
| agent_id | Long | PK, FK |
| sla_policy_id | Long | PK, FK |
| escalation_time | Long |  |

### advanced_survey_question

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| survey_id | String | PK, FK |
| deleted | Boolean |  |
| footer_content | String |  |
| header_text | String |  |
| hint_enabled | Boolean |  |
| hint_footer_content | String |  |
| image_url | String |  |
| label | String |  |
| multiline | Boolean |  |
| multiple | Boolean |  |
| question_identifier | String |  |
| required | Boolean |  |
| text | String |  |
| theme | String |  |
| type | String |  |

### satisfaction_rating

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| agent_id | Long | FK |
| contact_id | Long | FK |
| group_id | Long | FK |
| survey_id | String | FK |
| created_at | Instant |  |
| feedback | String |  |
| ticket_id | Long |  |
| updated_at | Instant |  |

### discussion_forum

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| discussion_category_id | Long | FK |
| description | String |  |
| forum_type | Long |  |
| forum_visibility | Long |  |
| name | String |  |
| position | Long |  |
| posts_count | Long |  |
| topics_count | Long |  |

### sla_policy_escalation_next_response

| Column | Type | Keys |
| --- | --- | --- |
| agent_id | Long | PK, FK |
| sla_policy_id | Long | PK, FK |
| escalation_time | Long |  |

### automation

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| active | Boolean |  |
| affected_tickets_count | Long |  |
| automation_type | String |  |
| created_at | Instant |  |
| last_updated_by | Long |  |
| name | String |  |
| operator | String |  |
| outdated | Boolean |  |
| performer_type | Long |  |
| position | Long |  |
| summary | Json |  |
| updated_at | Instant |  |

### ticket_cc_email

| Column | Type | Keys |
| --- | --- | --- |
| email | String | PK |
| ticket_id | Long | PK |

### agent_group

| Column | Type | Keys |
| --- | --- | --- |
| agent_id | Long | PK, FK |
| group_id | Long | PK, FK |

### email_config

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| group_id | Long | FK |
| product_id | Long | FK |
| active | Boolean |  |
| created_at | Instant |  |
| name | String |  |
| primary_role | Boolean |  |
| reply_email | String |  |
| to_email | String |  |
| updated_at | Instant |  |

### conversation_bcc_email

| Column | Type | Keys |
| --- | --- | --- |
| email | String | PK |
| conversation_id | Long | PK, FK |

### discussion_comment

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| contact_id | Long | FK |
| discussion_topic_id | Long | FK |
| answer | Boolean |  |
| body | String |  |
| body_text | String |  |
| created_at | Instant |  |
| published | Boolean |  |
| spam | Boolean |  |
| trash | Boolean |  |
| updated_at | Instant |  |

### status_lookup

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| label_for_agents | String |  |
| label_for_customer | String |  |

### survey_question

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| survey_id | String | PK, FK |
| accepted_ratings | Json |  |
| label | String |  |

### solution_folder

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| language_code | String | PK |
| category_id | Long | FK |
| parent_folder_id | Long | FK |
| articles_count | Long |  |
| company_ids | Json |  |
| company_segment_ids | Json |  |
| contact_segment_ids | Json |  |
| created_at | Instant |  |
| description | String |  |
| hierarchy | Json |  |
| icon_url | String |  |
| name | String |  |
| sub_folders_count | Long |  |
| updated_at | Instant |  |
| visibility | Long |  |
| visibility_label | String |  |

### discussion_topic

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| discussion_forum_id | Long | FK |
| created_at | Instant |  |
| hits | Long |  |
| locked | Boolean |  |
| merged_topic_id | Long |  |
| posts_count | Long |  |
| published | Boolean |  |
| replied_at | Instant |  |
| replied_by | Long |  |
| stamp_type | Long |  |
| sticky | Boolean |  |
| title | String |  |
| updated_at | Instant |  |
| user_id | Long |  |
| user_votes | Long |  |

### advanced_survey_answer

| Column | Type | Keys |
| --- | --- | --- |
| question_id | String | PK, FK |
| response_id | String | PK, FK |
| question_text | String |  |
| value | Json |  |

### advanced_survey_question_rating

| Column | Type | Keys |
| --- | --- | --- |
| value | Int | PK |
| question_id | String | PK, FK |
| survey_id | String | PK, FK |
| label | String |  |

### ticket_fwd_email

| Column | Type | Keys |
| --- | --- | --- |
| email | String | PK |
| ticket_id | Long | PK |

### conversation_attachment

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| conversation_id | Long | PK, FK |
| attachment_url | String |  |
| content_type | String |  |
| created_at | Instant |  |
| name | String |  |
| size | Long |  |
| updated_at | Instant |  |

### sla_policy_escalation_reminder_next_response

| Column | Type | Keys |
| --- | --- | --- |
| agent_id | Long | PK, FK |
| sla_policy_id | Long | PK, FK |
| escalation_time | Long |  |

### conversation_to_email

| Column | Type | Keys |
| --- | --- | --- |
| email | String | PK |
| conversation_id | Long | PK, FK |

### agent_role

| Column | Type | Keys |
| --- | --- | --- |
| agent_id | Long | PK, FK |
| role_id | Long | PK, FK |

### time_entries

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| agent_id | Long | FK |
| company_id | Long | FK |
| billable | Boolean |  |
| created_at | Instant |  |
| executed_at | Instant |  |
| note | String |  |
| start_time | Instant |  |
| ticket_id | Long |  |
| time_spent | String |  |
| timer_running | Boolean |  |
| updated_at | Instant |  |

### contact

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| company_id | Long | FK |
| active | Boolean |  |
| address | String |  |
| blocked | Boolean |  |
| created_at | Instant |  |
| csat_rating | String |  |
| description | String |  |
| email | String |  |
| facebook_id | String |  |
| job_title | String |  |
| language | String |  |
| mobile | String |  |
| name | String |  |
| phone | String |  |
| preferred_source | String |  |
| time_zone | String |  |
| twitter_id | String |  |
| unique_external_id | String |  |
| updated_at | Instant |  |

## Relationships

- group(escalate_to) → agent(id)
- group(business_hour_id) → business_hour(id)
- solution_article(agent_id) → agent(id)
- solution_article(category_id) → solution_category(id)
- solution_article(folder_id) → solution_folder(id)
- company_domain(company_id) → company(id)
- ticket_history(email_config_id) → email_config(id)
- ticket_history(group_id) → group(id)
- ticket_history(responder_id) → agent(id)
- ticket_history(product_id) → product(id)
- ticket_history(company_id) → company(id)
- ticket_history(priority) → priority_lookup(id)
- ticket_history(source) → source_lookup(id)
- ticket_history(status) → status_lookup(id)
- automation_action(automation_id) → automation(id)
- sla_policy_applicable_to(sla_policy_id) → sla_policy(id)
- sla_policy_escalation_resolution(agent_id) → agent(id)
- sla_policy_escalation_resolution(sla_policy_id) → sla_policy(id)
- conversation(contact_id) → contact(id)
- conversation_cc_email(conversation_id) → conversation(id)
- automation_performer_member(automation_id) → automation(id)
- automation_performer_member(member_id) → agent(id)
- sla_policy_escalation_reminder_response(agent_id) → agent(id)
- sla_policy_escalation_reminder_response(sla_policy_id) → sla_policy(id)
- automation_event(automation_id) → automation(id)
- sla_policy_escalation_reminder_resolution(agent_id) → agent(id)
- sla_policy_escalation_reminder_resolution(sla_policy_id) → sla_policy(id)
- automation_condition(automation_id) → automation(id)
- sla_policy_target(sla_policy_id) → sla_policy(id)
- satisfaction_rating_value(survey_question_id) → survey_question(id)
- satisfaction_rating_value(satisfaction_rating_id) → satisfaction_rating(id)
- advanced_survey_response(survey_id) → advanced_survey(id)
- advanced_survey_response(agent_id) → agent(id)
- advanced_survey_response(group_id) → group(id)
- advanced_survey_response(ticket_id) → ticket_history(id)
- advanced_survey_response(contact_id) → contact(id)
- sla_policy_escalation_response(agent_id) → agent(id)
- sla_policy_escalation_response(sla_policy_id) → sla_policy(id)
- advanced_survey_question(survey_id) → advanced_survey(id)
- satisfaction_rating(survey_id) → survey(id)
- satisfaction_rating(agent_id) → agent(id)
- satisfaction_rating(group_id) → group(id)
- satisfaction_rating(contact_id) → contact(id)
- discussion_forum(discussion_category_id) → discussion_category(id)
- sla_policy_escalation_next_response(agent_id) → agent(id)
- sla_policy_escalation_next_response(sla_policy_id) → sla_policy(id)
- agent_group(agent_id) → agent(id)
- agent_group(group_id) → group(id)
- email_config(product_id) → product(id)
- email_config(group_id) → group(id)
- conversation_bcc_email(conversation_id) → conversation(id)
- discussion_comment(discussion_topic_id) → discussion_topic(id)
- discussion_comment(contact_id) → contact(id)
- survey_question(survey_id) → survey(id)
- solution_folder(category_id) → solution_category(id)
- solution_folder(parent_folder_id) → solution_folder(id)
- discussion_topic(discussion_forum_id) → discussion_forum(id)
- advanced_survey_answer(response_id) → advanced_survey_response(id)
- advanced_survey_answer(question_id) → advanced_survey_question(id)
- advanced_survey_question_rating(survey_id) → advanced_survey_question(id)
- advanced_survey_question_rating(question_id) → advanced_survey_question(id)
- conversation_attachment(conversation_id) → conversation(id)
- sla_policy_escalation_reminder_next_response(agent_id) → agent(id)
- sla_policy_escalation_reminder_next_response(sla_policy_id) → sla_policy(id)
- conversation_to_email(conversation_id) → conversation(id)
- agent_role(agent_id) → agent(id)
- agent_role(role_id) → role(id)
- time_entries(agent_id) → agent(id)
- time_entries(company_id) → company(id)
- contact(company_id) → company(id)
