REST ClientLogsMessage Logs

get

View as MarkdownOpen in Claude

Retrieve a specific message log entry.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of the log.

Response

idstringRequiredformat: "uuid"
A unique identifier for the log.
fromstringRequired
The origin phone number.
tostringRequired
The destination phone number.
statusenumRequired
The status of the message.
directionenumRequired
The direction of the message.
kindenumRequired
The kind of message.
sourceenumRequired
Source of this log entry.
typeenumRequired
Type of this log entry.
urlstring or nullRequiredformat: "uri"
URL for the resource associated with this log entry. Null for Relay messages.
number_of_segmentsintegerRequired
The number of segments.
chargedoubleRequired
The charge in dollars.
charge_detailslist of objectsRequired
Details on charges associated with this log.
created_atdatetimeRequired
Date and time when the message entry was created.
error_messagestring or nullRequired
Description of the error when the message failed. Null when the message did not fail. LaML messages use the codes documented at https://signalwire.com/docs/compatibility-api/rest/error-codes.
error_codestring or nullRequired
Error code identifying why the message failed. Null when the message did not fail. Some Relay messages may have an `error_message` without an `error_code` — the `error_code` is a newer pattern that is not used in all Relay areas.

Response Example

Response
1{
2 "id": "string",
3 "from": "+12077447397",
4 "to": "+12029921413",
5 "status": "failed",
6 "direction": "inbound",
7 "kind": "sms",
8 "source": "laml",
9 "type": "relay_message",
10 "url": "https://example.signalwire.com/api/laml/2010-04-01/Accounts/c38dacad-2f6c-4de1-93d6-cc732e0c70c5/Messages/9ee38635-899a-490a-bfd1-9e72f5eea53c",
11 "number_of_segments": 1,
12 "charge": 0,
13 "charge_details": [
14 {
15 "description": "Inbound SMS",
16 "charge": 0.00415
17 }
18 ],
19 "created_at": "2024-05-06T12:20:00Z",
20 "error_message": "From number is not a SMS-capable phone number.",
21 "error_code": "21601"
22}

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9msg = client.logs.messages.get("message-log-id")
10print(msg.get("from"), "->", msg.get("to"))