# 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."
}
]
}
}
}
}
Contactos
Get Contact Call History by Phone Number
Get contact by phone number and your call history
GET
/
v1
/
contacts
/
{phoneNumber}
/
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."
}
]
}
}
}
}
This endpoint allows you to retrieve the complete call history for a contact using their phone number. This is useful when you don’t have the contact’s ID but need to quickly access their call history.Documentation Index
Fetch the complete documentation index at: https://docs.contactship.ai/llms.txt
Use this file to discover all available pages before exploring further.
Use Cases
- Review call history with a contact using just their phone number
- Track communication history for incoming calls from unknown numbers
- Quick lookup of call records during customer service interactions
- Verify previous interactions with a phone number
Path Parameters
The phone number of the contact in international format (e.g., +12124567890)
Headers
Your API key for authentication. You can find this in your dashboard under API settings.
Query Parameters
Filter calls that occurred on or after this date (ISO 8601 format, e.g., 2023-01-01). If not specified, returns all calls from the beginning.
Filter calls that occurred on or before this date (ISO 8601 format, e.g., 2023-12-31). If not specified, returns all calls up to the current date.
Filter calls by direction. Possible values:
inbound, outbound. If not specified, returns both inbound and outbound calls.Filter calls by status. Possible values:
answered, missed, rejected, busy, failed. If not specified, returns calls with any status.Response
200 on success
Information about the contact
Mostrar Contact object
Mostrar Contact object
The unique identifier of the contact (UUID format)
The timestamp when the contact was created (ISO 8601 format)
The phone number of the contact
The full name of the contact
The country of the contact
The email of the contact
Description or notes about the contact
Additional data associated with the contact
The call history for the contact
Mostrar Call History object
Mostrar Call History object
Total number of call attempts
Details of the last call made
Mostrar Call object
Mostrar Call object
The unique identifier of the call record (UUID format)
The timestamp when the call record was created (ISO 8601 format)
The timestamp when the call occurred (ISO 8601 format)
The duration of the call in seconds
The direction of the call (
inbound or outbound)The status of the call (
answered, missed, rejected, busy, or failed)Any notes associated with the call
URL to the call recording, if available (null if no recording exists)
List of all calls
Mostrar Call object
Mostrar Call object
The unique identifier of the call record (UUID format)
The timestamp when the call record was created (ISO 8601 format)
The timestamp when the call occurred (ISO 8601 format)
The duration of the call in seconds
The direction of the call (
inbound or outbound)The status of the call (
answered, missed, rejected, busy, or failed)Any notes associated with the call
URL to the call recording, if available (null if no recording exists)
Error Codes
400 Bad Request- Invalid phone number format401 Unauthorized- Invalid or missing API key404 Not Found- Contact not found500 Internal Server Error- Server-side error
Code Examples
# 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."
}
]
}
}
}
}
Notes and Best Practices
- Always use international format for phone numbers (e.g., +12124567890)
- URL encode the phone number in the request URL to handle special characters
- Use date filtering to narrow down results for contacts with extensive call histories
- Consider implementing caching for frequently accessed call histories
- Monitor call durations and frequencies to optimize customer engagement strategies
⌘I
