> For the complete documentation index, see [llms.txt](https://docs.coherent.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherent.global/navigation/api-call-history.md).

# API Call History

Spark stores all the API calls that have been executed by Spark into the **API Call History**.

After choosing a specific service from the [Folder overview](/navigation/folder-overview.md), select the ![API Call History](https://2714190325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc7fek1ZgAUH5MA3m5pH8%2Fuploads%2FBRRvwbip4s3hLw2Z53W4%2Fimage.png?alt=media\&token=1a3e946e-75d3-42c2-bb24-351cc462c0d8) icon from the service sidebar.

## Change how API calls are displayed

The **API Call History** page shows the list of all the API calls made to a Spark service.

* By default, all service versions are shown by descending **Log time** for the past `24 h`.
* Each call has a **Log time** for when the call was logged and a unique **Call ID**.
* Select the **Filter** button to add any additional filters.
* For any new filter fields, enter or select the appropriate conditions.&#x20;
* Additional filters can be applied to the API calls. Reference for these additional metadata fields can be found in [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#request_meta).

| Filter                       | Description                                                                                                          |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **Service version**          | Filter for a specific service version.                                                                               |
| **User**                     | Filter for the `UserName` that made the API call.                                                                    |
| **Metadata fields**          | Filter for a particular `call_id`, `correlation_id`, or `source_system`.                                             |
| **Call purpose**             | Filter for by `call_purpose`.                                                                                        |
| **Call response properties** | Filter for calls that have `warnings` and/or calls that have `errors`.                                               |
| **Keep latest**              | For records that have the same `call_purpose`, `correlation_id`, and/or `source_system`, keep only the latest entry. |
| **Version ID**               | Filter by `version_id`.                                                                                              |

## Download API calls

Spark enables a download of the API call entries for analysis.

1. Adjust the filters as necessary to meet your requirements. It is best to minimize the number of calls to download as extremely large downloads may lead to an error.
2. Select **Download API calls**.
3. In the modal, select the download options.
4. **Choose download format**. `CSV` is recommended as it is the most compact data format.

   | Format                      | Description                                                                                                                                                                                                                                                                                                                      |
   | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **CSV**                     | Return the API calls in a `ZIP` file containing `CSV` files. Files are chunked at `25 MB`.                                                                                                                                                                                                                                       |
   | **CSV expanded tables**     | **CSV** plus **expanded tables** will write table inputs and outputs to separate CSV files making it easy to consume API calls that include tables.                                                                                                                                                                              |
   | **Excel**                   | Return the API calls in a single Excel file. This can also be used as a [Testing Center](/navigation/testing-center.md) testbed.                                                                                                                                                                                                 |
   | **Excel (expanded tables)** | **Excel** plus **expanded tables** will write table inputs and outputs to separate worksheets making it easy to consume API call results that include tables. This feature will not work if the download contains: i) a large number of API calls that include input or output tables, or ii) very large input or output tables. |
   | **Excel (fast beta)**       | A faster version of **Excel (expanded tables)**.                                                                                                                                                                                                                                                                                 |
   | **JSON**                    | Return the API calls in a `.zip` file containing `.json` files. Files are chunked at `25 MB`.                                                                                                                                                                                                                                    |
5. **Choose the API call data to return**. Excluding inputs or outputs will result in smaller file sizes and faster downloads.
6. **Choose how you would like headings to be ordered**. **Data order** sorts the mapped inputs and outputs in the order they appear in the workbook.
7. **Select particular outputs to download**. By default, all outputs are included. Choosing a subset of the outputs makes it easier to review the results and will result in smaller file sizes and faster downloads.
8. Select **Download**.
9. The download task initiates and can be monitored in **Background activity**.
10. Once the download is ready, it will automatically start to download.
11. If you missed the download, the download can be initiated again in **Background activity**.

## Review an individual API call

### View the detailed log of the API call

Interrogate the specifics of an API call for review. In the ellipsis menu, select **Inspect detailed log**. The **Detailed log** will display information about the API call including the [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#request-body) and [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#response-body).

### Download the Excel file with inputs

Business users may want to review the specifics of an API call in Excel to review the calculation and to maintain for record keeping. A copy of the Excel file can be downloaded in the ellipsis menu and choose **Download as Excel**.

1. Spark input ranges such as `Xinput` will be populated with the fields from the API request. If a field is not provided and the default is used, the default will be populated instead of the API call input.
2. Any files that include [Solve functions (Xsolve)](/build-spark-services/additional-mappings/solve-functions-xsolve.md) will have the `By changing` result injected into the file.
3. Any files that include [Call Spark services as functions (Xcall)](/build-spark-services/additional-mappings/call-spark-services-as-functions-xcall.md) will be recalculated when opened alongside [Coherent Assistant](https://docs.coherent.global/assistant/).
4. Spark output ranges such as `Xoutput` will not be populated with the fields from the API response. This is because the original formulas should not be overwritten.

**Download as Excel file (Legacy)** is our previous implementation.

* By default a cover page is included but can be disabled in [Tenant configuration](/tenant-administration/tenant-configuration.md#include-cover-sheet-in-upload-service-for-new-service-uploads).
* It is known to impact [dynamic array formulas](https://support.microsoft.com/en-US/Excel/dynamic-array-formulas-and-spilled-array-behavior) by introducing additional braces `{}`.
* It does not include the `Xsolve` and `CS.SPARK_XCALL()` features noted above.

### Run again in API Tester

The inputs from the particular API call will be sent to the [API Tester](/navigation/api-tester.md) to facilitate testing.
