> This page is for APIs.

> 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.

# List fax logs

GET https://%7BYour_Space_Name%7D.signalwire.com/api/fax/logs

Lists historical fax activity in the project for delivery review, usage reporting, and troubleshooting. The Fax Logs API is read-only; send or manage faxes through the Compatibility API's [Faxes](/docs/compatibility-api/rest/faxes/send-fax) operations instead.

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Fax_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

Reference: https://signalwire.com/docs/apis/rest/fax-logs/list-fax-logs

## 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

### Query parameters

- `include_deleted` (boolean, optional, default: false) — Include logs for deleted activity.
- `created_before` (string, optional) — Return logs for activity prior to this date.
- `created_on` (string, optional) — Return logs for activity on this date.
- `created_after` (string, optional) — Return logs for activity after this date.
- `page_size` (integer, optional, default: 50) — Specify the number of results to return on a single page. The default page size is `50` and the maximum is `1000`.
- `page_number` (integer, optional, default: 0) — Page number to retrieve. Requires `page_token` when greater than `0`.
- `page_token` (string, optional) — Token for cursor-based pagination. Required when `page_number` is greater than `0`. The token is returned in pagination links.

## Response

### 200

The request has succeeded.

- `links` (Fax.LogPaginationResponse, required) — Object containing pagination links
- `data` (list of Fax.FaxLog, required) — Array of log data

## Errors

### 400 Bad Request Error

The request is invalid.

- `error` (enum, required)
  - Allowed values: `Bad Request`

### 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

### Fax.LogPaginationResponse

- `self` (string, required) — URL for the current page of results.
- `first` (string, required) — URL for the first page of results.
- `next` (string, optional) — URL for the next page of results. Only present when more results are available.
- `prev` (string, optional) — URL for the previous page of results. Only present when on page 1 or later.

### Fax.FaxLog

- `id` (string, required) — A unique identifier for the log
- `from` (string, required, nullable) — The origin phone number in E.164 format.
- `to` (string, required, nullable) — The destination phone number in E.164 format.
- `status` (enum, required) — The status of this fax call.
  - Allowed values: `queued`, `initiated`, `ringing`, `in-progress`, `busy`, `failed`, `no-answer`, `canceled`, `completed`
- `direction` (enum, required, nullable) — The direction of this fax call.
  - Allowed values: `inbound`, `outbound-api`, `outbound-dial`
- `source` (enum, required) — Source of this log entry.
  - Allowed values: `laml`
- `type` (enum, required) — Type of this log entry.
  - Allowed values: `laml_call`
- `url` (string, required) — URL for the associated fax resource with this log entry.
- `remote_station` (string, required, nullable) — Represents a customer hosted Fax server.
- `charge` (double, required) — The amount charged for this fax request.
- `number_of_pages` (integer, required, nullable) — The number of pages the fax document contained.
- `quality` (enum, required, nullable) — The quality that was set when the fax document was sent.
  - Allowed values: `fine`, `standard`, `superfine`
- `charge_details` (list of Fax.ChargeDetail, required) — Details on charges associated with this log.
- `created_at` (datetime, required) — Date and time when the fax was created.
- `error_code` (string, required, nullable) — Error code for this resource (if available).
- `error_message` (string, required, nullable) — The description of this error (if available).

### 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.

### Fax.ChargeDetail

- `description` (string, required) — Description for this charge.
- `charge` (double, required) — Charged amount.

## Examples

**Response**

```json
{
  "links": {
    "self": "https://example.signalwire.com/api/fax/logs?page_number=0&page_size=50",
    "first": "https://example.signalwire.com/api/fax/logs?page_size=50",
    "next": "https://example.signalwire.com/api/fax/logs?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca",
    "prev": "https://example.signalwire.com/api/fax/logs?page_number=0&page_size=50&page_token=PBbff61159-faab-48b3-959a-3021a8f5beca"
  },
  "data": [
    {
      "id": "b7182dc2-00f3-40e4-a5ce-20f164b329df",
      "from": "+12065551212",
      "to": "+12065553434",
      "status": "completed",
      "direction": "inbound",
      "source": "laml",
      "type": "laml_call",
      "url": "https://example.signalwire.com/api/laml/2010-04-01/Accounts/b7182dc2-00f3-40e4-a5ce-20f164b329df/Faxes/c9a1d3e4-56f7-89ab-cdef-0123456789ab",
      "remote_station": null,
      "charge": 0.01,
      "number_of_pages": 2,
      "quality": "fine",
      "charge_details": [],
      "created_at": "2024-05-06T12:20:00Z",
      "error_code": "34004",
      "error_message": "The call dropped prematurely"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/fax/logs"

response = requests.get(url, auth=("<project_id>", "<api_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/fax/logs';
const credentials = btoa("<project_id>:<api_token>");

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/fax/logs"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<project_id>", "<api_token>")

	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/fax/logs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<project_id>", "<api_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/fax/logs")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/fax/logs', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/fax/logs");
client.Authenticator = new HttpBasicAuthenticator("<project_id>", "<api_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<project_id>:<api_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/fax/logs")! 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()
```