curl --request POST \
--url https://api.example.com/v1/sessions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"tutor_id": "<string>",
"student_id": "<string>",
"math_level_id": "<string>",
"starts_at": "<string>",
"ends_at": "<string>",
"duration_minutes": 123,
"mode": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.example.com/v1/sessions"
payload = {
"tutor_id": "<string>",
"student_id": "<string>",
"math_level_id": "<string>",
"starts_at": "<string>",
"ends_at": "<string>",
"duration_minutes": 123,
"mode": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tutor_id: '<string>',
student_id: '<string>',
math_level_id: '<string>',
starts_at: '<string>',
ends_at: '<string>',
duration_minutes: 123,
mode: '<string>',
title: '<string>'
})
};
fetch('https://api.example.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/sessions",
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([
'tutor_id' => '<string>',
'student_id' => '<string>',
'math_level_id' => '<string>',
'starts_at' => '<string>',
'ends_at' => '<string>',
'duration_minutes' => 123,
'mode' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sessions"
payload := strings.NewReader("{\n \"tutor_id\": \"<string>\",\n \"student_id\": \"<string>\",\n \"math_level_id\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"ends_at\": \"<string>\",\n \"duration_minutes\": 123,\n \"mode\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/sessions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tutor_id\": \"<string>\",\n \"student_id\": \"<string>\",\n \"math_level_id\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"ends_at\": \"<string>\",\n \"duration_minutes\": 123,\n \"mode\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tutor_id\": \"<string>\",\n \"student_id\": \"<string>\",\n \"math_level_id\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"ends_at\": \"<string>\",\n \"duration_minutes\": 123,\n \"mode\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"title": "<string>",
"tutor_id": "<string>",
"student_id": "<string>",
"starts_at": "<string>",
"ends_at": "<string>",
"duration_minutes": 123,
"tutor_pay_rate_cents": 123,
"student_rate_cents": 123,
"amount_owed_cents": 123,
"mode": "<string>",
"subject_id": "<string>",
"created_at": "<string>",
"completed_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Create Session
Create a SCHEDULED session.
Creates a tutor_sessions row with status=‘scheduled’ and a participant whose
per-hour rate snapshot is resolved server-side from the org rate matrix. No
charge is initiated — settlement flows through the existing Stripe PaymentIntent
- webhook, and the tutor-owed ledger row is written only on completion (see PUT
/v1/sessions//complete).
organization_id,creator_id,status, the rate snapshot, and timestamps are all server-set.tutor_id/student_idmust be org-scoped (404 otherwise). The money-moving write runs inside a single transactional RPC. Requires thesessions:writescope. HonoursIdempotency-Key.
curl --request POST \
--url https://api.example.com/v1/sessions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"tutor_id": "<string>",
"student_id": "<string>",
"math_level_id": "<string>",
"starts_at": "<string>",
"ends_at": "<string>",
"duration_minutes": 123,
"mode": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.example.com/v1/sessions"
payload = {
"tutor_id": "<string>",
"student_id": "<string>",
"math_level_id": "<string>",
"starts_at": "<string>",
"ends_at": "<string>",
"duration_minutes": 123,
"mode": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tutor_id: '<string>',
student_id: '<string>',
math_level_id: '<string>',
starts_at: '<string>',
ends_at: '<string>',
duration_minutes: 123,
mode: '<string>',
title: '<string>'
})
};
fetch('https://api.example.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/sessions",
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([
'tutor_id' => '<string>',
'student_id' => '<string>',
'math_level_id' => '<string>',
'starts_at' => '<string>',
'ends_at' => '<string>',
'duration_minutes' => 123,
'mode' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sessions"
payload := strings.NewReader("{\n \"tutor_id\": \"<string>\",\n \"student_id\": \"<string>\",\n \"math_level_id\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"ends_at\": \"<string>\",\n \"duration_minutes\": 123,\n \"mode\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/sessions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tutor_id\": \"<string>\",\n \"student_id\": \"<string>\",\n \"math_level_id\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"ends_at\": \"<string>\",\n \"duration_minutes\": 123,\n \"mode\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tutor_id\": \"<string>\",\n \"student_id\": \"<string>\",\n \"math_level_id\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"ends_at\": \"<string>\",\n \"duration_minutes\": 123,\n \"mode\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"title": "<string>",
"tutor_id": "<string>",
"student_id": "<string>",
"starts_at": "<string>",
"ends_at": "<string>",
"duration_minutes": 123,
"tutor_pay_rate_cents": 123,
"student_rate_cents": 123,
"amount_owed_cents": 123,
"mode": "<string>",
"subject_id": "<string>",
"created_at": "<string>",
"completed_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Authorizations
Org API key as Token token=ei_live_...
Headers
Body
POST /v1/sessions → tutor_sessions. Creates a SCHEDULED session only.
No charge is initiated here (see public_writes_batch2.py — real charging stays
in the existing Stripe PaymentIntent + webhook flow). organization_id,
creator_id, status ('scheduled'), the per-hour rate snapshot (resolved from
the org rate matrix onto the session's participant), and timestamps are ALL
server-set. tutor_id / student_id must be org-scoped. math_level_id is the
subject identifier (text, e.g. 'methods_34').
Subject identifier, e.g. 'methods_34'
ISO 8601 timestamp
ISO 8601 timestamp; must be after starts_at
One of 30, 45, 60 (tutor_sessions CHECK)
online | in_person
Optional; defaults server-side if omitted
Response
Successful Response
Was this page helpful?