> 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.

# Create Live Session

POST https://www.crehana.com/api/v5/rest/org/{organization_slug}/learning/live-sessions/
Content-Type: application/json

Create a live session in the organization.

`start_date` and `end_date` are wall-clock times in `time_zone`, without
offset. Participants can be invited on creation with
`participant_user_ids` or later with the participants endpoint.

User ids are learning user ids: take them from `user.id` in
`GET /org/{organization_slug}/learning/users/` or from `learning_user_id` in
`GET /org/{organization_slug}/users/user-organizations/` (where `user.id`
is the centralized id). A centralized user id targets a different person.

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

## 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)

### Body (application/json)

This endpoint expects a CreateLiveSessionInput.

- `session_title` (string, required) — Title of the session. If the organization already has one with this title, a numeric suffix is appended and the created title is returned in the response
- `start_date` (datetime, required) — Start of the session as wall-clock time in time_zone, without offset (YYYY-MM-DDTHH:MM:SS)
- `end_date` (datetime, required) — End of the session as wall-clock time in time_zone, without offset (YYYY-MM-DDTHH:MM:SS)
- `time_zone` (enum, required) — Time zone the dates are expressed in
  - Allowed values: `TIME_ZONE_ES_PE`, `TIME_ZONE_ES_CO`, `TIME_ZONE_ES_AR`, `TIME_ZONE_ES_MX`, `TIME_ZONE_ES_ES`, `TIME_ZONE_ES_CL`, `TIME_ZONE_PT_BR`, `TIME_ZONE_ES_DO`, `TIME_ZONE_ES_PR`, `TIME_ZONE_HT`, `TIME_ZONE_ES_CU`, `TIME_ZONE_ES_PY`, `TIME_ZONE_ES_BO`, `TIME_ZONE_ES_VE`, `TIME_ZONE_ES_UY`, `TIME_ZONE_EC_GUAYAQUIL`, `TIME_ZONE_EC_GALAPAGOS`, `TIME_ZONE_BZ`, `TIME_ZONE_GT`, `TIME_ZONE_HN`, `TIME_ZONE_SV`, `TIME_ZONE_NI`, `TIME_ZONE_CR`, `TIME_ZONE_PA`
- `type_session` (enum, required) — ONLINE for a virtual session, PRESENCE for an on-site one
  - Allowed values: `ONLINE`, `PRESENCE`
- `description` (string, required) — Description shown in the session detail. Required: the learning service stores it as a non-null column
- `location` (string, optional) — Meeting url for ONLINE sessions, physical address for PRESENCE ones
- `instructor_name` (string, optional) — Name shown as the instructor of the session
- `cover_file_id` (integer, optional) — Id of an uploaded file to use as the session cover image
- `resource_file_ids` (list of integer, optional) — Ids of uploaded files attached to the session as resources
- `participant_user_ids` (list of integer, optional) — Learning user ids invited on creation. More participants can be added later with the participants endpoint. These are learning user ids, not the centralized\_user\_id used by the users and enrollments endpoints: sending one in place of the other targets a different person. Get them from user.id in GET /org/\{organization\_slug}/learning/users/ (filter with user\_email; results\[].id is the membership id, not the user id), or from learning\_user\_id in GET /org/\{organization\_slug}/users/user-organizations/ (there user.id is the centralized id)
- `has_qr_available` (boolean, optional, default: false) — Generate a QR code so attendees can register their own attendance
- `issues_certificate` (boolean, optional, default: false) — Whether the session issues a certificate

## Response

### 201

Live session created

- `message` (string, required) — Message of the response
- `code` (string, required) — Internal code of the response
- `datetime` (string, required) — Datetime of the API in ISO Format
- `data` (LiveSession, optional) — The created live session

## Errors

### 400 Bad Request Error

Validation error reported by the learning service

- `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

### 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

### 409 Conflict Error

Integrity error while creating the session

- `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)

### 500 Internal Server Error

Internal server error

- `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

## 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

**Request**

```json
{
  "session_title": "Onboarding comercial",
  "start_date": "2026-10-01T10:00:00",
  "end_date": "2026-10-01T11:00:00",
  "time_zone": "TIME_ZONE_ES_PE",
  "type_session": "ONLINE",
  "description": "Sesión de bienvenida para el equipo comercial",
  "location": "https://meet.google.com/abc-defg-hij",
  "instructor_name": "Katherine N.",
  "participant_user_ids": [
    605275
  ],
  "has_qr_available": true,
  "issues_certificate": false
}
```

**Response**

```json
{
  "message": "Live session 1258 created",
  "code": "LIVE_SESSION_CREATED",
  "datetime": "2026-09-16T10:30:00.000Z",
  "data": {
    "id": "1258",
    "session_title": "Onboarding comercial",
    "type_session": "ONLINE",
    "location": "https://meet.google.com/abc-defg-hij",
    "time_zone": "TIME_ZONE_ES_PE",
    "start_date": "2026-10-01T10:00:00",
    "end_date": "2026-10-01T11:00:00",
    "has_qr_available": true,
    "issues_certificate": false
  }
}
```

**SDK Code**

```python
import requests

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

payload = {
    "session_title": "Onboarding comercial",
    "start_date": "2026-10-01T10:00:00",
    "end_date": "2026-10-01T11:00:00",
    "time_zone": "TIME_ZONE_ES_PE",
    "type_session": "ONLINE",
    "description": "Sesión de bienvenida para el equipo comercial",
    "location": "https://meet.google.com/abc-defg-hij",
    "instructor_name": "Katherine N.",
    "participant_user_ids": [605275],
    "has_qr_available": True,
    "issues_certificate": False
}
headers = {
    "Secret-Access": "Secret-Access",
    "Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/';
const options = {
  method: 'POST',
  headers: {
    'Secret-Access': 'Secret-Access',
    'Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"session_title":"Onboarding comercial","start_date":"2026-10-01T10:00:00","end_date":"2026-10-01T11:00:00","time_zone":"TIME_ZONE_ES_PE","type_session":"ONLINE","description":"Sesión de bienvenida para el equipo comercial","location":"https://meet.google.com/abc-defg-hij","instructor_name":"Katherine N.","participant_user_ids":[605275],"has_qr_available":true,"issues_certificate":false}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"session_title\": \"Onboarding comercial\",\n  \"start_date\": \"2026-10-01T10:00:00\",\n  \"end_date\": \"2026-10-01T11:00:00\",\n  \"time_zone\": \"TIME_ZONE_ES_PE\",\n  \"type_session\": \"ONLINE\",\n  \"description\": \"Sesión de bienvenida para el equipo comercial\",\n  \"location\": \"https://meet.google.com/abc-defg-hij\",\n  \"instructor_name\": \"Katherine N.\",\n  \"participant_user_ids\": [\n    605275\n  ],\n  \"has_qr_available\": true,\n  \"issues_certificate\": false\n}")

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

	req.Header.Add("Secret-Access", "Secret-Access")
	req.Header.Add("Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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::Post.new(url)
request["Secret-Access"] = 'Secret-Access'
request["Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"session_title\": \"Onboarding comercial\",\n  \"start_date\": \"2026-10-01T10:00:00\",\n  \"end_date\": \"2026-10-01T11:00:00\",\n  \"time_zone\": \"TIME_ZONE_ES_PE\",\n  \"type_session\": \"ONLINE\",\n  \"description\": \"Sesión de bienvenida para el equipo comercial\",\n  \"location\": \"https://meet.google.com/abc-defg-hij\",\n  \"instructor_name\": \"Katherine N.\",\n  \"participant_user_ids\": [\n    605275\n  ],\n  \"has_qr_available\": true,\n  \"issues_certificate\": false\n}"

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.post("https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/")
  .header("Secret-Access", "Secret-Access")
  .header("Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"session_title\": \"Onboarding comercial\",\n  \"start_date\": \"2026-10-01T10:00:00\",\n  \"end_date\": \"2026-10-01T11:00:00\",\n  \"time_zone\": \"TIME_ZONE_ES_PE\",\n  \"type_session\": \"ONLINE\",\n  \"description\": \"Sesión de bienvenida para el equipo comercial\",\n  \"location\": \"https://meet.google.com/abc-defg-hij\",\n  \"instructor_name\": \"Katherine N.\",\n  \"participant_user_ids\": [\n    605275\n  ],\n  \"has_qr_available\": true,\n  \"issues_certificate\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://www.crehana.com/api/v5/rest/org/organization_slug/learning/live-sessions/', [
  'body' => '{
  "session_title": "Onboarding comercial",
  "start_date": "2026-10-01T10:00:00",
  "end_date": "2026-10-01T11:00:00",
  "time_zone": "TIME_ZONE_ES_PE",
  "type_session": "ONLINE",
  "description": "Sesión de bienvenida para el equipo comercial",
  "location": "https://meet.google.com/abc-defg-hij",
  "instructor_name": "Katherine N.",
  "participant_user_ids": [
    605275
  ],
  "has_qr_available": true,
  "issues_certificate": false
}',
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Content-Type' => 'application/json',
    '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.POST);
request.AddHeader("Secret-Access", "Secret-Access");
request.AddHeader("Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"session_title\": \"Onboarding comercial\",\n  \"start_date\": \"2026-10-01T10:00:00\",\n  \"end_date\": \"2026-10-01T11:00:00\",\n  \"time_zone\": \"TIME_ZONE_ES_PE\",\n  \"type_session\": \"ONLINE\",\n  \"description\": \"Sesión de bienvenida para el equipo comercial\",\n  \"location\": \"https://meet.google.com/abc-defg-hij\",\n  \"instructor_name\": \"Katherine N.\",\n  \"participant_user_ids\": [\n    605275\n  ],\n  \"has_qr_available\": true,\n  \"issues_certificate\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Secret-Access": "Secret-Access",
  "Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "session_title": "Onboarding comercial",
  "start_date": "2026-10-01T10:00:00",
  "end_date": "2026-10-01T11:00:00",
  "time_zone": "TIME_ZONE_ES_PE",
  "type_session": "ONLINE",
  "description": "Sesión de bienvenida para el equipo comercial",
  "location": "https://meet.google.com/abc-defg-hij",
  "instructor_name": "Katherine N.",
  "participant_user_ids": [605275],
  "has_qr_available": true,
  "issues_certificate": false
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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 = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```