---
title: Returns a list of OpenVPN sessions by batches (up to 100 in a single request).
canonical: https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-0/sessions/returns-a-list-of-openvpn-sessions-by-batches--up-to-100-in-a-single-request/
product: CloudConnexa Docs
---

# Returns a list of OpenVPN sessions by batches (up to 100 in a single request).

`GET /api/v1/sessions`

Endpoint to retrieve a list of sessions with filters by date range and status.

For example:

```
GET /api/v1/sessions?startDate=2022-10-25T00:00:00.000Z&endDate=2022-10-26T00:00:00.000Z&size=100&status=ACTIVE
```

Will return:

```json
{
  "sessions": [ .. ],
  "nextCursor: "63527ce1d8e5811243db4902"
}
```

If `nextCursor` is not empty, then it should be passed in the subsequent request to retrieve the next 100 sessions:

`GET /api/v1/sessions?startDate=2022-10-25T00:00:00.000Z&endDate=2022-10-26T00:00:00.000Z&size=100&status=ACTIVE&cursor=63527ce1d8e5811243db4902`

If you encounter rate-limit issues, retry after 1 minute. If the issue persists, please open a [Support Ticket](https://support.openvpn.com/hc/en-us/requests/new?ticket_form_id=360001597871).

```
When nextCursor is missing in the response, then there are no more sessions.
```

If you encounter rate-limit issues, retry after 1 minute. If the issue persists, please open a [Support Ticket](https://support.openvpn.com/hc/en-us/requests/new?ticket_form_id=360001597871).

```
When nextCursor is missing in the response, then there are no more sessions.
```

If you encounter rate-limit issues, retry after 1 minute. If the issue persists, please open a [Support Ticket](https://support.openvpn.com/hc/en-us/requests/new?ticket_form_id=360001597871).

`GET /api/v1/sessions?startDate=2022-10-25T00:00:00.000Z&endDate=2022-10-26T00:00:00.000Z&size=100&status=ACTIVE&cursor=63527ce1d8e5811243db4902`

If you encounter rate-limit issues, retry after 1 minute. If the issue persists, please open a [Support Ticket](https://support.openvpn.com/hc/en-us/requests/new?ticket_form_id=360001597871).

```
When nextCursor is missing in the response, then there are no more sessions.
```

If you encounter rate-limit issues, retry after 1 minute. If the issue persists, please open a [Support Ticket](https://support.openvpn.com/hc/en-us/requests/new?ticket_form_id=360001597871).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| startDate | query | string(date-time) | false | Filter sessions by created or updated after this date (inclusive). |
| endDate | query | string(date-time) | false | Filter sessions by created or updated before this date (exclusive). |
| status | query | string | false | Filter by session status. |
| returnOnlyNew | query | boolean | false | `Notes:` |
| size | query | string(int32) | true | Session count to return in one batch min = 1 max = 100. |
| cursor | query | string | false | An opaque string value that represents a cursor pointer for the next batch of sessions. |

### Detailed descriptions

```
startDate: Filter sessions by created or updated after this date (inclusive).
Notes: * Max 30 days of history available.
* If value is before (now - 30 days), an error will be returned.
* Should use ISO_INSTANT format, e.g. 2022-11-08T14:53:43Z.
* Should be less than endDate, otherwise no sessions will be returned.
```

**Default value : now - 1 day**

```
endDate: Filter sessions by created or updated before this date (exclusive).
Notes: * Should use ISO_INSTANT format, e.g. 2022-11-08T14:53:43Z.
```

```
returnOnlyNew: Notes: * If true, returns only new sessions created between specified dates (no duplicates).
* If false, returns updated sessions between specified dates (duplicates may be returned in subsequent requests).
```

### Enumerated Values

| Parameter | Value |
| --- | --- |
| status | ACTIVE |
| status | COMPLETED |
| status | FAILED |

## Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [SessionsResponse](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-0/schemas/sessionsresponse.md) |

To perform this operation, you must be authenticated by means of one of the following methods: oauth

---

Prev: [Sessions](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-0/sessions.md)
Next: [Access Group](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-0/access-group.md)
Index: https://openvpn.net/cloud-docs/llms.txt
