GET
/
api
/
public
/
contact
/
{aiContactId}
/
info
Get info of an AI contact
curl --request GET \
  --url https://api.vambe.me/api/public/contact/{aiContactId}/info \
  --header 'x-api-key: <x-api-key>'

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:
x-api-key: your_api_key_here

Path Parameters

ParameterTypeRequiredDescription
aiContactIdstring (UUID)YesUnique identifier of the contact to retrieve

Response Structure

The endpoint returns a contact object with the following structure:

Contact Object

FieldTypeDescription
idstring (UUID)Unique identifier for the contact
namestringContact’s full name
emailstring | nullContact’s email address
phonestring | nullContact’s phone number
platformstringCommunication channel (e.g., “whatsapp”, “instagram”, “webchat”)
created_atstring (ISO)Timestamp when the contact was created
last_message_atstring (ISO)Timestamp of the last message sent or received
last_message_contentstring | nullContent of the last message
chat_statusstringCurrent chat status (e.g., “UNATTENDED”, “ATTENDED”, “CLOSED”)
is_chat_readbooleanWhether the chat has been read by an agent
blockedbooleanWhether the contact is blocked
client_idstring (UUID)ID of the client/owner account
ai_customer_idstring (UUID)Associated customer profile ID
default_stage_idstring | nullID of the contact’s current pipeline stage
active_ticket_v2_idstring | nullID of the currently active ticket
last_closed_ticket_v2_idstring | nullID of the most recently closed ticket
current_integration_dataobject | nullIntegration-specific data (e.g., CRM sync info)
metadataobjectCustom key-value pairs for additional contact data
active_ticketobject | nullDetails of the currently active ticket
last_closed_ticketobject | nullDetails of the last closed ticket

Active Ticket Object

When a contact has an active ticket, the active_ticket field contains:
FieldTypeDescription
idstring (UUID)Unique ticket identifier
ai_contact_idstring (UUID)Associated contact ID
statusstringTicket status (e.g., “OPEN”, “IN_PROGRESS”)
created_atstring (ISO)Ticket creation timestamp
updated_atstring (ISO)Last update timestamp
ticket_summarystring | nullAI-generated or human summary of the ticket
metadataobjectCustom ticket metadata

Last Closed Ticket Object

The last_closed_ticket field has the same structure as active_ticket but represents the most recently closed ticket.

Example Response

{
  "id": "df980fc8-b6db-4820-bf22-2969482d106d",
  "name": "Maria Rodriguez",
  "email": "maria.rodriguez@example.com",
  "phone": "+56912345678",
  "platform": "whatsapp",
  "created_at": "2024-01-15T10:30:00.000Z",
  "last_message_at": "2024-09-30T14:25:33.000Z",
  "last_message_content": "Gracias por tu ayuda!",
  "chat_status": "ATTENDED",
  "is_chat_read": true,
  "blocked": false,
  "client_id": "550e8400-e29b-41d4-a716-446655440000",
  "ai_customer_id": "660e8400-e29b-41d4-a716-446655440001",
  "default_stage_id": "770e8400-e29b-41d4-a716-446655440002",
  "active_ticket_v2_id": "880e8400-e29b-41d4-a716-446655440003",
  "last_closed_ticket_v2_id": "990e8400-e29b-41d4-a716-446655440004",
  "current_integration_data": {
    "crm_id": "12345",
    "last_sync": "2024-09-30T12:00:00.000Z"
  },
  "metadata": {
    "company": "Acme Corp",
    "plan": "Premium",
    "customer_since": "2024-01-15",
    "preferred_language": "es"
  },
  "active_ticket": {
    "id": "880e8400-e29b-41d4-a716-446655440003",
    "ai_contact_id": "df980fc8-b6db-4820-bf22-2969482d106d",
    "status": "IN_PROGRESS",
    "created_at": "2024-09-30T10:00:00.000Z",
    "updated_at": "2024-09-30T14:25:33.000Z",
    "ticket_summary": "Customer inquiring about premium plan upgrade options and pricing",
    "metadata": {
      "priority": "high",
      "category": "sales",
      "assigned_agent": "John Doe"
    }
  },
  "last_closed_ticket": {
    "id": "990e8400-e29b-41d4-a716-446655440004",
    "ai_contact_id": "df980fc8-b6db-4820-bf22-2969482d106d",
    "status": "CLOSED",
    "created_at": "2024-09-25T09:00:00.000Z",
    "updated_at": "2024-09-25T15:30:00.000Z",
    "ticket_summary": "Billing inquiry resolved - payment processed successfully",
    "metadata": {
      "priority": "medium",
      "category": "billing",
      "resolution_time": "6.5 hours"
    }
  }
}

Common Use Cases

1. Display Contact Profile in Dashboard

const contactId = 'df980fc8-b6db-4820-bf22-2969482d106d';

const response = await fetch(
  `https://api.vambe.ai/api/public/contact/${contactId}/info`,
  {
    headers: {
      'x-api-key': 'your_api_key_here',
    },
  },
);

const contact = await response.json();

// Display in UI
console.log(`Name: ${contact.name}`);
console.log(`Email: ${contact.email}`);
console.log(`Phone: ${contact.phone}`);
console.log(`Platform: ${contact.platform}`);
console.log(`Status: ${contact.chat_status}`);

2. Check for Active Tickets

const response = await fetch(
  `https://api.vambe.ai/api/public/contact/${contactId}/info`,
  {
    headers: {
      'x-api-key': 'your_api_key_here',
    },
  },
);

const contact = await response.json();

if (contact.active_ticket) {
  console.log('Active ticket found:', contact.active_ticket.ticket_summary);
  console.log('Ticket status:', contact.active_ticket.status);
  console.log(
    'Created:',
    new Date(contact.active_ticket.created_at).toLocaleString(),
  );
} else {
  console.log('No active tickets for this contact');
}

3. Access Custom Metadata

const response = await fetch(
  `https://api.vambe.ai/api/public/contact/${contactId}/info`,
  {
    headers: {
      'x-api-key': 'your_api_key_here',
    },
  },
);

const contact = await response.json();

// Access custom metadata
const company = contact.metadata?.company;
const plan = contact.metadata?.plan;
const customerSince = contact.metadata?.customer_since;

console.log(
  `${contact.name} from ${company} has been a ${plan} customer since ${customerSince}`,
);

4. Get Last Interaction Info

const response = await fetch(
  `https://api.vambe.ai/api/public/contact/${contactId}/info`,
  {
    headers: {
      'x-api-key': 'your_api_key_here',
    },
  },
);

const contact = await response.json();

const lastMessageDate = new Date(contact.last_message_at);
const daysSinceLastMessage = Math.floor(
  (Date.now() - lastMessageDate.getTime()) / (1000 * 60 * 60 * 24),
);

console.log(`Last message: ${contact.last_message_content}`);
console.log(`${daysSinceLastMessage} days ago`);
console.log(`Read status: ${contact.is_chat_read ? 'Read' : 'Unread'}`);

Chat Status Values

The chat_status field can have the following values:
StatusDescription
UNATTENDEDNew message received, not yet attended by an agent
ATTENDEDAgent is actively working on the conversation
CLOSEDConversation has been closed/resolved
PENDINGWaiting for customer response or additional information

Platform Values

The platform field indicates the communication channel:
PlatformDescription
whatsappWhatsApp (API or QR)
instagramInstagram Direct Messages
webchatWeb chat widget
tiktokTikTok Direct Messages
smsSMS messages
messengerFacebook Messenger
voiceVoice calls

Error Responses

Status CodeDescription
400Bad Request - Invalid contact ID format
401Unauthorized - Invalid or missing API key
404Not Found - Contact does not exist
500Internal 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 and active_ticket for compatibility

Headers

x-api-key
string
required

API key required to authorize the request

Path Parameters

aiContactId
string
required

ID of the AI contact

Response

AI contact info retrieved successfully.