Skip to main content

Call Logs

API endpoints related to managing Call Logs. Call logs contain records of conversations between callers and Agents. They are linked to an Organization.

Note: These endpoints require an API key scoped to the organization in the path. Requests made with an API key that belongs to a different organization return 401 Unauthorized.

Get Call Logs​

Retrieves a paginated list of call logs for a given organization, most recent first.

GET /v1/organizations/{organizationId}/call-logs

Path Parameters:

  • organizationId (string, required): The unique identifier of the organization.

Query Parameters:

  • limit (number, optional): Number of results per page (1-100). Defaults to 50.
  • nextCursor (string, optional): Opaque cursor for fetching the next page of results. Pass the nextCursor value returned by the previous page. Omit it to fetch the first page.
  • archivedOnly (boolean, optional): Return only archived call logs.
  • includeArchived (boolean, optional): Include archived call logs alongside active ones.

Note: archivedOnly and includeArchived are mutually exclusive — you cannot use both at the same time.

Headers:

  • x-api-key (string, required): Your API key for authentication.

Response:

  • 200 OK: Call logs retrieved successfully. When hasMore is true, request the next page by passing the returned nextCursor as a query parameter. An organization with no call logs returns an empty data array.
    {
    "message": "Successfully retrieved organization call logs",
    "data": [
    {
    "id": "call_123abc",
    "organizationId": "org_123abc",
    "agentId": "agent_123abc",
    "phoneNumber": "+15551234567",
    "status": "completed",
    "summary": "Customer inquired about product pricing and availability.",
    "audioUrl": "https://storage.example.com/recordings/call_123abc.mp3",
    "createdAt": 1698407100000,
    "updatedAt": 1698407280000,
    "transcript": [
    {
    "role": "assistant",
    "message": "Hello, this is Benny from Example Corp. How can I help you today?",
    "time_in_call_secs": 1
    },
    {
    "role": "user",
    "message": "Hi, I'm interested in your product pricing.",
    "time_in_call_secs": 9
    }
    ],
    "direction": "inbound",
    "agentNumber": "+15551234567",
    "calledNumber": "+15559876543"
    },
    {
    "id": "call_456def",
    "organizationId": "org_123abc",
    "agentId": "agent_789xyz",
    "phoneNumber": "+15559876543",
    "status": "transferred",
    "summary": "Customer had a complex issue that required human assistance.",
    "audioUrl": "https://storage.example.com/recordings/call_456def.mp3",
    "createdAt": 1698408100000,
    "updatedAt": 1698408340000,
    "transcript": [],
    "direction": "inbound",
    "agentNumber": "+15551234567",
    "calledNumber": "+15559876543"
    }
    ],
    "nextCursor": "eyJwayI6Ik9SR0FOSVpBVElPTl9DQUxMX0xPRy4uLiJ9",
    "hasMore": true
    }
  • 400 Bad Request: Invalid or expired API key, both archivedOnly and includeArchived were provided, or nextCursor is not a cursor this endpoint returned (Invalid cursor).
  • 404 Not Found: Organization with specified organizationId not found.

Try it yourself​

GET/v1/organizations/{organizationId}/call-logs
Request URL: https://api.askbenny.ca/v1/organizations/{organizationId}/call-logs

Get Call Log By ID​

Retrieves details for a specific call log.

GET /v1/organizations/{organizationId}/call-logs/{callLogId}

Path Parameters:

  • organizationId (string, required): The unique identifier of the organization.
  • callLogId (string, required): The unique identifier of the call log.

Headers:

  • x-api-key (string, required): Your API key for authentication.

Response:

  • 200 OK: Call log details retrieved successfully.
    {
    "message": "Successfully retrieved organization call log by id",
    "data": {
    "id": "call_123abc",
    "organizationId": "org_123abc",
    "agentId": "agent_123abc",
    "phoneNumber": "+15551234567",
    "status": "completed",
    "summary": "Customer inquired about product pricing and availability.",
    "audioUrl": "https://storage.example.com/recordings/call_123abc.mp3",
    "createdAt": 1698407100000,
    "updatedAt": 1698407280000,
    "transcript": [
    {
    "role": "assistant",
    "message": "Hello, this is Benny from Example Corp. How can I help you today?",
    "time_in_call_secs": 1
    },
    {
    "role": "user",
    "message": "Hi, I'm interested in your product pricing.",
    "time_in_call_secs": 9
    },
    {
    "role": "assistant",
    "message": "I'd be happy to help with pricing information. Our basic package starts at $99 per month...",
    "time_in_call_secs": 15
    }
    ],
    "direction": "inbound",
    "agentNumber": "+15551234567",
    "calledNumber": "+15559876543"
    }
    }
  • 400 Bad Request: Invalid or expired API key.
  • 404 Not Found: Organization not found, or the specific call log was not found.

Try it yourself​

GET/v1/organizations/{organizationId}/call-logs/{callLogId}
Request URL: https://api.askbenny.ca/v1/organizations/{organizationId}/call-logs/{callLogId}