# Get call history for a contact by phone number
curl -X GET "https://api.contactship.ai/v1/contacts/+573014445709/call-history" \
-H "x-api-key: your-api-key"
{
"statusCode": 200,
"data": {
"contact_id": "c8a23f45-9b12-4d78-af90-1e5d23c67890",
"contact": {
"full_name": "Maria González",
"country": "México",
"email": "maria.gonzalez@ejemplo.com",
"phone_number": "+525512345678",
"additional_data": null,
"description": "Lead from Facebook campaign",
"created_at": "2024-03-01T15:30:00.123+00:00"
},
"history": {
"call_attempts": 2,
"calls": [
{
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/abc123def456/recording.wav",
"status": "answered",
"start_at": "2024-03-05T14:20:15.445+00:00",
"finished_at": "2024-03-05T14:23:45.571+00:00",
"price": 15,
"price_unit": "USD",
"duration": "210",
"call_analysis": {
"call_summary": "Cliente mostró interés en el producto premium. Solicitó información sobre precios y características específicas.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "maria.gonzalez@ejemplo.com",
"canal_de_seguimiento": "email",
"quiere_mas_informacion": true
}
},
"type": "api_call",
"created_at": "2024-03-05T14:20:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "¡Hola! Le llamo de parte de nuestra empresa para hablar sobre nuestros servicios premium."
},
{
"role": "user",
"content": "Me interesa conocer más sobre los precios y características."
}
]
},
{
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/xyz789uvw/recording.wav",
"status": "voicemail",
"start_at": "2024-03-01T16:00:00.445+00:00",
"finished_at": "2024-03-01T16:00:45.571+00:00",
"price": 5,
"price_unit": "USD",
"duration": "45",
"call_analysis": {
"call_summary": "Llamada dirigida a buzón de voz. Se dejó mensaje con información de contacto.",
"in_voicemail": true,
"user_sentiment": "Neutral",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "",
"canal_de_seguimiento": "phone",
"quiere_mas_informacion": false
}
},
"type": "api_call",
"created_at": "2024-03-01T16:00:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "Le dejamos un mensaje en su buzón de voz con nuestra información de contacto."
}
]
}
],
"last_call": {
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/abc123def456/recording.wav",
"status": "answered",
"start_at": "2024-03-05T14:20:15.445+00:00",
"finished_at": "2024-03-05T14:23:45.571+00:00",
"price": 15,
"price_unit": "USD",
"duration": "210",
"call_analysis": {
"call_summary": "Cliente mostró interés en el producto premium. Solicitó información sobre precios y características específicas.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "maria.gonzalez@ejemplo.com",
"canal_de_seguimiento": "email",
"quiere_mas_informacion": true
}
},
"type": "api_call",
"created_at": "2024-03-05T14:20:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "¡Hola! Le llamo de parte de nuestra empresa para hablar sobre nuestros servicios premium."
},
{
"role": "user",
"content": "Me interesa conocer más sobre los precios y características."
}
]
}
}
}
}
Get contact by phone number and your call history
# Get call history for a contact by phone number
curl -X GET "https://api.contactship.ai/v1/contacts/+573014445709/call-history" \
-H "x-api-key: your-api-key"
{
"statusCode": 200,
"data": {
"contact_id": "c8a23f45-9b12-4d78-af90-1e5d23c67890",
"contact": {
"full_name": "Maria González",
"country": "México",
"email": "maria.gonzalez@ejemplo.com",
"phone_number": "+525512345678",
"additional_data": null,
"description": "Lead from Facebook campaign",
"created_at": "2024-03-01T15:30:00.123+00:00"
},
"history": {
"call_attempts": 2,
"calls": [
{
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/abc123def456/recording.wav",
"status": "answered",
"start_at": "2024-03-05T14:20:15.445+00:00",
"finished_at": "2024-03-05T14:23:45.571+00:00",
"price": 15,
"price_unit": "USD",
"duration": "210",
"call_analysis": {
"call_summary": "Cliente mostró interés en el producto premium. Solicitó información sobre precios y características específicas.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "maria.gonzalez@ejemplo.com",
"canal_de_seguimiento": "email",
"quiere_mas_informacion": true
}
},
"type": "api_call",
"created_at": "2024-03-05T14:20:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "¡Hola! Le llamo de parte de nuestra empresa para hablar sobre nuestros servicios premium."
},
{
"role": "user",
"content": "Me interesa conocer más sobre los precios y características."
}
]
},
{
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/xyz789uvw/recording.wav",
"status": "voicemail",
"start_at": "2024-03-01T16:00:00.445+00:00",
"finished_at": "2024-03-01T16:00:45.571+00:00",
"price": 5,
"price_unit": "USD",
"duration": "45",
"call_analysis": {
"call_summary": "Llamada dirigida a buzón de voz. Se dejó mensaje con información de contacto.",
"in_voicemail": true,
"user_sentiment": "Neutral",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "",
"canal_de_seguimiento": "phone",
"quiere_mas_informacion": false
}
},
"type": "api_call",
"created_at": "2024-03-01T16:00:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "Le dejamos un mensaje en su buzón de voz con nuestra información de contacto."
}
]
}
],
"last_call": {
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/abc123def456/recording.wav",
"status": "answered",
"start_at": "2024-03-05T14:20:15.445+00:00",
"finished_at": "2024-03-05T14:23:45.571+00:00",
"price": 15,
"price_unit": "USD",
"duration": "210",
"call_analysis": {
"call_summary": "Cliente mostró interés en el producto premium. Solicitó información sobre precios y características específicas.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "maria.gonzalez@ejemplo.com",
"canal_de_seguimiento": "email",
"quiere_mas_informacion": true
}
},
"type": "api_call",
"created_at": "2024-03-05T14:20:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "¡Hola! Le llamo de parte de nuestra empresa para hablar sobre nuestros servicios premium."
},
{
"role": "user",
"content": "Me interesa conocer más sobre los precios y características."
}
]
}
}
}
}
inbound, outbound. If not specified, returns both inbound and outbound calls.answered, missed, rejected, busy, failed. If not specified, returns calls with any status.Mostrar Contact object
Mostrar Call History object
Mostrar Call object
inbound or outbound)answered, missed, rejected, busy, or failed)Mostrar Call object
inbound or outbound)answered, missed, rejected, busy, or failed)400 Bad Request - Invalid phone number format401 Unauthorized - Invalid or missing API key404 Not Found - Contact not found500 Internal Server Error - Server-side error# Get call history for a contact by phone number
curl -X GET "https://api.contactship.ai/v1/contacts/+573014445709/call-history" \
-H "x-api-key: your-api-key"
{
"statusCode": 200,
"data": {
"contact_id": "c8a23f45-9b12-4d78-af90-1e5d23c67890",
"contact": {
"full_name": "Maria González",
"country": "México",
"email": "maria.gonzalez@ejemplo.com",
"phone_number": "+525512345678",
"additional_data": null,
"description": "Lead from Facebook campaign",
"created_at": "2024-03-01T15:30:00.123+00:00"
},
"history": {
"call_attempts": 2,
"calls": [
{
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/abc123def456/recording.wav",
"status": "answered",
"start_at": "2024-03-05T14:20:15.445+00:00",
"finished_at": "2024-03-05T14:23:45.571+00:00",
"price": 15,
"price_unit": "USD",
"duration": "210",
"call_analysis": {
"call_summary": "Cliente mostró interés en el producto premium. Solicitó información sobre precios y características específicas.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "maria.gonzalez@ejemplo.com",
"canal_de_seguimiento": "email",
"quiere_mas_informacion": true
}
},
"type": "api_call",
"created_at": "2024-03-05T14:20:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "¡Hola! Le llamo de parte de nuestra empresa para hablar sobre nuestros servicios premium."
},
{
"role": "user",
"content": "Me interesa conocer más sobre los precios y características."
}
]
},
{
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/xyz789uvw/recording.wav",
"status": "voicemail",
"start_at": "2024-03-01T16:00:00.445+00:00",
"finished_at": "2024-03-01T16:00:45.571+00:00",
"price": 5,
"price_unit": "USD",
"duration": "45",
"call_analysis": {
"call_summary": "Llamada dirigida a buzón de voz. Se dejó mensaje con información de contacto.",
"in_voicemail": true,
"user_sentiment": "Neutral",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "",
"canal_de_seguimiento": "phone",
"quiere_mas_informacion": false
}
},
"type": "api_call",
"created_at": "2024-03-01T16:00:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "Le dejamos un mensaje en su buzón de voz con nuestra información de contacto."
}
]
}
],
"last_call": {
"direction": "outbound-api",
"from": "+525619190379",
"call_record": "https://storage.example.com/recordings/abc123def456/recording.wav",
"status": "answered",
"start_at": "2024-03-05T14:20:15.445+00:00",
"finished_at": "2024-03-05T14:23:45.571+00:00",
"price": 15,
"price_unit": "USD",
"duration": "210",
"call_analysis": {
"call_summary": "Cliente mostró interés en el producto premium. Solicitó información sobre precios y características específicas.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {
"email_usuario": "maria.gonzalez@ejemplo.com",
"canal_de_seguimiento": "email",
"quiere_mas_informacion": true
}
},
"type": "api_call",
"created_at": "2024-03-05T14:20:00.123456+00:00",
"chat_history": [
{
"role": "assistant",
"content": "¡Hola! Le llamo de parte de nuestra empresa para hablar sobre nuestros servicios premium."
},
{
"role": "user",
"content": "Me interesa conocer más sobre los precios y características."
}
]
}
}
}
}