curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "x-api-key: your-api-key"
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890?transcript_format=toon" \
-H "x-api-key: your-api-key"
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890?include_transcript=false" \
-H "x-api-key: your-api-key"
const getCall = async (callId, params = {}) => {
const query = new URLSearchParams(params).toString();
const response = await fetch(
`https://api.contactship.ai/v1/calls/${callId}${query ? `?${query}` : ''}`,
{ headers: { 'x-api-key': 'your-api-key' } }
);
if (response.status === 404) throw new Error('Call not found');
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response.json();
};
// Example: get call with word-level timing data
const call = await getCall('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
include_words: true,
});
console.log(`Call duration: ${call.duration}s, result: ${call.call_result}`);
import requests
api_key = "your-api-key"
call_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
response = requests.get(
f"https://api.contactship.ai/v1/calls/{call_id}",
headers={"x-api-key": api_key},
params={"include_words": True},
)
if response.status_code == 200:
call = response.json()["data"]
print(f"Duration: {call['duration']}s, Result: {call['call_result']}")
if call.get("chat_history"):
print(f"Transcript entries: {len(call['chat_history'])}")
elif response.status_code == 404:
print("Call not found")
else:
print(f"Error {response.status_code}: {response.text}")
{
"statusCode": 200,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"direction": "outbound",
"from": "+12025551234",
"call_record": "https://api.contactship.ai/recordings/a1b2c3d4.mp3",
"call_status": "completed",
"call_result": "answered",
"disconnection_reason": "agent_hangup",
"finished_at": "2026-03-15T14:35:22Z",
"start_at": "2026-03-15T14:30:05Z",
"duration": 317,
"call_analysis": {
"summary": "Customer expressed interest in the premium plan and requested a demo.",
"sentiment": "positive"
},
"type": "ai_call",
"created_at": "2026-03-15T14:30:00Z",
"agent_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"contact": {
"id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"full_name": "Jane Smith",
"phone_number": "+14155552678",
"email": "jane.smith@example.com",
"country": "US"
},
"chat_history": [
{
"role": "agent",
"content": "Hello, this is an AI assistant calling from ContactShip. Am I speaking with Jane?"
},
{
"role": "user",
"content": "Yes, this is Jane."
},
{
"role": "agent",
"content": "Great! I'm reaching out about our premium plan. Do you have a moment to chat?"
}
],
"transcript_format": "json"
}
}
Llamadas
Get Call
Retrieve full details of a single call by its ID
GET
/
v1
/
calls
/
{callId}
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "x-api-key: your-api-key"
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890?transcript_format=toon" \
-H "x-api-key: your-api-key"
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890?include_transcript=false" \
-H "x-api-key: your-api-key"
const getCall = async (callId, params = {}) => {
const query = new URLSearchParams(params).toString();
const response = await fetch(
`https://api.contactship.ai/v1/calls/${callId}${query ? `?${query}` : ''}`,
{ headers: { 'x-api-key': 'your-api-key' } }
);
if (response.status === 404) throw new Error('Call not found');
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response.json();
};
// Example: get call with word-level timing data
const call = await getCall('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
include_words: true,
});
console.log(`Call duration: ${call.duration}s, result: ${call.call_result}`);
import requests
api_key = "your-api-key"
call_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
response = requests.get(
f"https://api.contactship.ai/v1/calls/{call_id}",
headers={"x-api-key": api_key},
params={"include_words": True},
)
if response.status_code == 200:
call = response.json()["data"]
print(f"Duration: {call['duration']}s, Result: {call['call_result']}")
if call.get("chat_history"):
print(f"Transcript entries: {len(call['chat_history'])}")
elif response.status_code == 404:
print("Call not found")
else:
print(f"Error {response.status_code}: {response.text}")
{
"statusCode": 200,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"direction": "outbound",
"from": "+12025551234",
"call_record": "https://api.contactship.ai/recordings/a1b2c3d4.mp3",
"call_status": "completed",
"call_result": "answered",
"disconnection_reason": "agent_hangup",
"finished_at": "2026-03-15T14:35:22Z",
"start_at": "2026-03-15T14:30:05Z",
"duration": 317,
"call_analysis": {
"summary": "Customer expressed interest in the premium plan and requested a demo.",
"sentiment": "positive"
},
"type": "ai_call",
"created_at": "2026-03-15T14:30:00Z",
"agent_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"contact": {
"id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"full_name": "Jane Smith",
"phone_number": "+14155552678",
"email": "jane.smith@example.com",
"country": "US"
},
"chat_history": [
{
"role": "agent",
"content": "Hello, this is an AI assistant calling from ContactShip. Am I speaking with Jane?"
},
{
"role": "user",
"content": "Yes, this is Jane."
},
{
"role": "agent",
"content": "Great! I'm reaching out about our premium plan. Do you have a moment to chat?"
}
],
"transcript_format": "json"
}
}
Returns the full details of a single call. The transcript (
chat_history) is included by default — pass include_transcript=false to omit it. Use include_words=true for per-word timing data, or transcript_format=toon for a token-efficient encoding.
Path Parameters
Headers
Query Parameters
Include per-word timing data in transcript entries. Only applies when
include_transcript=true.Format for transcript output. Possible values:
json (raw array), toon (token-efficient TOON encoding).Response
The response is{ "statusCode": number, "data": object }. The fields below describe data.
Status of the call. Possible values:
in-progress, completed, no-answer, failed, in-queue, incomplete, busy, answering-machine, scheduled, voice_mail.Transcript of the call. Present when
include_transcript=true (default). Returns an array of transcript entries (JSON format) or a TOON-encoded string when transcript_format=toon.Error Codes
401 Unauthorized— Invalid or missing API key404 Not Found— Call not found or does not belong to your organization500 Internal Server Error— Server-side error
Code Examples
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "x-api-key: your-api-key"
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890?transcript_format=toon" \
-H "x-api-key: your-api-key"
curl -X GET "https://api.contactship.ai/v1/calls/a1b2c3d4-e5f6-7890-abcd-ef1234567890?include_transcript=false" \
-H "x-api-key: your-api-key"
const getCall = async (callId, params = {}) => {
const query = new URLSearchParams(params).toString();
const response = await fetch(
`https://api.contactship.ai/v1/calls/${callId}${query ? `?${query}` : ''}`,
{ headers: { 'x-api-key': 'your-api-key' } }
);
if (response.status === 404) throw new Error('Call not found');
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response.json();
};
// Example: get call with word-level timing data
const call = await getCall('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
include_words: true,
});
console.log(`Call duration: ${call.duration}s, result: ${call.call_result}`);
import requests
api_key = "your-api-key"
call_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
response = requests.get(
f"https://api.contactship.ai/v1/calls/{call_id}",
headers={"x-api-key": api_key},
params={"include_words": True},
)
if response.status_code == 200:
call = response.json()["data"]
print(f"Duration: {call['duration']}s, Result: {call['call_result']}")
if call.get("chat_history"):
print(f"Transcript entries: {len(call['chat_history'])}")
elif response.status_code == 404:
print("Call not found")
else:
print(f"Error {response.status_code}: {response.text}")
{
"statusCode": 200,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"direction": "outbound",
"from": "+12025551234",
"call_record": "https://api.contactship.ai/recordings/a1b2c3d4.mp3",
"call_status": "completed",
"call_result": "answered",
"disconnection_reason": "agent_hangup",
"finished_at": "2026-03-15T14:35:22Z",
"start_at": "2026-03-15T14:30:05Z",
"duration": 317,
"call_analysis": {
"summary": "Customer expressed interest in the premium plan and requested a demo.",
"sentiment": "positive"
},
"type": "ai_call",
"created_at": "2026-03-15T14:30:00Z",
"agent_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"contact": {
"id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"full_name": "Jane Smith",
"phone_number": "+14155552678",
"email": "jane.smith@example.com",
"country": "US"
},
"chat_history": [
{
"role": "agent",
"content": "Hello, this is an AI assistant calling from ContactShip. Am I speaking with Jane?"
},
{
"role": "user",
"content": "Yes, this is Jane."
},
{
"role": "agent",
"content": "Great! I'm reaching out about our premium plan. Do you have a moment to chat?"
}
],
"transcript_format": "json"
}
}
