Initialize Chat Contact

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.

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"
}'

Request body

application/json

Responses

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.

application/json

422

404

The widget does not exist or does not belong to your team.

application/json

Examples

Request body example

{
    "widgetId": "eouqtiupanm6uvglwshy"
}

Response 201 example

{
    "message": "Contact created.",
    "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": "Green #88170",
            "email": null,
            "phone": null,
            "country_dialing_code": null,
            "bgcolor": "#007F3E",
            "location": null,
            "browser_type": null,
            "country_code": null,
            "country": null,
            "country_flag": null,
            "country_emoji": null,
            "page_visited": [],
            "timezone": null,
            "language": null,
            "ip": null,
            "operating_system": null,
            "online_status": null,
            "last_active_at": null,
            "blocked_at": null,
            "is_name_updated": false,
            "created_at": "2026-02-04T10:30:00Z",
            "verified_id": "",
            "verified_email": ""
        }
    }
}