Source: https://leadping.ai/docs/api-reference/appointments/list-appointments

# List appointments.

**Appointments**

Returns appointments visible to the current user, with optional lead, reminder, and status filters.

## Endpoint

```http
GET https://api.leadping.ai/appointments
```

## Authentication

### Authorization

`string` · **header** · **required**

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

```text
Authorization: Bearer <token>
```

## Request examples

### cURL

```bash
curl --request GET \
  --url https://api.leadping.ai/appointments \
  --header 'Authorization: Bearer <token>'
```

### Python

```python
import requests

url = "https://api.leadping.ai/appointments"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.leadping.ai/appointments");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);

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

### Java

```java
HttpResponse<String> response = Unirest.get("https://api.leadping.ai/appointments")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### JavaScript

```javascript
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

### Go

```go
package main

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

func main() {

	url := "https://api.leadping.ai/appointments"

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

	req.Header.Add("Authorization", "Bearer <token>")

	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/appointments",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

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

curl_close($curl);

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

## Query parameters

### `leadId`

`string`

An optional lead identifier to filter appointments.

### `dueOnly`

`boolean`

Whether to return only due, undismissed reminders assigned to the current agent.

### `adminMode`

`boolean`

Whether to browse across organizations. Requires a platform administrator; due-only results remain limited to the current agent.

### `includeClosed`

`boolean`

Whether to include completed and cancelled appointments. Ignored when `dueOnly` is true.

## Response

### `200` — Success

The request completed successfully.

Content type: `application/json`

Returns an array of appointment objects.

```json
[
  {
    "isDemo": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "modifiedAt": "2023-11-07T05:31:56Z",
    "history": [
      {
        "revision": 123,
        "type": "<string>",
        "at": "2023-11-07T05:31:56Z",
        "actorId": "<string>",
        "actorName": "<string>",
        "startAt": "2023-11-07T05:31:56Z",
        "reminderAt": "2023-11-07T05:31:56Z",
        "assignedToName": "<string>",
        "title": "<string>",
        "notes": "<string>"
      }
    ],
    "id": "<string>",
    "leadId": "<string>",
    "leadFirstName": "<string>",
    "leadLastName": "<string>",
    "leadEmail": "jsmith@example.com",
    "leadAvatarUrl": "<string>",
    "leadName": "<string>",
    "organizationId": "<string>",
    "organizationName": "<string>",
    "assignedToUserId": "<string>",
    "assignedToName": "<string>",
    "startAt": "2023-11-07T05:31:56Z",
    "timeZoneId": "<string>",
    "title": "<string>",
    "notes": "<string>",
    "status": "<string>",
    "revision": 123,
    "reminderAt": "2023-11-07T05:31:56Z",
    "dismissedAt": "2023-11-07T05:31:56Z"
  }
]
```

#### Response item fields

| Field | Type |
|---|---|
| `isDemo` | `boolean` |
| `createdAt` | `null \| string<date-time>` |
| `modifiedAt` | `null \| string<date-time>` |
| `history` | `object[]` |
| `id` | `string` |
| `leadId` | `string` |
| `leadFirstName` | `null \| string` |
| `leadLastName` | `null \| string` |
| `leadEmail` | `null \| string<email>` |
| `leadAvatarUrl` | `null \| string<uri>` |
| `leadName` | `string` |
| `organizationId` | `string` |
| `organizationName` | `null \| string` |
| `assignedToUserId` | `string` |
| `assignedToName` | `string` |
| `startAt` | `string<date-time>` |
| `timeZoneId` | `string` |
| `title` | `string` |
| `notes` | `null \| string` |
| `status` | `string` |
| `revision` | `integer<int64>` |
| `reminderAt` | `string<date-time>` |
| `dismissedAt` | `null \| string<date-time>` |

#### `history` item fields

`history` contains immutable snapshots of appointment changes and their actors.

| Field | Type |
|---|---|
| `revision` | `integer<int64>` |
| `type` | `string` |
| `at` | `string<date-time>` |
| `actorId` | `null \| string` |
| `actorName` | `null \| string` |
| `startAt` | `string<date-time>` |
| `reminderAt` | `string<date-time>` |
| `assignedToName` | `string` |
| `title` | `string` |
| `notes` | `null \| string` |

### `401` — Unauthorized

Authentication credentials are missing or invalid.

Content type: `application/problem+json`

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

Response header:

- `WWW-Authenticate`: Bearer authentication challenge returned when credentials are missing or invalid.

### `403` — Forbidden

The caller does not have permission to perform this operation.

Content type: `application/problem+json`

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

### `429` — Too Many Requests

The API rate limit for this account or client has been exceeded.

Content type: `application/problem+json`

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

Response header:

- `Retry-After`: Number of seconds to wait before retrying the request.
