Initialize Chat Contact

Create or initialize a new chat contact. This is typically used when a visitor starts a chat.

POST https://developers.chatway.app/api/v1/contacts/initialize

Example request

curl -X POST "https://developers.chatway.app/api/v1/contacts/initialize" \
  -H "X-API-KEY: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "widgetId": "eouqtiupanm6uvglwshy",
    "browser_type": "browser type",
    "operating_system": "operating system",
    "ip": "ip",
    "is_simulator": true,
    "language": "language",
    "name": "John Doe",
    "timezone": "timezone",
    "location": "location",
    "country": "country",
    "country_dialing_code": "country dialing code",
    "email": "[email protected]",
    "preferred_chat_language": "auto-detect",
    "phone": "+1XXXXXXXXXX",
    "marketplace_channel": "marketplace channel",
    "marketplace_origin": "marketplace origin",
    "is_form_auto_submitted": true,
    "message": {
        "urls": [
            "https://example.com/page"
        ],
        "content": "Hello world"
    },
    "page_visited": [
        {
            "page": "page",
            "date": "2026-02-04T10:30:00Z"
        }
    ]
}'

Request body

application/json

Responses

200

application/json

422

Examples

Request body example

{
    "widgetId": "eouqtiupanm6uvglwshy",
    "browser_type": "browser type",
    "operating_system": "operating system",
    "ip": "ip",
    "is_simulator": true,
    "language": "language",
    "name": "John Doe",
    "timezone": "timezone",
    "location": "location",
    "country": "country",
    "country_dialing_code": "country dialing code",
    "email": "[email protected]",
    "preferred_chat_language": "auto-detect",
    "phone": "+1XXXXXXXXXX",
    "marketplace_channel": "marketplace channel",
    "marketplace_origin": "marketplace origin",
    "is_form_auto_submitted": true,
    "message": {
        "urls": [
            "https://example.com/page"
        ],
        "content": "Hello world"
    },
    "page_visited": [
        {
            "page": "page",
            "date": "2026-02-04T10:30:00Z"
        }
    ]
}

Response 200 example

{
    "message": "Conversation not found",
    "data": {
        "type": "chat-contacts",
        "id": "9b0c5fe6-35ad-459d-b6ba-4288191f84f1",
        "attributes": {
            "widget_name": "Main site widget",
            "widget_id": "eouqtiupanm6uvglwshy",
            "team_id": "MOCK_TEAM_ID",
            "name": "John Doe",
            "email": "[email protected]",
            "phone": "+1XXXXXXXXXX",
            "country_dialing_code": "+1",
            "bgcolor": "#007F3E",
            "location": "New York, US",
            "browser_type": "Chrome 143",
            "country_code": "US",
            "country": "United States",
            "country_flag": "country flag",
            "country_emoji": "country emoji",
            "page_visited": [],
            "timezone": "timezone",
            "language": "language",
            "ip": "ip",
            "operating_system": "operating system",
            "online_status": "online",
            "last_active_at": "2026-02-04T10:30:00Z",
            "blocked_at": "blocked at",
            "is_name_updated": false,
            "created_at": "2026-02-04T10:30:00Z",
            "verified_id": "verified id",
            "verified_email": "verified email"
        }
    }
}