Overview
Retrieve comprehensive information about a specific contact, including their profile data, active ticket, last closed ticket, and custom metadata. This endpoint is essential for getting the complete context of a contact’s current state and interaction history.Use Cases
- Contact Profile Display: Show detailed contact information in your CRM or dashboard
- Ticket Management: Access current and historical ticket data for support workflows
- Custom Data Integration: Retrieve custom metadata fields for personalized experiences
- Contact Status Tracking: Monitor contact engagement status and last interaction
- Support Agent Context: Provide agents with full contact history before responding
Authentication
This endpoint requires authentication using an API key. Include your API key in the request header:Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
aiContactId | string (UUID) | Yes | Unique identifier of the contact to retrieve |
Response Structure
The endpoint returns a contact object with the following structure:Contact Object
Field | Type | Description |
---|---|---|
id | string (UUID) | Unique identifier for the contact |
name | string | Contact’s full name |
email | string | null | Contact’s email address |
phone | string | null | Contact’s phone number |
platform | string | Communication channel (e.g., “whatsapp”, “instagram”, “webchat”) |
created_at | string (ISO) | Timestamp when the contact was created |
last_message_at | string (ISO) | Timestamp of the last message sent or received |
last_message_content | string | null | Content of the last message |
chat_status | string | Current chat status (e.g., “UNATTENDED”, “ATTENDED”, “CLOSED”) |
is_chat_read | boolean | Whether the chat has been read by an agent |
blocked | boolean | Whether the contact is blocked |
client_id | string (UUID) | ID of the client/owner account |
ai_customer_id | string (UUID) | Associated customer profile ID |
default_stage_id | string | null | ID of the contact’s current pipeline stage |
active_ticket_v2_id | string | null | ID of the currently active ticket |
last_closed_ticket_v2_id | string | null | ID of the most recently closed ticket |
current_integration_data | object | null | Integration-specific data (e.g., CRM sync info) |
metadata | object | Custom key-value pairs for additional contact data |
active_ticket | object | null | Details of the currently active ticket |
last_closed_ticket | object | null | Details of the last closed ticket |
Active Ticket Object
When a contact has an active ticket, theactive_ticket
field contains:
Field | Type | Description |
---|---|---|
id | string (UUID) | Unique ticket identifier |
ai_contact_id | string (UUID) | Associated contact ID |
status | string | Ticket status (e.g., “OPEN”, “IN_PROGRESS”) |
created_at | string (ISO) | Ticket creation timestamp |
updated_at | string (ISO) | Last update timestamp |
ticket_summary | string | null | AI-generated or human summary of the ticket |
metadata | object | Custom ticket metadata |
Last Closed Ticket Object
Thelast_closed_ticket
field has the same structure as active_ticket
but represents the most recently closed ticket.
Example Response
Common Use Cases
1. Display Contact Profile in Dashboard
2. Check for Active Tickets
3. Access Custom Metadata
4. Get Last Interaction Info
Chat Status Values
Thechat_status
field can have the following values:
Status | Description |
---|---|
UNATTENDED | New message received, not yet attended by an agent |
ATTENDED | Agent is actively working on the conversation |
CLOSED | Conversation has been closed/resolved |
PENDING | Waiting for customer response or additional information |
Platform Values
Theplatform
field indicates the communication channel:
Platform | Description |
---|---|
whatsapp | WhatsApp (API or QR) |
instagram | Instagram Direct Messages |
webchat | Web chat widget |
tiktok | TikTok Direct Messages |
sms | SMS messages |
messenger | Facebook Messenger |
voice | Voice calls |
Error Responses
Status Code | Description |
---|---|
400 | Bad Request - Invalid contact ID format |
401 | Unauthorized - Invalid or missing API key |
404 | Not Found - Contact does not exist |
500 | Internal Server Error - Something went wrong |
Tips
- Contact ID Format: Always use the UUID format for
aiContactId
- Null Values: Many fields can be
null
- always check before accessing nested properties - Metadata Structure: Custom metadata fields vary by organization - check your specific fields
- Ticket History: Only the last closed ticket is returned, not all historical tickets
- Real-time Data: This endpoint returns current data - for historical conversation data, use the messages endpoint
- Backward Compatibility: The response includes both
active_ticket_v2
andactive_ticket
for compatibility
Headers
API key required to authorize the request
Path Parameters
ID of the AI contact
Response
AI contact info retrieved successfully.