Source: https://leadping.ai/docs/api-reference/events/list-a-conversations-event-history

# List a conversation's event history

**Events**

Lists event records for one conversation with paging, including notes, messages, calls, and follow-up history.

## Endpoint

```text
POST https://api.leadping.ai/events/conversations/{conversationId}
```

## Request examples

### cURL

```bash
curl --request POST \
  --url https://api.leadping.ai/events/conversations/{conversationId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

### Python

```python
import requests

url = "https://api.leadping.ai/events/conversations/{conversationId}"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### C# — RestSharp

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.leadping.ai/events/conversations/{conversationId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://api.leadping.ai/events/conversations/{conversationId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({})
};

fetch('https://api.leadping.ai/events/conversations/{conversationId}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.leadping.ai/events/conversations/{conversationId}"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### PHP

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.leadping.ai/events/conversations/{conversationId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

## Authorizations

### Authorization

- **Type:** `string`
- **Location:** Header
- **Required**

Authorization header using the Bearer scheme. Accepted values are Leadping user JWT access tokens and WorkOS organization API keys beginning with `sk_`.

## Path parameters

### conversationId

- **Type:** `string`
- **Required**

The ID of the conversation.

## Body

**Content types:**

- `application/json`
- `application/*+json`

Pagination, filtering, and sorting options.

Defines cursor pagination, sorting, search, exact-match filters, and range filters for a structured API query.

### pageSize

- **Type:** `integer<int32>`

Maximum number of items requested for one page; the server may enforce a lower maximum or apply a default.

### continuationToken

- **Type:** `null | string`

Opaque cursor returned by the previous paged response; omit it when requesting the first page and do not parse or modify it.

### orderBy

- **Type:** `null | object[]`

Sort instructions applied in priority order, with the first entry acting as the primary sort.

Child attributes are available for the `orderBy` objects.

### includeCount

- **Type:** `null | boolean`

Whether the response should include the total number of matching records; counting may increase query cost or latency.

### search

- **Type:** `null | string`

Free-text search term applied to the configured SearchFields.

### searchFields

- **Type:** `null | string[]`

Serializable string field names searched for Search; supported names are determined by the queried resource.

### filters

- **Type:** `null | object[]`

Exact-match conditions that require each named field to equal its supplied value.

Child attributes are available for the `filters` objects.

### rangeFilters

- **Type:** `null | object[]`

Range conditions that constrain comparable fields with inclusive or exclusive lower and upper bounds.

Child attributes are available for the `rangeFilters` objects.

## Response

### `200` — application/json

Events for the conversation were successfully retrieved.

Returns one page of query results together with page-size, optional total-count, and opaque continuation-cursor metadata.

#### Response fields

##### items

- **Type:** `object[]`

Items included in the current page, in the order determined by the query.

Each item may contain the following fields:

- `isDemo`
- `id`
- `eventType`
- `eventCategory`
- `timelineType`
- `timelineCategory`
- `description`
- `conversationId`
- `leadId`
- `relatedEntityType`
- `relatedEntityId`
- `automationRunId`
- `summary`
- `media`
- `direction`
- `status`
- `statusReason`
- `trafficType`
- `fromPhoneNumberId`
- `outboundPhoneNumberId`
- `fromPhoneNumber`
- `toPhoneNumber`
- `selectionReason`
- `wasManuallyOverridden`
- `campaignId`
- `sourceId`
- `complianceAction`
- `billingStatus`
- `billableAmount`
- `errorCode`
- `retryCount`
- `queuedAt`
- `sendingStartedAt`
- `sentAt`
- `deliveredAt`
- `receivedAt`
- `failedAt`
- `undeliverableAt`
- `blockedAt`
- `nextRetryAt`
- `scheduledFor`
- `scheduledReason`
- `canceledAt`
- `cancelReason`
- `createdAt`
- `createdBy`
- `actorUserId`
- `actorDisplayName`
- `actorEmail`

The `media` field contains an array of media objects with:

- `fileId`
- `url`
- `contentType`
- `size`
- `sha256`
- `fileName`

##### pageSize

- **Type:** `integer<int32>`

Effective page-size limit used for this response, which may differ from the requested size because of server defaults or limits.

##### totalCount

- **Type:** `null | integer<int32>`

Total number of records matching the query across all pages, or `null` when counting was not requested or computed.

##### continuationToken

- **Type:** `null | string`

Opaque cursor for requesting the next page, or `null` when no additional page is available; clients must not parse or modify it.

#### Example response

```json
{
  "items": [
    {
      "isDemo": true,
      "id": "<string>",
      "eventType": "<string>",
      "eventCategory": "<string>",
      "timelineType": "Message",
      "timelineCategory": "<string>",
      "description": "<string>",
      "conversationId": "<string>",
      "leadId": "<string>",
      "relatedEntityType": "<string>",
      "relatedEntityId": "<string>",
      "automationRunId": "<string>",
      "summary": "<string>",
      "media": [
        {
          "fileId": "<string>",
          "url": "<string>",
          "contentType": "<string>",
          "size": 123,
          "sha256": "<string>",
          "fileName": "<string>"
        }
      ],
      "direction": "<string>",
      "status": "Pending",
      "statusReason": "<string>",
      "trafficType": "RealLead",
      "fromPhoneNumberId": "<string>",
      "outboundPhoneNumberId": "<string>",
      "fromPhoneNumber": "<string>",
      "toPhoneNumber": "<string>",
      "selectionReason": "StickyConversation",
      "wasManuallyOverridden": true,
      "campaignId": "<string>",
      "sourceId": "<string>",
      "complianceAction": "<string>",
      "billingStatus": "<string>",
      "billableAmount": 123,
      "errorCode": "<string>",
      "retryCount": 123,
      "queuedAt": "2023-11-07T05:31:56Z",
      "sendingStartedAt": "2023-11-07T05:31:56Z",
      "sentAt": "2023-11-07T05:31:56Z",
      "deliveredAt": "2023-11-07T05:31:56Z",
      "receivedAt": "2023-11-07T05:31:56Z",
      "failedAt": "2023-11-07T05:31:56Z",
      "undeliverableAt": "2023-11-07T05:31:56Z",
      "blockedAt": "2023-11-07T05:31:56Z",
      "nextRetryAt": "2023-11-07T05:31:56Z",
      "scheduledFor": "2023-11-07T05:31:56Z",
      "scheduledReason": "<string>",
      "canceledAt": "2023-11-07T05:31:56Z",
      "cancelReason": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "createdBy": "<string>",
      "actorUserId": "<string>",
      "actorDisplayName": "<string>",
      "actorEmail": "jsmith@example.com"
    }
  ],
  "pageSize": 123,
  "totalCount": 123,
  "continuationToken": "<string>"
}
```

### `400` — Bad Request

```json
{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "The request could not be completed."
}
```

### `401` — Unauthorized

```json
{
  "type": "about:blank",
  "title": "Unauthorized",
  "status": 401,
  "detail": "The request could not be completed."
}
```

### `403` — Forbidden

```json
{
  "type": "about:blank",
  "title": "Forbidden",
  "status": 403,
  "detail": "The request could not be completed."
}
```

### `429` — Too Many Requests

```json
{
  "type": "about:blank",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "The request could not be completed."
}
```
