---
title: "Initialize Chat Contact"
method: POST
path: "/contacts/initialize"
tags: ["Contacts", "ChatContact"]
---

# Initialize Chat Contact

`POST /contacts/initialize`

## Request

- Base URL: `https://developers.chatway.app/api/v1`
- URL: `https://developers.chatway.app/api/v1/contacts/initialize`
- Auth: API key in header `X-API-KEY`

Initialize a visitor contact for a widget. Obtain the widget identifier from data[].id in List Widgets and send it as widgetId. The response returns the contact under data; save `data.id` for later contact operations.

Start with the required widgetId field. The other fields add optional visitor details or context; you do not need to copy every field from the example to initialize a contact. Supply only information your integration has and needs.

## Request body

- object
  - `widgetId` string, required: Widget identifier
  - `browser_type` string, nullable
  - `operating_system` string, nullable
  - `ip` string, nullable
  - `is_simulator` boolean, nullable: Optional boolean used by the Chatway widget. This endpoint validates it but does not store it, so it has no effect on the created contact. Omit it.
  - `language` string, nullable
  - `name` string, nullable
  - `timezone` string, nullable
  - `location` string, nullable
  - `country` string, nullable
  - `country_dialing_code` string, nullable
  - `email` string, email, nullable
  - `preferred_chat_language` 'auto-detect' | 'en' | 'pt' | 'es' | 'de' | 'fr' | 'ja' | 'ru' | 'da' | 'fi' | 'it' | 'tr' | 'zh' | 'ab' | 'ace' | 'ach' | 'af' | 'sq' | 'alz' | 'am' | 'ar' | 'hy' | 'as' | 'awa' | 'ay' | 'az' | 'ban' | 'bm' | 'ba' | 'eu' | 'btx' | 'bts' | 'bbc' | 'be' | 'bem' | 'bn' | 'bew' | 'bho' | 'bik' | 'bs' | 'br' | 'bg' | 'bua' | 'yue' | 'ca' | 'ceb' | 'ny' | 'zh-TW' | 'cv' | 'co' | 'crh' | 'hr' | 'cs' | 'din' | 'dv' | 'doi' | 'dov' | 'nl' | 'dz' | 'eo' | 'et' | 'ee' | 'fj' | 'fil' | 'fr-FR' | 'fr-CA' | 'fy' | 'ff' | 'gaa' | 'gl' | 'ka' | 'el' | 'gn' | 'gu' | 'gv' | 'ht' | 'cnh' | 'ha' | 'haw' | 'he' | 'iw' | 'hi' | 'hmn' | 'hu' | 'hrx' | 'is' | 'ig' | 'ilo' | 'id' | 'ga' | 'jv' | 'jw' | 'kn' | 'pam' | 'kk' | 'km' | 'cgg' | 'rw' | 'ktu' | 'gom' | 'ko' | 'kri' | 'ku' | 'ckb' | 'ky' | 'lo' | 'ltg' | 'la' | 'lv' | 'lij' | 'li' | 'ln' | 'lt' | 'lmo' | 'luo' | 'lb' | 'lg' | 'mk' | 'mai' | 'mak' | 'mg' | 'ms' | 'ms-Arab' | 'ml' | 'mt' | 'mi' | 'mr' | 'mni-Mtei' | 'min' | 'lus' | 'mn' | 'my' | 'nr' | 'new' | 'ne' | 'no' | 'nus' | 'oc' | 'or' | 'om' | 'pag' | 'pap' | 'ps' | 'fa' | 'pl' | 'pt-PT' | 'pt-BR' | 'pa' | 'qu' | 'rom' | 'ro' | 'rn' | 'sm' | 'sg' | 'sa' | 'gd' | 'nso' | 'sr' | 'st' | 'crs' | 'shn' | 'sn' | 'scn' | 'szl' | 'sd' | 'si' | 'sk' | 'sl' | 'so' | 'su' | 'sw' | 'ss' | 'sv' | 'tl' | 'tg' | 'ta' | 'tt' | 'te' | 'tet' | 'th' | 'ti' | 'ts' | 'tn' | 'tk' | 'ak' | 'uk' | 'ur' | 'ug' | 'uz' | 'vi' | 'cy' | 'xh' | 'yi' | 'yo' | 'yua' | 'zu' | 'zh-CN' | 'ak' | 'gom' | 'null', nullable
  - `phone` string, nullable
  - `marketplace_channel` string, nullable
  - `marketplace_origin` string, nullable
  - `is_form_auto_submitted` boolean, nullable: Optional boolean used by the Chatway widget. This endpoint validates it but does not store it, so it has no effect on the created contact. Omit it.
  - `message` object: Optional pre-chat message with referenced page URLs (each URL must be valid)
    - `urls` string[], nullable
    - `content` string, nullable
  - `page_visited` object[], nullable
    - `page` string, nullable
    - `date` string, date-time

## Response `201`

To send a visitor message for the returned contact, call Create Visitor Message with the same widget, the returned ID as contact_id, and your message in content. That endpoint uses widget_id, while this endpoint uses widgetId. Keep this spelling difference when building requests.

- object
  - `message` string, required
  - `data` object, required
    - `type` string, required
    - `id` string, required
    - `attributes` object, required
      - `widget_name` string, nullable, required
      - `widget_id` string, nullable, required
      - `team_id` string, nullable, required
      - `name` string, nullable, required
      - `email` string, nullable, required
      - `phone` string, nullable, required
      - `country_dialing_code` string, nullable, required
      - `bgcolor` string, nullable, required
      - `location` string, nullable, required
      - `browser_type` string, nullable, required
      - `country_code` string, nullable, required
      - `country` string, nullable, required
      - `country_flag` string, nullable, required
      - `country_emoji` string, nullable, required
      - `page_visited` unknown[], required
        - unknown
      - `timezone` string, nullable, required
      - `language` string, nullable, required
      - `ip` string, nullable, required
      - `operating_system` string, nullable, required
      - `online_status` string, nullable, required
      - `last_active_at` string, nullable, required
      - `blocked_at` string, nullable, required
      - `is_name_updated` boolean, required
      - `created_at` string, nullable, required
      - `verified_id` string, nullable, required
      - `verified_email` string, nullable, required

## Other responses

- `404`: The widget does not exist or does not belong to your team.
- `422`: Validation error

---

[API](https://skmtc.dev/chatway/apis/chatway-developer-docs.md) · [All operations](https://skmtc.dev/chatway/apis/chatway-developer-docs/llms.txt) · [OpenAPI document](https://skmtc.dev/chatway/apis/chatway-developer-docs/revisions/ca1a1da291cc?raw)
