> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Get voice log GET https://%7BYour_Space_Name%7D.signalwire.com/api/voice/logs/{id} Retrieves one historical voice activity record by log ID for reporting or troubleshooting a known call segment. This read-only endpoint does not retrieve or control a live call; use [Send call commands](/docs/apis/rest/calls/call-commands) for live control. #### Permissions The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_. [Learn more about API scopes](/docs/platform/your-signalwire-api-space). Reference: https://signalwire.com/docs/apis/rest/voice-logs/get-voice-log ## Authentication - `Authorization` header (basic auth, required) — SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ``` ## Request ### Path parameters - `id` (string, required) — Unique ID of the log. This is the segment_id you can find in Relay call details in your Dashboard UI or in return objects when using the SDK. ## Response ### 200 Response model for voice log retrieve endpoint - `Voice.VoiceLog` ## Errors ### 400 Bad Request Error The request is invalid. - `error` (enum, required) - Allowed values: `Bad Request` ### 401 Unauthorized Error Access is unauthorized. - `error` (enum, required) - Allowed values: `Unauthorized` ### 404 Not Found Error The server cannot find the requested resource. - `error` (enum, required) - Allowed values: `Not Found` ### 422 Unprocessable Entity Error The request contains invalid parameters. See errors for details. - `errors` (list of Types.StatusCodes.RestApiErrorItem, required) — List of validation errors. ### 500 Internal Server Error An internal server error occurred. - `error` (enum, required) - Allowed values: `Internal Server Error` ## Types ### Voice.RelayVoiceLog Voice log for Compatibility and Relay call types. Returned when `type` is `laml_call`, `relay_pstn_call`, `relay_sip_call`, or `relay_webrtc_call`. - `id` (string, required) — A unique identifier for the log. - `from` (string, required) — The origin phone number. - `to` (string, required) — The destination phone number. - `source` (enum, required) — Source of this log entry. - Allowed values: `dialogflow`, `laml`, `realtime_api` - `charge` (double, required) — The charge in dollars. - `charge_details` (list of Voice.ChargeDetail, required) — Details on charges associated with this log. - `created_at` (datetime, required) — Date and time when the call entry was created. - `type` (enum, required) — Type of this log entry. - Allowed values: `laml_call`, `relay_pstn_call`, `relay_sip_call`, `relay_webrtc_call` - `url` (string, required, nullable) — URL for the resource associated with this log entry. Present for LAML calls, null for Relay calls. - `direction` (enum, required) — The direction of the voice activity. - Allowed values: `inbound`, `outbound`, `outbound-api`, `outbound-dial` - `status` (enum, required) — The status of the voice activity. - Allowed values: `queued`, `initiated`, `ringing`, `in-progress`, `busy`, `failed`, `no-answer`, `canceled`, `completed`, `ended`, `answered`, `created`, `ending`, `joined` - `duration` (integer, required, nullable) — The duration of the voice activity in seconds. - `duration_ms` (integer, required, nullable) — The duration of the voice activity in milliseconds. - `billing_ms` (integer, required, nullable) — The billable duration of the voice activity in milliseconds. - `parent_id` (string, required, nullable) — Parent log identifier for related call entries. ### Voice.VideoRoomVoiceLog Voice log for audio legs in a Video Room. Returned when `type` is `video_room_pstn_leg` or `video_room_sip_leg`. - `id` (string, required) — A unique identifier for the log. - `from` (string, required) — The origin phone number. - `to` (string, required) — The destination phone number. - `source` (enum, required) — Source of this log entry. - Allowed values: `dialogflow`, `laml`, `realtime_api` - `charge` (double, required) — The charge in dollars. - `charge_details` (list of Voice.ChargeDetail, required) — Details on charges associated with this log. - `created_at` (datetime, required) — Date and time when the call entry was created. - `type` (enum, required) — Type of this log entry. - Allowed values: `video_room_pstn_leg`, `video_room_sip_leg` - `url` (any, required) — Always null for this call type. - `direction` (enum, required) — The direction of the voice activity. - Allowed values: `inbound`, `outbound`, `outbound-api`, `outbound-dial` - `status` (enum, required) — The status of the voice activity. - Allowed values: `queued`, `initiated`, `ringing`, `in-progress`, `busy`, `failed`, `no-answer`, `canceled`, `completed`, `ended`, `answered`, `created`, `ending`, `joined` - `duration` (integer, required, nullable) — The duration of the voice activity in seconds. - `duration_ms` (integer, required, nullable) — The duration of the voice activity in milliseconds. ### Voice.DialogflowVoiceLog Voice log for Dialogflow call types. Returned when `type` is `dialogflow_call`. - `id` (string, required) — A unique identifier for the log. - `from` (string, required) — The origin phone number. - `to` (string, required) — The destination phone number. - `source` (enum, required) — Source of this log entry. - Allowed values: `dialogflow`, `laml`, `realtime_api` - `charge` (double, required) — The charge in dollars. - `charge_details` (list of Voice.ChargeDetail, required) — Details on charges associated with this log. - `created_at` (datetime, required) — Date and time when the call entry was created. - `type` (enum, required) — Type of this log entry. - Allowed values: `dialogflow_call` - `url` (any, required) — Always null for this call type. - `status` (enum, required) — The status of the voice activity. - Allowed values: `queued`, `initiated`, `ringing`, `in-progress`, `busy`, `failed`, `no-answer`, `canceled`, `completed`, `ended`, `answered`, `created`, `ending`, `joined` - `duration` (integer, required, nullable) — The duration of the voice activity in seconds. ### Voice.FabricVoiceLog Voice log for Fabric Subscriber Device call types. Returned when `type` is `fabric_subscriber_device_leg`. - `id` (string, required) — A unique identifier for the log. - `from` (string, required) — The origin phone number. - `to` (string, required) — The destination phone number. - `source` (enum, required) — Source of this log entry. - Allowed values: `dialogflow`, `laml`, `realtime_api` - `charge` (double, required) — The charge in dollars. - `charge_details` (list of Voice.ChargeDetail, required) — Details on charges associated with this log. - `created_at` (datetime, required) — Date and time when the call entry was created. - `type` (enum, required) — Type of this log entry. - Allowed values: `fabric_subscriber_device_leg` - `url` (any, required) — Always null for this call type. - `direction` (enum, required) — The direction of the voice activity. - Allowed values: `inbound`, `outbound`, `outbound-api`, `outbound-dial` - `status` (enum, required, nullable) — The status of the voice activity. Always null for this call type. - Allowed values: `queued`, `initiated`, `ringing`, `in-progress`, `busy`, `failed`, `no-answer`, `canceled`, `completed`, `ended`, `answered`, `created`, `ending`, `joined` ### Voice.DiscardedVoiceLog A discarded/deleted voice log entry. Returned when the log has been deleted. Only present when `include_deleted` is `true`. - `id` (string, required) — A unique identifier for the log. - `discarded_at` (datetime, required) — Date and time when the log was discarded. - `created_at` (datetime, required) — Date and time when the log was originally created. ### Types.StatusCodes.RestApiErrorItem Details about a specific error. - `type` (string, required) — The category of error. - `code` (string, required) — A specific error code. - `message` (string, required) — A description of what caused the error. - `url` (string, required) — A link to documentation about this error. - `attribute` (string, optional, nullable) — The request parameter that caused the error, if applicable. ### Voice.ChargeDetail Details on charges associated with this log. - `description` (string, required) — Description for this charge. - `charge` (double, required) — Charged amount. ## Examples **Response** ```json { "billing_ms": 60000, "charge": 0.01, "charge_details": [], "created_at": "2024-05-06T12:20:00Z", "direction": "inbound", "duration": 9, "duration_ms": 9638, "from": "+12065551212", "id": "b7182dc2-00f3-40e4-a5ce-20f164b329df", "parent_id": null, "source": "realtime_api", "status": "completed", "to": "+12065553434", "type": "relay_sip_call", "url": null } ``` **SDK Code** ```python import requests url = "https://{your_space_name}.signalwire.com/api/voice/logs/id" response = requests.get(url, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://{your_space_name}.signalwire.com/api/voice/logs/id'; const credentials = btoa(":"); const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://{your_space_name}.signalwire.com/api/voice/logs/id" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth("", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://{your_space_name}.signalwire.com/api/voice/logs/id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://{your_space_name}.signalwire.com/api/voice/logs/id") .basicAuth("", "") .asString(); ``` ```php request('GET', 'https://{your_space_name}.signalwire.com/api/voice/logs/id', [ 'headers' => [ ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://{your_space_name}.signalwire.com/api/voice/logs/id"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = ["Authorization": "Basic \(credentials)"] let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/voice/logs/id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```