Search Call Log by Unit
Endpoint used to search call logs by unit.
Request Example
Section titled “Request Example”curl --request POST \ --url https://chat.api.toolzz.com.br/api/v1/voice/call-logs/search/{unityId} \ --header 'Authorization: Bearer TOKEN_HERE' \ --header 'Content-Type: application/json' \ --data ' { "filters": { "search": "<string>", "operator": "<string>", "date": "<string>", "startDate": "<string>", "endDate": "<string>", "nDays": 123 }, "pagination": { "page": 123, "pageSize": 123 }, "orderBy": { "column": "<string>", "direction": "<string>" } }'Response Example
Section titled “Response Example”{ "message": "<string>", "items": [ { "message": "<string>", "id": "<string>", "callId": "<string>", "callName": "<string>", "unityId": "<string>", "successEvaluation": true, "botId": "<string>", "audioFileUrl": "<string>", "agentRecordingUrl": "<string>", "userRecordingUrl": "<string>", "endCallType": "<string>", "callType": "<string>", "dateFormatted": "<string>", "costBreakdown": {}, "duration": 123, "phone": "<string>", "callDate": "<string>", "dataStructure": {}, "durationFormatted": "<string>", "transcription": [ {} ], "metadata": {}, "callTime": "<string>", "totalCost": 123, "summary": "<string>", "createdAt": "<string>", "updatedAt": "<string>" } ], "pagination": { "currentPage": 123, "hasNextPage": true, "hasPreviousPage": true, "pageSize": 123, "totalItems": 123, "totalPages": 123 }}Request description
Section titled “Request description”Access Token
Section titled “Access Token”| Parameter | Type | Description | Required |
|---|---|---|---|
Authorization | String | Access token (“Bearer” must be before the token) | Yes |
URL Parameters
Section titled “URL Parameters”| Parameter | Type | Description | Required |
|---|---|---|---|
unityId | UUID | Unit identifier. | Yes |
Body Parameters
Section titled “Body Parameters”| Parameter | Type | Description | Required |
|---|---|---|---|
filters | Object | Object containing search and filtering criteria. | No |
filters.search | String | Term for textual search (e.g., agent name or title). | No |
filters.operator | String | Logical operator for the search (e.g., all_time). | No |
filters.date | String | Fixed or relative date filter. | No |
filters.startDate | String | Start date for period filter (ISO 8601). | No |
filters.endDate | String | End date for period filter (ISO 8601). | No |
filters.nDays | Number | Filter for records from the last “N” days. | No |
pagination | Object | Object for result pagination control. | Yes |
pagination.page | Number | Page number to retrieve (default 1). | Yes |
pagination.pageSize | Number | Amount of records returned per page (default: 10). | Yes |
orderBy | Object | Object to define the sorting rule. | No |
orderBy.column | String | Column/field name to base the sort on (default: createdAt). | Yes |
orderBy.direction | String | Sort direction: ASC (ascending) or DESC (descending) (default: DESC). | No |
Response description
Section titled “Response description”| Key | Type | Description |
|---|---|---|
message | String | Global status message of the operation. |
items | Array | List containing detailed logs of calls/interactions. |
items[].id | UUID | Unique identifier of the history record. |
items[].callId | String | Identifier of the call at the telephony or voice provider. |
items[].callName | String | Identification name or title assigned to the interaction. |
items[].unityId | UUID | Identifier of the organizational unit where the call occurred. |
items[].botId | UUID | Identifier of the Agent that performed the service. |
items[].successEvaluation | Boolean | Indicates if the interaction was evaluated as successful. |
items[].audioFileUrl | URL | Link to the complete audio file of the interaction. |
items[].agentRecordingUrl | URL | Link to the exclusive recording of the Agent channel. |
items[].userRecordingUrl | URL | Link to the exclusive recording of the User channel. |
items[].endCallType | String | Reason for termination (e.g., CONVERTED, NO_ANSWER, ENDED). |
items[].callType | String | Interaction type (e.g., web, phone). |
items[].duration | Number | Total duration of the interaction in seconds. |
items[].durationFormatted | String | Duration formatted for human reading (e.g., 02:15). |
items[].phone | String | Source or destination phone number. |
items[].callDate | String | Exact date and time of the start of the interaction. |
items[].transcription | Array | List of objects containing speech converted to text. |
items[].totalCost | Number | Total financial cost processed for the call. |
items[].summary | String | Executive summary generated by IA about the conversation content. |
pagination | Object | Metadata for navigation control between pages. |
pagination.currentPage | Number | Index of the current page returned. |
pagination.pageSize | Number | Amount of items per page. |
pagination.totalItems | Number | Absolute total of records found in the database. |
pagination.totalPages | Number | Total amount of pages available for query. |
Security
Section titled “Security”To access this endpoint, it is necessary to send a valid access token through the authorization header (Authorization) of the request. Additionally, the API is protected by other security measures to safeguard user data.
To access your access token, follow these steps:
- Log in to the ToolzzAI platform
- Click on “Settings”
- Click on “Access Token”
- Copy the access token
