@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Intercom API
@base https://api.intercom.io
@version 2.11
@auth Bearer bearer
@common_fields {Intercom-Version: str}
@endpoints 108
@hint download_for_search
@toc me(1), admins(4), articles(6), help_center(7), companies(9), contacts(21), conversations(14), data_attributes(3), events(3), export(3), download(1), messages(1), news(8), notes(1), segments(2), subscription_types(1), phone_call_redirects(1), tags(4), teams(2), ticket_types(6), tickets(7), visitors(3)

@group me
@endpoint GET /me
@returns(200) {type: str, id: str, name: str, email: str, job_title: str, away_mode_enabled: bool, away_mode_reassign: bool, has_inbox_seat: bool, team_ids: [int], avatar: map{type: str, image_url: str(uri)?}, email_verified: bool?, app: map{type: str, id_code: str, name: str, region: str, timezone: str, created_at: int, identity_verification: bool}}

@endgroup

@group admins
@endpoint PUT /admins/{admin_id}/away
@required {admin_id: str, away_mode_enabled: bool=true, away_mode_reassign: bool=false}
@returns(200) {type: str, id: str, name: str, email: str, job_title: str, away_mode_enabled: bool, away_mode_reassign: bool, has_inbox_seat: bool, team_ids: [int], avatar: map?{image_url: str(uri)}, team_priority_level: map{primary_team_ids: [int]?, secondary_team_ids: [int]?}}
@errors {401, 404}

@endpoint GET /admins/activity_logs
@required {created_at_after: str}
@optional {created_at_before: str}
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, activity_logs: [map]}
@errors {401}

@endpoint GET /admins
@returns(200) {type: str, admins: [map]}
@errors {401}

@endpoint GET /admins/{admin_id}
@required {admin_id: str}
@returns(200) {type: str, id: str, name: str, email: str, job_title: str, away_mode_enabled: bool, away_mode_reassign: bool, has_inbox_seat: bool, team_ids: [int], avatar: map?{image_url: str(uri)}, team_priority_level: map{primary_team_ids: [int]?, secondary_team_ids: [int]?}}
@errors {401, 404}

@endgroup

@group articles
@endpoint GET /articles
@optional {page: int, per_page: int}
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int, data: [map]}
@errors {401}

@endpoint POST /articles
@required {title: str, author_id: int}
@optional {description: str, body: str, state: str(published/draft), parent_id: int, parent_type: str, translated_content: map{type: str, ar: map, bg: map, bs: map, ca: map, cs: map, da: map, de: map, el: map, en: map, es: map, et: map, fi: map, fr: map, he: map, hr: map, hu: map, id: map, it: map, ja: map, ko: map, lt: map, lv: map, mn: map, nb: map, nl: map, pl: map, pt: map, ro: map, ru: map, sl: map, sr: map, sv: map, tr: map, vi: map, pt-BR: map, zh-CN: map, zh-TW: map}}
@returns(200) {statistics: map{type: str, views: int, conversions: int, reactions: int, happy_reaction_percentage: num(float), neutral_reaction_percentage: num(float), sad_reaction_percentage: num(float)}}
@errors {400, 401}

@endpoint GET /articles/{article_id}
@required {article_id: str}
@returns(200) {statistics: map{type: str, views: int, conversions: int, reactions: int, happy_reaction_percentage: num(float), neutral_reaction_percentage: num(float), sad_reaction_percentage: num(float)}}
@errors {401, 404}

@endpoint PUT /articles/{article_id}
@required {article_id: str}
@optional {title: str, description: str, body: str, author_id: int, state: str(published/draft), parent_id: str, parent_type: str, translated_content: map{type: str, ar: map, bg: map, bs: map, ca: map, cs: map, da: map, de: map, el: map, en: map, es: map, et: map, fi: map, fr: map, he: map, hr: map, hu: map, id: map, it: map, ja: map, ko: map, lt: map, lv: map, mn: map, nb: map, nl: map, pl: map, pt: map, ro: map, ru: map, sl: map, sr: map, sv: map, tr: map, vi: map, pt-BR: map, zh-CN: map, zh-TW: map}}
@returns(200) {statistics: map{type: str, views: int, conversions: int, reactions: int, happy_reaction_percentage: num(float), neutral_reaction_percentage: num(float), sad_reaction_percentage: num(float)}}
@errors {401, 404}

@endpoint DELETE /articles/{article_id}
@required {article_id: str}
@returns(200) {id: str, object: str, deleted: bool}
@errors {401, 404}

@endpoint GET /articles/search
@optional {phrase: str, state: str, help_center_id: int, highlight: bool}
@returns(200) {type: str, total_count: int, data: map{articles: [map], highlights: [map]}, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}
@errors {401}

@endgroup

@group help_center
@endpoint GET /help_center/collections
@optional {page: int, per_page: int}
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int, data: [map]}
@errors {401}

@endpoint POST /help_center/collections
@required {name: str}
@optional {description: str, translated_content: map{type!: str, ar: map, bg: map, bs: map, ca: map, cs: map, da: map, de: map, el: map, en: map, es: map, et: map, fi: map, fr: map, he: map, hr: map, hu: map, id: map, it: map, ja: map, ko: map, lt: map, lv: map, mn: map, nb: map, nl: map, pl: map, pt: map, ro: map, ru: map, sl: map, sr: map, sv: map, tr: map, vi: map, pt-BR: map, zh-CN: map, zh-TW: map}, parent_id: str, help_center_id: int}
@returns(200) {id: str, workspace_id: str, name: str, description: str?, created_at: int(date-time), updated_at: int(date-time), url: str?, icon: str?, order: int, default_locale: str, translated_content: map{type: str, ar: map{type: str, name: str, description: str}, bg: map{type: str, name: str, description: str}, bs: map{type: str, name: str, description: str}, ca: map{type: str, name: str, description: str}, cs: map{type: str, name: str, description: str}, da: map{type: str, name: str, description: str}, de: map{type: str, name: str, description: str}, el: map{type: str, name: str, description: str}, en: map{type: str, name: str, description: str}, es: map{type: str, name: str, description: str}, et: map{type: str, name: str, description: str}, fi: map{type: str, name: str, description: str}, fr: map{type: str, name: str, description: str}, he: map{type: str, name: str, description: str}, hr: map{type: str, name: str, description: str}, hu: map{type: str, name: str, description: str}, id: map{type: str, name: str, description: str}, it: map{type: str, name: str, description: str}, ja: map{type: str, name: str, description: str}, ko: map{type: str, name: str, description: str}, lt: map{type: str, name: str, description: str}, lv: map{type: str, name: str, description: str}, mn: map{type: str, name: str, description: str}, nb: map{type: str, name: str, description: str}, nl: map{type: str, name: str, description: str}, pl: map{type: str, name: str, description: str}, pt: map{type: str, name: str, description: str}, ro: map{type: str, name: str, description: str}, ru: map{type: str, name: str, description: str}, sl: map{type: str, name: str, description: str}, sr: map{type: str, name: str, description: str}, sv: map{type: str, name: str, description: str}, tr: map{type: str, name: str, description: str}, vi: map{type: str, name: str, description: str}, pt-BR: map{type: str, name: str, description: str}, zh-CN: map{type: str, name: str, description: str}, zh-TW: map{type: str, name: str, description: str}}, parent_id: str?, help_center_id: int?}
@errors {400, 401}

@endpoint GET /help_center/collections/{collection_id}
@required {collection_id: str}
@returns(200) {id: str, workspace_id: str, name: str, description: str?, created_at: int(date-time), updated_at: int(date-time), url: str?, icon: str?, order: int, default_locale: str, translated_content: map{type: str, ar: map{type: str, name: str, description: str}, bg: map{type: str, name: str, description: str}, bs: map{type: str, name: str, description: str}, ca: map{type: str, name: str, description: str}, cs: map{type: str, name: str, description: str}, da: map{type: str, name: str, description: str}, de: map{type: str, name: str, description: str}, el: map{type: str, name: str, description: str}, en: map{type: str, name: str, description: str}, es: map{type: str, name: str, description: str}, et: map{type: str, name: str, description: str}, fi: map{type: str, name: str, description: str}, fr: map{type: str, name: str, description: str}, he: map{type: str, name: str, description: str}, hr: map{type: str, name: str, description: str}, hu: map{type: str, name: str, description: str}, id: map{type: str, name: str, description: str}, it: map{type: str, name: str, description: str}, ja: map{type: str, name: str, description: str}, ko: map{type: str, name: str, description: str}, lt: map{type: str, name: str, description: str}, lv: map{type: str, name: str, description: str}, mn: map{type: str, name: str, description: str}, nb: map{type: str, name: str, description: str}, nl: map{type: str, name: str, description: str}, pl: map{type: str, name: str, description: str}, pt: map{type: str, name: str, description: str}, ro: map{type: str, name: str, description: str}, ru: map{type: str, name: str, description: str}, sl: map{type: str, name: str, description: str}, sr: map{type: str, name: str, description: str}, sv: map{type: str, name: str, description: str}, tr: map{type: str, name: str, description: str}, vi: map{type: str, name: str, description: str}, pt-BR: map{type: str, name: str, description: str}, zh-CN: map{type: str, name: str, description: str}, zh-TW: map{type: str, name: str, description: str}}, parent_id: str?, help_center_id: int?}
@errors {401, 404}

@endpoint PUT /help_center/collections/{collection_id}
@required {collection_id: str}
@optional {name: str, description: str, translated_content: map{type!: str, ar: map, bg: map, bs: map, ca: map, cs: map, da: map, de: map, el: map, en: map, es: map, et: map, fi: map, fr: map, he: map, hr: map, hu: map, id: map, it: map, ja: map, ko: map, lt: map, lv: map, mn: map, nb: map, nl: map, pl: map, pt: map, ro: map, ru: map, sl: map, sr: map, sv: map, tr: map, vi: map, pt-BR: map, zh-CN: map, zh-TW: map}, parent_id: str}
@returns(200) {id: str, workspace_id: str, name: str, description: str?, created_at: int(date-time), updated_at: int(date-time), url: str?, icon: str?, order: int, default_locale: str, translated_content: map{type: str, ar: map{type: str, name: str, description: str}, bg: map{type: str, name: str, description: str}, bs: map{type: str, name: str, description: str}, ca: map{type: str, name: str, description: str}, cs: map{type: str, name: str, description: str}, da: map{type: str, name: str, description: str}, de: map{type: str, name: str, description: str}, el: map{type: str, name: str, description: str}, en: map{type: str, name: str, description: str}, es: map{type: str, name: str, description: str}, et: map{type: str, name: str, description: str}, fi: map{type: str, name: str, description: str}, fr: map{type: str, name: str, description: str}, he: map{type: str, name: str, description: str}, hr: map{type: str, name: str, description: str}, hu: map{type: str, name: str, description: str}, id: map{type: str, name: str, description: str}, it: map{type: str, name: str, description: str}, ja: map{type: str, name: str, description: str}, ko: map{type: str, name: str, description: str}, lt: map{type: str, name: str, description: str}, lv: map{type: str, name: str, description: str}, mn: map{type: str, name: str, description: str}, nb: map{type: str, name: str, description: str}, nl: map{type: str, name: str, description: str}, pl: map{type: str, name: str, description: str}, pt: map{type: str, name: str, description: str}, ro: map{type: str, name: str, description: str}, ru: map{type: str, name: str, description: str}, sl: map{type: str, name: str, description: str}, sr: map{type: str, name: str, description: str}, sv: map{type: str, name: str, description: str}, tr: map{type: str, name: str, description: str}, vi: map{type: str, name: str, description: str}, pt-BR: map{type: str, name: str, description: str}, zh-CN: map{type: str, name: str, description: str}, zh-TW: map{type: str, name: str, description: str}}, parent_id: str?, help_center_id: int?}
@errors {401, 404}

@endpoint DELETE /help_center/collections/{collection_id}
@required {collection_id: str}
@returns(200) {id: str, object: str, deleted: bool}
@errors {401, 404}

@endpoint GET /help_center/help_centers/{help_center_id}
@required {help_center_id: str}
@returns(200) {id: str, workspace_id: str, created_at: int(date-time), updated_at: int(date-time), identifier: str, website_turned_on: bool, display_name: str, url: str, custom_domain: str?}
@errors {401, 404}

@endpoint GET /help_center/help_centers
@optional {page: int, per_page: int}
@returns(200) {type: str, data: [map]}
@errors {401}

@endgroup

@group companies
@endpoint POST /companies
@optional {name: str, company_id: str, plan: str, size: int, website: str, industry: str, custom_attributes: map, remote_created_at: int, monthly_spend: int}
@returns(200) {type: str, id: str, name: str, app_id: str, plan: map{type: str, id: str, name: str}, company_id: str, remote_created_at: int, created_at: int, updated_at: int, last_request_at: int, size: int, website: str, industry: str, monthly_spend: int, session_count: int, user_count: int, custom_attributes: map, tags: map{type: str, tags: [map]}, segments: map{type: str, segments: [map]}}
@errors {400, 401}

@endpoint GET /companies
@optional {name: str, company_id: str, tag_id: str, segment_id: str, page: int, per_page: int}
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int, data: [map]}
@errors {401, 404}

@endpoint GET /companies/{company_id}
@required {company_id: str}
@returns(200) {type: str, id: str, name: str, app_id: str, plan: map{type: str, id: str, name: str}, company_id: str, remote_created_at: int, created_at: int, updated_at: int, last_request_at: int, size: int, website: str, industry: str, monthly_spend: int, session_count: int, user_count: int, custom_attributes: map, tags: map{type: str, tags: [map]}, segments: map{type: str, segments: [map]}}
@errors {401, 404}

@endpoint PUT /companies/{company_id}
@required {company_id: str}
@returns(200) {type: str, id: str, name: str, app_id: str, plan: map{type: str, id: str, name: str}, company_id: str, remote_created_at: int, created_at: int, updated_at: int, last_request_at: int, size: int, website: str, industry: str, monthly_spend: int, session_count: int, user_count: int, custom_attributes: map, tags: map{type: str, tags: [map]}, segments: map{type: str, segments: [map]}}
@errors {401, 404}

@endpoint DELETE /companies/{company_id}
@required {company_id: str}
@returns(200) {id: str, object: str, deleted: bool}
@errors {401, 404}

@endpoint GET /companies/{company_id}/contacts
@required {company_id: str}
@optional {page: int, per_page: int}
@returns(200) {type: str, data: [map], total_count: int, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}
@errors {401, 404}

@endpoint GET /companies/{company_id}/segments
@required {company_id: str}
@returns(200) {type: str, data: [map]}
@errors {401, 404}

@endpoint POST /companies/list
@optional {page: int, per_page: int, order: str}
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int, data: [map]}
@errors {401}

@endpoint GET /companies/scroll
@optional {scroll_param: str}
@returns(200) {type: str, data: [map], pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int?, scroll_param: str}
@errors {401}

@endgroup

@group contacts
@endpoint POST /contacts/{contact_id}/companies
@required {contact_id: str, id: str}
@returns(200) {type: str, id: str, name: str, app_id: str, plan: map{type: str, id: str, name: str}, company_id: str, remote_created_at: int, created_at: int, updated_at: int, last_request_at: int, size: int, website: str, industry: str, monthly_spend: int, session_count: int, user_count: int, custom_attributes: map, tags: map{type: str, tags: [map]}, segments: map{type: str, segments: [map]}}
@errors {400, 401, 404}

@endpoint GET /contacts/{contact_id}/companies
@required {contact_id: str}
@optional {page: int, per_page: int}
@returns(200) {type: str, companies: [map], total_count: int, pages: map{type: str, page: int, next: str(uri)?, per_page: int, total_pages: int}}
@errors {401, 404}

@endpoint DELETE /contacts/{contact_id}/companies/{company_id}
@required {contact_id: str, company_id: str}
@returns(200) {type: str, id: str, name: str, app_id: str, plan: map{type: str, id: str, name: str}, company_id: str, remote_created_at: int, created_at: int, updated_at: int, last_request_at: int, size: int, website: str, industry: str, monthly_spend: int, session_count: int, user_count: int, custom_attributes: map, tags: map{type: str, tags: [map]}, segments: map{type: str, segments: [map]}}
@errors {401, 404}

@endpoint GET /contacts/{contact_id}/notes
@required {contact_id: str}
@optional {page: int, per_page: int}
@returns(200) {type: str, data: [map], total_count: int, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}
@errors {404}

@endpoint POST /contacts/{contact_id}/notes
@required {contact_id: str, body: str}
@optional {admin_id: str}
@returns(200) {type: str, id: str, created_at: int(timestamp), contact: map?{type: str, id: str}, author: map{type: str, id: str, name: str, email: str, job_title: str, away_mode_enabled: bool, away_mode_reassign: bool, has_inbox_seat: bool, team_ids: [int], avatar: map?{image_url: str(uri)}, team_priority_level: map{primary_team_ids: [int]?, secondary_team_ids: [int]?}}, body: str}
@errors {404}

@endpoint GET /contacts/{contact_id}/segments
@required {contact_id: str}
@returns(200) {type: str, data: [map]}
@errors {401, 404}

@endpoint GET /contacts/{contact_id}/subscriptions
@required {contact_id: str}
@returns(200) {type: str, data: [map]}
@errors {401, 404}

@endpoint POST /contacts/{contact_id}/subscriptions
@required {contact_id: str, id: str, consent_type: str}
@returns(200) {type: str, id: str, state: str, default_translation: map{name: str, description: str, locale: str}, translations: [map], consent_type: str, content_types: [str]}
@errors {401, 404}

@endpoint DELETE /contacts/{contact_id}/subscriptions/{subscription_id}
@required {contact_id: str, subscription_id: str}
@returns(200) {type: str, id: str, state: str, default_translation: map{name: str, description: str, locale: str}, translations: [map], consent_type: str, content_types: [str]}
@errors {401, 404}

@endpoint GET /contacts/{contact_id}/tags
@required {contact_id: str}
@returns(200) {type: str, data: [map]}
@errors {401, 404}

@endpoint POST /contacts/{contact_id}/tags
@required {contact_id: str, id: str}
@returns(200) {type: str, id: str, name: str, applied_at: int(date-time)?, applied_by: map?}
@errors {401, 404}

@endpoint DELETE /contacts/{contact_id}/tags/{tag_id}
@required {contact_id: str, tag_id: str}
@returns(200) {type: str, id: str, name: str, applied_at: int(date-time)?, applied_by: map?}
@errors {401, 404}

@endpoint PUT /contacts/{contact_id}
@required {contact_id: str}
@optional {role: str, external_id: str, email: str, phone: str, name: str, avatar: str, signed_up_at: int(date-time), last_seen_at: int(date-time), owner_id: int, unsubscribed_from_emails: bool, custom_attributes: map}
@returns(200) {type: str, id: str, external_id: str?, workspace_id: str, role: str, email: str, email_domain: str, phone: str?, formatted_phone: str?, name: str?, owner_id: int?, has_hard_bounced: bool, marked_email_as_spam: bool, unsubscribed_from_emails: bool, created_at: int(date-time), updated_at: int(date-time), signed_up_at: int(date-time)?, last_seen_at: int(date-time)?, last_replied_at: int(date-time)?, last_contacted_at: int(date-time)?, last_email_opened_at: int(date-time)?, last_email_clicked_at: int(date-time)?, language_override: str?, browser: str?, browser_version: str?, browser_language: str?, os: str?, android_app_name: str?, android_app_version: str?, android_device: str?, android_os_version: str?, android_sdk_version: str?, android_last_seen_at: int(date-time)?, ios_app_name: str?, ios_app_version: str?, ios_device: str?, ios_os_version: str?, ios_sdk_version: str?, ios_last_seen_at: int(date-time)?, custom_attributes: map, avatar: map?{type: str, image_url: str(uri)?}, tags: map{data: [map], url: str(uri), total_count: int, has_more: bool}, notes: map{data: [map], url: str(uri), total_count: int, has_more: bool}, companies: map{type: str, data: [map], url: str(uri), total_count: int, has_more: bool}, location: map{type: str, country: str?, region: str?, city: str?}, social_profiles: map{data: [map]}}
@errors {401}

@endpoint GET /contacts/{contact_id}
@required {contact_id: str}
@returns(200) {type: str, id: str, external_id: str?, workspace_id: str, role: str, email: str, email_domain: str, phone: str?, formatted_phone: str?, name: str?, owner_id: int?, has_hard_bounced: bool, marked_email_as_spam: bool, unsubscribed_from_emails: bool, created_at: int(date-time), updated_at: int(date-time), signed_up_at: int(date-time)?, last_seen_at: int(date-time)?, last_replied_at: int(date-time)?, last_contacted_at: int(date-time)?, last_email_opened_at: int(date-time)?, last_email_clicked_at: int(date-time)?, language_override: str?, browser: str?, browser_version: str?, browser_language: str?, os: str?, android_app_name: str?, android_app_version: str?, android_device: str?, android_os_version: str?, android_sdk_version: str?, android_last_seen_at: int(date-time)?, ios_app_name: str?, ios_app_version: str?, ios_device: str?, ios_os_version: str?, ios_sdk_version: str?, ios_last_seen_at: int(date-time)?, custom_attributes: map, avatar: map?{type: str, image_url: str(uri)?}, tags: map{data: [map], url: str(uri), total_count: int, has_more: bool}, notes: map{data: [map], url: str(uri), total_count: int, has_more: bool}, companies: map{type: str, data: [map], url: str(uri), total_count: int, has_more: bool}, location: map{type: str, country: str?, region: str?, city: str?}, social_profiles: map{data: [map]}}
@errors {401}

@endpoint DELETE /contacts/{contact_id}
@required {contact_id: str}
@returns(200) {type: str, id: str, external_id: str?, deleted: bool}
@errors {401}

@endpoint POST /contacts/merge
@required {from: str, into: str}
@returns(200) {type: str, id: str, external_id: str?, workspace_id: str, role: str, email: str, email_domain: str, phone: str?, formatted_phone: str?, name: str?, owner_id: int?, has_hard_bounced: bool, marked_email_as_spam: bool, unsubscribed_from_emails: bool, created_at: int(date-time), updated_at: int(date-time), signed_up_at: int(date-time)?, last_seen_at: int(date-time)?, last_replied_at: int(date-time)?, last_contacted_at: int(date-time)?, last_email_opened_at: int(date-time)?, last_email_clicked_at: int(date-time)?, language_override: str?, browser: str?, browser_version: str?, browser_language: str?, os: str?, android_app_name: str?, android_app_version: str?, android_device: str?, android_os_version: str?, android_sdk_version: str?, android_last_seen_at: int(date-time)?, ios_app_name: str?, ios_app_version: str?, ios_device: str?, ios_os_version: str?, ios_sdk_version: str?, ios_last_seen_at: int(date-time)?, custom_attributes: map, avatar: map?{type: str, image_url: str(uri)?}, tags: map{data: [map], url: str(uri), total_count: int, has_more: bool}, notes: map{data: [map], url: str(uri), total_count: int, has_more: bool}, companies: map{type: str, data: [map], url: str(uri), total_count: int, has_more: bool}, location: map{type: str, country: str?, region: str?, city: str?}, social_profiles: map{data: [map]}}
@errors {401}

@endpoint POST /contacts/search
@required {query: any}
@optional {pagination: map{per_page!: int, starting_after: str}}
@returns(200) {type: str, data: [map], total_count: int, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}
@errors {401}

@endpoint GET /contacts
@optional {page: int, per_page: int, starting_after: str}
@returns(200) {type: str, data: [map], total_count: int, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}
@errors {401}

@endpoint POST /contacts
@optional {role: str, external_id: str, email: str, phone: str, name: str, avatar: str, signed_up_at: int(date-time), last_seen_at: int(date-time), owner_id: int, unsubscribed_from_emails: bool, custom_attributes: map}
@returns(200) {type: str, id: str, external_id: str?, workspace_id: str, role: str, email: str, email_domain: str, phone: str?, formatted_phone: str?, name: str?, owner_id: int?, has_hard_bounced: bool, marked_email_as_spam: bool, unsubscribed_from_emails: bool, created_at: int(date-time), updated_at: int(date-time), signed_up_at: int(date-time)?, last_seen_at: int(date-time)?, last_replied_at: int(date-time)?, last_contacted_at: int(date-time)?, last_email_opened_at: int(date-time)?, last_email_clicked_at: int(date-time)?, language_override: str?, browser: str?, browser_version: str?, browser_language: str?, os: str?, android_app_name: str?, android_app_version: str?, android_device: str?, android_os_version: str?, android_sdk_version: str?, android_last_seen_at: int(date-time)?, ios_app_name: str?, ios_app_version: str?, ios_device: str?, ios_os_version: str?, ios_sdk_version: str?, ios_last_seen_at: int(date-time)?, custom_attributes: map, avatar: map?{type: str, image_url: str(uri)?}, tags: map{data: [map], url: str(uri), total_count: int, has_more: bool}, notes: map{data: [map], url: str(uri), total_count: int, has_more: bool}, companies: map{type: str, data: [map], url: str(uri), total_count: int, has_more: bool}, location: map{type: str, country: str?, region: str?, city: str?}, social_profiles: map{data: [map]}}
@errors {401}

@endpoint POST /contacts/{contact_id}/archive
@required {contact_id: str}
@returns(200) {type: str, id: str, external_id: str?, archived: bool}

@endpoint POST /contacts/{contact_id}/unarchive
@required {contact_id: str}
@returns(200) {type: str, id: str, external_id: str?, archived: bool}

@endgroup

@group conversations
@endpoint POST /conversations/{conversation_id}/tags
@required {conversation_id: str, id: str, admin_id: str}
@returns(200) {type: str, id: str, name: str, applied_at: int(date-time)?, applied_by: map?}
@errors {401, 404}

@endpoint DELETE /conversations/{conversation_id}/tags/{tag_id}
@required {conversation_id: str, tag_id: str, admin_id: str}
@returns(200) {type: str, id: str, name: str, applied_at: int(date-time)?, applied_by: map?}
@errors {401, 404}

@endpoint GET /conversations
@optional {per_page: int=20, starting_after: str}
@returns(200) {type: str, conversations: [map], total_count: int, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}
@errors {401, 403}

@endpoint POST /conversations
@required {from: map{type!: str, id!: str(uuid)}, body: str}
@optional {attachment_urls: [str(uri)], created_at: int(date-time)}
@returns(200)
@errors {401, 403, 404}

@endpoint GET /conversations/{conversation_id}
@required {conversation_id: str}
@optional {display_as: str}
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 403, 404}

@endpoint PUT /conversations/{conversation_id}
@required {conversation_id: str}
@optional {display_as: str, read: bool, custom_attributes: any}
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 403, 404}

@endpoint POST /conversations/search
@required {query: any}
@optional {pagination: map{per_page!: int, starting_after: str}}
@returns(200) {type: str, conversations: [map], total_count: int, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}

@endpoint POST /conversations/{conversation_id}/reply
@required {conversation_id: str}
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 403, 404}

@endpoint POST /conversations/{conversation_id}/parts
@required {conversation_id: str}
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 403, 404}

@endpoint POST /conversations/{conversation_id}/run_assignment_rules
@required {conversation_id: str}
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 403, 404}

@endpoint POST /conversations/{conversation_id}/customers
@required {conversation_id: str}
@optional {admin_id: str, customer: map}
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 403, 404}

@endpoint DELETE /conversations/{conversation_id}/customers/{contact_id}
@required {conversation_id: str, contact_id: str, admin_id: str}
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 403, 404, 422}

@endpoint POST /conversations/redact
@returns(200) {type: str, id: str, title: str?, created_at: int(date-time), updated_at: int(date-time), waiting_since: int(date-time)?, snoozed_until: int(date-time)?, open: bool, state: str, read: bool, priority: str, admin_assignee_id: int?, team_assignee_id: str?, tags: map{type: str, tags: [map]}, conversation_rating: map{rating: int, remark: str, created_at: int(date-time), contact: map{type: str, id: str, external_id: str?}, teammate: map{type: str, id: str?}}, source: map{type: str, id: str, delivered_as: str, subject: str, body: str, author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], url: str?, redacted: bool}, contacts: map{type: str, contacts: [map]}, teammates: map{type: str, teammates: [map]}, custom_attributes: any, first_contact_reply: map{created_at: int(date-time), type: str, url: str?}, sla_applied: map{type: str, sla_name: str, sla_status: str}, statistics: map{type: str, time_to_assignment: int, time_to_admin_reply: int, time_to_first_close: int, time_to_last_close: int, median_time_to_reply: int, first_contact_reply_at: int(date-time), first_assignment_at: int(date-time), first_admin_reply_at: int(date-time), first_close_at: int(date-time), last_assignment_at: int(date-time), last_assignment_admin_reply_at: int(date-time), last_contact_reply_at: int(date-time), last_admin_reply_at: int(date-time), last_close_at: int(date-time), last_closed_by_id: str, count_reopens: int, count_assignments: int, count_conversation_parts: int}, conversation_parts: map{type: str, conversation_parts: [map], total_count: int}, linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ai_agent_participated: bool, ai_agent: map{source_type: str?, source_title: str?, last_answer_type: str?, resolution_state: str?, rating: int?, rating_remark: str?, content_sources: any}}
@errors {401, 404}

@endpoint POST /conversations/{conversation_id}/convert
@required {conversation_id: str, ticket_type_id: str}
@optional {attributes: map}
@returns(200) {type: str, id: str, ticket_id: str, category: str, ticket_attributes: map, ticket_state: str, ticket_type: map{type: str, id: str, category: str, name: str, description: str, icon: str, workspace_id: str, ticket_type_attributes: map{type: str, ticket_type_attributes: [map]}, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}, contacts: map{type: str, contacts: [map]}, admin_assignee_id: str, team_assignee_id: str, created_at: int(date-time), updated_at: int(date-time), open: bool, snoozed_until: int(date-time), linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ticket_parts: map{type: str, ticket_parts: [map], total_count: int}, is_shared: bool, ticket_state_internal_label: str, ticket_state_external_label: str}
@errors {400}

@endgroup

@group data_attributes
@endpoint GET /data_attributes
@optional {model: str(contact/company/conversation), include_archived: bool}
@returns(200) {type: str, data: [map]}
@errors {401}

@endpoint POST /data_attributes
@required {name: str, model: str(contact/company), data_type: str(string/integer/float/boolean/datetime/date)}
@optional {description: str, options: [str], messenger_writable: bool}
@returns(200) {type: str, id: int, model: str, name: str, full_name: str, label: str, description: str, data_type: str, options: [str], api_writable: bool, messenger_writable: bool, ui_writable: bool, custom: bool, archived: bool, created_at: int(date-time), updated_at: int(date-time), admin_id: str}
@errors {400, 401}

@endpoint PUT /data_attributes/{data_attribute_id}
@required {data_attribute_id: str}
@optional {archived: bool, description: str, options: [map{value!: str}], messenger_writable: bool}
@returns(200) {type: str, id: int, model: str, name: str, full_name: str, label: str, description: str, data_type: str, options: [str], api_writable: bool, messenger_writable: bool, ui_writable: bool, custom: bool, archived: bool, created_at: int(date-time), updated_at: int(date-time), admin_id: str}
@errors {400, 401, 404, 422}

@endgroup

@group events
@endpoint POST /events
@optional {event_name: str, created_at: int(date-time), user_id: str, id: str, email: str, metadata: map}
@returns(202)
@errors {401}

@endpoint GET /events
@required {filter: map, type: str}
@optional {summary: bool, per_page: int}
@returns(200) {type: str, email: str, intercom_user_id: str, user_id: str, events: [map]}
@errors {401}

@endpoint POST /events/summaries
@optional {user_id: str, event_summaries: map{event_name: str, count: int, first: int(date-time), last: int(date-time)}}
@returns(200)
@errors {401}

@endgroup

@group export
@endpoint POST /export/content/data
@required {created_at_after: int, created_at_before: int}
@returns(200) {job_identifier: str, status: str, download_expires_at: str, download_url: str}

@endpoint GET /export/content/data/{job_identifier}
@required {job_identifier: str}
@returns(200) {job_identifier: str, status: str, download_expires_at: str, download_url: str}

@endpoint POST /export/cancel/{job_identifier}
@required {job_identifier: str}
@returns(200) {job_identifier: str, status: str, download_expires_at: str, download_url: str}

@endgroup

@group download
@endpoint GET /download/content/data/{job_identifier}
@required {job_identifier: str}
@returns(200)

@endgroup

@group messages
@endpoint POST /messages
@optional {message_type: str(in_app/email), subject: str, body: str, template: str, from: map{type!: str, id!: int}, to: map{type!: str, id!: str}, created_at: int, create_conversation_without_contact_reply: bool=false}
@returns(200) {type: str, id: str, created_at: int(date-time), subject: str, body: str, message_type: str, conversation_id: str}
@errors {400, 401, 403, 422}

@endgroup

@group news
@endpoint GET /news/news_items
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int, data: [map]}
@errors {401}

@endpoint POST /news/news_items
@required {title: str, sender_id: int}
@optional {body: str, state: str(draft/live), deliver_silently: bool, labels: [str], reactions: [str], newsfeed_assignments: [map{newsfeed_id!: int, published_at!: int(timestamp)}]}
@returns(200) {type: str, id: str, workspace_id: str, title: str, body: str, sender_id: int, state: str, newsfeed_assignments: [map], labels: [str], cover_image_url: str(uri)?, reactions: [str], deliver_silently: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401}

@endpoint GET /news/news_items/{news_item_id}
@required {news_item_id: str}
@returns(200) {type: str, id: str, workspace_id: str, title: str, body: str, sender_id: int, state: str, newsfeed_assignments: [map], labels: [str], cover_image_url: str(uri)?, reactions: [str], deliver_silently: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401, 404}

@endpoint PUT /news/news_items/{news_item_id}
@required {news_item_id: str, title: str, sender_id: int}
@optional {body: str, state: str(draft/live), deliver_silently: bool, labels: [str], reactions: [str], newsfeed_assignments: [map{newsfeed_id!: int, published_at!: int(timestamp)}]}
@returns(200) {type: str, id: str, workspace_id: str, title: str, body: str, sender_id: int, state: str, newsfeed_assignments: [map], labels: [str], cover_image_url: str(uri)?, reactions: [str], deliver_silently: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401, 404}

@endpoint DELETE /news/news_items/{news_item_id}
@required {news_item_id: str}
@returns(200) {id: str, object: str, deleted: bool}
@errors {401, 404}

@endpoint GET /news/newsfeeds/{newsfeed_id}/items
@required {newsfeed_id: str}
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int, data: [map]}
@errors {401}

@endpoint GET /news/newsfeeds
@returns(200) {type: str, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}, total_count: int, data: [map]}
@errors {401}

@endpoint GET /news/newsfeeds/{newsfeed_id}
@required {newsfeed_id: str}
@returns(200) {id: str, type: str, name: str, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401}

@endgroup

@group notes
@endpoint GET /notes/{note_id}
@required {note_id: str}
@returns(200) {type: str, id: str, created_at: int(timestamp), contact: map?{type: str, id: str}, author: map{type: str, id: str, name: str, email: str, job_title: str, away_mode_enabled: bool, away_mode_reassign: bool, has_inbox_seat: bool, team_ids: [int], avatar: map?{image_url: str(uri)}, team_priority_level: map{primary_team_ids: [int]?, secondary_team_ids: [int]?}}, body: str}
@errors {401, 404}

@endgroup

@group segments
@endpoint GET /segments
@optional {include_count: bool}
@returns(200) {type: str, segments: [map], pages: map}
@errors {401}

@endpoint GET /segments/{segment_id}
@required {segment_id: str}
@returns(200) {type: str, id: str, name: str, created_at: int, updated_at: int, person_type: str, count: int?}
@errors {401, 404}

@endgroup

@group subscription_types
@endpoint GET /subscription_types
@returns(200) {type: str, data: [map]}
@errors {401}

@endgroup

@group phone_call_redirects
@endpoint POST /phone_call_redirects
@required {phone: str}
@optional {custom_attributes: any}
@returns(200) {type: str, phone: str}
@errors {400, 401, 422}

@endgroup

@group tags
@endpoint GET /tags
@returns(200) {type: str, data: [map]}
@errors {401}

@endpoint POST /tags
@returns(200) {type: str, id: str, name: str}
@errors {400, 401, 404}

@endpoint GET /tags/{tag_id}
@required {tag_id: str}
@returns(200) {type: str, id: str, name: str}
@errors {401, 404}

@endpoint DELETE /tags/{tag_id}
@required {tag_id: str}
@returns(200)
@errors {400, 401, 404}

@endgroup

@group teams
@endpoint GET /teams
@returns(200) {type: str, teams: [map]}
@errors {401}

@endpoint GET /teams/{team_id}
@required {team_id: str}
@returns(200) {type: str, id: str, name: str, admin_ids: [int], admin_priority_level: map{primary_admin_ids: [int]?, secondary_admin_ids: [int]?}}
@errors {401, 404}

@endgroup

@group ticket_types
@endpoint POST /ticket_types/{ticket_type_id}/attributes
@required {ticket_type_id: str, name: str, description: str, data_type: str(string/list/integer/decimal/boolean/datetime/files)}
@optional {required_to_create: bool=false, required_to_create_for_contacts: bool=false, visible_on_create: bool=true, visible_to_contacts: bool=true, multiline: bool, list_items: str, allow_multiple_values: bool}
@returns(200) {type: str, id: str, workspace_id: str, name: str, description: str, data_type: str, input_options: map, order: int, required_to_create: bool, required_to_create_for_contacts: bool, visible_on_create: bool, visible_to_contacts: bool, default: bool, ticket_type_id: int, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401}

@endpoint PUT /ticket_types/{ticket_type_id}/attributes/{attribute_id}
@required {ticket_type_id: str, attribute_id: str}
@optional {name: str, description: str, required_to_create: bool=false, required_to_create_for_contacts: bool=false, visible_on_create: bool=true, visible_to_contacts: bool=true, multiline: bool, list_items: str, allow_multiple_values: bool, archived: bool}
@returns(200) {type: str, id: str, workspace_id: str, name: str, description: str, data_type: str, input_options: map, order: int, required_to_create: bool, required_to_create_for_contacts: bool, visible_on_create: bool, visible_to_contacts: bool, default: bool, ticket_type_id: int, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401}

@endpoint GET /ticket_types
@returns(200) {type: str, ticket_types: [map]}
@errors {401}

@endpoint POST /ticket_types
@required {name: str}
@optional {description: str, category: str(Customer/Back-office/Tracker), icon: str=🎟️, is_internal: bool=false}
@returns(200) {type: str, id: str, category: str, name: str, description: str, icon: str, workspace_id: str, ticket_type_attributes: map{type: str, ticket_type_attributes: [map]}, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401}

@endpoint GET /ticket_types/{ticket_type_id}
@required {ticket_type_id: str}
@returns(200) {type: str, id: str, category: str, name: str, description: str, icon: str, workspace_id: str, ticket_type_attributes: map{type: str, ticket_type_attributes: [map]}, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401}

@endpoint PUT /ticket_types/{ticket_type_id}
@required {ticket_type_id: str}
@optional {name: str, description: str, category: str(Customer/Back-office/Tracker), icon: str=🎟️, archived: bool, is_internal: bool=false}
@returns(200) {type: str, id: str, category: str, name: str, description: str, icon: str, workspace_id: str, ticket_type_attributes: map{type: str, ticket_type_attributes: [map]}, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}
@errors {401}

@endgroup

@group tickets
@endpoint POST /tickets/{ticket_id}/reply
@required {ticket_id: str}
@returns(200) {type: str, id: str, part_type: str, body: str?, created_at: int(date-time), updated_at: int(date-time), author: map{type: str, id: str, name: str?, email: str(email)}, attachments: [map], redacted: bool}
@errors {400, 401, 404}

@endpoint POST /tickets/{ticket_id}/tags
@required {ticket_id: str, id: str, admin_id: str}
@returns(200) {type: str, id: str, name: str, applied_at: int(date-time)?, applied_by: map?}
@errors {401, 404}

@endpoint DELETE /tickets/{ticket_id}/tags/{tag_id}
@required {ticket_id: str, tag_id: str, admin_id: str}
@returns(200) {type: str, id: str, name: str, applied_at: int(date-time)?, applied_by: map?}
@errors {401, 404}

@endpoint POST /tickets
@required {ticket_type_id: str, contacts: [map]}
@optional {company_id: str, created_at: int, ticket_attributes: map}
@returns(200) {type: str, id: str, ticket_id: str, category: str, ticket_attributes: map, ticket_state: str, ticket_type: map{type: str, id: str, category: str, name: str, description: str, icon: str, workspace_id: str, ticket_type_attributes: map{type: str, ticket_type_attributes: [map]}, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}, contacts: map{type: str, contacts: [map]}, admin_assignee_id: str, team_assignee_id: str, created_at: int(date-time), updated_at: int(date-time), open: bool, snoozed_until: int(date-time), linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ticket_parts: map{type: str, ticket_parts: [map], total_count: int}, is_shared: bool, ticket_state_internal_label: str, ticket_state_external_label: str}
@errors {401}

@endpoint PUT /tickets/{ticket_id}
@required {ticket_id: str}
@optional {ticket_attributes: map, state: str(in_progress/waiting_on_customer/resolved), open: bool, is_shared: bool, snoozed_until: int(timestamp), assignment: map{admin_id: str, assignee_id: str}}
@returns(200) {type: str, id: str, ticket_id: str, category: str, ticket_attributes: map, ticket_state: str, ticket_type: map{type: str, id: str, category: str, name: str, description: str, icon: str, workspace_id: str, ticket_type_attributes: map{type: str, ticket_type_attributes: [map]}, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}, contacts: map{type: str, contacts: [map]}, admin_assignee_id: str, team_assignee_id: str, created_at: int(date-time), updated_at: int(date-time), open: bool, snoozed_until: int(date-time), linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ticket_parts: map{type: str, ticket_parts: [map], total_count: int}, is_shared: bool, ticket_state_internal_label: str, ticket_state_external_label: str}
@errors {401, 404}

@endpoint GET /tickets/{ticket_id}
@required {ticket_id: str}
@returns(200) {type: str, id: str, ticket_id: str, category: str, ticket_attributes: map, ticket_state: str, ticket_type: map{type: str, id: str, category: str, name: str, description: str, icon: str, workspace_id: str, ticket_type_attributes: map{type: str, ticket_type_attributes: [map]}, archived: bool, created_at: int(timestamp), updated_at: int(timestamp)}, contacts: map{type: str, contacts: [map]}, admin_assignee_id: str, team_assignee_id: str, created_at: int(date-time), updated_at: int(date-time), open: bool, snoozed_until: int(date-time), linked_objects: map{type: str, total_count: int, has_more: bool, data: [map]}, ticket_parts: map{type: str, ticket_parts: [map], total_count: int}, is_shared: bool, ticket_state_internal_label: str, ticket_state_external_label: str}
@errors {401}

@endpoint POST /tickets/search
@required {query: any}
@optional {pagination: map{per_page!: int, starting_after: str}}
@returns(200) {type: str, tickets: [map], total_count: int, pages: map{type: str, page: int, next: map{per_page: int, starting_after: str?}, per_page: int, total_pages: int}}

@endgroup

@group visitors
@endpoint PUT /visitors
@optional {id: str, user_id: str, name: str, custom_attributes: map}
@returns(200) {type: str, id: str, user_id: str, anonymous: bool, email: str(email), phone: str?, name: str?, pseudonym: str?, avatar: map{type: str, image_url: str(uri)?}, app_id: str, companies: map{type: str, companies: [map]}, location_data: map{type: str, city_name: str, continent_code: str, country_code: str, country_name: str, postal_code: str, region_name: str, timezone: str}, las_request_at: int, created_at: int, remote_created_at: int, signed_up_at: int, updated_at: int, session_count: int, social_profiles: map{type: str, social_profiles: [str]}, owner_id: str?, unsubscribed_from_emails: bool, marked_email_as_spam: bool, has_hard_bounced: bool, tags: map{type: str, tags: [any]}, segments: map{type: str, segments: [str]}, custom_attributes: map, referrer: str?, utm_campaign: str?, utm_content: str?, utm_medium: str?, utm_source: str?, utm_term: str?, do_not_track: bool?}
@errors {401, 404}

@endpoint GET /visitors
@required {user_id: str}
@returns(200) {type: str, id: str, user_id: str, anonymous: bool, email: str(email), phone: str?, name: str?, pseudonym: str?, avatar: map{type: str, image_url: str(uri)?}, app_id: str, companies: map{type: str, companies: [map]}, location_data: map{type: str, city_name: str, continent_code: str, country_code: str, country_name: str, postal_code: str, region_name: str, timezone: str}, las_request_at: int, created_at: int, remote_created_at: int, signed_up_at: int, updated_at: int, session_count: int, social_profiles: map{type: str, social_profiles: [str]}, owner_id: str?, unsubscribed_from_emails: bool, marked_email_as_spam: bool, has_hard_bounced: bool, tags: map{type: str, tags: [any]}, segments: map{type: str, segments: [str]}, custom_attributes: map, referrer: str?, utm_campaign: str?, utm_content: str?, utm_medium: str?, utm_source: str?, utm_term: str?, do_not_track: bool?}
@errors {401, 404}

@endpoint POST /visitors/convert
@required {type: str, user: map{id: str, user_id: str, email: str}, visitor: map{id: str, user_id: str, email: str}}
@returns(200) {type: str, id: str, external_id: str?, workspace_id: str, role: str, email: str, email_domain: str, phone: str?, formatted_phone: str?, name: str?, owner_id: int?, has_hard_bounced: bool, marked_email_as_spam: bool, unsubscribed_from_emails: bool, created_at: int(date-time), updated_at: int(date-time), signed_up_at: int(date-time)?, last_seen_at: int(date-time)?, last_replied_at: int(date-time)?, last_contacted_at: int(date-time)?, last_email_opened_at: int(date-time)?, last_email_clicked_at: int(date-time)?, language_override: str?, browser: str?, browser_version: str?, browser_language: str?, os: str?, android_app_name: str?, android_app_version: str?, android_device: str?, android_os_version: str?, android_sdk_version: str?, android_last_seen_at: int(date-time)?, ios_app_name: str?, ios_app_version: str?, ios_device: str?, ios_os_version: str?, ios_sdk_version: str?, ios_last_seen_at: int(date-time)?, custom_attributes: map, avatar: map?{type: str, image_url: str(uri)?}, tags: map{data: [map], url: str(uri), total_count: int, has_more: bool}, notes: map{data: [map], url: str(uri), total_count: int, has_more: bool}, companies: map{type: str, data: [map], url: str(uri), total_count: int, has_more: bool}, location: map{type: str, country: str?, region: str?, city: str?}, social_profiles: map{data: [map]}}
@errors {401}

@endgroup

@end
