{"openapi":"3.1.0","info":{"title":"eLearning.edu.pl Integration API","version":"0.59.0","description":"REST API for integrating HR systems, identity providers and reporting tools with the training platform.\n\n**Base URL** — use the API host of your platform (shown under *Servers*). The host does not change when your\norganisation is moved between data-centre nodes.\n\n**Tenant** — every request names your organisation with the `X-Tenant-Code` header (SCIM: the code is part of the\npath, `/scim/v2/{tenant_code}/…`). Your tenant code is shown in the IT administration panel.\n\n**Authentication** — an integration client created by your IT administrator authenticates with either:\n- `X-API-Key: <secret>` on every request, or\n- OAuth 2.0 client credentials: `POST /api/v1/oauth/token` returns a 15-minute bearer token.\n\nEach client has scopes, an optional IP allowlist and its own rate limits.\n\n**Errors** use Problem Details (RFC 9457, `application/problem+json`) with a stable `type`/`title` and, where\napplicable, a machine-readable code. **Rate limits** are reported in `RateLimit-*` headers; on `429` wait for\n`Retry-After` seconds.\n\n**Versioning** — the major version is in the path (`/api/v1`). Within v1 we only make backward-compatible changes:\nnew endpoints, new optional parameters, new response fields and new enum values. Clients must ignore unknown fields\nand tolerate unknown enum values. A breaking change ships as `/api/v2`; v1 then stays available for at least 12 months,\nannounced with `Deprecation` and `Sunset` response headers and an e-mail to IT administrators.\n"},"servers":[{"url":"https://api.elearning.edu.pl","description":"Production"}],"tags":[{"name":"Authentication","description":"OAuth 2.0 client credentials for integration clients."},{"name":"Users","description":"Employees and contractors: synchronisation from HR systems and profile fields."},{"name":"Courses","description":"The organisation's course catalog: identifiers and codes for enrollments and compliance reports."},{"name":"Enrollments","description":"Assigning courses to people."},{"name":"Compliance","description":"Training compliance status of people per course."},{"name":"Webhooks","description":"Event subscriptions delivered to your endpoint, signed with HMAC-SHA256.","x-displayName":"Webhook subscriptions"},{"name":"SCIM","description":"SCIM 2.0 user and group provisioning (RFC 7643/7644)."}],"paths":{"/api/v1/compliance/matrix":{"get":{"tags":["Compliance"],"operationId":"getComplianceMatrix","summary":"Compliance matrix: person × course","description":"Compliance status of people per course, refreshed periodically (see `refreshed_at`). The summary counts people by their worst status and respects the scope filters (department, course) but not the flag filter. Requires the `compliance:read` scope.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"department_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"department_query","in":"query","schema":{"type":"string","maxLength":100},"description":"Department name, matched fuzzily (e.g. \"Welding shop\")."},{"name":"course_code","in":"query","schema":{"type":"string","maxLength":64}},{"name":"compliance_flag","in":"query","schema":{"type":"string","enum":["COMPLIANT","EXPIRING_SOON","OVERDUE","IN_PROGRESS","PENDING"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"Matrix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceMatrix"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/compliance/matrix?limit=50\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/compliance/matrix\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    params={\"limit\": \"50\"},\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/compliance/matrix', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'query' => ['limit' => '50'],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/compliance/matrix?limit=50\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/compliance/matrix?limit=50`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/compliance/matrix?limit=50\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/compliance/matrix?limit=50\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/users":{"get":{"tags":["Users"],"operationId":"listUsers","summary":"List people (HR synchronisation)","description":"Requires the `users:read` scope.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"department_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"employee_no","in":"query","schema":{"type":"string","maxLength":64}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"worker_type","in":"query","schema":{"type":"string","enum":["internal_payroll","b2b_contractor"]}},{"name":"contractor_id","in":"query","schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]},{"integrationToken":[]},{"integrationToken":[]}],"responses":{"200":{"description":"People.","content":{"application/json":{"schema":{"type":"object","required":["pagination","users"],"properties":{"pagination":{"type":"object","required":["total","limit","offset"],"properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/users?limit=100\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/users\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    params={\"limit\": \"100\"},\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/users', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'query' => ['limit' => '100'],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/users?limit=100\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/users?limit=100`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/users?limit=100\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/users?limit=100\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"post":{"tags":["Users"],"operationId":"createUser","summary":"Create a person (onboarding)","description":"Creates an account without a password; the person sets one at first sign-in. Requires the `users:write` scope. Accepts standard fields and custom `attributes`.","parameters":[{"$ref":"#/components/parameters/TenantCode"}],"security":[{"apiKey":[]},{"integrationToken":[]},{"integrationToken":[]},{"integrationToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"},"example":{"employee_no":"E1001","first_name":"Anna","last_name":"Example","email":"anna.example@example.com","department_name":"Logistics","worker_type":"internal_payroll","job_title":"Warehouse operator"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"A person with this employee number, login or e-mail already exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/users\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  --data @- <<'JSON'\n{\n  \"employee_no\": \"E1001\",\n  \"first_name\": \"Anna\",\n  \"last_name\": \"Example\",\n  \"email\": \"anna.example@example.com\",\n  \"department_name\": \"Logistics\",\n  \"worker_type\": \"internal_payroll\",\n  \"job_title\": \"Warehouse operator\"\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/users\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    json={\n        \"employee_no\": \"E1001\",\n        \"first_name\": \"Anna\",\n        \"last_name\": \"Example\",\n        \"email\": \"anna.example@example.com\",\n        \"department_name\": \"Logistics\",\n        \"worker_type\": \"internal_payroll\",\n        \"job_title\": \"Warehouse operator\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/users', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'json' => [\n        'employee_no' => 'E1001',\n        'first_name' => 'Anna',\n        'last_name' => 'Example',\n        'email' => 'anna.example@example.com',\n        'department_name' => 'Logistics',\n        'worker_type' => 'internal_payroll',\n        'job_title' => 'Warehouse operator',\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"employee_no\": \"E1001\",\n  \"first_name\": \"Anna\",\n  \"last_name\": \"Example\",\n  \"email\": \"anna.example@example.com\",\n  \"department_name\": \"Logistics\",\n  \"worker_type\": \"internal_payroll\",\n  \"job_title\": \"Warehouse operator\"\n}`\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/users\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/users`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"employee_no\": \"E1001\",\n    \"first_name\": \"Anna\",\n    \"last_name\": \"Example\",\n    \"email\": \"anna.example@example.com\",\n    \"department_name\": \"Logistics\",\n    \"worker_type\": \"internal_payroll\",\n    \"job_title\": \"Warehouse operator\"\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/users\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"employee_no\": \"E1001\",\n      \"first_name\": \"Anna\",\n      \"last_name\": \"Example\",\n      \"email\": \"anna.example@example.com\",\n      \"department_name\": \"Logistics\",\n      \"worker_type\": \"internal_payroll\",\n      \"job_title\": \"Warehouse operator\"\n    }\n    \"\"\", Encoding.UTF8, \"application/json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"employee_no\": \"E1001\",\n              \"first_name\": \"Anna\",\n              \"last_name\": \"Example\",\n              \"email\": \"anna.example@example.com\",\n              \"department_name\": \"Logistics\",\n              \"worker_type\": \"internal_payroll\",\n              \"job_title\": \"Warehouse operator\"\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/users\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/json\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/enrollments":{"post":{"tags":["Enrollments"],"operationId":"assignEnrollment","summary":"Assign a course","description":"Emits the `enrollment.assigned` webhook event. Requires the `enrollments:write` scope. Licensed library courses follow their licence: a course licensed only as part of a learning path or with an expired licence returns 422; no free seat returns 409 `SEAT_LIMIT_REACHED`.","parameters":[{"$ref":"#/components/parameters/TenantCode"}],"security":[{"apiKey":[]},{"integrationToken":[]},{"integrationToken":[]},{"integrationToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignEnrollmentRequest"},"example":{"employee_no":"E1001","course_code":"OHS-BASIC","cycle_year":2026,"due_date":"2026-12-31"}}}},"responses":{"201":{"description":"Assigned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Enrollment"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"An enrollment for this course in this cycle already exists, or the licence has no free seat (`SEAT_LIMIT_REACHED`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/enrollments\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  --data @- <<'JSON'\n{\n  \"employee_no\": \"E1001\",\n  \"course_code\": \"OHS-BASIC\",\n  \"cycle_year\": 2026,\n  \"due_date\": \"2026-12-31\"\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/enrollments\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    json={\n        \"employee_no\": \"E1001\",\n        \"course_code\": \"OHS-BASIC\",\n        \"cycle_year\": 2026,\n        \"due_date\": \"2026-12-31\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/enrollments', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'json' => [\n        'employee_no' => 'E1001',\n        'course_code' => 'OHS-BASIC',\n        'cycle_year' => 2026,\n        'due_date' => '2026-12-31',\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"employee_no\": \"E1001\",\n  \"course_code\": \"OHS-BASIC\",\n  \"cycle_year\": 2026,\n  \"due_date\": \"2026-12-31\"\n}`\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/enrollments\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/enrollments`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"employee_no\": \"E1001\",\n    \"course_code\": \"OHS-BASIC\",\n    \"cycle_year\": 2026,\n    \"due_date\": \"2026-12-31\"\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/enrollments\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"employee_no\": \"E1001\",\n      \"course_code\": \"OHS-BASIC\",\n      \"cycle_year\": 2026,\n      \"due_date\": \"2026-12-31\"\n    }\n    \"\"\", Encoding.UTF8, \"application/json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"employee_no\": \"E1001\",\n              \"course_code\": \"OHS-BASIC\",\n              \"cycle_year\": 2026,\n              \"due_date\": \"2026-12-31\"\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/enrollments\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/json\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions":{"get":{"tags":["Webhooks"],"operationId":"listWebhookSubscriptions","summary":"List webhook subscriptions (no secrets)","description":"A client with `webhooks:manage` sees its own subscriptions.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"client_id","in":"query","schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"Subscriptions.","content":{"application/json":{"schema":{"type":"object","required":["subscriptions"],"properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscription"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/webhooks/subscriptions', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/webhooks/subscriptions\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/webhooks/subscriptions\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"post":{"tags":["Webhooks"],"operationId":"createWebhookSubscription","summary":"Create a webhook subscription","description":"Integration clients may target only hosts on their allowed list (403 `WEBHOOK_HOST_NOT_ALLOWED`); the subscription is created immediately (201) and `secret_token` is returned once. The number of subscriptions per tenant is limited (default 10) — 409 `WEBHOOK_SUBSCRIPTIONS_QUOTA_EXCEEDED`.","parameters":[{"$ref":"#/components/parameters/TenantCode"}],"security":[{"apiKey":[]},{"integrationToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookSubscriptionRequest"},"example":{"name":"HR sync","target_url":"https://hr.example.com/hooks/training","subscribed_events":["course.completed","compliance.expired"]}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionResult"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Missing scope, or `WEBHOOK_HOST_NOT_ALLOWED` — the target host is not on the client's allowed list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`CLIENT_NOT_ACTIVE` or `WEBHOOK_SUBSCRIPTIONS_QUOTA_EXCEEDED`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  --data @- <<'JSON'\n{\n  \"name\": \"HR sync\",\n  \"target_url\": \"https://hr.example.com/hooks/training\",\n  \"subscribed_events\": [\n    \"course.completed\",\n    \"compliance.expired\"\n  ]\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    json={\n        \"name\": \"HR sync\",\n        \"target_url\": \"https://hr.example.com/hooks/training\",\n        \"subscribed_events\": [\"course.completed\", \"compliance.expired\"],\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/webhooks/subscriptions', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'json' => [\n        'name' => 'HR sync',\n        'target_url' => 'https://hr.example.com/hooks/training',\n        'subscribed_events' => ['course.completed', 'compliance.expired'],\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"name\": \"HR sync\",\n  \"target_url\": \"https://hr.example.com/hooks/training\",\n  \"subscribed_events\": [\n    \"course.completed\",\n    \"compliance.expired\"\n  ]\n}`\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/webhooks/subscriptions\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"name\": \"HR sync\",\n    \"target_url\": \"https://hr.example.com/hooks/training\",\n    \"subscribed_events\": [\n      \"course.completed\",\n      \"compliance.expired\"\n    ]\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/webhooks/subscriptions\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"name\": \"HR sync\",\n      \"target_url\": \"https://hr.example.com/hooks/training\",\n      \"subscribed_events\": [\n        \"course.completed\",\n        \"compliance.expired\"\n      ]\n    }\n    \"\"\", Encoding.UTF8, \"application/json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"name\": \"HR sync\",\n              \"target_url\": \"https://hr.example.com/hooks/training\",\n              \"subscribed_events\": [\n                \"course.completed\",\n                \"compliance.expired\"\n              ]\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/json\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions/{id}":{"get":{"tags":["Webhooks"],"operationId":"getWebhookSubscription","summary":"Subscription","description":"Secrets are never returned. Requires the `webhooks:manage` scope; a client sees only its own subscriptions.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"Subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscription"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"patch":{"tags":["Webhooks"],"operationId":"updateWebhookSubscription","summary":"Update a subscription","description":"Integration clients may change the target only to a host on their allowed list; changes take effect immediately. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"Applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionResult"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`OBJECT_CHANGED` — the resource changed concurrently.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"target_url":{"type":"string","format":"uri"},"subscribed_events":{"type":"array","items":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},"filter_course_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"filter_department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"justification":{"type":"string","maxLength":1000,"description":"Justification — used only for changes made in the IT administration panel that require approval."}}},"example":{"subscribed_events":["course.completed","compliance.certified","compliance.expired"]}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X PATCH \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  --data @- <<'JSON'\n{\n  \"subscribed_events\": [\n    \"course.completed\",\n    \"compliance.certified\",\n    \"compliance.expired\"\n  ]\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.patch(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    json={\n        \"subscribed_events\": [\"course.completed\", \"compliance.certified\", \"compliance.expired\"],\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('PATCH', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'json' => [\n        'subscribed_events' => ['course.completed', 'compliance.certified', 'compliance.expired'],\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"subscribed_events\": [\n    \"course.completed\",\n    \"compliance.certified\",\n    \"compliance.expired\"\n  ]\n}`\n\treq, err := http.NewRequest(\"PATCH\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"PATCH\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"subscribed_events\": [\n      \"course.completed\",\n      \"compliance.certified\",\n      \"compliance.expired\"\n    ]\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Patch, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"subscribed_events\": [\n        \"course.completed\",\n        \"compliance.certified\",\n        \"compliance.expired\"\n      ]\n    }\n    \"\"\", Encoding.UTF8, \"application/json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"subscribed_events\": [\n                \"course.completed\",\n                \"compliance.certified\",\n                \"compliance.expired\"\n              ]\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/json\")\n            .method(\"PATCH\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"delete":{"tags":["Webhooks"],"operationId":"deleteWebhookSubscription","summary":"Delete a subscription (and its delivery queue)","description":"Takes effect immediately. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X DELETE \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.delete(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.status_code)\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('DELETE', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getStatusCode(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"DELETE\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(res.Status)\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"DELETE\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(response.status);\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Delete, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine((int)response.StatusCode);\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"DELETE\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.statusCode());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions/{id}/enable":{"post":{"tags":["Webhooks"],"operationId":"enableWebhookSubscription","summary":"Re-enable a subscription","description":"Re-enabling the same target. A subscription stopped because its client was disabled: 409 `CLIENT_NOT_ACTIVE`. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"Subscription.","content":{"application/json":{"schema":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/WebhookSubscription"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`WEBHOOK_NOT_DISABLED`, `WEBHOOK_DISABLED` or `CLIENT_NOT_ACTIVE`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/enable\" \\\n  -X POST \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/enable\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/enable', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/enable\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/enable`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/enable\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/enable\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions/{id}/disable":{"post":{"tags":["Webhooks"],"operationId":"disableWebhookSubscription","summary":"Disable a subscription","description":"Takes effect immediately. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"Subscription.","content":{"application/json":{"schema":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/WebhookSubscription"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`WEBHOOK_NOT_DISABLED`, `WEBHOOK_DISABLED` or `CLIENT_NOT_ACTIVE`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/disable\" \\\n  -X POST \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/disable\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/disable', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/disable\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/disable`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/disable\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/disable\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions/{id}/rotate-secret":{"post":{"tags":["Webhooks"],"operationId":"rotateWebhookSecret","summary":"Rotate the HMAC secret","description":"Issues a new secret immediately (returned once); the previous secret keeps signing deliveries for `grace_days` days (default 7, max 30) — during that time the header carries two `v1` signatures. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"New secret.","content":{"application/json":{"schema":{"type":"object","required":["subscription","secret_token"],"properties":{"subscription":{"$ref":"#/components/schemas/WebhookSubscription"},"secret_token":{"type":"string"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grace_days":{"type":"integer","minimum":0,"maximum":30,"default":7}}},"example":{"grace_days":7}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/rotate-secret\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  --data @- <<'JSON'\n{\n  \"grace_days\": 7\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/rotate-secret\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    json={\n        \"grace_days\": 7,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/rotate-secret', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'json' => [\n        'grace_days' => 7,\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"grace_days\": 7\n}`\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/rotate-secret\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/rotate-secret`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"grace_days\": 7\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/rotate-secret\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"grace_days\": 7\n    }\n    \"\"\", Encoding.UTF8, \"application/json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"grace_days\": 7\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/rotate-secret\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/json\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions/{id}/ping":{"post":{"tags":["Webhooks"],"operationId":"pingWebhookSubscription","summary":"Test event ping","description":"Queues a `ping` event (`data.subscription_id`) for this subscription only. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"type":"object","properties":{"delivery_id":{"type":"string","format":"uuid"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`WEBHOOK_DISABLED`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/ping\" \\\n  -X POST \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/ping\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/ping', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/ping\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/ping`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/ping\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/ping\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions/{id}/deliveries":{"get":{"tags":["Webhooks"],"operationId":"listWebhookDeliveries","summary":"Delivery log (metadata)","description":"Metadata only (no event or response bodies); newest first. Paginate with `before` = `created_at` of the last item. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"before","in":"query","schema":{"type":"string","format":"date-time"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"200":{"description":"Deliveries.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries?limit=50\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    params={\"limit\": \"50\"},\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'query' => ['limit' => '50'],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries?limit=50\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries?limit=50`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries?limit=50\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries?limit=50\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/webhooks/subscriptions/{id}/deliveries/{delivery_id}/retry":{"post":{"tags":["Webhooks"],"operationId":"retryWebhookDelivery","summary":"Retry a delivery manually","description":"One additional attempt for a delivery that exhausted its retries. Requires the `webhooks:manage` scope; own subscriptions only.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"apiKey":[]},{"integrationToken":[]}],"responses":{"202":{"description":"Queued.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/retry\" \\\n  -X POST \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/retry\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.status_code)\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/retry', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getStatusCode(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/retry\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(res.Status)\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/retry`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(response.status);\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/retry\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine((int)response.StatusCode);\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/webhooks/subscriptions/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/deliveries/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d/retry\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.statusCode());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/oauth/token":{"post":{"tags":["Authentication"],"operationId":"issueOAuthToken","summary":"Get an OAuth 2.0 token (client credentials)","description":"RFC 6749 §4.4. Client authentication: `client_secret_basic` (Authorization: Basic) or `client_secret_post` — exactly one of them. The token is valid for 15 minutes, bound to the tenant, with the client's scopes or a subset (`scope`). Errors follow RFC 6749 §5.2; `invalid_client` (401) does not reveal the reason. Limits: 60 requests per minute per address, 10 issued tokens per minute per client (reuse a token until it expires), an address with 20 failures per minute is blocked for 10 minutes — 429 `invalid_request` with `Retry-After`.","parameters":[{"$ref":"#/components/parameters/TenantCode"}],"security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type"],"properties":{"grant_type":{"type":"string","const":"client_credentials"},"scope":{"type":"string","description":"Space-separated scopes (default: all scopes of the client)."},"client_id":{"type":"string","format":"uuid"},"client_secret":{"type":"string"}}},"example":{"grant_type":"client_credentials","scope":"users:read compliance:read"}}}},"responses":{"200":{"description":"Token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthToken"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"401":{"description":"`invalid_client`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"429":{"description":"Too many requests (per address, per client, or a block after failed authentications).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/oauth/token\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -u \"$CLIENT_ID:$CLIENT_SECRET\" \\\n  --data-urlencode 'grant_type=client_credentials' \\\n  --data-urlencode 'scope=users:read compliance:read'\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nCLIENT_ID = os.environ[\"CLIENT_ID\"]\nCLIENT_SECRET = os.environ[\"CLIENT_SECRET\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/api/v1/oauth/token\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n    },\n    auth=(CLIENT_ID, CLIENT_SECRET),\n    data={\n        \"grant_type\": \"client_credentials\",\n        \"scope\": \"users:read compliance:read\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/api/v1/oauth/token', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n    ],\n    'auth' => [getenv('CLIENT_ID'), getenv('CLIENT_SECRET')],\n    'form_params' => [\n        'grant_type' => 'client_credentials',\n        'scope' => 'users:read compliance:read',\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tform := url.Values{\n\t\t\"grant_type\": {\"client_credentials\"},\n\t\t\"scope\":      {\"users:read compliance:read\"},\n\t}\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/api/v1/oauth/token\", strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.SetBasicAuth(os.Getenv(\"CLIENT_ID\"), os.Getenv(\"CLIENT_SECRET\"))\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst CLIENT_ID = process.env.CLIENT_ID ?? \"\";\nconst CLIENT_SECRET = process.env.CLIENT_SECRET ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/oauth/token`, {\n  method: \"POST\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    Authorization: `Basic ${btoa(`${CLIENT_ID}:${CLIENT_SECRET}`)}`,\n  },\n  body: new URLSearchParams({\n    \"grant_type\": \"client_credentials\",\n    \"scope\": \"users:read compliance:read\"\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"/api/v1/oauth/token\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nvar credentials = $\"{Environment.GetEnvironmentVariable(\"CLIENT_ID\")}:{Environment.GetEnvironmentVariable(\"CLIENT_SECRET\")}\";\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Basic\", Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials)));\nrequest.Content = new FormUrlEncodedContent(new Dictionary<string, string>\n{\n    [\"grant_type\"] = \"client_credentials\",\n    [\"scope\"] = \"users:read compliance:read\",\n});\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Base64;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String form = \"grant_type=client_credentials&scope=users%3Aread+compliance%3Aread\";\n        String credentials = System.getenv(\"CLIENT_ID\") + \":\" + System.getenv(\"CLIENT_SECRET\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/oauth/token\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"Authorization\", \"Basic \" + Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.UTF_8)))\n            .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(form))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/users/{id}":{"get":{"tags":["Users"],"operationId":"getEmployeeProfile","summary":"Person profile (standard and custom fields, groups)","description":"Requires the `users:read` scope. Sensitive fields are not returned.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/TenantCode"}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Profile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeProfile"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"patch":{"tags":["Users"],"operationId":"updateEmployeeProfile","summary":"Update person fields","description":"Standard fields and custom `attributes` (partial update: omitted fields stay unchanged, `null` clears a value). Every change is recorded in the history (who, when, previous value, source). Afterwards the person's dynamic groups are refreshed; joining a group creates its enrollments (`group_changes`). Requires the `users:write` scope. **409 `MANAGED_ELSEWHERE`** (`code: managed_elsewhere`, `managed_by`, `fields`): integration clients may change only accounts with source `api` or `manual`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/TenantCode"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"employment_start_date":{"oneOf":[{"type":"string","format":"date","description":"Employment start date."},{"type":"null"}]},"job_title":{"oneOf":[{"type":"string","maxLength":150,"description":"Job title."},{"type":"null"}]},"location":{"oneOf":[{"type":"string","maxLength":150,"description":"Location (site, hall, branch)."},{"type":"null"}]},"manager_email":{"oneOf":[{"type":"string","format":"email","description":"Manager's e-mail address."},{"type":"null"}]},"attributes":{"type":"object","additionalProperties":{"description":"A value matching the field type: text — string (≤ 500), number — number, date — YYYY-MM-DD, boolean, select — option key; `null` clears the value.","oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Tenant-defined custom fields: field key → value. Sensitive fields are written only by administrators and HR integrations and read only by administrators."}}},"example":{"job_title":"Shift leader","location":"Warehouse 2","attributes":{"cost_center":"CC-104"}}}}},"responses":{"200":{"description":"Profile after the change.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EmployeeProfile"},{"type":"object","required":["changed_fields","group_changes"],"properties":{"changed_fields":{"type":"array","items":{"type":"string"},"description":"Changed fields (e.g. job_title, attr.shift)."},"group_changes":{"type":"object","required":["groups","joined","left","enrollments"],"properties":{"groups":{"type":"integer","description":"Dynamic groups refreshed."},"joined":{"type":"integer"},"left":{"type":"integer"},"enrollments":{"type":"integer","description":"Enrollments created automatically for people joining groups."}}}}}]}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`MANAGED_ELSEWHERE` — the account is managed by another source.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X PATCH \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  --data @- <<'JSON'\n{\n  \"job_title\": \"Shift leader\",\n  \"location\": \"Warehouse 2\",\n  \"attributes\": {\n    \"cost_center\": \"CC-104\"\n  }\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.patch(\n    f\"{BASE_URL}/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    json={\n        \"job_title\": \"Shift leader\",\n        \"location\": \"Warehouse 2\",\n        \"attributes\": {\n            \"cost_center\": \"CC-104\",\n        },\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('PATCH', '/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'json' => [\n        'job_title' => 'Shift leader',\n        'location' => 'Warehouse 2',\n        'attributes' => [\n            'cost_center' => 'CC-104',\n        ],\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"job_title\": \"Shift leader\",\n  \"location\": \"Warehouse 2\",\n  \"attributes\": {\n    \"cost_center\": \"CC-104\"\n  }\n}`\n\treq, err := http.NewRequest(\"PATCH\", baseURL+\"/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"PATCH\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"job_title\": \"Shift leader\",\n    \"location\": \"Warehouse 2\",\n    \"attributes\": {\n      \"cost_center\": \"CC-104\"\n    }\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Patch, \"/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"job_title\": \"Shift leader\",\n      \"location\": \"Warehouse 2\",\n      \"attributes\": {\n        \"cost_center\": \"CC-104\"\n      }\n    }\n    \"\"\", Encoding.UTF8, \"application/json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"job_title\": \"Shift leader\",\n              \"location\": \"Warehouse 2\",\n              \"attributes\": {\n                \"cost_center\": \"CC-104\"\n              }\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/json\")\n            .method(\"PATCH\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/ServiceProviderConfig":{"get":{"tags":["SCIM"],"operationId":"scimServiceProviderConfig","summary":"SCIM: service provider configuration","description":"PATCH supported, filtering (max 200 results); no bulk, sort or ETag.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Configuration.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/ServiceProviderConfig\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/ServiceProviderConfig\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/ServiceProviderConfig', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/ServiceProviderConfig\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/ServiceProviderConfig`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/ServiceProviderConfig\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/ServiceProviderConfig\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/ResourceTypes":{"get":{"tags":["SCIM"],"operationId":"scimResourceTypes","summary":"SCIM: list resource types","description":"User (with the Enterprise User extension) and Group.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"ListResponse.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/ResourceTypes\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/ResourceTypes\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/ResourceTypes', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/ResourceTypes\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/ResourceTypes`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/ResourceTypes\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/ResourceTypes\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/ResourceTypes/{id}":{"get":{"tags":["SCIM"],"operationId":"scimResourceType","summary":"SCIM: get resource type","description":"User or Group.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Type.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/ResourceTypes/User\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/ResourceTypes/User\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/ResourceTypes/User', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/ResourceTypes/User\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/ResourceTypes/User`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/ResourceTypes/User\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/ResourceTypes/User\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/Schemas":{"get":{"tags":["SCIM"],"operationId":"scimSchemas","summary":"SCIM: list schemas","description":"Supported attributes of User, Enterprise User and Group.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"ListResponse.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Schemas\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Schemas\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/Schemas', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Schemas\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Schemas`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Schemas\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Schemas\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/Schemas/{id}":{"get":{"tags":["SCIM"],"operationId":"scimSchema","summary":"SCIM: get schema","description":"Schema URN.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Schema.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Schemas/urn:ietf:params:scim:schemas:core:2.0:User\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Schemas/urn:ietf:params:scim:schemas:core:2.0:User\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/Schemas/urn:ietf:params:scim:schemas:core:2.0:User', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Schemas/urn:ietf:params:scim:schemas:core:2.0:User\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Schemas/urn:ietf:params:scim:schemas:core:2.0:User`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Schemas/urn:ietf:params:scim:schemas:core:2.0:User\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Schemas/urn:ietf:params:scim:schemas:core:2.0:User\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/Users":{"get":{"tags":["SCIM"],"operationId":"scimListUsers","summary":"SCIM: list users","description":"Resources: SCIM-managed accounts and pending entries (takeover / dry run). Attributes: userName, externalId, name (givenName, familyName), displayName, title (job title), active, emails, phoneNumbers, Enterprise User extension (employeeNumber, department → mapped to a department, manager). `roles` and `entitlements` are ignored — SCIM does not grant roles.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"filter","in":"query","schema":{"type":"string"},"description":"`<attribute> eq \"value\"` — Users: userName, externalId, id, emails.value, urn:…:enterprise:2.0:User:employeeNumber; Groups: displayName, externalId, id."},{"name":"startIndex","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"count","in":"query","schema":{"type":"integer","minimum":0,"maximum":200,"default":100}},{"name":"attributes","in":"query","schema":{"type":"string"}},{"name":"excludedAttributes","in":"query","schema":{"type":"string"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"ListResponse.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Users\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Users\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/Users', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Users\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Users`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Users\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Users\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"post":{"tags":["SCIM"],"operationId":"scimCreateUser","summary":"SCIM: create user","description":"New person: in live mode an account is created with the same enrollments as a new person from an HR file (onboarding, department rules). In dry-run mode (before the first takeover) and when the person matches an existing account (employee number, then e-mail from a verified domain), a pending entry is created for administrator approval (201 with an id that becomes the resource id). A person previously deleted via SCIM (same externalId / userName) returns to the same account. 409 uniqueness — userName or externalId already in use, or the person already exists in SCIM under another userName.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"201":{"description":"Created (Location header).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"anna.example@example.com","externalId":"00u1a2b3c4","active":true,"name":{"givenName":"Anna","familyName":"Example"},"emails":[{"value":"anna.example@example.com","type":"work","primary":true}],"title":"Warehouse operator","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"employeeNumber":"E1001","department":"Logistics"}}},"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"anna.example@example.com","externalId":"00u1a2b3c4","active":true,"name":{"givenName":"Anna","familyName":"Example"},"emails":[{"value":"anna.example@example.com","type":"work","primary":true}],"title":"Warehouse operator","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"employeeNumber":"E1001","department":"Logistics"}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Users\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/scim+json\" \\\n  --data @- <<'JSON'\n{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\",\n    \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n  ],\n  \"userName\": \"anna.example@example.com\",\n  \"externalId\": \"00u1a2b3c4\",\n  \"active\": true,\n  \"name\": {\n    \"givenName\": \"Anna\",\n    \"familyName\": \"Example\"\n  },\n  \"emails\": [\n    {\n      \"value\": \"anna.example@example.com\",\n      \"type\": \"work\",\n      \"primary\": true\n    }\n  ],\n  \"title\": \"Warehouse operator\",\n  \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n    \"employeeNumber\": \"E1001\",\n    \"department\": \"Logistics\"\n  }\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import json\nimport os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Users\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n        \"Content-Type\": \"application/scim+json\",\n    },\n    data=json.dumps({\n        \"schemas\": [\n            \"urn:ietf:params:scim:schemas:core:2.0:User\",\n            \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\",\n        ],\n        \"userName\": \"anna.example@example.com\",\n        \"externalId\": \"00u1a2b3c4\",\n        \"active\": True,\n        \"name\": {\n            \"givenName\": \"Anna\",\n            \"familyName\": \"Example\",\n        },\n        \"emails\": [\n            {\n                \"value\": \"anna.example@example.com\",\n                \"type\": \"work\",\n                \"primary\": True,\n            },\n        ],\n        \"title\": \"Warehouse operator\",\n        \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n            \"employeeNumber\": \"E1001\",\n            \"department\": \"Logistics\",\n        },\n    }),\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/scim/v2/' . getenv('TENANT_CODE') . '/Users', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n        'Content-Type' => 'application/scim+json',\n    ],\n    'body' => json_encode([\n        'schemas' => [\n            'urn:ietf:params:scim:schemas:core:2.0:User',\n            'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User',\n        ],\n        'userName' => 'anna.example@example.com',\n        'externalId' => '00u1a2b3c4',\n        'active' => true,\n        'name' => [\n            'givenName' => 'Anna',\n            'familyName' => 'Example',\n        ],\n        'emails' => [\n            [\n                'value' => 'anna.example@example.com',\n                'type' => 'work',\n                'primary' => true,\n            ],\n        ],\n        'title' => 'Warehouse operator',\n        'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User' => [\n            'employeeNumber' => 'E1001',\n            'department' => 'Logistics',\n        ],\n    ]),\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\",\n    \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n  ],\n  \"userName\": \"anna.example@example.com\",\n  \"externalId\": \"00u1a2b3c4\",\n  \"active\": true,\n  \"name\": {\n    \"givenName\": \"Anna\",\n    \"familyName\": \"Example\"\n  },\n  \"emails\": [\n    {\n      \"value\": \"anna.example@example.com\",\n      \"type\": \"work\",\n      \"primary\": true\n    }\n  ],\n  \"title\": \"Warehouse operator\",\n  \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n    \"employeeNumber\": \"E1001\",\n    \"department\": \"Logistics\"\n  }\n}`\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Users\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/scim+json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Users`, {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n    \"Content-Type\": \"application/scim+json\",\n  },\n  body: JSON.stringify({\n    \"schemas\": [\n      \"urn:ietf:params:scim:schemas:core:2.0:User\",\n      \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n    ],\n    \"userName\": \"anna.example@example.com\",\n    \"externalId\": \"00u1a2b3c4\",\n    \"active\": true,\n    \"name\": {\n      \"givenName\": \"Anna\",\n      \"familyName\": \"Example\"\n    },\n    \"emails\": [\n      {\n        \"value\": \"anna.example@example.com\",\n        \"type\": \"work\",\n        \"primary\": true\n      }\n    ],\n    \"title\": \"Warehouse operator\",\n    \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n      \"employeeNumber\": \"E1001\",\n      \"department\": \"Logistics\"\n    }\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Users\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"schemas\": [\n        \"urn:ietf:params:scim:schemas:core:2.0:User\",\n        \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n      ],\n      \"userName\": \"anna.example@example.com\",\n      \"externalId\": \"00u1a2b3c4\",\n      \"active\": true,\n      \"name\": {\n        \"givenName\": \"Anna\",\n        \"familyName\": \"Example\"\n      },\n      \"emails\": [\n        {\n          \"value\": \"anna.example@example.com\",\n          \"type\": \"work\",\n          \"primary\": true\n        }\n      ],\n      \"title\": \"Warehouse operator\",\n      \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n        \"employeeNumber\": \"E1001\",\n        \"department\": \"Logistics\"\n      }\n    }\n    \"\"\", Encoding.UTF8, \"application/scim+json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"schemas\": [\n                \"urn:ietf:params:scim:schemas:core:2.0:User\",\n                \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n              ],\n              \"userName\": \"anna.example@example.com\",\n              \"externalId\": \"00u1a2b3c4\",\n              \"active\": true,\n              \"name\": {\n                \"givenName\": \"Anna\",\n                \"familyName\": \"Example\"\n              },\n              \"emails\": [\n                {\n                  \"value\": \"anna.example@example.com\",\n                  \"type\": \"work\",\n                  \"primary\": true\n                }\n              ],\n              \"title\": \"Warehouse operator\",\n              \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n                \"employeeNumber\": \"E1001\",\n                \"department\": \"Logistics\"\n              }\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Users\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/scim+json\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/Users/{id}":{"get":{"tags":["SCIM"],"operationId":"scimGetUser","summary":"SCIM: get user","description":"A SCIM-managed account or a pending entry awaiting approval.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"User resource.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"put":{"tags":["SCIM"],"operationId":"scimReplaceUser","summary":"SCIM: replace user","description":"`active: false` deactivates the account (history and certificates are kept). An account managed by another source — 409 `managed_elsewhere`.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Resource after the change.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"anna.example@example.com","externalId":"00u1a2b3c4","active":true,"name":{"givenName":"Anna","familyName":"Example"},"emails":[{"value":"anna.example@example.com","type":"work","primary":true}],"title":"Warehouse operator","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"employeeNumber":"E1001","department":"Logistics"}}},"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"anna.example@example.com","externalId":"00u1a2b3c4","active":true,"name":{"givenName":"Anna","familyName":"Example"},"emails":[{"value":"anna.example@example.com","type":"work","primary":true}],"title":"Warehouse operator","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"employeeNumber":"E1001","department":"Logistics"}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X PUT \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/scim+json\" \\\n  --data @- <<'JSON'\n{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\",\n    \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n  ],\n  \"userName\": \"anna.example@example.com\",\n  \"externalId\": \"00u1a2b3c4\",\n  \"active\": true,\n  \"name\": {\n    \"givenName\": \"Anna\",\n    \"familyName\": \"Example\"\n  },\n  \"emails\": [\n    {\n      \"value\": \"anna.example@example.com\",\n      \"type\": \"work\",\n      \"primary\": true\n    }\n  ],\n  \"title\": \"Warehouse operator\",\n  \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n    \"employeeNumber\": \"E1001\",\n    \"department\": \"Logistics\"\n  }\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import json\nimport os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.put(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n        \"Content-Type\": \"application/scim+json\",\n    },\n    data=json.dumps({\n        \"schemas\": [\n            \"urn:ietf:params:scim:schemas:core:2.0:User\",\n            \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\",\n        ],\n        \"userName\": \"anna.example@example.com\",\n        \"externalId\": \"00u1a2b3c4\",\n        \"active\": True,\n        \"name\": {\n            \"givenName\": \"Anna\",\n            \"familyName\": \"Example\",\n        },\n        \"emails\": [\n            {\n                \"value\": \"anna.example@example.com\",\n                \"type\": \"work\",\n                \"primary\": True,\n            },\n        ],\n        \"title\": \"Warehouse operator\",\n        \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n            \"employeeNumber\": \"E1001\",\n            \"department\": \"Logistics\",\n        },\n    }),\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('PUT', '/scim/v2/' . getenv('TENANT_CODE') . '/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n        'Content-Type' => 'application/scim+json',\n    ],\n    'body' => json_encode([\n        'schemas' => [\n            'urn:ietf:params:scim:schemas:core:2.0:User',\n            'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User',\n        ],\n        'userName' => 'anna.example@example.com',\n        'externalId' => '00u1a2b3c4',\n        'active' => true,\n        'name' => [\n            'givenName' => 'Anna',\n            'familyName' => 'Example',\n        ],\n        'emails' => [\n            [\n                'value' => 'anna.example@example.com',\n                'type' => 'work',\n                'primary' => true,\n            ],\n        ],\n        'title' => 'Warehouse operator',\n        'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User' => [\n            'employeeNumber' => 'E1001',\n            'department' => 'Logistics',\n        ],\n    ]),\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\",\n    \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n  ],\n  \"userName\": \"anna.example@example.com\",\n  \"externalId\": \"00u1a2b3c4\",\n  \"active\": true,\n  \"name\": {\n    \"givenName\": \"Anna\",\n    \"familyName\": \"Example\"\n  },\n  \"emails\": [\n    {\n      \"value\": \"anna.example@example.com\",\n      \"type\": \"work\",\n      \"primary\": true\n    }\n  ],\n  \"title\": \"Warehouse operator\",\n  \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n    \"employeeNumber\": \"E1001\",\n    \"department\": \"Logistics\"\n  }\n}`\n\treq, err := http.NewRequest(\"PUT\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/scim+json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n    \"Content-Type\": \"application/scim+json\",\n  },\n  body: JSON.stringify({\n    \"schemas\": [\n      \"urn:ietf:params:scim:schemas:core:2.0:User\",\n      \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n    ],\n    \"userName\": \"anna.example@example.com\",\n    \"externalId\": \"00u1a2b3c4\",\n    \"active\": true,\n    \"name\": {\n      \"givenName\": \"Anna\",\n      \"familyName\": \"Example\"\n    },\n    \"emails\": [\n      {\n        \"value\": \"anna.example@example.com\",\n        \"type\": \"work\",\n        \"primary\": true\n      }\n    ],\n    \"title\": \"Warehouse operator\",\n    \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n      \"employeeNumber\": \"E1001\",\n      \"department\": \"Logistics\"\n    }\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Put, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"schemas\": [\n        \"urn:ietf:params:scim:schemas:core:2.0:User\",\n        \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n      ],\n      \"userName\": \"anna.example@example.com\",\n      \"externalId\": \"00u1a2b3c4\",\n      \"active\": true,\n      \"name\": {\n        \"givenName\": \"Anna\",\n        \"familyName\": \"Example\"\n      },\n      \"emails\": [\n        {\n          \"value\": \"anna.example@example.com\",\n          \"type\": \"work\",\n          \"primary\": true\n        }\n      ],\n      \"title\": \"Warehouse operator\",\n      \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n        \"employeeNumber\": \"E1001\",\n        \"department\": \"Logistics\"\n      }\n    }\n    \"\"\", Encoding.UTF8, \"application/scim+json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"schemas\": [\n                \"urn:ietf:params:scim:schemas:core:2.0:User\",\n                \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"\n              ],\n              \"userName\": \"anna.example@example.com\",\n              \"externalId\": \"00u1a2b3c4\",\n              \"active\": true,\n              \"name\": {\n                \"givenName\": \"Anna\",\n                \"familyName\": \"Example\"\n              },\n              \"emails\": [\n                {\n                  \"value\": \"anna.example@example.com\",\n                  \"type\": \"work\",\n                  \"primary\": true\n                }\n              ],\n              \"title\": \"Warehouse operator\",\n              \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\": {\n                \"employeeNumber\": \"E1001\",\n                \"department\": \"Logistics\"\n              }\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/scim+json\")\n            .method(\"PUT\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"patch":{"tags":["SCIM"],"operationId":"scimPatchUser","summary":"SCIM: update user (PATCH)","description":"PatchOp: add / replace / remove; paths `attr`, `attr.sub`, `attr[sub eq \"x\"]`, `attr[…].sub`, optionally prefixed with the schema URN; without a path — an object of attributes. Booleans are also accepted as strings (\"False\" as sent by Entra ID).","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Resource after the change.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"replace","path":"active","value":false}]}},"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"replace","path":"active","value":false}]}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X PATCH \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/scim+json\" \\\n  --data @- <<'JSON'\n{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"Operations\": [\n    {\n      \"op\": \"replace\",\n      \"path\": \"active\",\n      \"value\": false\n    }\n  ]\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import json\nimport os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.patch(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n        \"Content-Type\": \"application/scim+json\",\n    },\n    data=json.dumps({\n        \"schemas\": [\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\n        \"Operations\": [\n            {\n                \"op\": \"replace\",\n                \"path\": \"active\",\n                \"value\": False,\n            },\n        ],\n    }),\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('PATCH', '/scim/v2/' . getenv('TENANT_CODE') . '/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n        'Content-Type' => 'application/scim+json',\n    ],\n    'body' => json_encode([\n        'schemas' => ['urn:ietf:params:scim:api:messages:2.0:PatchOp'],\n        'Operations' => [\n            [\n                'op' => 'replace',\n                'path' => 'active',\n                'value' => false,\n            ],\n        ],\n    ]),\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"Operations\": [\n    {\n      \"op\": \"replace\",\n      \"path\": \"active\",\n      \"value\": false\n    }\n  ]\n}`\n\treq, err := http.NewRequest(\"PATCH\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/scim+json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n    \"Content-Type\": \"application/scim+json\",\n  },\n  body: JSON.stringify({\n    \"schemas\": [\n      \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n    ],\n    \"Operations\": [\n      {\n        \"op\": \"replace\",\n        \"path\": \"active\",\n        \"value\": false\n      }\n    ]\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Patch, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"schemas\": [\n        \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n      ],\n      \"Operations\": [\n        {\n          \"op\": \"replace\",\n          \"path\": \"active\",\n          \"value\": false\n        }\n      ]\n    }\n    \"\"\", Encoding.UTF8, \"application/scim+json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"schemas\": [\n                \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n              ],\n              \"Operations\": [\n                {\n                  \"op\": \"replace\",\n                  \"path\": \"active\",\n                  \"value\": false\n                }\n              ]\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/scim+json\")\n            .method(\"PATCH\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"delete":{"tags":["SCIM"],"operationId":"scimDeleteUser","summary":"SCIM: delete user","description":"Deactivates the account and deletes the SCIM resource. Personal data is not physically erased here (retention and erasure follow a separate process).","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"204":{"description":"Resource deleted."},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X DELETE \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.delete(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.status_code)\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('DELETE', '/scim/v2/' . getenv('TENANT_CODE') . '/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getStatusCode(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"DELETE\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(res.Status)\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(response.status);\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Delete, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine((int)response.StatusCode);\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Users/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"DELETE\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.statusCode());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/Groups":{"get":{"tags":["SCIM"],"operationId":"scimListGroups","summary":"SCIM: list groups","description":"`excludedAttributes=members` omits members.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"filter","in":"query","schema":{"type":"string"},"description":"`<attribute> eq \"value\"` — Users: userName, externalId, id, emails.value, urn:…:enterprise:2.0:User:employeeNumber; Groups: displayName, externalId, id."},{"name":"startIndex","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"count","in":"query","schema":{"type":"integer","minimum":0,"maximum":200,"default":100}},{"name":"attributes","in":"query","schema":{"type":"string"}},{"name":"excludedAttributes","in":"query","schema":{"type":"string"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"ListResponse.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Groups\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Groups\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/Groups', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Groups\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Groups`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Groups\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Groups\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"post":{"tags":["SCIM"],"operationId":"scimCreateGroup","summary":"SCIM: create group","description":"Groups are mapped to departments by the IT administrator; they do not grant roles. `displayName` is unique, case-insensitive.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"201":{"description":"Created.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"displayName":"Forklift operators","externalId":"grp-forklift","members":[{"value":"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d"}]}},"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"displayName":"Forklift operators","externalId":"grp-forklift","members":[{"value":"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d"}]}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Groups\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/scim+json\" \\\n  --data @- <<'JSON'\n{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n  ],\n  \"displayName\": \"Forklift operators\",\n  \"externalId\": \"grp-forklift\",\n  \"members\": [\n    {\n      \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n    }\n  ]\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import json\nimport os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.post(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Groups\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n        \"Content-Type\": \"application/scim+json\",\n    },\n    data=json.dumps({\n        \"schemas\": [\"urn:ietf:params:scim:schemas:core:2.0:Group\"],\n        \"displayName\": \"Forklift operators\",\n        \"externalId\": \"grp-forklift\",\n        \"members\": [\n            {\n                \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n            },\n        ],\n    }),\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('POST', '/scim/v2/' . getenv('TENANT_CODE') . '/Groups', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n        'Content-Type' => 'application/scim+json',\n    ],\n    'body' => json_encode([\n        'schemas' => ['urn:ietf:params:scim:schemas:core:2.0:Group'],\n        'displayName' => 'Forklift operators',\n        'externalId' => 'grp-forklift',\n        'members' => [\n            [\n                'value' => '3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d',\n            ],\n        ],\n    ]),\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n  ],\n  \"displayName\": \"Forklift operators\",\n  \"externalId\": \"grp-forklift\",\n  \"members\": [\n    {\n      \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n    }\n  ]\n}`\n\treq, err := http.NewRequest(\"POST\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Groups\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/scim+json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Groups`, {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n    \"Content-Type\": \"application/scim+json\",\n  },\n  body: JSON.stringify({\n    \"schemas\": [\n      \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n    ],\n    \"displayName\": \"Forklift operators\",\n    \"externalId\": \"grp-forklift\",\n    \"members\": [\n      {\n        \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n      }\n    ]\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Post, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Groups\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"schemas\": [\n        \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n      ],\n      \"displayName\": \"Forklift operators\",\n      \"externalId\": \"grp-forklift\",\n      \"members\": [\n        {\n          \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n        }\n      ]\n    }\n    \"\"\", Encoding.UTF8, \"application/scim+json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"schemas\": [\n                \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n              ],\n              \"displayName\": \"Forklift operators\",\n              \"externalId\": \"grp-forklift\",\n              \"members\": [\n                {\n                  \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n                }\n              ]\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Groups\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/scim+json\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/scim/v2/{tenant_code}/Groups/{id}":{"get":{"tags":["SCIM"],"operationId":"scimGetGroup","summary":"SCIM: get group","description":"With members (User resource ids).","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Group resource.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/scim/v2/' . getenv('TENANT_CODE') . '/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"GET\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"put":{"tags":["SCIM"],"operationId":"scimReplaceGroup","summary":"SCIM: replace group","description":"Changing members recalculates the members' departments (group mapping).","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Resource after the change.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"displayName":"Forklift operators","externalId":"grp-forklift","members":[{"value":"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d"}]}},"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"displayName":"Forklift operators","externalId":"grp-forklift","members":[{"value":"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d"}]}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X PUT \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/scim+json\" \\\n  --data @- <<'JSON'\n{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n  ],\n  \"displayName\": \"Forklift operators\",\n  \"externalId\": \"grp-forklift\",\n  \"members\": [\n    {\n      \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n    }\n  ]\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import json\nimport os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.put(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n        \"Content-Type\": \"application/scim+json\",\n    },\n    data=json.dumps({\n        \"schemas\": [\"urn:ietf:params:scim:schemas:core:2.0:Group\"],\n        \"displayName\": \"Forklift operators\",\n        \"externalId\": \"grp-forklift\",\n        \"members\": [\n            {\n                \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n            },\n        ],\n    }),\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('PUT', '/scim/v2/' . getenv('TENANT_CODE') . '/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n        'Content-Type' => 'application/scim+json',\n    ],\n    'body' => json_encode([\n        'schemas' => ['urn:ietf:params:scim:schemas:core:2.0:Group'],\n        'displayName' => 'Forklift operators',\n        'externalId' => 'grp-forklift',\n        'members' => [\n            [\n                'value' => '3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d',\n            ],\n        ],\n    ]),\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n  ],\n  \"displayName\": \"Forklift operators\",\n  \"externalId\": \"grp-forklift\",\n  \"members\": [\n    {\n      \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n    }\n  ]\n}`\n\treq, err := http.NewRequest(\"PUT\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/scim+json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n    \"Content-Type\": \"application/scim+json\",\n  },\n  body: JSON.stringify({\n    \"schemas\": [\n      \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n    ],\n    \"displayName\": \"Forklift operators\",\n    \"externalId\": \"grp-forklift\",\n    \"members\": [\n      {\n        \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n      }\n    ]\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Put, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"schemas\": [\n        \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n      ],\n      \"displayName\": \"Forklift operators\",\n      \"externalId\": \"grp-forklift\",\n      \"members\": [\n        {\n          \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n        }\n      ]\n    }\n    \"\"\", Encoding.UTF8, \"application/scim+json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"schemas\": [\n                \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n              ],\n              \"displayName\": \"Forklift operators\",\n              \"externalId\": \"grp-forklift\",\n              \"members\": [\n                {\n                  \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n                }\n              ]\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/scim+json\")\n            .method(\"PUT\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"patch":{"tags":["SCIM"],"operationId":"scimPatchGroup","summary":"SCIM: update group (PATCH)","description":"E.g. `{op: Remove, path: members, value: [{value: <id>}]}` or `members[value eq \"<id>\"]`.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Resource after the change.","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"add","path":"members","value":[{"value":"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d"}]}]}},"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"add","path":"members","value":[{"value":"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d"}]}]}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X PATCH \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/scim+json\" \\\n  --data @- <<'JSON'\n{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"Operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n        }\n      ]\n    }\n  ]\n}\nJSON\n"},{"lang":"python","label":"Python","source":"import json\nimport os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.patch(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n        \"Content-Type\": \"application/scim+json\",\n    },\n    data=json.dumps({\n        \"schemas\": [\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\n        \"Operations\": [\n            {\n                \"op\": \"add\",\n                \"path\": \"members\",\n                \"value\": [\n                    {\n                        \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n                    },\n                ],\n            },\n        ],\n    }),\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('PATCH', '/scim/v2/' . getenv('TENANT_CODE') . '/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n        'Content-Type' => 'application/scim+json',\n    ],\n    'body' => json_encode([\n        'schemas' => ['urn:ietf:params:scim:api:messages:2.0:PatchOp'],\n        'Operations' => [\n            [\n                'op' => 'add',\n                'path' => 'members',\n                'value' => [\n                    [\n                        'value' => '3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d',\n                    ],\n                ],\n            ],\n        ],\n    ]),\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\tbody := `{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"Operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n        }\n      ]\n    }\n  ]\n}`\n\treq, err := http.NewRequest(\"PATCH\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/scim+json\")\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n    \"Content-Type\": \"application/scim+json\",\n  },\n  body: JSON.stringify({\n    \"schemas\": [\n      \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n    ],\n    \"Operations\": [\n      {\n        \"op\": \"add\",\n        \"path\": \"members\",\n        \"value\": [\n          {\n            \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n          }\n        ]\n      }\n    ]\n  }),\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Patch, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\nrequest.Content = new StringContent(\"\"\"\n    {\n      \"schemas\": [\n        \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n      ],\n      \"Operations\": [\n        {\n          \"op\": \"add\",\n          \"path\": \"members\",\n          \"value\": [\n            {\n              \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n            }\n          ]\n        }\n      ]\n    }\n    \"\"\", Encoding.UTF8, \"application/scim+json\");\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        String body = \"\"\"\n            {\n              \"schemas\": [\n                \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n              ],\n              \"Operations\": [\n                {\n                  \"op\": \"add\",\n                  \"path\": \"members\",\n                  \"value\": [\n                    {\n                      \"value\": \"3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"\n                    }\n                  ]\n                }\n              ]\n            }\n            \"\"\";\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .header(\"Content-Type\", \"application/scim+json\")\n            .method(\"PATCH\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]},"delete":{"tags":["SCIM"],"operationId":"scimDeleteGroup","summary":"SCIM: delete group","description":"Deletes the group and its mapping; departments of former members are recalculated.","parameters":[{"name":"tenant_code","in":"path","required":true,"schema":{"type":"string"},"description":"Your tenant code — identity providers do not send custom headers, so the code is part of the path. The full SCIM base URL is shown in the IT administration panel."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"scimBearer":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted."},"401":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"SCIM error: `schemas: [urn:ietf:params:scim:api:messages:2.0:Error]`, `status` (string), `scimType` (invalidValue, invalidFilter, invalidPath, invalidSyntax, noTarget, uniqueness, mutability), `detail`, and a platform `code` (e.g. `managed_elsewhere`).","content":{"application/scim+json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/scim/v2/$TENANT_CODE/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\" \\\n  -X DELETE \\\n  -H \"Authorization: Bearer $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.delete(\n    f\"{BASE_URL}/scim/v2/{TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\",\n    headers={\n        \"Authorization\": f\"Bearer {API_KEY}\",\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.status_code)\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('DELETE', '/scim/v2/' . getenv('TENANT_CODE') . '/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d', [\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('API_KEY'),\n    ],\n]);\necho $response->getStatusCode(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"DELETE\", baseURL+\"/scim/v2/\"+os.Getenv(\"TENANT_CODE\")+\"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(res.Status)\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/scim/v2/${TENANT_CODE}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d`, {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${API_KEY}`,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(response.status);\n"},{"lang":"csharp","label":"C#","source":"using System.Net.Http.Headers;\nusing System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Delete, $\"/scim/v2/{Environment.GetEnvironmentVariable(\"TENANT_CODE\")}/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine((int)response.StatusCode);\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/scim/v2/\" + System.getenv(\"TENANT_CODE\") + \"/Groups/3b9d6c1e-8a2f-4e7b-9c5d-1f2e3a4b5c6d\"))\n            .header(\"Authorization\", \"Bearer \" + System.getenv(\"API_KEY\"))\n            .method(\"DELETE\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.statusCode());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/departments":{"get":{"tags":["Users"],"operationId":"listDepartments","summary":"List departments","description":"The organisation's departments (active first) with identifiers for `department_id`. Requires the `users:read` scope.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"security":[{"apiKey":[]},{"integrationToken":[]},{"integrationToken":[]},{"integrationToken":[]}],"responses":{"200":{"description":"List.","content":{"application/json":{"schema":{"type":"object","required":["pagination","departments"],"properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"departments":{"type":"array","items":{"$ref":"#/components/schemas/Department"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/departments?limit=100\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/departments\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    params={\"limit\": \"100\"},\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/departments', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'query' => ['limit' => '100'],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/departments?limit=100\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/departments?limit=100`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/departments?limit=100\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/departments?limit=100\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/contractors":{"get":{"tags":["Users"],"operationId":"listContractors","summary":"List contractor companies","description":"Contractor companies (B2B) with identifiers for `contractor_id`. Requires the `users:read` scope.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"security":[{"apiKey":[]},{"integrationToken":[]},{"integrationToken":[]},{"integrationToken":[]}],"responses":{"200":{"description":"List.","content":{"application/json":{"schema":{"type":"object","required":["pagination","contractors"],"properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"contractors":{"type":"array","items":{"$ref":"#/components/schemas/Contractor"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/contractors?limit=100\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/contractors\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    params={\"limit\": \"100\"},\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/contractors', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'query' => ['limit' => '100'],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/contractors?limit=100\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/contractors?limit=100`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/contractors?limit=100\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/contractors?limit=100\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}},"/api/v1/course-catalog":{"get":{"tags":["Courses"],"operationId":"listCourseCatalog","summary":"List courses","description":"The organisation's courses (including inactive ones, which still appear in history and the compliance matrix) and whether each can be assigned. Requires the `enrollments:write` or `compliance:read` scope.","parameters":[{"$ref":"#/components/parameters/TenantCode"},{"name":"code","in":"query","schema":{"type":"string","maxLength":64},"description":"Exact course code."},{"name":"assignable","in":"query","schema":{"type":"boolean"},"description":"Only courses that can (true) or cannot (false) be assigned now."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"security":[{"apiKey":[]},{"integrationToken":[]},{"integrationToken":[]},{"integrationToken":[]}],"responses":{"200":{"description":"List.","content":{"application/json":{"schema":{"type":"object","required":["pagination","courses"],"properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"courses":{"type":"array","items":{"$ref":"#/components/schemas/CatalogCourse"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"x-audience":"public","x-codeSamples":[{"lang":"shell","label":"cURL","source":"BASE_URL=\"${BASE_URL:-https://api.elearning.edu.pl}\"\n\ncurl --fail-with-body -sS \"$BASE_URL/api/v1/course-catalog?limit=100\" \\\n  -H \"X-Tenant-Code: $TENANT_CODE\" \\\n  -H \"X-API-Key: $API_KEY\"\n"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nBASE_URL = os.environ.get(\"BASE_URL\", \"https://api.elearning.edu.pl\")\nTENANT_CODE = os.environ[\"TENANT_CODE\"]\nAPI_KEY = os.environ[\"API_KEY\"]\n\nresponse = requests.get(\n    f\"{BASE_URL}/api/v1/course-catalog\",\n    headers={\n        \"X-Tenant-Code\": TENANT_CODE,\n        \"X-API-Key\": API_KEY,\n    },\n    params={\"limit\": \"100\"},\n    timeout=30,\n)\nresponse.raise_for_status()\nprint(response.json())\n"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$client = new GuzzleHttp\\Client([\n    'base_uri' => getenv('BASE_URL') ?: 'https://api.elearning.edu.pl',\n    'timeout' => 30,\n]);\n\n$response = $client->request('GET', '/api/v1/course-catalog', [\n    'headers' => [\n        'X-Tenant-Code' => getenv('TENANT_CODE'),\n        'X-API-Key' => getenv('API_KEY'),\n    ],\n    'query' => ['limit' => '100'],\n]);\necho $response->getBody(), PHP_EOL;\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbaseURL := os.Getenv(\"BASE_URL\")\n\tif baseURL == \"\" {\n\t\tbaseURL = \"https://api.elearning.edu.pl\"\n\t}\n\treq, err := http.NewRequest(\"GET\", baseURL+\"/api/v1/course-catalog?limit=100\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"X-Tenant-Code\", os.Getenv(\"TENANT_CODE\"))\n\treq.Header.Set(\"X-API-Key\", os.Getenv(\"API_KEY\"))\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\tdata, _ := io.ReadAll(res.Body)\n\tif res.StatusCode >= 300 {\n\t\tfmt.Fprintln(os.Stderr, res.Status, string(data))\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(string(data))\n}\n"},{"lang":"javascript","label":"JavaScript","source":"const BASE_URL = process.env.BASE_URL ?? \"https://api.elearning.edu.pl\";\nconst TENANT_CODE = process.env.TENANT_CODE ?? \"\";\nconst API_KEY = process.env.API_KEY ?? \"\";\n\nconst response = await fetch(`${BASE_URL}/api/v1/course-catalog?limit=100`, {\n  method: \"GET\",\n  headers: {\n    \"X-Tenant-Code\": TENANT_CODE,\n    \"X-API-Key\": API_KEY,\n  },\n});\nif (!response.ok) throw new Error(`${response.status} ${await response.text()}`);\nconsole.log(await response.json());\n"},{"lang":"csharp","label":"C#","source":"using System.Text;\n\nvar baseUrl = Environment.GetEnvironmentVariable(\"BASE_URL\") ?? \"https://api.elearning.edu.pl\";\nusing var http = new HttpClient { BaseAddress = new Uri(baseUrl) };\n\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"/api/v1/course-catalog?limit=100\");\nrequest.Headers.Add(\"X-Tenant-Code\", Environment.GetEnvironmentVariable(\"TENANT_CODE\"));\nrequest.Headers.Add(\"X-API-Key\", Environment.GetEnvironmentVariable(\"API_KEY\"));\n\nusing var response = await http.SendAsync(request);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\nresponse.EnsureSuccessStatusCode();\n"},{"lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String baseUrl = System.getenv().getOrDefault(\"BASE_URL\", \"https://api.elearning.edu.pl\");\n        HttpRequest request = HttpRequest.newBuilder(URI.create(baseUrl + \"/api/v1/course-catalog?limit=100\"))\n            .header(\"X-Tenant-Code\", System.getenv(\"TENANT_CODE\"))\n            .header(\"X-API-Key\", System.getenv(\"API_KEY\"))\n            .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n            .build();\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n        if (response.statusCode() >= 300) {\n            System.exit(1);\n        }\n    }\n}\n"}]}}},"webhooks":{"course.completed":{"post":{"operationId":"webhookCourseCompleted","summary":"Event course.completed","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseCompletedEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}},"course.failed":{"post":{"operationId":"webhookCourseFailed","summary":"Event course.failed","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseFailedEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}},"compliance.certified":{"post":{"operationId":"webhookComplianceCertified","summary":"Event compliance.certified","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceCertifiedEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}},"compliance.expired":{"post":{"operationId":"webhookComplianceExpired","summary":"Event compliance.expired","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceExpiredEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}},"enrollment.assigned":{"post":{"operationId":"webhookEnrollmentAssigned","summary":"Event enrollment.assigned","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentAssignedEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}},"enrollment.cancelled":{"post":{"operationId":"webhookEnrollmentCancelled","summary":"Event enrollment.cancelled","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentCancelledEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}},"group.member_joined":{"post":{"operationId":"webhookGroupMemberJoined","summary":"Event group.member_joined","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupMemberJoinedEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}},"group.member_left":{"post":{"operationId":"webhookGroupMemberLeft","summary":"Event group.member_left","description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts).","parameters":[{"name":"X-LMS-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"},"description":"Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."},{"name":"X-LMS-Event","in":"header","required":true,"schema":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},{"name":"X-LMS-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-LMS-Delivery-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"webhookSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupMemberLeftEvent"}}}},"responses":{"2XX":{"description":"The receiver accepted the event."},"default":{"description":"Any other response, or no response within 5 seconds, is retried."}}}}},"components":{"headers":{"RateLimit-Limit":{"description":"Client bucket capacity (burst), default 30.","schema":{"type":"integer"}},"RateLimit-Policy":{"description":"Limit policy, e.g. `20;w=60;burst=30, 5000;w=86400`.","schema":{"type":"string"}},"RateLimit-Remaining":{"description":"Requests available immediately: min(full tokens, remaining daily quota).","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full (after the daily limit is exhausted — until midnight UTC).","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds until the first allowed request.","schema":{"type":"integer"}}},"parameters":{"TenantCode":{"name":"X-Tenant-Code","in":"header","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"description":"Your tenant code (shown in the IT administration panel). Required by integration clients on every request."}},"responses":{"BadRequest":{"description":"Malformed JSON or invalid request data.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Forbidden":{"description":"Insufficient permissions, a token issued for another tenant, or the tenant is not active.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"NotFound":{"description":"Resource or tenant not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"RateLimited":{"description":"**429 `RATE_LIMITED`** — the integration client exceeded its rate limit; the request was not executed. Retry after `Retry-After` seconds. **429 `TOO_MANY_FAILED_AUTHENTICATIONS`** — the source address sent too many failed authentications (20 per minute) and is blocked for 10 minutes.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Unauthorized":{"description":"Missing, invalid or expired credentials; `TOKEN_AUDIENCE_MISMATCH` — the token was issued for another platform.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"ValidationFailed":{"description":"Field validation errors.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ValidationProblem"}}}}},"schemas":{"AssignEnrollmentRequest":{"type":"object","required":["cycle_year","due_date"],"properties":{"user_id":{"type":"string","format":"uuid"},"employee_no":{"type":"string","maxLength":64,"description":"Employee number instead of user_id."},"course_id":{"type":"string","format":"uuid"},"course_code":{"type":"string","maxLength":64,"description":"Course code from GET /course-catalog instead of course_id."},"cycle_year":{"type":"integer","minimum":2000,"maximum":2100},"due_date":{"type":"string","description":"A date `YYYY-MM-DD` (end of day, UTC) or an RFC 3339 date-time.","examples":["2027-03-31"]}},"description":"Person: `user_id` or `employee_no`; course: `course_id` or `course_code` — exactly one of each pair."},"CatalogCourse":{"type":"object","required":["id","code","title","course_type","item_kind","status","is_recurring","validity_days","estimated_minutes","assignable","unassignable_reason"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","description":"Course code — use it as `course_code` in POST /enrollments; also the column key of the compliance matrix."},"title":{"type":"string"},"course_type":{"type":"string","enum":["compliance","learning"],"description":"compliance — a requirement with validity (compliance matrix); learning — training without a certificate."},"item_kind":{"type":"string","enum":["course","path"]},"status":{"type":"string","enum":["draft","published","archived"]},"is_recurring":{"type":"boolean"},"validity_days":{"oneOf":[{"type":"integer"},{"type":"null"}]},"estimated_minutes":{"oneOf":[{"type":"integer"},{"type":"null"}]},"assignable":{"type":"boolean","description":"Whether the course can be assigned now. A seat-based licence limit is checked only when assigning (409)."},"unassignable_reason":{"oneOf":[{"type":"string","enum":["inactive","path_only","license_expired"],"description":"inactive — the course is unpublished or withdrawn; path_only — licensed only as part of a learning path, assign the path; license_expired — the licence has expired."},{"type":"null"}]}}},"ComplianceCertifiedEvent":{"type":"object","description":"A new certificate (SCORM completion or an audited manual credit).","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier (shared by all subscriptions) — use it to deduplicate."},"type":{"type":"string","const":"compliance.certified"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","course","department_id","compliance_record_id","source","certified_at","expires_at"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"course":{"$ref":"#/components/schemas/EventCourse"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"compliance_record_id":{"type":"string","format":"uuid"},"enrollment_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"source":{"type":"string","enum":["scorm","manual"]},"score":{"oneOf":[{"type":"number"},{"type":"null"}]},"certified_at":{"type":"string","format":"date-time"},"expires_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}}}},"ComplianceExpiredEvent":{"type":"object","description":"A certificate expired with no successor (nightly job, once per certificate).","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier (shared by all subscriptions) — use it to deduplicate."},"type":{"type":"string","const":"compliance.expired"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","course","department_id","compliance_record_id","certified_at","expires_at"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"course":{"$ref":"#/components/schemas/EventCourse"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"compliance_record_id":{"type":"string","format":"uuid"},"certified_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}}}},"ComplianceMatrix":{"type":"object","required":["summary","pagination","refreshed_at","rows"],"properties":{"summary":{"type":"object","required":["total_employees","compliant","expiring_soon","overdue","in_progress","pending"],"properties":{"total_employees":{"type":"integer","minimum":0},"compliant":{"type":"integer","minimum":0},"expiring_soon":{"type":"integer","minimum":0},"overdue":{"type":"integer","minimum":0},"in_progress":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0}}},"pagination":{"type":"object","required":["total","limit","offset"],"properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"refreshed_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"rows":{"type":"array","items":{"type":"object","required":["user_id","employee_no","full_name","department_id","department","courses"],"properties":{"user_id":{"type":"string","format":"uuid"},"employee_no":{"oneOf":[{"type":"string"},{"type":"null"}]},"full_name":{"type":"string"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"courses":{"type":"object","description":"Key: course code.","additionalProperties":{"$ref":"#/components/schemas/MatrixCell"}}}}}}},"Contractor":{"type":"object","required":["id","name","tax_id","employee_no_prefix","is_active"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"Company name — use it as `contractor_name` in POST /users."},"tax_id":{"oneOf":[{"type":"string","description":"Tax / VAT ID."},{"type":"null"}]},"employee_no_prefix":{"oneOf":[{"type":"string","description":"Employee-number prefix of this company's people."},{"type":"null"}]},"is_active":{"type":"boolean"}}},"CourseCompletedEvent":{"type":"object","description":"A SCORM course was completed.","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier (shared by all subscriptions) — use it to deduplicate."},"type":{"type":"string","const":"course.completed"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","course","department_id","attempt_id","enrollment_id","status","completed_at"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"course":{"$ref":"#/components/schemas/EventCourse"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt_id":{"type":"string","format":"uuid"},"enrollment_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["passed","completed"]},"score":{"oneOf":[{"type":"number"},{"type":"null"}]},"completed_at":{"type":"string","format":"date-time"}}}}},"CourseFailedEvent":{"type":"object","description":"A SCORM attempt was failed (once per attempt).","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier (shared by all subscriptions) — use it to deduplicate."},"type":{"type":"string","const":"course.failed"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","course","department_id","attempt_id","enrollment_id"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"course":{"$ref":"#/components/schemas/EventCourse"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt_id":{"type":"string","format":"uuid"},"enrollment_id":{"type":"string","format":"uuid"},"score":{"oneOf":[{"type":"number"},{"type":"null"}]}}}}},"CreateUserRequest":{"type":"object","required":["employee_no","first_name","last_name"],"properties":{"employee_no":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._/-]{0,63}$"},"first_name":{"type":"string","maxLength":100},"last_name":{"type":"string","maxLength":100},"login":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{2,99}$","description":"Defaults to the employee number in lower case."},"email":{"oneOf":[{"type":"string","format":"email","maxLength":255},{"type":"null"}]},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"worker_type":{"type":"string","enum":["internal_payroll","b2b_contractor"],"default":"internal_payroll"},"contractor_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string","pattern":"^\\+?[0-9 ()-]{6,32}$"},{"type":"null"}]},"employment_start_date":{"oneOf":[{"type":"string","format":"date","description":"Employment start date."},{"type":"null"}]},"job_title":{"oneOf":[{"type":"string","maxLength":150,"description":"Job title."},{"type":"null"}]},"location":{"oneOf":[{"type":"string","maxLength":150,"description":"Location (site, hall, branch)."},{"type":"null"}]},"manager_email":{"oneOf":[{"type":"string","format":"email","description":"Manager's e-mail address."},{"type":"null"}]},"attributes":{"type":"object","additionalProperties":{"description":"A value matching the field type: text — string (≤ 500), number — number, date — YYYY-MM-DD, boolean, select — option key; `null` clears the value.","oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Tenant-defined custom fields: field key → value. Sensitive fields are written only by administrators and HR integrations and read only by administrators."},"onboarding":{"type":"boolean","default":true,"description":"The same onboarding path as a new person from an HR file (department enrollments always apply)."},"department_name":{"type":"string","maxLength":150,"description":"Name of an active department from GET /departments — matched ignoring case, diacritics and extra whitespace."},"contractor_name":{"type":"string","maxLength":200,"description":"Name of an active contractor company from GET /contractors (matched like department names); if several companies share the name you get 422 — send contractor_id."}},"description":"internal_payroll requires a department (no company); b2b_contractor requires an active contractor company (the department is optional — the workplace on site). Department: `department_id` or `department_name`; company: `contractor_id` or `contractor_name` — not both."},"CreateWebhookSubscriptionRequest":{"type":"object","required":["name","target_url","subscribed_events"],"properties":{"name":{"type":"string","maxLength":150},"target_url":{"type":"string","format":"uri","description":"A public HTTPS URL; private, loopback and link-local addresses are rejected (SSRF protection). Calls leave from a fixed platform address (outbound proxy; ask your onboarding contact for the address to allowlist), so the URL must use a host name (not an IP address) on the default HTTPS port 443 — anything else is rejected (422)."},"secret_token":{"type":"string","minLength":24,"maxLength":128,"description":"Omitted — will be generated."},"subscribed_events":{"type":"array","minItems":1,"items":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},"filter_course_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"filter_department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"client_id":{"type":"string","format":"uuid","description":"Integration clients always own their subscriptions."},"format":{"type":"string","enum":["platform.v1"],"default":"platform.v1","description":"Delivery format."},"justification":{"type":"string","maxLength":1000,"description":"Justification — used only for changes made in the IT administration panel that require approval."}}},"Department":{"type":"object","required":["id","name","is_active"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"Department name — use it as `department_name` in POST /users."},"is_active":{"type":"boolean"}}},"EmployeeProfile":{"type":"object","required":["id","employee_no","first_name","last_name","login","email","phone","worker_type","is_active","preferred_language","department","contractor","employment_start_date","job_title","location","manager_email","created_at","last_login_at","attributes","groups","managed_by","managed_fields"],"properties":{"id":{"type":"string","format":"uuid"},"employee_no":{"oneOf":[{"type":"string"},{"type":"null"}]},"first_name":{"type":"string"},"last_name":{"type":"string"},"login":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"worker_type":{"type":"string","enum":["internal_payroll","b2b_contractor"]},"is_active":{"type":"boolean"},"preferred_language":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},{"type":"null"}]},"contractor":{"oneOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},{"type":"null"}]},"employment_start_date":{"oneOf":[{"type":"string","format":"date","description":"Employment start date."},{"type":"null"}]},"job_title":{"oneOf":[{"type":"string","maxLength":150,"description":"Job title."},{"type":"null"}]},"location":{"oneOf":[{"type":"string","maxLength":150,"description":"Location (site, hall, branch)."},{"type":"null"}]},"manager_email":{"oneOf":[{"type":"string","format":"email","description":"Manager's e-mail address."},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"last_login_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"attributes":{"type":"object","additionalProperties":{"description":"A value matching the field type: text — string (≤ 500), number — number, date — YYYY-MM-DD, boolean, select — option key; `null` clears the value.","oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Values of active custom fields; sensitive fields only for administrators."},"groups":{"type":"array","items":{"type":"object","required":["id","name","kind"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"kind":{"type":"string","enum":["static","dynamic"]}}},"description":"Active groups the person belongs to."},"managed_by":{"type":"string","enum":["roster","scim","api","manual"],"description":"Source that owns the account."},"managed_fields":{"type":"array","items":{"type":"string"},"description":"Fields managed by the owning source; read-only elsewhere (scim: personal data, department, active flag, job title, manager)."}}},"Enrollment":{"type":"object","required":["enrollment_id","user_id","course_id","cycle_year","status","due_date","source"],"properties":{"enrollment_id":{"type":"string","format":"uuid"},"user_id":{"type":"string","format":"uuid"},"course_id":{"type":"string","format":"uuid"},"cycle_year":{"type":"integer"},"status":{"type":"string"},"due_date":{"type":"string","format":"date-time"},"source":{"type":"string"}}},"EnrollmentAssignedEvent":{"type":"object","description":"A new enrollment (API, department rule, admin panel or periodic renewal).","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier (shared by all subscriptions) — use it to deduplicate."},"type":{"type":"string","const":"enrollment.assigned"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","course","department_id","enrollment_id","cycle_year","due_date","source"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"course":{"$ref":"#/components/schemas/EventCourse"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"enrollment_id":{"type":"string","format":"uuid"},"cycle_year":{"type":"integer"},"due_date":{"type":"string","format":"date-time"},"source":{"type":"string","enum":["recurring_rule","onboarding_path","manual_hr_credit","legacy_migration","department_rule","admin_assignment","group_assignment"]}}}}},"EnrollmentCancelledEvent":{"type":"object","description":"A not-yet-started enrollment was cancelled (the enrollment is removed; the audit log keeps a record).","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier (shared by all subscriptions) — use it to deduplicate."},"type":{"type":"string","const":"enrollment.cancelled"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","course","department_id","enrollment_id","cycle_year","reason"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"course":{"$ref":"#/components/schemas/EventCourse"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"enrollment_id":{"type":"string","format":"uuid"},"cycle_year":{"type":"integer"},"reason":{"type":"string"}}}}},"EventCourse":{"type":"object","required":["id","code"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string"}}},"EventUser":{"type":"object","required":["id","employee_no"],"properties":{"id":{"type":"string","format":"uuid"},"employee_no":{"oneOf":[{"type":"string"},{"type":"null"}]}}},"GroupMemberJoinedEvent":{"type":"object","description":"A person joined a group: added manually (static group) or started matching the rule (dynamic group). Subscriptions with a course filter do not receive it.","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier — use it to deduplicate."},"type":{"type":"string","const":"group.member_joined"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","group","department_id","reason"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"group":{"type":"object","required":["id","name","kind"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"kind":{"type":"string","enum":["static","dynamic"]}}},"reason":{"type":"string","enum":["manual","rule_match","rule_changed","employee_changed","scheduled_refresh"]}}}}},"GroupMemberLeftEvent":{"type":"object","description":"A person left a group; their enrollments stay.","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Event identifier — use it to deduplicate."},"type":{"type":"string","const":"group.member_left"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["user","group","department_id","reason"],"properties":{"user":{"$ref":"#/components/schemas/EventUser"},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"group":{"type":"object","required":["id","name","kind"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"kind":{"type":"string","enum":["static","dynamic"]}}},"reason":{"type":"string","enum":["manual","rule_match","rule_changed","employee_changed","scheduled_refresh"]}}}}},"MatrixCell":{"type":"object","required":["course_id","title","status","cycle_year","due_date","certified_at","expires_at"],"properties":{"course_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string","enum":["COMPLIANT","EXPIRING_SOON","OVERDUE","IN_PROGRESS","PENDING"]},"cycle_year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"due_date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"certified_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expires_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}},"OAuthError":{"type":"object","required":["error"],"description":"RFC 6749 §5.2.","properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","invalid_grant","unauthorized_client","unsupported_grant_type","invalid_scope"]},"error_description":{"type":"string"}}},"OAuthToken":{"type":"object","required":["access_token","token_type","expires_in","scope"],"properties":{"access_token":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"integer","const":900},"scope":{"type":"string"}}},"Pagination":{"type":"object","required":["total","limit","offset"],"properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"Problem":{"type":"object","required":["type","title","status"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"exceptions":{"type":"array","description":"Present only in development environments.","items":{"type":"object"}}}},"User":{"type":"object","required":["id","employee_no","first_name","last_name","login","email","department_id","department","is_active","created_at","worker_type","contractor_id","contractor","employment_start_date","job_title","location","manager_email"],"properties":{"id":{"type":"string","format":"uuid"},"employee_no":{"oneOf":[{"type":"string"},{"type":"null"}]},"first_name":{"type":"string"},"last_name":{"type":"string"},"login":{"type":"string"},"email":{"oneOf":[{"type":"string","format":"email"},{"type":"null"}]},"department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"is_active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"worker_type":{"type":"string","enum":["internal_payroll","b2b_contractor"]},"contractor_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"contractor":{"oneOf":[{"type":"string","description":"Contractor company name."},{"type":"null"}]},"employment_start_date":{"oneOf":[{"type":"string","format":"date","description":"Employment start date."},{"type":"null"}]},"job_title":{"oneOf":[{"type":"string","maxLength":150,"description":"Job title."},{"type":"null"}]},"location":{"oneOf":[{"type":"string","maxLength":150,"description":"Location (site, hall, branch)."},{"type":"null"}]},"manager_email":{"oneOf":[{"type":"string","format":"email","description":"Manager's e-mail address."},{"type":"null"}]},"managed_by":{"type":"string","enum":["roster","scim","api","manual"],"description":"Source that owns the account."}}},"ValidationProblem":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field → error message."}}}]},"WebhookDelivery":{"type":"object","required":["id","event_id","event_type","state","attempts","created_at"],"description":"Metadata only (kept for 30 days).","properties":{"id":{"type":"string","format":"uuid"},"event_id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"state":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer"},"max_attempts":{"type":"integer"},"response_status":{"oneOf":[{"type":"integer"},{"type":"null"}]},"response_digest":{"oneOf":[{"type":"string","description":"SHA-256 of the response body (the body itself is not stored)."},{"type":"null"}]},"duration_ms":{"oneOf":[{"type":"integer"},{"type":"null"}]},"error":{"oneOf":[{"type":"string"},{"type":"null"}],"description":"Last error: `HTTP <code>` (receiver's response) or a connection error; the `proxy:` prefix means an error of the platform's outbound proxy (e.g. `proxy: CONNECT 503` — receiver unreachable from the platform's address), not of the receiver."},"created_at":{"type":"string","format":"date-time"},"delivered_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"next_retry_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}},"WebhookSubscription":{"type":"object","required":["id","name","target_url","status","subscribed_events","filter_course_id","filter_department_id","consecutive_failures","created_at","updated_at","client_id","format","version"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"target_url":{"type":"string","format":"uri"},"status":{"type":"string","enum":["active","degraded","disabled"],"description":"`degraded` after 5 consecutive failures (deliveries continue); `disabled` after 20 consecutive failures or 3 days of failures (IT administrators are notified by e-mail). A target that violates the address policy at delivery time (e.g. the name resolves to a private address or the outbound proxy refuses the tunnel) disables the subscription immediately with `disabled_reason` `delivery_failures`; pending deliveries wait until it is re-enabled."},"subscribed_events":{"type":"array","items":{"type":"string","enum":["course.completed","course.failed","compliance.certified","compliance.expired","enrollment.assigned","enrollment.cancelled","group.member_joined","group.member_left"]}},"filter_course_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"filter_department_id":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"consecutive_failures":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"pending_deliveries":{"type":"integer","description":"List only."},"failed_deliveries":{"type":"integer","description":"List only — deliveries that failed 5 attempts."},"client_id":{"type":"string","format":"uuid","description":"The integration client that owns the subscription."},"format":{"type":"string","enum":["platform.v1"],"description":"Delivery format."},"disabled_reason":{"oneOf":[{"type":"string","enum":["manual","delivery_failures","client_disabled"]},{"type":"null"}]},"failing_since":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"previous_secret_expires_at":{"oneOf":[{"type":"string","format":"date-time","description":"Until this moment deliveries also carry a signature made with the previous secret."},{"type":"null"}]},"version":{"type":"integer"}}},"WebhookSubscriptionResult":{"type":"object","required":["outcome","subscription"],"description":"Result of saving the subscription.","properties":{"outcome":{"type":"string","enum":["applied","unchanged"],"description":"`unchanged` — the request changed nothing."},"subscription":{"$ref":"#/components/schemas/WebhookSubscription"},"secret_token":{"type":"string","description":"New webhook secret — returned once."}}}},"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Integration client credential `lms_live_<12>_<32>`, created by your IT administrator. The same secret works as `client_secret` in `POST /api/v1/oauth/token` (client_id = client id) when the client allows both methods. A rejected credential (invalid, expired, disabled client, address outside the allowlist) returns 401 without a reason. Scopes: `compliance:read`, `users:read`, `users:write`, `enrollments:write`, `webhooks:manage`; `scim` — SCIM server only (`/scim/v2`). A credential is valid only for its own tenant."},"integrationToken":{"type":"oauth2","description":"Integration client token (JWT, 15 minutes) from `POST /api/v1/oauth/token` — the same scopes and rules as the client's API key. The client's state (disabled, revoked, IP allowlist, validity) is checked on every request.","flows":{"clientCredentials":{"tokenUrl":"/api/v1/oauth/token","scopes":{"compliance:read":"Read the compliance matrix","users:read":"List people","users:write":"Create and update people","enrollments:write":"Assign courses","webhooks:manage":"Manage own webhook subscriptions (hosts on the client's allowed list)"}}}},"scimBearer":{"type":"http","scheme":"bearer","description":"Secret of an integration client credential with the `scim` scope (`lms_live_…`, a long-lived token as used by the Entra ID connector) or a token from `POST /api/v1/oauth/token`."},"webhookSignature":{"type":"apiKey","in":"header","name":"X-LMS-Signature","description":"HMAC-SHA256 signature of an event sent by the platform to your endpoint. Header `X-LMS-Signature: t={unix_timestamp},v1={hex}`, where hex = HMAC-SHA256(secret_token, \"{timestamp}.{raw request body}\"). Compare signatures in constant time and reject requests older than 5 minutes (replay protection). Delivery is at-least-once: deduplicate by the event `id` (`X-LMS-Event-Id`). A 2xx response means delivered; otherwise retries after 60 s, 5 min, 30 min and 2 h (5 attempts)."}}}}