> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.crehana.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.crehana.com/_mcp/server.

# Get Live Sessions

GET https://www.crehana.com/api/v5/rest/org/{organization_slug}/learning/live-sessions/

Return the live sessions of the organization, newest first.

The counters cover the whole calendar of the organization: `total` is every
session in both timelines, while `next_sessions_count` and
`past_sessions_count` say how many are in each one. `results` holds only
the requested page of the requested `status`.

Reference: https://developer.crehana.com/api-reference/endpoints/live-sessions/get-live-sessions

## Authentication

- `Api-Key` header (required) — API key of the organization. Always sent together with the `Secret-Access` header.

## Servers

- `https://www.crehana.com` (Production, default)
- `https://qa.creha.co` (QA)

## Request

### Path parameters

- `organization_slug` (string, required)

### Query parameters

- `status` (enum, optional, default: NEXT) — NEXT returns the sessions that have not finished yet, PAST the ones already finished. Ask for both to walk the whole calendar
  - Allowed values: `NEXT`, `PAST`
- `first` (integer, optional, default: 10) — Page size (1-100)
- `page` (integer, optional, default: 1) — Page number, starting at 1
- `ids` (list of integer, optional) — Return only these live session ids (up to 100, the same cap as the page size)

## Response

### 200

Successful Response

- `total` (integer, required) — Sessions of the organization in both timelines, not only the requested status
- `next_sessions_count` (integer, required) — Sessions that have not finished yet
- `past_sessions_count` (integer, required) — Sessions already finished
- `results` (list of LiveSession, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, required)
- `errors` (list of string, required)
- `datetime` (string, optional)

### 401 Unauthorized Error

Unauthorized - Invalid or missing credentials

- `any`

### 403 Forbidden Error

The credentials do not give access to that organization

- `message` (string, required) — Message of the error
- `code` (string, required) — Internal code of the error
- `datetime` (string, required) — Datetime of the API in ISO Format
- `detail` (string, required) — Detail of the error

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### LiveSession

A live session (instructor-led event) of the organization.

- `id` (string, required) — Id of the live session; send it in the path when assigning participants or registering attendance
- `session_title` (string, required) — Title of the session. A numeric suffix is appended when the organization already has a session with the same title
- `description` (string, optional)
- `instructor_name` (string, optional)
- `type_session` (string, optional) — ONLINE or PRESENCE
- `location` (string, optional) — Meeting url for ONLINE sessions, physical address for PRESENCE ones
- `time_zone` (string, optional) — Time zone the session dates are expressed in
- `start_date` (string, optional) — Start of the session as wall-clock time in its own time_zone (YYYY-MM-DDTHH:MM:SS)
- `end_date` (string, optional) — End of the session as wall-clock time in its own time_zone (YYYY-MM-DDTHH:MM:SS)
- `start_date_utc` (datetime, optional) — Start of the session in UTC (ISO 8601)
- `end_date_utc` (datetime, optional) — End of the session in UTC (ISO 8601)
- `timeline` (string, optional) — PAST, FOR_START, LIVE or FUTURE
- `status_session` (string, optional) — FUTURE or PAST, as stored when the session was saved
- `total_guests` (integer, optional) — Participants currently assigned to the session
- `has_qr_available` (boolean, optional) — Whether the session has a QR code for attendance
- `issues_certificate` (boolean, optional)
- `created_at` (datetime, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "total": 1,
  "next_sessions_count": 1,
  "past_sessions_count": 1,
  "results": [
    {
      "id": "string",
      "session_title": "string",
      "description": "string",
      "instructor_name": "string",
      "type_session": "string",
      "location": "string",
      "time_zone": "string",
      "start_date": "string",
      "end_date": "string",
      "start_date_utc": "2024-01-15T09:30:00Z",
      "end_date_utc": "2024-01-15T09:30:00Z",
      "timeline": "string",
      "status_session": "string",
      "total_guests": 1,
      "has_qr_available": true,
      "issues_certificate": true,
      "created_at": "2024-01-15T09:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/"

headers = {
    "Secret-Access": "Secret-Access",
    "Api-Key": "<apiKey>"
}

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

print(response.json())
```

```javascript
const url = 'https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/';
const options = {
  method: 'GET',
  headers: {'Secret-Access': 'Secret-Access', 'Api-Key': '<apiKey>'}
};

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://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/"

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

	req.Header.Add("Secret-Access", "Secret-Access")
	req.Header.Add("Api-Key", "<apiKey>")

	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://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/")

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

request = Net::HTTP::Get.new(url)
request["Secret-Access"] = 'Secret-Access'
request["Api-Key"] = '<apiKey>'

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://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/")
  .header("Secret-Access", "Secret-Access")
  .header("Api-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/', [
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Secret-Access' => 'Secret-Access',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/");
var request = new RestRequest(Method.GET);
request.AddHeader("Secret-Access", "Secret-Access");
request.AddHeader("Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Secret-Access": "Secret-Access",
  "Api-Key": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/")! 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()
```