{"openapi":"3.1.0","info":{"title":"TeachMeHIPAA Developer API","version":"planetary-perch","description":"The TeachMeHIPAA API is organized around REST. It has predictable resource-oriented URLs, accepts JSON request bodies (form-encoded for access tokens, CSV for imports), returns JSON responses, and uses standard HTTP response codes, authentication and verbs.\n\nYou can use the API in the Sandbox, which doesn't email real learners. The Sandbox and live have separate servers and separate API clients.\n\nThe API covers the training lifecycle of an organization: add learners, invite them to a course, follow their progress, and collect their certificates. Subscribe to webhooks to hear about changes instead of polling.\n\n## Authentication\n\nThe API uses OAuth 2.0 access tokens. An organization admin creates an API client in the TeachMeHIPAA console; the client secret is shown once, so store it securely and never in client-side code.\n\nExchange the client id and secret for an access token at `POST /v1/auth/token` with `grant_type=client_credentials`, authenticating with HTTP Basic. Send the token as `Authorization: Bearer <token>` on every other request. Tokens last 15 minutes and there is no refresh token: request a new one when it expires. `GET /v1/auth/introspection` tells you what a token holds.\n\nRequests without a valid token fail with `401`, and requests whose token lacks the scope an operation needs fail with `403`.\n\n## Errors\n\nTeachMeHIPAA uses conventional HTTP response codes. Codes in the `2xx` range mean success, codes in the `4xx` range mean the request can't be fulfilled as sent (a missing parameter, a conflict with the resource's state), and codes in the `5xx` range mean something went wrong on our side.\n\nErrors are returned as Problem Details (`application/problem+json`, RFC 9457). Every error has a `status`, a short `title`, and a machine-readable `code` you can branch on, such as `seat_unavailable` or `illegal_transition`; `detail` explains this occurrence, and `errors` lists each invalid field with its `path` and `message`. The token endpoint is the exception: it answers in the OAuth 2.0 shape, `{ error, error_description }`.\n\n| Status | Meaning |\n| --- | --- |\n| `200` `201` `202` `204` | Success. `202` means accepted for processing. |\n| `304` | Not modified: your cached copy is current. |\n| `400` | Bad request: the request couldn't be read. |\n| `401` | Unauthorized: no valid access token. |\n| `403` | Forbidden: the token lacks the required scope or limit. |\n| `404` | Not found, including a resource in another organization. |\n| `409` | Conflict with the resource's current state. |\n| `412` `428` | A required `If-Match` is stale or missing. |\n| `415` | Unsupported content type. |\n| `422` | Validation failed; see `errors`. |\n| `429` | Too many requests; wait for `Retry-After`. |\n| `502` `503` | Something went wrong on our side; retry later. |\n\n## Pagination\n\nList operations return a page of results with `items` and `nextCursor`. Pass `limit` to set the page size and the previous page's `nextCursor` as `cursor` to get the next page. When `nextCursor` is `null`, you've reached the end. Cursors are opaque: don't build or edit them. List responses also carry a `Link` header with `rel=\"next\"` (RFC 8288).\n\nSome filters are applied per page, so a page can hold fewer than `limit` items while `nextCursor` still points to more. Keep paging until `nextCursor` is `null`.\n\n## Idempotent requests\n\nOperations that create or change something require an `Idempotency-Key` header, so you can retry them safely after a network error without doing the work twice. Use a unique value per operation, such as a UUID.\n\nFor 24 hours, a retry with the same key and body returns the first response without running the operation again. Reusing a key with a different body fails with `422` `idempotency_key_reuse`.\n\n## Conditional requests\n\nResources carry a strong `ETag`. Send it back as `If-None-Match` on a `GET` to get `304 Not Modified` when nothing changed. Updates that require `If-Match` fail with `428` when it's missing and `412` when the resource changed since you read it: read it again and retry.\n\n## Sandbox\n\nBuild against the **Sandbox (test mode)** server before you go live. Create Sandbox API clients in the staging console and use them only with the Sandbox server: a test-mode client can't get a token from the live server, and a live client can't get one from the Sandbox.\n\nThe Sandbox only emails addresses on the staging allowlist.\n\n## Use with AI assistants\n\nAI assistants that speak the Model Context Protocol (MCP), such as Claude Code, Cursor and VS Code, can call the API for you: ask who is out of compliance or to enroll a new hire, and the assistant runs the matching operations. The MCP server uses the same API client, scopes and audit trail as any other integration. The hosted endpoint is pre-release.\n\nThe hosted server is a Streamable HTTP endpoint at `https://mcp.teachmehipaa.com/mcp`. The Sandbox has its own at `https://mcp-staging.teachmehipaa.com/mcp`. Send an access token as `Authorization: Bearer <token>`, the same token you get from `POST /v1/auth/token`. Requests without a valid token fail with `401`. Only API client tokens are accepted.\n\nAccess tokens last 15 minutes. Claude Code can fetch a fresh one on every connection with a `headersHelper`, a script that prints the headers as JSON. This command saves it as `~/.teachmehipaa/mcp-headers.sh` and makes it executable:\n\n```sh\nmkdir -p ~/.teachmehipaa && cat > ~/.teachmehipaa/mcp-headers.sh <<'EOF'\n#!/bin/sh\n# Prints an Authorization header with a fresh TeachMeHIPAA access token.\ncurl -s -u \"$TMH_CLIENT_ID:$TMH_CLIENT_SECRET\" \\\n  -d grant_type=client_credentials \"$TMH_API_URL/v1/auth/token\" \\\n  | sed -n 's/.*\"access_token\":\"\\([^\"]*\\)\".*/{\"Authorization\": \"Bearer \\1\"}/p'\nEOF\nchmod +x ~/.teachmehipaa/mcp-headers.sh\n```\n\nIn the shell you start Claude Code from, set `TMH_CLIENT_ID` and `TMH_CLIENT_SECRET`, and set `TMH_API_URL` to `https://api.tme.so` for a live client or `https://sandbox.api.tme.so` for a Sandbox client. Then add the server:\n\n```sh\nclaude mcp add-json --scope user teachmehipaa '{\"type\":\"http\",\"url\":\"https://mcp.teachmehipaa.com/mcp\",\"headersHelper\":\"~/.teachmehipaa/mcp-headers.sh\"}'\n```\n\nTo replace an earlier setup, run `claude mcp remove teachmehipaa` first.\n\n`--scope user` saves the server in your user configuration (`~/.claude.json`), so every project can use it. For a Sandbox client, use `https://mcp-staging.teachmehipaa.com/mcp` as the `url`.\n\nCursor and VS Code take a static header instead. Request a token, paste it into the configuration, and replace it when it expires 15 minutes later. In Cursor's `mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"teachmehipaa\": {\n      \"url\": \"https://mcp.teachmehipaa.com/mcp\",\n      \"headers\": { \"Authorization\": \"Bearer <token>\" }\n    }\n  }\n}\n```\n\nIn VS Code's `.vscode/mcp.json`, use `servers` in place of `mcpServers` and add `\"type\": \"http\"` to the entry.","contact":{"name":"TeachMeHIPAA","url":"https://teachmehipaa.com"}},"servers":[{"url":"https://api.tme.so/v1","description":"Live (production)","x-internal":false},{"url":"https://sandbox.api.tme.so/v1","description":"Sandbox (test mode)","x-internal":false}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Authentication","description":"Access tokens authenticate every other request. Get one with your client credentials and send it as a bearer token. Tokens last 15 minutes.\n\n### The access token object\n\n#### Attributes\n\n- **`access_token`** *string*  \n  The access token. Send it as `Authorization: Bearer`.\n- **`token_type`** *enum*  \n  Always `Bearer`.\n- **`expires_in`** *integer*  \n  Seconds until the token expires.\n- **`scope`** *string*  \n  The scopes the token holds, space-delimited.","x-displayName":"Access tokens"},{"name":"Courses","description":"Courses are the trainings TeachMeHIPAA offers. The catalog is public: you can list and retrieve courses without an access token.\n\n### The Course object\n\n#### Attributes\n\n- **`courseId`** *string*  \n  Unique identifier for the course.\n- **`title`** *string*  \n  The course's title.\n- **`courseVersion`** *string*  \n  The current version of the course content.\n- **`passingThreshold`** *number*  \n  The score needed to pass the course's assessment."},{"name":"Organizations","description":"An organization is the account your API client belongs to. Every invite uses one seat, so check the seat inventory before inviting learners in bulk.\n\n### The Seat inventory object\n\n#### Attributes\n\n- **`purchased`** *integer*  \n  Seats the organization holds and hasn't been refunded for, including a trial seat.\n- **`assigned`** *integer*  \n  Seats held by an invited or enrolled learner.\n- **`available`** *integer*  \n  Seats a new invite can use now.\n\n<details><summary>More attributes</summary>\n\n- **`total`** *integer*  \n  All seats on record.\n- **`used`** *integer*  \n  Seats in use.\n- **`byState`** *object*  \n  Seats by internal state. Prefer `purchased`, `assigned` and `available`.\n\n</details>"},{"name":"Members","description":"Members are the people in an organization: its admins and its learners. A member is addressed by `subjectId`, which is also the learner's `learnerId`.\n\n### The Member object\n\n#### Attributes\n\n- **`subjectId`** *nullable string*  \n  Unique identifier for the member. `null` for an older member who can't be addressed yet.\n- **`email`** *string*  \n  The member's email address.\n- **`name`** *nullable string*  \n  The member's full name.\n- **`role`** *enum*  \n  `admin` or `learner`.\n- **`isDisabled`** *boolean*  \n  Whether the member's account is disabled."},{"name":"Learners","description":"A learner is a person your organization trains in one course. The learner object combines their membership, enrollment and current certificate, so one call tells you where they stand: invited, in progress, compliant, expiring soon or expired. Use learners for most integrations; use enrollments when you need the underlying lifecycle.\n\n### The Learner object\n\n#### Attributes\n\n- **`learnerId`** *string*  \n  Unique identifier for the learner. The same as the member's `subjectId`.\n- **`email`** *string*  \n  The learner's email address.\n- **`name`** *nullable string*  \n  The learner's full name.\n- **`externalId`** *nullable string*  \n  Your own id for the learner, unique within the organization.\n- **`status`** *enum*  \n  The learner's training status in this course. One of `not_started` (invited), `invite_bounced`, `in_progress`, `compliant`, `expiring_soon` (within 60 days of expiry), `expired` or `removed`.\n- **`course`** *object*  \n  The course this learner record is for.\n- **`certificate`** *nullable object*  \n  The learner's current certificate, with its verification and PDF links.\n\n<details><summary>More attributes</summary>\n\n- **`invitedAt`** *nullable string*  \n  When the learner was invited (ISO 8601).\n- **`startedAt`** *nullable string*  \n  When the learner started training.\n- **`completedAt`** *nullable string*  \n  When the learner completed the course.\n- **`dueAt`** *nullable string*  \n  When the learner's training is due.\n\n</details>"},{"name":"Compliance","description":"The compliance summary counts an organization's learners in one course by status, using the same statuses as the learner object. Use it for dashboards; list learners with a `status` filter for the people behind each count.\n\n### The Compliance summary object\n\n#### Attributes\n\n- **`courseId`** *string*  \n  The course.\n- **`asOf`** *string*  \n  When the counts were taken (ISO 8601).\n- **`totals`** *object*  \n  Learners by status: `learners`, `compliant`, `expiringSoon`, `expired`, `inProgress`, `notStarted` and `inviteBounced`.\n- **`compliantRate`** *number*  \n  `compliant` divided by `learners`, or 0 with no learners."},{"name":"Enrollments","description":"An enrollment is one learner's place in one course for one certification cycle. It moves from invited, to started, to certified, and can be cancelled while it's still an invite. Renewing a certified enrollment opens the next cycle.\n\n### The Enrollment object\n\n#### Attributes\n\n- **`enrollmentId`** *string*  \n  Unique identifier for the enrollment.\n- **`subjectId`** *string*  \n  The learner's member id.\n- **`courseId`** *string*  \n  The course.\n- **`status`** *enum*  \n  The stored lifecycle state: `INVITED`, `EMAIL_BOUNCED`, `STARTED`, `ASSESSMENT_IN_PROGRESS`, `CERTIFIED` or `CANCELLED`.\n- **`effectiveStatus`** *enum*  \n  The status to display. Adds `EXPIRING`, `EXPIRED` and `ARCHIVED`, derived when you read it.\n- **`cycle`** *integer*  \n  The certification cycle, starting at 0. Renewing adds one.\n- **`certificateId`** *nullable string*  \n  The certificate issued for this cycle, if any.\n\n<details><summary>More attributes</summary>\n\n- **`orgId`** *string*  \n  The organization's id.\n- **`archived`** *boolean*  \n  Whether the enrollment is archived.\n- **`rev`** *integer*  \n  The resource's revision. Its strong `ETag` is derived from it.\n- **`invitedAt`** *nullable string*  \n  When the learner was invited (ISO 8601).\n- **`startedAt`** *nullable string*  \n  When the learner started.\n- **`completedAt`** *nullable string*  \n  When the learner completed the course.\n- **`certifiedAt`** *nullable string*  \n  When the learner was certified.\n- **`expiresAt`** *nullable string*  \n  When the certification expires.\n\n</details>"},{"name":"Certificates","description":"A certificate is issued when a learner passes a course. It carries its issue and expiry dates and whether it's valid, expired or revoked. You can download it as a PDF and get its LinkedIn and shareable verification links.\n\n### The Certificate object\n\n#### Attributes\n\n- **`certificateId`** *string*  \n  Unique identifier for the certificate.\n- **`subjectId`** *nullable string*  \n  The holder's member id.\n- **`courseId`** *string*  \n  The course the certificate is for.\n- **`status`** *enum*  \n  `VALID`, `EXPIRED` or `REVOKED`.\n- **`issuedAt`** *nullable string*  \n  When it was issued (ISO 8601).\n- **`expiresAt`** *nullable string*  \n  When it expires.\n\n<details><summary>More attributes</summary>\n\n- **`holderStatus`** *enum*  \n  Whether the holder could be resolved: `resolved`, `none` or `lookup_failed`.\n- **`courseVersion`** *nullable string*  \n  The course version the holder passed.\n- **`revokedAt`** *nullable string*  \n  When it was revoked, if it was.\n\n</details>"},{"name":"Certificate Verification","description":"Anyone can verify a certificate from its `tme.so` link, without an access token. Verification shows whether the certificate is valid, who it was issued to, the course and its dates, and never the learner's email or any internal id.\n\n### The Certificate verification object\n\n#### Attributes\n\n- **`status`** *enum*  \n  `valid`, `expired` or `revoked`.\n- **`learnerName`** *string*  \n  The name printed on the certificate.\n- **`courseTitle`** *string*  \n  The course.\n- **`issuedAt`** *string*  \n  When it was issued (ISO 8601).\n- **`expiresAt`** *string*  \n  When it expires.\n\n<details><summary>More attributes</summary>\n\n- **`issuer`** *enum*  \n  Who issued it.\n\n</details>"},{"name":"Audit Events","description":"The audit log is the organization's append-only compliance record. Every change to enrollments, certificates, members, settings and API clients is recorded with who made it and when, newest first. Each event has a `type` and the fields of its family; writes made with an API client's token record that client as the `actor`."},{"name":"Bulk Operations","description":"Bulk operations act on many enrollments at once: send reminders, cancel or renew a selection, invite learners from a CSV file, and export rosters and certificate records. Long-running work answers with an operation you can poll; each item reports its own outcome, so one failure never stops the rest.\n\n### The Operation object\n\n#### Attributes\n\n- **`name`** *string*  \n  Unique identifier for the operation.\n- **`done`** *boolean*  \n  Whether the operation has finished.\n- **`response`** *object*  \n  The result, once `done` is `true`.\n- **`error`** *object*  \n  The problem, if the operation failed.\n\n<details><summary>More attributes</summary>\n\n- **`metadata`** *object*  \n  Progress information, if any.\n\n</details>"},{"name":"Webhook Subscriptions","description":"Webhook subscriptions deliver signed events to your HTTPS endpoint as they happen, so you don't have to poll. Each subscription has its own signing secret, shown once when you create it.\n\n### The Webhook subscription object\n\n#### Attributes\n\n- **`subscriptionId`** *string*  \n  Unique identifier for the subscription.\n- **`endpointUrl`** *string*  \n  The HTTPS URL events are delivered to.\n- **`eventTypes`** *array of strings*  \n  The event types delivered.\n- **`enabled`** *boolean*  \n  Whether deliveries are on.\n- **`secretKeyId`** *string*  \n  Identifies the signing secret. Sent as `x-tmh-key-id`.\n\n<details><summary>More attributes</summary>\n\n- **`description`** *nullable string*  \n  Your description of the subscription.\n- **`seatsLowThreshold`** *integer*  \n  Send `seats.low` when available seats drop to this number. Defaults to 5.\n- **`createdAt`** *string*  \n  When it was created (ISO 8601).\n- **`rev`** *integer*  \n  The resource's revision. Its strong `ETag` is derived from it.\n\n</details>\n\n### Verifying a delivery\n\nEach delivery is a `POST` with these headers: `x-tmh-key-id` (the subscription's `secretKeyId`), `x-tmh-timestamp`, `x-tmh-body-hash` (hex SHA-256 of the raw body), `x-tmh-signature`, `x-tmh-event-type` and `x-tmh-event-id`.\n\nThe signature is the hex HMAC-SHA256, keyed with the subscription's secret, of four lines joined by `\\n`: `POST`, your endpoint's path and query, `x-tmh-timestamp`, and the body hash. Recompute it over the raw body, compare in constant time, and reject a timestamp more than 5 minutes from your clock. Deliveries are retried up to 12 times, so deduplicate on `eventId`."},{"name":"Events","description":"Events are the same envelopes webhooks deliver, kept for 30 days. The event log is the source of truth: use it to catch up after a missed delivery or an outage. Every event is logged whether or not a subscription listens for it.\n\n### The Event object\n\n#### Attributes\n\n- **`eventId`** *string*  \n  Unique identifier for the event. Ids sort by time.\n\n- **`eventType`** *string*  \n  The event's type, such as `learner.certified`.\n\n- **`orgId`** *string*  \n  The organization the event happened in.\n\n- **`occurredAt`** *string*  \n  When it happened (ISO 8601).\n\n- **`data`** *object*  \n  The event's payload. Its shape depends on `eventType`.\n\n#### Event types\n\n| Type | Sent when |\n| --- | --- |\n| `learner.invited` | A learner is invited, or re-invited for a new cycle. |\n| `learner.started` | A learner starts training. |\n| `learner.certified` | A learner certifies. |\n| `enrollment.certified` | A learner certifies (ids only). |\n| `learner.expiring` | A certificate enters its 60-day expiry window. |\n| `learner.expired` | A certificate expires. |\n| `learner.removed` | An invite is cancelled or a learner is removed. |\n| `invite.bounced` | An invite email bounces. |\n| `certificate.revoked` | An admin revokes a certificate. |\n| `seats.low` | Available seats drop to the subscription's threshold. |"}],"components":{"securitySchemes":{"bearerAuth":{"type":"oauth2","description":"OAuth 2.0. **API clients** (one organization) use client credentials (RFC 6749 §4.4). POST `application/x-www-form-urlencoded` `grant_type=client_credentials` (optionally `scope`, space-delimited) to the token URL, authenticated with your client id and secret as HTTP Basic (or `client_id` and `client_secret` form fields). The response's `access_token` is a JWT valid for 15 minutes (`expires_in`), bound to the client's organization; send it as `Authorization: Bearer`. There is no refresh token: run the grant again when the token expires. A client can only ever hold the scopes listed here. Conforms to JWT best current practices (RFC8725): the signing `alg` is pinned, and `iss`/`aud`/`exp` are validated on every request.","flows":{"clientCredentials":{"tokenUrl":"https://api.tme.so/v1/auth/token","refreshUrl":"https://api.tme.so/v1/auth/token","scopes":{"enrollments:read":"Read enrollments, invitations, seats, and member sub-resources.","enrollments:write":"Create and transition enrollments and assessment attempts.","certificates:read":"Read certificates and download certificate artifacts.","members:read":"Read organization members and the organization record.","audit:read":"Read the organization's audit-event trail and event log.","learners:read":"API clients: read learners.","learners:write":"API clients: create and update learners.","compliance:read":"API clients: read the compliance summary.","webhooks:manage":"API clients: manage webhook subscriptions and read the event log."}}}}},"responses":{"Unauthorized":{"description":"Missing or invalid bearer token (RFC 6750 challenge attached).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"parameters":{"limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"How many objects to return, between 1 and 100. Defaults to 20."},"rosterLimit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":20},"description":"How many objects to return, between 1 and 1000. Defaults to 20."},"cursor":{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"The `nextCursor` from the previous page."},"ifMatch":{"name":"If-Match","in":"header","required":true,"schema":{"type":"string"},"description":"The resource's current `ETag`. A stale value fails with `412`."},"idempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"},"description":"A unique key that makes the request safe to retry. See Idempotent requests."},"ifNoneMatch":{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string"},"description":"An `ETag` you hold. A match returns `304 Not Modified`."},"orgId":{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},"subjectId":{"name":"subjectId","in":"path","required":true,"description":"The member's id.","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}}},"headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator (from the canonical rev) for If-Match."},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying (sent with 429 / 503)."},"Access-Control-Allow-Origin":{"schema":{"type":"string"},"description":"Allowed CORS origin (explicit allow-list, never `*`)."}},"schemas":{"CourseDto":{"type":"object","properties":{"courseId":{"type":"string","minLength":1,"description":"Unique identifier for the course."},"title":{"type":"string","minLength":1,"description":"The course's title."},"courseVersion":{"type":"string","minLength":1,"description":"The current version of the course content."},"passingThreshold":{"type":"number","exclusiveMinimum":0,"maximum":1,"description":"The score needed to pass the course's assessment."}},"required":["courseId","title","courseVersion","passingThreshold"],"additionalProperties":false},"CoursesPage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"courseId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"courseVersion":{"type":"string","minLength":1},"passingThreshold":{"type":"number","exclusiveMinimum":0,"maximum":1}},"required":["courseId","title","courseVersion","passingThreshold"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"SeatsInventoryDto":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"description":"All seats on record."},"used":{"type":"integer","minimum":0,"description":"Seats in use."},"available":{"type":"integer","minimum":0,"description":"Seats a new invite can use now."},"purchased":{"type":"integer","minimum":0,"description":"Seats the organization holds and hasn't been refunded for, including a trial seat."},"assigned":{"type":"integer","minimum":0,"description":"Seats held by an invited or enrolled learner."},"byState":{"type":"object","properties":{"UNUSED":{"type":"integer","minimum":0},"ASSIGNED":{"type":"integer","minimum":0},"ACCEPTED":{"type":"integer","minimum":0},"REVOKED":{"type":"integer","minimum":0},"FREE":{"type":"integer","minimum":0},"REFUNDED":{"type":"integer","minimum":0}},"required":["UNUSED","ASSIGNED","ACCEPTED","REVOKED","FREE","REFUNDED"],"additionalProperties":false,"description":"Seats by internal state. Prefer `purchased`, `assigned` and `available`."}},"required":["total","used","available","byState"],"additionalProperties":false},"MemberDto":{"type":"object","properties":{"subjectId":{"type":["string","null"],"description":"Unique identifier for the member. `null` for an older member who can't be addressed yet."},"email":{"type":"string","minLength":1,"description":"The member's email address."},"name":{"type":["string","null"],"description":"The member's full name."},"role":{"type":"string","enum":["admin","learner"],"description":"`admin` or `learner`."},"isDisabled":{"type":"boolean","description":"Whether the member's account is disabled."}},"required":["subjectId","email","name","role","isDisabled"],"additionalProperties":false},"MembersPage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"subjectId":{"type":["string","null"]},"email":{"type":"string","minLength":1},"name":{"type":["string","null"]},"role":{"type":"string","enum":["admin","learner"]},"isDisabled":{"type":"boolean"},"enrollmentSubjectId":{"type":["string","null"],"minLength":1},"holdsInvitation":{"type":"boolean"}},"required":["subjectId","email","name","role","isDisabled"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"EnrollmentDto":{"type":"object","properties":{"enrollmentId":{"type":"string","minLength":1,"description":"Unique identifier for the enrollment."},"subjectId":{"type":"string","minLength":1,"description":"The learner's member id."},"courseId":{"type":"string","minLength":1,"description":"The course."},"orgId":{"type":"string","minLength":1,"description":"The organization's id."},"status":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED"],"description":"The stored lifecycle state: `INVITED`, `EMAIL_BOUNCED`, `STARTED`, `ASSESSMENT_IN_PROGRESS`, `CERTIFIED` or `CANCELLED`."},"effectiveStatus":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED","EXPIRING","EXPIRED","ARCHIVED"],"description":"The status to display. Adds `EXPIRING`, `EXPIRED` and `ARCHIVED`, derived when you read it."},"archived":{"type":"boolean","description":"Whether the enrollment is archived."},"cycle":{"type":"integer","minimum":0,"description":"The certification cycle, starting at 0. Renewing adds one."},"rev":{"type":"integer","minimum":0,"description":"The resource's revision. Its strong `ETag` is derived from it."},"invitedAt":{"type":["string","null"],"description":"When the learner was invited (ISO 8601)."},"startedAt":{"type":["string","null"],"description":"When the learner started."},"completedAt":{"type":["string","null"],"description":"When the learner completed the course."},"certifiedAt":{"type":["string","null"],"description":"When the learner was certified."},"expiresAt":{"type":["string","null"],"description":"When the certification expires."},"certificateId":{"type":["string","null"],"description":"The certificate issued for this cycle, if any."}},"required":["enrollmentId","subjectId","courseId","orgId","status","effectiveStatus","archived","cycle","rev","invitedAt","startedAt","completedAt","certifiedAt","expiresAt","certificateId"],"additionalProperties":false},"OrgEnrollmentListItemDto":{"type":"object","properties":{"enrollmentId":{"type":"string","minLength":1},"subjectId":{"type":"string","minLength":1},"courseId":{"type":"string","minLength":1},"orgId":{"type":"string","minLength":1},"status":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED"]},"effectiveStatus":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED","EXPIRING","EXPIRED","ARCHIVED"]},"archived":{"type":"boolean"},"cycle":{"type":"integer","minimum":0},"rev":{"type":"integer","minimum":0},"invitedAt":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"certifiedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"certificateId":{"type":["string","null"]},"priorCertificate":{"type":["object","null"],"properties":{"certificateId":{"type":"string","minLength":1},"issuedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"status":{"type":"string","enum":["VALID","EXPIRED"]}},"required":["certificateId","issuedAt","expiresAt","status"],"additionalProperties":false}},"required":["enrollmentId","subjectId","courseId","orgId","status","effectiveStatus","archived","cycle","rev","invitedAt","startedAt","completedAt","certifiedAt","expiresAt","certificateId"],"additionalProperties":false},"EnrollmentsListPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OrgEnrollmentListItemDto"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"EnrollmentCreateRequest":{"type":"object","properties":{"email":{"type":"string","description":"The learner's email address."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"The learner's full name."},"courseId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$","description":"The course to invite them to. Defaults to `hipaa`."}},"required":["email"],"additionalProperties":false},"EnrollmentActionAccepted":{"type":"object","properties":{"enrollmentId":{"type":"string","minLength":1,"description":"The enrollment the request is for."},"action":{"type":"string","enum":["remind","resendInvite"],"description":"The action that was accepted: `remind` or `resendInvite`."}},"required":["enrollmentId","action"],"additionalProperties":false},"EnrollmentCancelRequest":{"type":"object","properties":{"refund":{"type":"boolean","description":"Refund the seat to the card that paid for it instead of returning it to the pool. Defaults to `false`."}},"additionalProperties":false},"EnrollmentCancelRefundedDto":{"type":"object","properties":{"enrollmentId":{"type":"string","minLength":1},"subjectId":{"type":"string","minLength":1},"courseId":{"type":"string","minLength":1},"orgId":{"type":"string","minLength":1},"status":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED"]},"effectiveStatus":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED","EXPIRING","EXPIRED","ARCHIVED"]},"archived":{"type":"boolean"},"cycle":{"type":"integer","minimum":0},"rev":{"type":"integer","minimum":0},"invitedAt":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"certifiedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"certificateId":{"type":["string","null"]},"refund":{"type":"object","properties":{"refundId":{"type":"string","minLength":1},"amountCents":{"type":"integer","exclusiveMinimum":0},"currency":{"type":"string","minLength":1}},"required":["refundId","amountCents","currency"],"additionalProperties":false}},"required":["enrollmentId","subjectId","courseId","orgId","status","effectiveStatus","archived","cycle","rev","invitedAt","startedAt","completedAt","certifiedAt","expiresAt","certificateId","refund"],"additionalProperties":false},"CertificateDto":{"type":"object","properties":{"certificateId":{"type":"string","minLength":1,"description":"Unique identifier for the certificate."},"subjectId":{"type":["string","null"],"description":"The holder's member id."},"holderStatus":{"type":"string","enum":["resolved","none","lookup_failed"],"description":"Whether the holder could be resolved: `resolved`, `none` or `lookup_failed`."},"courseId":{"type":"string","minLength":1,"description":"The course the certificate is for."},"courseVersion":{"type":["string","null"],"description":"The course version the holder passed."},"issuedAt":{"type":["string","null"],"description":"When it was issued (ISO 8601)."},"expiresAt":{"type":["string","null"],"description":"When it expires."},"status":{"type":"string","enum":["VALID","EXPIRED","REVOKED"],"description":"`VALID`, `EXPIRED` or `REVOKED`."},"revokedAt":{"type":["string","null"],"description":"When it was revoked, if it was."}},"required":["certificateId","subjectId","courseId","courseVersion","issuedAt","expiresAt","status","revokedAt"],"additionalProperties":false},"CertificatesPage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"certificateId":{"type":"string","minLength":1},"subjectId":{"type":["string","null"]},"holderStatus":{"type":"string","enum":["resolved","none","lookup_failed"]},"courseId":{"type":"string","minLength":1},"courseVersion":{"type":["string","null"]},"issuedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"status":{"type":"string","enum":["VALID","EXPIRED","REVOKED"]},"revokedAt":{"type":["string","null"]}},"required":["certificateId","subjectId","courseId","courseVersion","issuedAt","expiresAt","status","revokedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"CertificateCredentialsDto":{"type":"object","properties":{"certificateId":{"type":"string","minLength":1,"description":"The certificate."},"linkedInUrl":{"type":"string","format":"uri","description":"Adds the certificate to the holder's LinkedIn profile."},"shortLink":{"type":"string","format":"uri","description":"The public `tme.so` verification link."},"tinyId":{"type":"string","minLength":1,"description":"The verification link's id."},"paywalled":{"type":"boolean"}},"required":["certificateId","linkedInUrl","shortLink","tinyId"],"additionalProperties":false},"CertificateVerificationDto":{"type":"object","properties":{"status":{"type":"string","enum":["valid","expired","revoked"],"description":"`valid`, `expired` or `revoked`."},"learnerName":{"type":"string","minLength":1,"description":"The name printed on the certificate."},"courseTitle":{"type":"string","minLength":1,"description":"The course."},"issuedAt":{"type":"string","format":"date-time","description":"When it was issued (ISO 8601)."},"expiresAt":{"type":"string","format":"date-time","description":"When it expires."},"issuer":{"type":"string","enum":["TeachMeHIPAA"],"description":"Who issued it."}},"required":["status","learnerName","courseTitle","issuedAt","expiresAt","issuer"],"additionalProperties":false},"AuditEventsPage":{"type":"object","properties":{"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["enrollment.transition"]},"transition":{"type":"string","enum":["bounce","start","beginAssessment","submitAssessment","certify","revokeCert","archive","unarchive","reinvite","cancelInvite"]},"subjectId":{"type":"string","minLength":1},"courseId":{"type":"string","minLength":1},"statusFrom":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED"]},"statusTo":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED"]},"archivedFrom":{"type":"boolean"},"archivedTo":{"type":"boolean"},"rev":{"type":"integer","minimum":0}},"required":["eventId","at","type","transition","subjectId","courseId","statusFrom","statusTo","archivedFrom","archivedTo","rev"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["organization.updated"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"fields":{"type":"array","items":{"type":"string","enum":["name","trainingNeeds","snoozeDuration","autoRecertify"]}}},"required":["eventId","at","type","actorSubjectId","actor","fields"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["organization.closed"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]}},"required":["eventId","at","type","actorSubjectId","actor"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["organization.reopened"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]}},"required":["eventId","at","type","actorSubjectId","actor"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["member.role_changed"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"subjectId":{"type":"string","minLength":1},"roleFrom":{"type":"string","enum":["admin","learner"]},"roleTo":{"type":"string","enum":["admin","learner"]}},"required":["eventId","at","type","actorSubjectId","actor","subjectId","roleFrom","roleTo"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["member.transferred"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"subjectId":{"type":"string","minLength":1},"targetOrgId":{"type":"string","minLength":1}},"required":["eventId","at","type","actorSubjectId","actor","subjectId","targetOrgId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["member.removed"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"subjectId":{"type":"string","minLength":1},"wasAdmin":{"type":"boolean"}},"required":["eventId","at","type","actorSubjectId","actor","subjectId","wasAdmin"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["certificate.issued"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"certificateId":{"type":"string","minLength":1},"subjectId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1}},"required":["eventId","at","type","actorSubjectId","actor","certificateId","subjectId","courseId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["certificate.revoked"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"certificateId":{"type":"string","minLength":1},"subjectId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1}},"required":["eventId","at","type","actorSubjectId","actor","certificateId","subjectId","courseId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["seat.granted"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"quantity":{"type":"integer","exclusiveMinimum":0}},"required":["eventId","at","type","actorSubjectId","actor","quantity"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["api_client.created"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"clientId":{"type":"string","minLength":1}},"required":["eventId","at","type","actorSubjectId","actor","clientId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["api_client.secret_rotated"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"clientId":{"type":"string","minLength":1}},"required":["eventId","at","type","actorSubjectId","actor","clientId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["api_client.revoked"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"clientId":{"type":"string","minLength":1}},"required":["eventId","at","type","actorSubjectId","actor","clientId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["learner.updated"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"subjectId":{"type":"string","minLength":1},"fields":{"type":"array","items":{"type":"string","enum":["name","externalId"]},"minItems":1}},"required":["eventId","at","type","actorSubjectId","actor","subjectId","fields"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["learner.launch_link_created"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"subjectId":{"type":"string","minLength":1},"courseId":{"type":"string","minLength":1}},"required":["eventId","at","type","actorSubjectId","actor","subjectId","courseId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"at":{"type":"string","minLength":1},"type":{"type":"string","enum":["api_client.updated"]},"actorSubjectId":{"type":"string","minLength":1},"actor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"subjectId":{"type":"string","minLength":1}},"required":["type","subjectId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["client"]},"clientId":{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["type","clientId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["scim"]},"keyId":{"type":"string","minLength":1}},"required":["type","keyId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1}},"required":["type","agentId"],"additionalProperties":false}]},"clientId":{"type":"string","minLength":1},"fields":{"type":"array","items":{"type":"string","enum":["name"]},"minItems":1}},"required":["eventId","at","type","actorSubjectId","actor","clientId","fields"],"additionalProperties":false}]}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"AccessTokenResponse":{"type":"object","properties":{"tokenType":{"type":"string","enum":["Bearer"]},"accessToken":{"type":"string","minLength":1},"expiresInSec":{"type":"integer","exclusiveMinimum":0},"scopes":{"type":"array","items":{"type":"string","enum":["me","enrollments:read","enrollments:write","members:read","members:admin","certificates:read","certificates:write","billing:write","org:admin","audit:read","scim","support:write","learners:read","learners:write","compliance:read","webhooks:manage"]}}},"required":["tokenType","accessToken","expiresInSec","scopes"],"additionalProperties":false},"ClientCredentialsTokenResponse":{"type":"object","properties":{"access_token":{"type":"string","minLength":1,"description":"The access token. Send it as `Authorization: Bearer`."},"token_type":{"type":"string","enum":["Bearer"],"description":"Always `Bearer`."},"expires_in":{"type":"integer","exclusiveMinimum":0,"description":"Seconds until the token expires."},"scope":{"type":"string","description":"The scopes the token holds, space-delimited."}},"required":["access_token","token_type","expires_in","scope"],"additionalProperties":false},"OAuthTokenError":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","invalid_grant","invalid_scope","unsupported_grant_type","slow_down","temporarily_unavailable"]},"error_description":{"type":"string"}},"required":["error"],"additionalProperties":false},"TokenIntrospection":{"type":"object","properties":{"actorType":{"type":"string","enum":["user","client"],"description":"`client` for an API client, `user` for a person."},"clientId":{"anyOf":[{"type":"string","pattern":"^cli_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}],"description":"The API client the token belongs to."},"subjectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The person the token belongs to, for a user token."},"orgId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The organization the token is bound to, if any."},"scopes":{"type":"array","items":{"type":"string","enum":["me","enrollments:read","enrollments:write","members:read","members:admin","certificates:read","certificates:write","billing:write","org:admin","audit:read","scim","support:write","learners:read","learners:write","compliance:read","webhooks:manage"]},"description":"The scopes the token holds."},"mode":{"anyOf":[{"type":"string","enum":["test","live"]},{"type":"null"}],"description":"`test` for a Sandbox client, `live` otherwise."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the token expires (ISO 8601)."}},"required":["actorType","clientId","subjectId","orgId","scopes","mode","expiresAt"],"additionalProperties":false},"EnrollmentsBatchRequest":{"type":"object","properties":{"operation":{"type":"string","enum":["remind","resendInvite","cancel","recertify","archive","unarchive"],"description":"What to do to each enrollment: `remind`, `resendInvite`, `cancel`, `recertify`, `archive` or `unarchive`."},"select":{"anyOf":[{"type":"object","properties":{"enrollmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":10000}},"required":["enrollmentIds"],"additionalProperties":false},{"type":"object","properties":{"filter":{"type":"object","properties":{"status":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED","EXPIRING","EXPIRED","ARCHIVED"]},"courseId":{"type":"string","minLength":1,"maxLength":64},"archived":{"type":"boolean"}},"additionalProperties":false}},"required":["filter"],"additionalProperties":false}],"description":"The enrollments to act on: a list of `enrollmentIds` (up to 500), or a `filter`."}},"required":["operation","select"],"additionalProperties":false},"EnrollmentsBatchResults":{"type":"object","properties":{"operation":{"type":"string","enum":["remind","resendInvite","cancel","recertify","archive","unarchive"],"description":"The operation that was run."},"results":{"type":"array","items":{"type":"object","properties":{"enrollmentId":{"type":"string","minLength":1},"outcome":{"type":"string","enum":["succeeded","skipped","failed"]},"problem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string","enum":["validation_failed","unauthorized","forbidden","not_found","method_not_allowed","not_acceptable","conflict","rate_limited","precondition_required","precondition_failed","idempotency_key_reuse","unsupported_media_type","illegal_transition","seat_unavailable","seat_already_claimed","already_invited","email_already_registered","last_admin_removal_blocked","org_not_active","enrollment_archived","lessons_incomplete","batch_too_large","import_too_large","export_too_large","summary_too_large","seat_not_refundable","refund_failed","not_configured","reset_unavailable","auto_recertify_unavailable","api_client_limit_reached","external_id_conflict","cannot_offboard_admin","cannot_launch_admin","learner_removed","learner_not_accepted","cannot_rename_admin","learner_in_multiple_orgs","account_exists_use_sign_in","name_change_not_allowed","temporarily_unavailable"]},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["title","status","code"]}},"required":["enrollmentId","outcome"],"additionalProperties":false},"description":"One result per enrollment: `succeeded`, `skipped` or `failed` with a problem."}},"required":["operation","results"],"additionalProperties":false},"EnrollmentsExportRequest":{"type":"object","properties":{"format":{"type":"string","enum":["csv","xlsx"],"description":"The file format. Only `csv` today."}},"required":["format"],"additionalProperties":false},"CertificatesExportRequest":{"type":"object","properties":{"format":{"type":"string","enum":["csv","zip"],"description":"The file format. Only `csv` today."}},"required":["format"],"additionalProperties":false},"ImportOptions":{"type":"object","properties":{"courseId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$","description":"The course to invite everyone to. Defaults to the organization's default course."},"validateOnly":{"type":"boolean","description":"Check the file and return a preview without inviting anyone."}},"additionalProperties":false},"ImportPreview":{"type":"object","properties":{"totalRows":{"type":"integer","minimum":0,"description":"Rows in the file."},"validRows":{"type":"integer","minimum":0,"description":"Rows that would be invited."},"seatsRequired":{"type":"integer","minimum":0,"description":"Seats the import would use."},"seatsAvailable":{"type":"integer","minimum":0,"description":"Seats available now."},"rows":{"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":2},"email":{"type":"string","maxLength":320},"name":{"type":"string","maxLength":200},"courseId":{"type":"string","minLength":1,"maxLength":64},"status":{"type":"string","enum":["valid","invalid_email","duplicate_in_file","already_enrolled","already_invited"]},"detail":{"type":"string"}},"required":["rowNumber","email","courseId","status"],"additionalProperties":false},"description":"Each row's result: `valid`, `invalid_email`, `duplicate_in_file`, `already_enrolled` or `already_invited`."}},"required":["totalRows","validRows","seatsRequired","seatsAvailable","rows"],"additionalProperties":false},"WebhookSubscriptionDto":{"type":"object","properties":{"subscriptionId":{"type":"string","minLength":1,"description":"Unique identifier for the subscription."},"endpointUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The HTTPS URL events are delivered to."},"eventTypes":{"type":"array","items":{"type":"string","enum":["enrollment.certified","seat.consumed","seat.freed","learner.invited","learner.started","learner.certified","learner.expiring","learner.expired","learner.removed","invite.bounced","certificate.revoked","seats.low"]},"minItems":1,"description":"The event types delivered."},"enabled":{"type":"boolean","description":"Whether deliveries are on."},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Your description of the subscription."},"seatsLowThreshold":{"type":"integer","minimum":0,"maximum":10000,"description":"Send `seats.low` when available seats drop to this number. Defaults to 5."},"secretKeyId":{"type":"string","minLength":1,"description":"Identifies the signing secret. Sent as `x-tmh-key-id`."},"createdAt":{"type":"string","format":"date-time","description":"When it was created (ISO 8601)."},"rev":{"type":"integer","minimum":0,"description":"The resource's revision. Its strong `ETag` is derived from it."}},"required":["subscriptionId","endpointUrl","eventTypes","enabled","description","seatsLowThreshold","secretKeyId","createdAt","rev"],"additionalProperties":false},"WebhookSubscriptionsPage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"subscriptionId":{"type":"string","minLength":1},"endpointUrl":{"type":"string","maxLength":2048,"format":"uri"},"eventTypes":{"type":"array","items":{"type":"string","enum":["enrollment.certified","seat.consumed","seat.freed","learner.invited","learner.started","learner.certified","learner.expiring","learner.expired","learner.removed","invite.bounced","certificate.revoked","seats.low"]},"minItems":1},"enabled":{"type":"boolean"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"seatsLowThreshold":{"type":"integer","minimum":0,"maximum":10000},"secretKeyId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"rev":{"type":"integer","minimum":0}},"required":["subscriptionId","endpointUrl","eventTypes","enabled","description","seatsLowThreshold","secretKeyId","createdAt","rev"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"WebhookSubscriptionCreated":{"type":"object","properties":{"subscriptionId":{"type":"string","minLength":1,"description":"Unique identifier for the subscription."},"endpointUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The HTTPS URL events are delivered to."},"eventTypes":{"type":"array","items":{"type":"string","enum":["enrollment.certified","seat.consumed","seat.freed","learner.invited","learner.started","learner.certified","learner.expiring","learner.expired","learner.removed","invite.bounced","certificate.revoked","seats.low"]},"minItems":1,"description":"The event types delivered."},"enabled":{"type":"boolean","description":"Whether deliveries are on."},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"seatsLowThreshold":{"type":"integer","minimum":0,"maximum":10000},"secretKeyId":{"type":"string","minLength":1,"description":"Identifies the signing secret."},"createdAt":{"type":"string","format":"date-time"},"rev":{"type":"integer","minimum":0},"secret":{"type":"string","minLength":1,"description":"The signing secret. Returned only once: store it now."}},"required":["subscriptionId","endpointUrl","eventTypes","enabled","description","seatsLowThreshold","secretKeyId","createdAt","rev","secret"],"additionalProperties":false},"WebhookSubscriptionCreate":{"type":"object","properties":{"endpointUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The HTTPS URL to deliver events to."},"eventTypes":{"type":"array","items":{"type":"string","enum":["enrollment.certified","seat.consumed","seat.freed","learner.invited","learner.started","learner.certified","learner.expiring","learner.expired","learner.removed","invite.bounced","certificate.revoked","seats.low"]},"minItems":1,"description":"The event types to deliver."},"description":{"type":"string","maxLength":500,"description":"A description for your own reference."},"seatsLowThreshold":{"type":"integer","minimum":0,"maximum":10000,"description":"Send `seats.low` when available seats drop to this number. Defaults to 5."}},"required":["endpointUrl","eventTypes"],"additionalProperties":false},"WebhookSubscriptionPatch":{"type":"object","properties":{"endpointUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The HTTPS URL to deliver events to."},"eventTypes":{"type":"array","items":{"type":"string","enum":["enrollment.certified","seat.consumed","seat.freed","learner.invited","learner.started","learner.certified","learner.expiring","learner.expired","learner.removed","invite.bounced","certificate.revoked","seats.low"]},"minItems":1,"description":"The event types to deliver."},"enabled":{"type":"boolean","description":"Turn deliveries on or off."},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"A description for your own reference."},"seatsLowThreshold":{"type":"integer","minimum":0,"maximum":10000,"description":"Send `seats.low` when available seats drop to this number."}},"additionalProperties":false},"OrgEventsPage":{"type":"object","properties":{"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["enrollment.certified"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"subjectId":{"type":"string","minLength":1},"courseId":{"type":"string","minLength":1},"enrollmentId":{"type":"string","minLength":1}},"required":["subjectId","courseId"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["seat.consumed"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","additionalProperties":{}}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["seat.freed"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","additionalProperties":{}}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["learner.invited"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"externalId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"occurredAt":{"type":"string","format":"date-time"}},"required":["learnerId","email","externalId","courseId","status","occurredAt"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["learner.started"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"externalId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"occurredAt":{"type":"string","format":"date-time"}},"required":["learnerId","email","externalId","courseId","status","occurredAt"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["learner.certified"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"externalId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"occurredAt":{"type":"string","format":"date-time"}},"required":["learnerId","email","externalId","courseId","status","occurredAt"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["learner.expiring"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"externalId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"occurredAt":{"type":"string","format":"date-time"}},"required":["learnerId","email","externalId","courseId","status","occurredAt"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["learner.expired"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"externalId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"occurredAt":{"type":"string","format":"date-time"}},"required":["learnerId","email","externalId","courseId","status","occurredAt"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["learner.removed"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"externalId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"occurredAt":{"type":"string","format":"date-time"}},"required":["learnerId","email","externalId","courseId","status","occurredAt"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["invite.bounced"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"externalId":{"type":["string","null"],"minLength":1},"courseId":{"type":"string","minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"occurredAt":{"type":"string","format":"date-time"}},"required":["learnerId","email","externalId","courseId","status","occurredAt"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["certificate.revoked"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"certificateId":{"type":"string","minLength":1},"learnerId":{"type":"string","minLength":1},"courseId":{"type":"string","minLength":1}},"required":["certificateId","learnerId","courseId"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"eventType":{"type":"string","enum":["seats.low"]},"orgId":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"available":{"type":"integer","minimum":0},"threshold":{"type":"integer","minimum":0,"maximum":10000}},"required":["available","threshold"],"additionalProperties":false}},"required":["eventId","eventType","orgId","occurredAt","data"],"additionalProperties":false}]}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"LearnerStatus":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"LearnerDto":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1,"description":"Unique identifier for the learner. The same as the member's `subjectId`."},"email":{"type":"string","minLength":1,"description":"The learner's email address."},"name":{"type":["string","null"],"description":"The learner's full name."},"externalId":{"type":["string","null"],"minLength":1,"description":"Your own id for the learner, unique within the organization."},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"],"description":"The learner's training status in this course. One of `not_started` (invited), `invite_bounced`, `in_progress`, `compliant`, `expiring_soon` (within 60 days of expiry), `expired` or `removed`."},"course":{"type":"object","properties":{"courseId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1}},"required":["courseId","title"],"additionalProperties":false,"description":"The course this learner record is for."},"invitedAt":{"type":["string","null"],"format":"date-time","description":"When the learner was invited (ISO 8601)."},"startedAt":{"type":["string","null"],"format":"date-time","description":"When the learner started training."},"completedAt":{"type":["string","null"],"format":"date-time","description":"When the learner completed the course."},"dueAt":{"type":["string","null"],"format":"date-time","description":"When the learner's training is due."},"certificate":{"type":["object","null"],"properties":{"certificateId":{"type":"string","minLength":1},"issuedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"verifyUrl":{"type":["string","null"],"format":"uri"},"pdfUrl":{"type":"string","minLength":1}},"required":["certificateId","issuedAt","expiresAt","verifyUrl","pdfUrl"],"additionalProperties":false,"description":"The learner's current certificate, with its verification and PDF links."}},"required":["learnerId","email","name","externalId","status","course","invitedAt","startedAt","completedAt","dueAt","certificate"],"additionalProperties":false},"LearnersPage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"name":{"type":["string","null"]},"externalId":{"type":["string","null"],"minLength":1},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"]},"course":{"type":"object","properties":{"courseId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1}},"required":["courseId","title"],"additionalProperties":false},"invitedAt":{"type":["string","null"],"format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"dueAt":{"type":["string","null"],"format":"date-time"},"certificate":{"type":["object","null"],"properties":{"certificateId":{"type":"string","minLength":1},"issuedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"verifyUrl":{"type":["string","null"],"format":"uri"},"pdfUrl":{"type":"string","minLength":1}},"required":["certificateId","issuedAt","expiresAt","verifyUrl","pdfUrl"],"additionalProperties":false}},"required":["learnerId","email","name","externalId","status","course","invitedAt","startedAt","completedAt","dueAt","certificate"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"ComplianceSummary":{"type":"object","properties":{"asOf":{"type":"string","format":"date-time","description":"When the counts were taken (ISO 8601)."},"courseId":{"type":"string","minLength":1,"description":"The course."},"totals":{"type":"object","properties":{"learners":{"type":"integer","minimum":0},"compliant":{"type":"integer","minimum":0},"expiringSoon":{"type":"integer","minimum":0},"expired":{"type":"integer","minimum":0},"inProgress":{"type":"integer","minimum":0},"notStarted":{"type":"integer","minimum":0},"inviteBounced":{"type":"integer","minimum":0}},"required":["learners","compliant","expiringSoon","expired","inProgress","notStarted","inviteBounced"],"additionalProperties":false,"description":"Learners by status: `learners`, `compliant`, `expiringSoon`, `expired`, `inProgress`, `notStarted` and `inviteBounced`."},"compliantRate":{"type":"number","minimum":0,"maximum":1,"description":"`compliant` divided by `learners`, or 0 with no learners."}},"required":["asOf","courseId","totals","compliantRate"],"additionalProperties":false},"LearnerCreateRequest":{"type":"object","properties":{"email":{"type":"string","description":"The learner's email address."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"The learner's full name."},"externalId":{"type":"string","minLength":1,"maxLength":128,"description":"Your own id for the learner, unique within the organization."},"courseId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$","description":"The course to invite them to. Defaults to the organization's default course."},"delivery":{"type":"string","enum":["email","none"],"description":"`email` (default) sends the invite email. `none` sends nothing and returns `joinUrl` for you to deliver."},"seatPolicy":{"type":"string","enum":["require_available"],"description":"`require_available` fails with `409` when no seat is free."}},"required":["email"],"additionalProperties":false},"LearnerUpsertRequest":{"type":"object","properties":{"email":{"type":"string","description":"The learner's email address."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"The learner's full name."},"courseId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$","description":"The course to invite them to. Defaults to the organization's default course."},"delivery":{"type":"string","enum":["email","none"],"description":"`email` (default) sends the invite email. `none` sends nothing and returns `joinUrl` for you to deliver."},"seatPolicy":{"type":"string","enum":["require_available"],"description":"`require_available` fails with `409` when no seat is free."}},"required":["email"],"additionalProperties":false},"LearnerCreated":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1,"description":"Unique identifier for the learner."},"email":{"type":"string","minLength":1,"description":"The learner's email address."},"name":{"type":["string","null"],"description":"The learner's full name."},"externalId":{"type":["string","null"],"minLength":1,"description":"Your own id for the learner."},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"],"description":"The learner's training status. One of `not_started` (invited), `invite_bounced`, `in_progress`, `compliant`, `expiring_soon` (within 60 days of expiry), `expired` or `removed`."},"course":{"type":"object","properties":{"courseId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1}},"required":["courseId","title"],"additionalProperties":false,"description":"The course the learner was invited to."},"invitedAt":{"type":["string","null"],"format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"dueAt":{"type":["string","null"],"format":"date-time"},"certificate":{"type":["object","null"],"properties":{"certificateId":{"type":"string","minLength":1},"issuedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"verifyUrl":{"type":["string","null"],"format":"uri"},"pdfUrl":{"type":"string","minLength":1}},"required":["certificateId","issuedAt","expiresAt","verifyUrl","pdfUrl"],"additionalProperties":false},"delivery":{"type":"string","enum":["email","none"],"description":"How the invite was delivered: `email`, or `none` when you deliver it."},"joinUrl":{"type":"string","format":"uri","description":"The invite link, returned once when `delivery` is `none`. Send it to the learner yourself."}},"required":["learnerId","email","name","externalId","status","course","invitedAt","startedAt","completedAt","dueAt","certificate"],"additionalProperties":false},"LearnerPatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The learner's full name."},"externalId":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"Your own id for the learner. Set it to `null` to clear it."}},"additionalProperties":false},"LearnerRemindAccepted":{"type":"object","properties":{"learnerId":{"type":"string","minLength":1,"description":"The learner the reminder is for."},"action":{"type":"string","enum":["remind"],"description":"Always `remind`."}},"required":["learnerId","action"],"additionalProperties":false},"LearnerLaunchLink":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The single-use sign-in URL. Redirect the learner to it right away."},"expiresAt":{"type":"string","format":"date-time","description":"When the URL stops working, 5 minutes after it was created."}},"required":["url","expiresAt"],"additionalProperties":false},"LearnerBatchUpsertRequest":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":200},"externalId":{"type":"string","minLength":1,"maxLength":128},"courseId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$"}},"required":["email"],"additionalProperties":false},"minItems":1,"maxItems":500,"description":"Up to 500 learners, each with the same fields as creating one learner."},"delivery":{"type":"string","enum":["email","none"],"description":"Applies to every item. `email` (default) sends invites; `none` sends nothing."},"seatPolicy":{"type":"string","enum":["require_available"],"description":"Applies to every item. `require_available` fails an item when no seat is free."}},"required":["items"],"additionalProperties":false},"LearnersExportRequest":{"type":"object","properties":{"format":{"type":"string","enum":["csv"],"description":"The file format. Only `csv` today."},"courseId":{"type":"string","minLength":1,"maxLength":64,"description":"The course to export. Defaults to the organization's default course."},"status":{"type":"string","enum":["not_started","invite_bounced","in_progress","compliant","expiring_soon","expired","removed"],"description":"Only export learners with this status."}},"required":["format"],"additionalProperties":false},"Problem":{"type":"object","properties":{"type":{"type":"string","description":"A URI identifying the problem type."},"title":{"type":"string","description":"A short summary of the problem."},"status":{"type":"integer","description":"The HTTP status code."},"detail":{"type":"string","description":"An explanation of this occurrence."},"instance":{"type":"string","description":"Identifies this occurrence."},"code":{"type":"string","enum":["validation_failed","unauthorized","forbidden","not_found","method_not_allowed","not_acceptable","conflict","rate_limited","precondition_required","precondition_failed","idempotency_key_reuse","unsupported_media_type","illegal_transition","seat_unavailable","seat_already_claimed","already_invited","email_already_registered","last_admin_removal_blocked","org_not_active","enrollment_archived","lessons_incomplete","batch_too_large","import_too_large","export_too_large","summary_too_large","seat_not_refundable","refund_failed","not_configured","reset_unavailable","auto_recertify_unavailable","api_client_limit_reached","external_id_conflict","cannot_offboard_admin","cannot_launch_admin","learner_removed","learner_not_accepted","cannot_rename_admin","learner_in_multiple_orgs","account_exists_use_sign_in","name_change_not_allowed","temporarily_unavailable"],"description":"A machine-readable error code, such as `seat_unavailable`."},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]},"description":"Each invalid field, with its `path` and `message`."}},"required":["title","status","code"]},"Operation":{"type":"object","properties":{"name":{"type":"string","description":"Unique identifier for the operation."},"done":{"type":"boolean","description":"Whether the operation has finished."},"metadata":{"type":"object","additionalProperties":{},"description":"Progress information, if any."},"response":{"description":"The result, once `done` is `true`."},"error":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string","enum":["validation_failed","unauthorized","forbidden","not_found","method_not_allowed","not_acceptable","conflict","rate_limited","precondition_required","precondition_failed","idempotency_key_reuse","unsupported_media_type","illegal_transition","seat_unavailable","seat_already_claimed","already_invited","email_already_registered","last_admin_removal_blocked","org_not_active","enrollment_archived","lessons_incomplete","batch_too_large","import_too_large","export_too_large","summary_too_large","seat_not_refundable","refund_failed","not_configured","reset_unavailable","auto_recertify_unavailable","api_client_limit_reached","external_id_conflict","cannot_offboard_admin","cannot_launch_admin","learner_removed","learner_not_accepted","cannot_rename_admin","learner_in_multiple_orgs","account_exists_use_sign_in","name_change_not_allowed","temporarily_unavailable"]},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["title","status","code"],"description":"The problem, if the operation failed."}},"required":["name","done"]}}},"paths":{"/courses":{"get":{"tags":["Courses"],"operationId":"listCourses","summary":"List all courses","description":"Returns a list of the courses in the public catalog. Needs no access token.","security":[],"parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"A dictionary with an `items` array of courses and a `nextCursor`.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 pagination: `<url>; rel=\"next\"` when more remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursesPage"}}}},"422":{"description":"Invalid pagination query.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({ environment: \"sandbox\" });\n\nfor await (const course of client.courses.list()) {\n  console.log(course.courseId, course.title);\n}\n"},{"lang":"python","label":"Python","source":"from teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(environment=\"sandbox\")\n\nfor course in client.courses.list():\n    print(course.course_id, course.title)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(environment: :sandbox)\n\ncourses = client.courses.list\ncourses.auto_paging_each { |course| puts course.title }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nawait foreach (var course in client.Courses.ListAutoPagingAsync())\n{\n    Console.WriteLine($\"{course.CourseId}: {course.Title}\");\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Course;\n\nTeachMeHipaaClient client = TeachMeHipaaClient.builder().environment(Environment.SANDBOX).build();\n\nfor (Course course : client.courses().list().autoPagingIterable()) {\n  System.out.println(course.getCourseId() + \" \" + course.getTitle());\n}\n"},{"lang":"shell","label":"CLI","source":"# Public: works before tmh login.\ntmh courses list | jq -r '.items[] | [.courseId, .title] | @tsv'"}]}},"/courses/{courseId}":{"get":{"tags":["Courses"],"operationId":"getCourse","summary":"Retrieve a course","description":"Retrieves a course from the public catalog.","security":[],"parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},{"$ref":"#/components/parameters/ifNoneMatch"}],"responses":{"200":{"description":"Returns a course object if a valid identifier was provided.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseDto"}}}},"304":{"description":"Not Modified (If-None-Match matched)."},"404":{"description":"No such course.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({ environment: \"sandbox\" });\n\nconst course = await client.courses.retrieve(\"hipaa-2026\");\nconsole.log(course.title, course.passingThreshold);\n"},{"lang":"python","label":"Python","source":"from teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(environment=\"sandbox\")\n\ncourse = client.courses.retrieve(\"hipaa-2026\")\nprint(course.title, course.course_version)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(environment: :sandbox)\n\ncourse = client.courses.retrieve(\"hipaa-2026\")\nputs course.title\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nCourse course = await client.Courses.GetAsync(\"hipaa-2026\");\nConsole.WriteLine($\"{course.Title}, passing score {course.PassingThreshold:P0}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Course;\n\nTeachMeHipaaClient client = TeachMeHipaaClient.builder().environment(Environment.SANDBOX).build();\n\nCourse course = client.courses().retrieve(\"hipaa-2026\");\nSystem.out.println(course.getTitle() + \" \" + course.getCourseVersion());\n"},{"lang":"shell","label":"CLI","source":"# Public: works before tmh login.\ntmh courses retrieve hipaa-2026 | jq -r .title"}]}},"/organizations/{orgId}/seats":{"get":{"tags":["Organizations"],"operationId":"getSeatInventory","security":[{"bearerAuth":["enrollments:read"]}],"summary":"Retrieve the seat inventory","description":"Retrieves how many seats the organization has, how many are assigned and how many are available for new invites. Requires the `enrollments:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"}],"responses":{"200":{"description":"Returns the organization's seat inventory object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatsInventoryDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the required read scope, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst seats = await client.seats.retrieve();\nconsole.log(seats.available, \"of\", seats.total);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nseats = client.seats.retrieve()\nprint(seats.available, \"of\", seats.total, \"seats available\")\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nseats = client.seats.retrieve\nputs \"#{seats.available} of #{seats.total} Seats free\"\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nSeatsInventory seats = await client.Seats.GetAsync();\nConsole.WriteLine($\"{seats.Available} of {seats.Total} Seats available\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.SeatsInventory;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nSeatsInventory seats = client.seats().retrieve();\nSystem.out.println(seats.getAvailable() + \" of \" + seats.getTotal() + \" seats free\");\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh seats retrieve | jq .available"}]}},"/organizations/{orgId}/members":{"get":{"tags":["Members"],"operationId":"listMembers","security":[{"bearerAuth":["members:read"]}],"summary":"List all members","description":"Returns a list of the organization's members, its admins and learners. Pass `role=admin` to list only admins.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/rosterLimit"},{"$ref":"#/components/parameters/cursor"},{"name":"include","in":"query","required":false,"description":"Opt-in, comma-separated. With `enrollmentSubject`, a member whose `subjectId` is null carries `enrollmentSubjectId`: the subject their email resolves to (a never-signed-in invitee), or null when none. Use it only to match the member to Enrollments; it is not an address for member routes. With `holdsInvitation`, each learner carries `holdsInvitation`: whether the organization has an invitation for their email or a Seat bound to them. Each key is omitted when its lookup failed.","schema":{"type":"string","pattern":"^(enrollmentSubject|holdsInvitation)(,(enrollmentSubject|holdsInvitation))*$"}},{"name":"role","in":"query","required":false,"description":"Only admins (paginated).","schema":{"type":"string","enum":["admin"]}}],"responses":{"200":{"description":"A dictionary with an `items` array of members and a `nextCursor`.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 pagination: `<url>; rel=\"next\"` when more remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembersPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `members:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid pagination, `include` or filter query.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nfor await (const member of client.members.list({ role: \"admin\" })) {\n  console.log(member.email, member.role);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nfor member in client.members.list():\n    print(member.email, member.role)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nmembers = client.members.list(role: \"admin\")\nmembers.auto_paging_each { |member| puts member.email }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nawait foreach (var member in client.Members.ListAutoPagingAsync())\n{\n    Console.WriteLine($\"{member.Email} {member.Role}\");\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.MemberListItem;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nfor (MemberListItem member : client.members().list().autoPagingIterable()) {\n  System.out.println(member.getEmail() + \" \" + member.getRole());\n}\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh members list \\\n  --role admin \\\n  | jq -r '.items[] | [.email, .name] | @tsv'"}]}},"/organizations/{orgId}/members/{subjectId}":{"get":{"tags":["Members"],"operationId":"getMember","security":[{"bearerAuth":["members:read"]}],"summary":"Retrieve a member","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/subjectId"}],"responses":{"200":{"description":"Returns a member object if a valid identifier was provided.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on writes."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `members:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such member in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst member = await client.members.retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nconsole.log(member.email, member.role);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nmember = client.members.retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nprint(member.email, member.role)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nmember = client.members.retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nputs \"#{member.name} (#{member.role})\"\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nMember member = await client.Members.GetAsync(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nConsole.WriteLine($\"{member.Name} {member.Role}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Member;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nMember member = client.members().retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nSystem.out.println(member.getName() + \" \" + member.getRole());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh members retrieve sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .role"}],"description":"Retrieves a member of the organization."}},"/organizations/{orgId}/enrollments":{"get":{"tags":["Enrollments"],"operationId":"listEnrollments","security":[{"bearerAuth":["enrollments:read"]}],"summary":"List all enrollments","description":"Returns a list of the organization's enrollments. Filter by `status`, `courseId` or `archived`. Requires the `enrollments:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/rosterLimit"},{"$ref":"#/components/parameters/cursor"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["INVITED","EMAIL_BOUNCED","STARTED","ASSESSMENT_IN_PROGRESS","CERTIFIED","CANCELLED","EXPIRING","EXPIRED","ARCHIVED"]},"description":"Filter on the derived effectiveStatus."},{"name":"courseId","in":"query","required":false,"schema":{"type":"string"}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"include","in":"query","required":false,"schema":{"type":"string","enum":["priorCertificate"]},"description":"Opt-in enrichment. With `priorCertificate`, an item carries `priorCertificate` (object, or null when the server confirmed there is none). The key is omitted on an item whose answer is unknown, and on every item of the page if the certificate lookup failed; clients must treat a missing key as unknown, never as null."}],"responses":{"200":{"description":"A dictionary with an `items` array of enrollments and a `nextCursor`.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 pagination: `<url>; rel=\"next\"` when more remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentsListPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the enrollments scope, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid pagination/filter query.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nfor await (const enrollment of client.enrollments.list({\n  status: \"EXPIRING\",\n})) {\n  console.log(enrollment.enrollmentId, enrollment.expiresAt);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nfor enrollment in client.enrollments.list(status=\"CERTIFIED\"):\n    print(enrollment.enrollment_id, enrollment.certified_at)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nenrollments = client.enrollments.list(course_id: \"hipaa-2026\")\nenrollments.auto_paging_each { |e| puts e.enrollment_id }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nvar expiring = new EnrollmentListOptions { Status = ListEnrollmentsStatus.Expiring };\nawait foreach (var enrollment in client.Enrollments.ListAutoPagingAsync(expiring))\n{\n    Console.WriteLine($\"{enrollment.EnrollmentId} expires {enrollment.ExpiresAt}\");\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.OrgEnrollmentListItem;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nfor (OrgEnrollmentListItem enrollment : client.enrollments().list().autoPagingIterable()) {\n  System.out.println(enrollment.getEnrollmentId() + \" \" + enrollment.getStatus());\n}\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments list \\\n  --status CERTIFIED \\\n  | jq -r '.items[] | [.enrollmentId, .subjectId, .expiresAt] | @tsv'"}]},"post":{"tags":["Enrollments"],"operationId":"createEnrollment","security":[{"bearerAuth":["enrollments:write"]}],"summary":"Create an enrollment","description":"Invites a person to a course, creating their profile if needed, and uses one seat. The course defaults to `hipaa`. Requires the `enrollments:write` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentCreateRequest"}}}},"responses":{"201":{"description":"Returns the enrollment object. Fails with `409` `seat_unavailable` when no seat is free, or `seat_already_claimed` when the person already holds a seat for the course.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator from the canonical rev; present it via If-Match on PATCH."},"Location":{"schema":{"type":"string"},"description":"The enrollment's canonical URL."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Email-Queued":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Learner emails this request queued (new outbox entries). Present only when email is enabled for the organization; absent or `0` means this request queued nothing new. Queued, not delivered. An Idempotency-Key replay returns the original value."},"TMH-Email-Deduped":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Items whose email for the same invitation was already queued (pending or sent) — a same-hour resend or reminder — so no new email was queued. Sent together with `TMH-Email-Queued`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the enrollments scope, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`seat_unavailable`, `seat_already_claimed`, Archived enrollment (`enrollment_archived` — unarchive first), or an in-flight Idempotency-Key duplicate. With the invite fence enforced, also `already_invited` (a live invitation exists and cannot be re-sent here) or a Recertify answer for a CERTIFIED person (`illegal_transition`, `conflict`; a retryable one carries `type` `urn:tmh:problem:retryable`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body, missing Idempotency-Key, or the key was reused with a different body.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst enrollment = await client.enrollments.create({\n  email: \"dana.whitfield@example.com\",\n  courseId: \"hipaa-2026\",\n});\nconsole.log(enrollment.enrollmentId, enrollment.status);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nenrollment = client.enrollments.create(\n    email=\"dana.whitfield@example.com\", course_id=\"hipaa-2026\"\n)\nprint(enrollment.enrollment_id, enrollment.status)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nenrollment = client.enrollments.create(\n  email: \"dana.whitfield@example.com\",\n  course_id: \"hipaa-2026\",\n)\nputs enrollment.enrollment_id\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nEnrollment enrollment = await client.Enrollments.CreateAsync(new EnrollmentCreateOptions\n{\n    Email = \"dana.whitfield@example.com\",\n    CourseId = \"hipaa-2026\",\n});\nConsole.WriteLine($\"{enrollment.EnrollmentId} {enrollment.Status}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Enrollment;\nimport com.teachmehipaa.param.EnrollmentCreateParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nEnrollment enrollment =\n    client\n        .enrollments()\n        .create(\n            EnrollmentCreateParams.builder()\n                .email(\"dana.whitfield@example.com\")\n                .courseId(\"hipaa-2026\")\n                .build());\nSystem.out.println(enrollment.getEnrollmentId() + \" \" + enrollment.getStatus());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments create \\\n  --email dana.whitfield@example.com \\\n  --course-id hipaa-2026 \\\n  | jq -r .enrollmentId"}]}},"/organizations/{orgId}/enrollments/{enrollmentId}":{"get":{"tags":["Enrollments"],"operationId":"getEnrollment","security":[{"bearerAuth":["enrollments:read"]}],"summary":"Retrieve an enrollment","description":"Retrieves an enrollment. Requires the `enrollments:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"enrollmentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.-]+__[A-Za-z0-9_.-]+$"}},{"$ref":"#/components/parameters/ifNoneMatch"}],"responses":{"200":{"description":"Returns an enrollment object if a valid identifier was provided.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator from the canonical rev; present it via If-Match on PATCH."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentDto"}}}},"304":{"description":"Not modified."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the enrollments scope, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such enrollment in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst enrollment = await client.enrollments.retrieve(\n  \"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\",\n);\nconsole.log(enrollment.status, enrollment.certificateId);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nenrollment = client.enrollments.retrieve(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nprint(enrollment.status, enrollment.expires_at)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nenrollment = client.enrollments.retrieve(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nputs enrollment.effective_status\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nEnrollment enrollment = await client.Enrollments.GetAsync(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nConsole.WriteLine($\"{enrollment.EffectiveStatus}, certified {enrollment.CertifiedAt}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Enrollment;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nEnrollment enrollment = client.enrollments().retrieve(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nSystem.out.println(enrollment.getStatus() + \" \" + enrollment.getExpiresAt());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments retrieve enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \\\n  | jq -r .effectiveStatus"}]}},"/organizations/{orgId}/enrollments/{enrollmentId}:cancel":{"post":{"tags":["Enrollments"],"operationId":"cancelEnrollment","security":[{"bearerAuth":["enrollments:write"]}],"summary":"Cancel an enrollment","description":"Cancels an invite that hasn't been accepted yet and returns its seat to the pool. With `refund: true`, refunds the seat to the card that paid for it instead. The enrollment remains, with status `CANCELLED`. Requires the `enrollments:write` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"enrollmentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.-]+__[A-Za-z0-9_.-]+$"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentCancelRequest"}}}},"responses":{"200":{"description":"Returns the cancelled enrollment object, with the refund when you asked for one. Fails with `409` `illegal_transition` once the learner has started.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator from the canonical rev; present it via If-Match on PATCH."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/EnrollmentDto"},{"$ref":"#/components/schemas/EnrollmentCancelRefundedDto"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the enrollments scope, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such enrollment in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`illegal_transition` (with the offending from→to detail), Archived enrollment (`enrollment_archived` — unarchive first), no pending invitation, `seat_not_refundable`, or an in-flight Idempotency-Key duplicate.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Missing Idempotency-Key, or the key was reused with a different target.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"`refund_failed` — the cancel committed but the Stripe refund did not; retry the same request (refund idempotency-keyed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"`not_configured` — no Stripe secret in this deployment.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst enrollment = await client.enrollments.cancel(\n  \"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\",\n  { refund: true },\n);\nconsole.log(enrollment.status);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nenrollment = client.enrollments.cancel(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nprint(enrollment.status)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nenrollment = client.enrollments.cancel(\n  \"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\",\n  refund: true,\n)\nputs enrollment.status\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nCancelEnrollmentResponse cancelled = await client.Enrollments.CancelAsync(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nConsole.WriteLine($\"Cancelled {cancelled.EnrollmentId}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.CancelEnrollmentResponse;\nimport com.teachmehipaa.model.EnrollmentCancelRefunded;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nCancelEnrollmentResponse cancelled =\n    client.enrollments().cancel(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nSystem.out.println(cancelled instanceof EnrollmentCancelRefunded ? \"refunded\" : \"cancelled\");\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments cancel enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \\\n  --refund \\\n  | jq -r .status"}]}},"/organizations/{orgId}/enrollments/{enrollmentId}:renew":{"post":{"tags":["Enrollments"],"operationId":"renewEnrollment","security":[{"bearerAuth":["enrollments:write"]}],"summary":"Renew an enrollment","description":"Starts the next certification cycle for a certified learner and invites them again, using one seat. Retrying never uses a second seat. Requires the `enrollments:write` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"enrollmentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.-]+__[A-Za-z0-9_.-]+$"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"201":{"description":"Returns the renewed enrollment object, with `cycle` increased by one.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator from the canonical rev; present it via If-Match on PATCH."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Email-Queued":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Learner emails this request queued (new outbox entries). Present only when email is enabled for the organization; absent or `0` means this request queued nothing new. Queued, not delivered. An Idempotency-Key replay returns the original value."},"TMH-Email-Deduped":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Items whose email for the same invitation was already queued (pending or sent) — a same-hour resend or reminder — so no new email was queued. Sent together with `TMH-Email-Queued`."},"TMH-Recertify-Fenced":{"schema":{"type":"string","enum":["1"]},"description":"`1` when this API uses at most one Seat per certification cycle, so re-sending a recertify is safe. Absent on an API that does not."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the enrollments scope, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such enrollment in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`illegal_transition`, `seat_unavailable`, Archived enrollment (`enrollment_archived` — unarchive first), an in-flight Idempotency-Key duplicate, or `conflict` titled \"Recertify needs support\": the Learner's records need a fix, and a retry answers the same.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Recertify-Fenced":{"schema":{"type":"string","enum":["1"]},"description":"`1` when this API uses at most one Seat per certification cycle, so re-sending a recertify is safe. Absent on an API that does not."}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Missing Idempotency-Key, or the key was reused with a different target.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The renewal is being recorded; retry after `Retry-After` seconds with the same Idempotency-Key. The retry never uses a second Seat. The body is the server error envelope, not a Problem: `data` is `{ \"retry\": \"fenced\", \"reason\", \"retryAfterSeconds\" }`. A 503 without that `data.retry` marker makes no such promise.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Recertify-Fenced":{"schema":{"type":"string","enum":["1"]},"description":"`1` when this API uses at most one Seat per certification cycle, so re-sending a recertify is safe. Absent on an API that does not."}},"content":{"application/json":{"schema":{"type":"object","required":["statusCode","data"],"properties":{"statusCode":{"type":"integer","format":"int32","minimum":503,"maximum":503},"data":{"type":"object","required":["retry","reason","retryAfterSeconds"],"properties":{"retry":{"type":"string","enum":["fenced"]},"reason":{"type":"string","enum":["record_pending","transient","reread_failed"]},"retryAfterSeconds":{"type":"integer","format":"int32","minimum":1,"maximum":60}}}}}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst enrollment = await client.enrollments.renew(\n  \"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\",\n);\nconsole.log(enrollment.cycle, enrollment.status);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nenrollment = client.enrollments.renew(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nprint(enrollment.cycle, enrollment.status)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nenrollment = client.enrollments.renew(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nputs enrollment.cycle\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nEnrollment renewed = await client.Enrollments.RenewAsync(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nConsole.WriteLine($\"Cycle {renewed.Cycle}: {renewed.Status}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Enrollment;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nEnrollment renewed = client.enrollments().renew(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nSystem.out.println(renewed.getStatus() + \" cycle \" + renewed.getCycle());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments renew enr_01JD8K2M4N6P8Q0R2S4T6V8W0X | jq .cycle"}]}},"/organizations/{orgId}/enrollments/{enrollmentId}:remind":{"post":{"tags":["Enrollments"],"operationId":"remindEnrollment","security":[{"bearerAuth":["enrollments:write"]}],"summary":"Remind an enrollment","description":"Emails the learner again: the invitation if they haven't joined, or a reminder linking to the training if they have. Requires the `enrollments:write` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"enrollmentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.-]+__[A-Za-z0-9_.-]+$"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"202":{"description":"Returns `202` once the reminder is accepted.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Email-Queued":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Learner emails this request queued (new outbox entries). Present only when email is enabled for the organization; absent or `0` means this request queued nothing new. Queued, not delivered. An Idempotency-Key replay returns the original value."},"TMH-Email-Deduped":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Items whose email for the same invitation was already queued (pending or sent) — a same-hour resend or reminder — so no new email was queued. Sent together with `TMH-Email-Queued`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentActionAccepted"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the enrollments scope, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such enrollment in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`illegal_transition` or Archived enrollment (`enrollment_archived` — unarchive first).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Missing Idempotency-Key, or the key was reused with a different target.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst accepted = await client.enrollments.remind(\n  \"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\",\n);\nconsole.log(accepted.action);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\naccepted = client.enrollments.remind(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nprint(accepted.action)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nreminder = client.enrollments.remind(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nputs reminder.action\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nEnrollmentActionAccepted accepted = await client.Enrollments.RemindAsync(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nConsole.WriteLine($\"{accepted.Action} accepted for {accepted.EnrollmentId}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.EnrollmentActionAccepted;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nEnrollmentActionAccepted accepted =\n    client.enrollments().remind(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nSystem.out.println(accepted.getAction() + \" \" + accepted.getEnrollmentId());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments remind enr_01JD8K2M4N6P8Q0R2S4T6V8W0X | jq -r .action"}]}},"/organizations/{orgId}/enrollments/{enrollmentId}:resendInvite":{"post":{"tags":["Enrollments"],"operationId":"resendEnrollmentInvite","security":[{"bearerAuth":["enrollments:write"]}],"summary":"Resend an invite","description":"Sends a pending invite again, within the same cycle. To invite a certified learner again, renew the enrollment. Requires the `enrollments:write` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"enrollmentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_.-]+__[A-Za-z0-9_.-]+$"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"202":{"description":"Returns `202` once the resend is accepted.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Email-Queued":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Learner emails this request queued (new outbox entries). Present only when email is enabled for the organization; absent or `0` means this request queued nothing new. Queued, not delivered. An Idempotency-Key replay returns the original value."},"TMH-Email-Deduped":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Items whose email for the same invitation was already queued (pending or sent) — a same-hour resend or reminder — so no new email was queued. Sent together with `TMH-Email-Queued`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentActionAccepted"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the enrollments scope, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such enrollment in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`illegal_transition` or Archived enrollment (`enrollment_archived` — unarchive first).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Missing Idempotency-Key, or the key was reused with a different target.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst accepted = await client.enrollments.resendInvite(\n  \"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\",\n);\nconsole.log(accepted.action);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\naccepted = client.enrollments.resend_invite(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nprint(accepted.action)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nresent = client.enrollments.resend_invite(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\")\nputs resent.action\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nEnrollmentActionAccepted accepted = await client.Enrollments.ResendInviteAsync(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nConsole.WriteLine($\"{accepted.Action} accepted for {accepted.EnrollmentId}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.EnrollmentActionAccepted;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nEnrollmentActionAccepted accepted =\n    client.enrollments().resendInvite(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\");\nSystem.out.println(accepted.getAction() + \" \" + accepted.getEnrollmentId());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments resend-invite enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \\\n  | jq -r .action"}]}},"/organizations/{orgId}/certificates":{"get":{"tags":["Certificates"],"operationId":"listCertificates","security":[{"bearerAuth":["certificates:read"]}],"summary":"List all certificates","description":"Returns a list of the organization's certificates. Pass `subjectId` to list one learner's.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"subjectId","in":"query","required":false,"description":"Filter to one holder (canonical subject id).","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"A dictionary with an `items` array of certificates and a `nextCursor`.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 pagination: `<url>; rel=\"next\"` when more remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificatesPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `certificates:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid query.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nfor await (const certificate of client.certificates.list({\n  subjectId: \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n})) {\n  console.log(certificate.certificateId, certificate.status);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nfor certificate in client.certificates.list(\n    subject_id=\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\"\n):\n    print(certificate.certificate_id, certificate.expires_at)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\ncertificates = client.certificates.list(\n  subject_id: \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n)\ncertificates.auto_paging_each { |cert| puts cert.expires_at }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nawait foreach (var certificate in client.Certificates.ListAutoPagingAsync())\n{\n    Console.WriteLine($\"{certificate.CertificateId} {certificate.Status}, expires {certificate.ExpiresAt}\");\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Certificate;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nfor (Certificate certificate : client.certificates().list().autoPagingIterable()) {\n  System.out.println(certificate.getCertificateId() + \" \" + certificate.getExpiresAt());\n}\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh certificates list \\\n  --subject-id sub_01JD80AB2C3D4E5F6G7H8J9K0M \\\n  | jq -r '.items[] | [.certificateId, .status, .expiresAt] | @tsv'"}]}},"/organizations/{orgId}/certificates/{certId}":{"get":{"tags":["Certificates"],"operationId":"getCertificate","security":[{"bearerAuth":["certificates:read"]}],"summary":"Retrieve a certificate","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"certId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Returns a certificate object if a valid identifier was provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `certificates:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such certificate in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst certificate = await client.certificates.retrieve(\n  \"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\",\n);\nconsole.log(certificate.status, certificate.expiresAt);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\ncertificate = client.certificates.retrieve(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\")\nprint(certificate.status, certificate.expires_at)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\ncertificate = client.certificates.retrieve(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\")\nputs \"#{certificate.status}, expires #{certificate.expires_at}\"\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nCertificate certificate = await client.Certificates.GetAsync(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\");\nConsole.WriteLine($\"{certificate.Status}, expires {certificate.ExpiresAt}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Certificate;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nCertificate certificate = client.certificates().retrieve(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\");\nSystem.out.println(certificate.getStatus() + \" until \" + certificate.getExpiresAt());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh certificates retrieve cert_01JD8F3G5H7J9K1M3N5P7Q9R1S \\\n  | jq -r .expiresAt"}],"description":"Retrieves a certificate."}},"/organizations/{orgId}/certificates/{certId}/content":{"get":{"tags":["Certificates"],"operationId":"downloadCertificatePdf","security":[{"bearerAuth":["certificates:read"]}],"summary":"Download a certificate","description":"Downloads the certificate as a PDF. Revoked and expired certificates are watermarked. Requires the `certificates:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"certId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Returns the PDF file.","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"`attachment; filename=…`."},"Cache-Control":{"schema":{"type":"string"},"description":"`private, no-store`."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/pdf":{"schema":{"type":"string","contentMediaType":"application/pdf"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `certificates:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such certificate in this organization, or its render data is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import { writeFile } from \"node:fs/promises\";\nimport TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst pdf = await client.certificates.downloadPdf(\n  \"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\",\n);\nawait writeFile(pdf.filename ?? \"certificate.pdf\", pdf.data);\n"},{"lang":"python","label":"Python","source":"import os\nfrom pathlib import Path\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\npdf = client.certificates.download_pdf(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\")\nPath(pdf.filename or \"certificate.pdf\").write_bytes(pdf.content)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\npdf = client.certificates.download_pdf(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\")\nFile.binwrite(pdf.filename || \"certificate.pdf\", pdf.data)\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nBinaryResponse pdf = await client.Certificates.DownloadPdfAsync(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\");\nawait File.WriteAllBytesAsync(pdf.FileName ?? \"certificate.pdf\", pdf.Data);\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.core.BinaryResponse;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nBinaryResponse pdf = client.certificates().downloadPdf(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\");\nFiles.write(Path.of(\"certificate.pdf\"), pdf.data());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh certificates download-pdf cert_01JD8F3G5H7J9K1M3N5P7Q9R1S \\\n  -o certificate.pdf"}]}},"/organizations/{orgId}/certificates/{certId}/credentials":{"get":{"tags":["Certificates"],"operationId":"getCertificateCredentials","security":[{"bearerAuth":["certificates:read"]}],"summary":"Retrieve certificate links","description":"Retrieves the certificate's LinkedIn add-to-profile link and its public `tme.so` verification link. Requires the `certificates:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"certId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Returns the certificate's links.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateCredentialsDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `certificates:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such certificate in this organization (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst links = await client.certificates.retrieveLinks(\n  \"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\",\n);\nconsole.log(links.shortLink);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nlinks = client.certificates.retrieve_links(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\")\nprint(links.short_link, links.linked_in_url)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nlinks = client.certificates.retrieve_links(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\")\nputs links.short_link\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nCertificateLinks links = await client.Certificates.RetrieveLinksAsync(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\");\nConsole.WriteLine(links.ShortLink);\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.CertificateLinks;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nCertificateLinks links =\n    client.certificates().retrieveLinks(\"cert_01JD8F3G5H7J9K1M3N5P7Q9R1S\");\nSystem.out.println(links.getShortLink());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh certificates retrieve-links cert_01JD8F3G5H7J9K1M3N5P7Q9R1S \\\n  | jq -r .shortLink"}]}},"/certificate-verifications/{tinyId}":{"get":{"tags":["Certificate Verification"],"operationId":"getCertificateVerification","summary":"Verify a certificate","description":"Verifies the certificate behind a `https://tme.so/{tinyId}` link. Needs no access token. Limited to 60 requests a minute per IP address.","security":[],"parameters":[{"name":"tinyId","in":"path","required":true,"description":"The id at the end of the certificate's tme.so link.","schema":{"type":"string","pattern":"^c[A-Za-z0-9_-]{12}$"}}],"responses":{"200":{"description":"Returns a certificate verification object. An unknown or disabled link returns `404`.","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"`public, max-age=300`."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateVerificationDto"}}}},"404":{"description":"No certificate behind this link.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many verifications from this address.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({ environment: \"sandbox\" });\n\nconst verification = await client.certificateVerifications.retrieve(\"a7Kq2Z\");\nconsole.log(verification.status, verification.learnerName);\n"},{"lang":"python","label":"Python","source":"from teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(environment=\"sandbox\")\n\nverification = client.certificate_verifications.retrieve(\"a7Kq2Z\")\nprint(verification.status, verification.learner_name)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(environment: :sandbox)\n\nverification = client.certificate_verifications.retrieve(\"a7Kq2Z\")\nputs verification.status\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nCertificateVerification verification = await client.CertificateVerifications.GetAsync(\"a7Kq2Z\");\nConsole.WriteLine($\"{verification.Status}: {verification.LearnerName}, {verification.CourseTitle}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.CertificateVerification;\n\nTeachMeHipaaClient client = TeachMeHipaaClient.builder().environment(Environment.SANDBOX).build();\n\nCertificateVerification verification =\n    client.certificateVerifications().retrieve(\"a7Kq2Z\");\nSystem.out.println(verification.getStatus() + \" \" + verification.getLearnerName());\n"},{"lang":"shell","label":"CLI","source":"# Public: works before tmh login.\ntmh certificate-verifications retrieve a7Kq2Z | jq -r .status"}]}},"/organizations/{orgId}/audit-events":{"get":{"tags":["Audit Events"],"operationId":"listAuditEvents","security":[{"bearerAuth":["audit:read"]}],"summary":"List all audit events","description":"Returns a list of the organization's audit events, newest first. Filter by `type`, `transition`, `subjectId`, or a `since` and `until` range.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"type","in":"query","required":false,"description":"Filter to one audit-event family.","schema":{"type":"string","enum":["enrollment.transition","organization.updated","organization.closed","organization.reopened","member.role_changed","member.transferred","member.removed","certificate.issued","certificate.revoked","seat.granted","api_client.created","api_client.secret_rotated","api_client.revoked","learner.updated","learner.launch_link_created","api_client.updated"]}},{"name":"transition","in":"query","required":false,"description":"Filter to one lifecycle transition.","schema":{"type":"string","enum":["bounce","start","beginAssessment","submitAssessment","certify","revokeCert","archive","unarchive","reinvite","cancelInvite"]}},{"name":"subjectId","in":"query","required":false,"description":"Filter to one member (canonical subject id).","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"since","in":"query","required":false,"description":"Inclusive lower bound on `at` (ISO-8601 instant).","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":false,"description":"Inclusive upper bound on `at` (ISO-8601 instant).","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"A dictionary with an `items` array of audit events and a `nextCursor`. A page can hold fewer than `limit` events while more remain.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 pagination: `<url>; rel=\"next\"` when more remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventsPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `audit:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid query.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nfor await (const event of client.auditEvents.list({\n  subjectId: \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n})) {\n  console.log(event.at, event.type);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nfor event in client.audit_events.list(type=\"enrollment.transition\"):\n    print(event.type)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nevents = client.audit_events.list\nevents.auto_paging_each { |event| puts \"#{event.at} #{event.type}\" }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nawait foreach (var auditEvent in client.AuditEvents.ListAutoPagingAsync())\n{\n    if (auditEvent is AuditEventEnrollmentTransition transition)\n    {\n        Console.WriteLine($\"{transition.SubjectId}: {transition.StatusFrom} -> {transition.StatusTo}\");\n    }\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.AuditEvent;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nfor (AuditEvent event : client.auditEvents().list().autoPagingIterable()) {\n  System.out.println(event.getType());\n}\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh audit-events list \\\n  --type learner.updated \\\n  | jq -r '.items[] | [.at, .type, .actorSubjectId] | @tsv'"}]}},"/auth/token":{"post":{"tags":["Authentication"],"operationId":"createAccessToken","summary":"Create an access token","description":"Exchanges credentials for a short-lived access token. API clients send `grant_type=client_credentials` authenticated with their client id and secret over HTTP Basic. Send the body as `application/x-www-form-urlencoded`.","requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type"],"properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"scope":{"type":"string","description":"Space-delimited subset of the client's scopes: enrollments:read, enrollments:write, certificates:read, members:read, audit:read, learners:read, learners:write, compliance:read, webhooks:manage."},"client_id":{"type":"string","description":"`client_secret_post` only."},"client_secret":{"type":"string","description":"`client_secret_post` only."}}}}}},"responses":{"200":{"description":"Returns an access token object valid for 15 minutes. Fails with an OAuth error such as `invalid_client` or `invalid_scope`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ClientCredentialsTokenResponse"},{"$ref":"#/components/schemas/AccessTokenResponse"}]}}}},"400":{"description":"Client credentials grant: `invalid_request` (a repeated parameter, or both client authentication methods), `unsupported_grant_type`, `invalid_scope` (an unknown scope, or one the client does not hold), or `invalid_grant` (the client's organization is closed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenError"}}}},"401":{"description":"Client credentials grant: `invalid_client` — unknown, revoked or malformed client, or a wrong secret, all with the same body (`WWW-Authenticate: Basic` attached). Session exchange: a missing, invalid or revoked ID token, or no canonical identity for the caller (problem+json, RFC 6750 challenge attached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenError"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Client credentials grant: `slow_down` — too many failed client authentications from this IP or for this client id. Wait `Retry-After` seconds.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenError"}}}},"503":{"description":"The endpoint is not configured (no signing secret; problem+json), or the client credentials grant could not reach its stores (`temporarily_unavailable`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenError"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/auth/introspection":{"get":{"tags":["Authentication"],"operationId":"introspectAccessToken","summary":"Retrieve the current token","description":"Describes the access token you call with: whether it belongs to an API client or a person, its organization, its scopes and when it expires. Needs no scope.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Returns a token introspection object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenIntrospection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst token = await client.auth.introspect();\nconsole.log(token.orgId, token.mode, token.scopes);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\ntoken = client.auth.introspect()\nprint(token.org_id, token.scopes)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\ntoken = client.auth.introspect\nputs token.scopes.join(\" \")\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nTokenIntrospection token = await client.Auth.IntrospectAsync();\nConsole.WriteLine($\"{token.Mode} token for {token.OrgId}, expires {token.ExpiresAt:u}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.TokenIntrospection;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nTokenIntrospection token = client.auth().introspect();\nSystem.out.println(token.getOrgId() + \" \" + token.getScopes());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh auth introspect | jq -r '.scopes[]'"}]}},"/organizations/{orgId}/enrollments:batch":{"post":{"tags":["Bulk Operations"],"operationId":"batchEnrollments","security":[{"bearerAuth":["enrollments:write"]}],"summary":"Update many enrollments","description":"Reminds, resends, cancels, renews, archives or unarchives up to 500 enrollments in one request, chosen by id or by filter. Each enrollment succeeds or fails on its own. Requires the `enrollments:write` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentsBatchRequest"}}}},"responses":{"200":{"description":"Returns one result per enrollment: `succeeded`, `skipped` or `failed`. A filter selection returns an operation instead. Fails with `422` `batch_too_large` over 500 enrollments.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Email-Queued":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Learner emails this request queued (new outbox entries). Present only when email is enabled for the organization; absent or `0` means this request queued nothing new. Queued, not delivered. An Idempotency-Key replay returns the original value."},"TMH-Email-Deduped":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Items whose email for the same invitation was already queued (pending or sent) — a same-hour resend or reminder — so no new email was queued. Sent together with `TMH-Email-Queued`."},"TMH-Recertify-Fenced":{"schema":{"type":"string","enum":["1"]},"description":"`1` when this API uses at most one Seat per certification cycle, so re-sending a recertify is safe. Absent on an API that does not."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentsBatchResults"}}}},"202":{"description":"Returns one result per enrollment: `succeeded`, `skipped` or `failed`. A filter selection returns an operation instead. Fails with `422` `batch_too_large` over 500 enrollments.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Email-Queued":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Learner emails this request queued (new outbox entries). Present only when email is enabled for the organization; absent or `0` means this request queued nothing new. Queued, not delivered. An Idempotency-Key replay returns the original value."},"TMH-Email-Deduped":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Items whose email for the same invitation was already queued (pending or sent) — a same-hour resend or reminder — so no new email was queued. Sent together with `TMH-Email-Queued`."},"TMH-Recertify-Fenced":{"schema":{"type":"string","enum":["1"]},"description":"`1` when this API uses at most one Seat per certification cycle, so re-sending a recertify is safe. Absent on an API that does not."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `enrollments:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A duplicate request with the same Idempotency-Key is still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body, `batch_too_large` (selection or resolved filter over the 500-item cap), or `idempotency_key_reuse`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst batch = await client.enrollments.batch({\n  operation: \"remind\",\n  select: { enrollmentIds: [\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\"] },\n});\nfor (const result of batch.results) {\n  console.log(result.enrollmentId, result.outcome);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nbatch = client.enrollments.batch(\n    operation=\"remind\", select={\"enrollment_ids\": [\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\"]}\n)\nfor result in batch.results:\n    print(result.enrollment_id, result.outcome)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nbatch = client.enrollments.batch(\n  operation: \"remind\",\n  select: { enrollment_ids: [\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\"] },\n)\nbatch.results.each { |row| puts \"#{row.enrollment_id}: #{row.outcome}\" }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nEnrollmentsBatchResults batch = await client.Enrollments.BatchAsync(new EnrollmentBatchOptions\n{\n    Operation = EnrollmentsBatchRequestOperation.Remind,\n    Select = new() { EnrollmentIds = [\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\"] },\n});\nConsole.WriteLine(string.Join(\", \", batch.Results.Select(result => $\"{result.EnrollmentId}: {result.Outcome}\")));\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.EnrollmentsBatchRequestOperation;\nimport com.teachmehipaa.model.EnrollmentsBatchResults;\nimport com.teachmehipaa.param.EnrollmentBatchParams;\nimport com.teachmehipaa.param.EnrollmentsBatchRequestSelectEnrollmentIds;\nimport java.util.List;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nEnrollmentsBatchResults batch =\n    client\n        .enrollments()\n        .batch(\n            EnrollmentBatchParams.builder()\n                .operation(EnrollmentsBatchRequestOperation.REMIND)\n                .select(\n                    EnrollmentsBatchRequestSelectEnrollmentIds.builder()\n                        .enrollmentIds(List.of(\"enr_01JD8K2M4N6P8Q0R2S4T6V8W0X\"))\n                        .build())\n                .build());\nbatch.getResults().forEach(r -> System.out.println(r.getEnrollmentId() + \" \" + r.getOutcome()));\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments batch \\\n  --operation remind \\\n  --select.enrollment-ids enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \\\n  | jq -r '.results[] | [.enrollmentId, .outcome] | @tsv'"}]}},"/organizations/{orgId}/enrollments:import":{"post":{"tags":["Bulk Operations"],"operationId":"importEnrollments","security":[{"bearerAuth":["enrollments:write"]}],"summary":"Import learners from CSV","description":"Invites everyone in a CSV file with an `email` column (and optional `name` and `courseId`). Send `validateOnly: true` first to preview the file without inviting anyone. Up to 500 rows. Requires the `enrollments:write` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","contentMediaType":"text/csv","description":"UTF-8 CSV (RFC 4180: quoted fields, `\"\"` escapes, CRLF/LF). Header row required."},"options":{"$ref":"#/components/schemas/ImportOptions"}}},"encoding":{"file":{"contentType":"text/csv"},"options":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Returns a preview of each row, or, when you commit, an operation with each row's result: `invited`, `skipped` or `failed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPreview"}}}},"202":{"description":"Returns a preview of each row, or, when you commit, an operation with each row's result: `invited`, `skipped` or `failed`.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"},"TMH-Email-Queued":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Learner emails this request queued (new outbox entries). Present only when email is enabled for the organization; absent or `0` means this request queued nothing new. Queued, not delivered. An Idempotency-Key replay returns the original value."},"TMH-Email-Deduped":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Items whose email for the same invitation was already queued (pending or sent) — a same-hour resend or reminder — so no new email was queued. Sent together with `TMH-Email-Queued`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `enrollments:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A duplicate request with the same Idempotency-Key is still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Not multipart/form-data, or the `file` part is not a CSV (content type, extension, or binary content sniff).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`import_too_large` (over 500 rows / 1 MiB), invalid UTF-8, malformed CSV, missing email column, a malformed name/courseId cell, invalid `options`, or `idempotency_key_reuse`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.enrollments.import({\n  file: \"roster.csv\",\n  options: { courseId: \"hipaa-2026\" },\n});\nconst done = await operation.wait();\nconsole.log(done.name, done.done);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\noperation = client.enrollments.import_(\n    file=\"roster.csv\", options={\"course_id\": \"hipaa-2026\"}\n)\nprint(operation.wait().response)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\noperation = client.enrollments.import(\n  file: \"roster.csv\",\n  options: { course_id: \"hipaa-2026\" },\n)\nputs operation.wait.done\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.Enrollments.ImportAsync(new EnrollmentImportOptions(\"roster.csv\"));\nOperation done = await operation.WaitAsync();\nConsole.WriteLine($\"Imported roster.csv: {done.Name}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.FileUpload;\nimport com.teachmehipaa.model.Operation;\nimport com.teachmehipaa.param.EnrollmentImportParams;\nimport java.nio.file.Path;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nOperation imported =\n    client\n        .enrollments()\n        .importEnrollments(\n            EnrollmentImportParams.builder()\n                .file(FileUpload.of(Path.of(\"roster.csv\")))\n                .build());\nSystem.out.println(imported.waitForCompletion().getResponse());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments import --file roster.csv --wait | jq .response"}]}},"/organizations/{orgId}/enrollments:export":{"post":{"tags":["Bulk Operations"],"operationId":"exportEnrollments","security":[{"bearerAuth":["enrollments:read"]}],"summary":"Export enrollments","description":"Exports the organization's enrollments as CSV. Requires the `enrollments:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentsExportRequest"}}}},"responses":{"202":{"description":"Returns a completed operation whose `response` holds the CSV file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `enrollments:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A duplicate request with the same Idempotency-Key is still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body, `xlsx` requested (not yet available), `export_too_large`, or `idempotency_key_reuse`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import { writeFile } from \"node:fs/promises\";\nimport TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.enrollments.export({ format: \"csv\" });\nconst done = await operation.wait();\nawait writeFile(\"enrollments.csv\", done.exportResult().csv);\n"},{"lang":"python","label":"Python","source":"import os\nfrom pathlib import Path\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nexport = client.enrollments.export(format=\"csv\").wait().export_result()\nPath(\"enrollments.csv\").write_text(export.csv, newline=\"\")\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nexport = client.enrollments.export(format: \"csv\").wait.export_result\nFile.write(export.filename || \"enrollments.csv\", export.csv)\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.Enrollments.ExportAsync(\n    new EnrollmentExportOptions { Format = EnrollmentsExportRequestFormat.Csv });\nExportResult export = (await operation.WaitAsync()).GetExportResult();\nawait File.WriteAllTextAsync(\"enrollments.csv\", export.Csv);\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.EnrollmentsExportRequestFormat;\nimport com.teachmehipaa.model.Operation;\nimport com.teachmehipaa.param.EnrollmentExportParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nOperation export =\n    client\n        .enrollments()\n        .export(\n            EnrollmentExportParams.builder()\n                .format(EnrollmentsExportRequestFormat.CSV)\n                .build());\nSystem.out.println(export.waitForCompletion().getExportResult().filename());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh enrollments export --format csv -o enrollments.csv"}]}},"/organizations/{orgId}/certificates:export":{"post":{"tags":["Bulk Operations"],"operationId":"exportCertificates","security":[{"bearerAuth":["certificates:read"]}],"summary":"Export certificates","description":"Exports the organization's certificate records as CSV. Requires the `certificates:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificatesExportRequest"}}}},"responses":{"202":{"description":"Returns a completed operation whose `response` holds the CSV file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `certificates:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A duplicate request with the same Idempotency-Key is still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body, `zip` requested (not yet available), `export_too_large`, or `idempotency_key_reuse`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import { writeFile } from \"node:fs/promises\";\nimport TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.certificates.export({ format: \"csv\" });\nconst done = await operation.wait();\nawait writeFile(\"certificates.csv\", done.exportResult().csv);\n"},{"lang":"python","label":"Python","source":"import os\nfrom pathlib import Path\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nexport = client.certificates.export(format=\"csv\").wait().export_result()\nPath(\"certificates.csv\").write_text(export.csv, newline=\"\")\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nexport = client.certificates.export(format: \"csv\").wait.export_result\nFile.write(export.filename || \"certificates.csv\", export.csv)\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.Certificates.ExportAsync(\n    new CertificateExportOptions { Format = CertificatesExportRequestFormat.Csv });\nExportResult export = (await operation.WaitAsync()).GetExportResult();\nawait File.WriteAllTextAsync(\"certificates.csv\", export.Csv);\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.CertificatesExportRequestFormat;\nimport com.teachmehipaa.model.Operation;\nimport com.teachmehipaa.param.CertificateExportParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nOperation export =\n    client\n        .certificates()\n        .export(\n            CertificateExportParams.builder()\n                .format(CertificatesExportRequestFormat.CSV)\n                .build());\nSystem.out.println(export.waitForCompletion().getExportResult().filename());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh certificates export --format csv -o certificates.csv"}]}},"/organizations/{orgId}/operations/{operationId}":{"get":{"tags":["Bulk Operations"],"operationId":"getOperation","summary":"Retrieve an operation","description":"Retrieves a bulk operation and its result. Operations are kept for 24 hours.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"operationId","in":"path","required":true,"description":"The server-minted opaque operation id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9-]+$"}}],"responses":{"200":{"description":"Returns an operation object if a valid identifier was provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks the scope recorded on the operation, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such operation (unknown, expired past the 24h retention, or belonging to another organization).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.operations.retrieve(\n  \"op_01JD8T4V6W8X0Y2Z4A6B8C0D2E\",\n);\nconsole.log(operation.done, operation.error?.code);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\noperation = client.operations.retrieve(\"op_01JD8T4V6W8X0Y2Z4A6B8C0D2E\")\nprint(operation.name, operation.done)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\noperation = client.operations.retrieve(\"op_01JD8T4V6W8X0Y2Z4A6B8C0D2E\")\nputs operation.done\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.Operations.GetAsync(\"op_01JD8T4V6W8X0Y2Z4A6B8C0D2E\");\nConsole.WriteLine(operation.Done ? \"Done\" : \"Still running\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Operation;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nOperation operation = client.operations().retrieve(\"op_01JD8T4V6W8X0Y2Z4A6B8C0D2E\");\nSystem.out.println(operation.getName() + \" done: \" + operation.isDone());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh operations retrieve op_01JD8T4V6W8X0Y2Z4A6B8C0D2E | jq .done"}]}},"/organizations/{orgId}/webhook-subscriptions":{"get":{"tags":["Webhook Subscriptions"],"operationId":"listWebhookSubscriptions","security":[{"bearerAuth":["org:admin"]},{"bearerAuth":["webhooks:manage"]}],"summary":"List all webhook subscriptions","description":"Returns a list of the organization's webhook subscriptions. Signing secrets are never returned. Requires the `webhooks:manage` or `org:admin` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"A dictionary with an `items` array of webhook subscriptions and a `nextCursor`.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 `next` link when more pages remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionsPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `org:admin` nor `webhooks:manage`, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization or webhook subscription.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Malformed cursor or limit.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nfor await (const subscription of client.webhookSubscriptions.list()) {\n  console.log(subscription.subscriptionId, subscription.endpointUrl);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nfor subscription in client.webhook_subscriptions.list():\n    print(subscription.subscription_id, subscription.endpoint_url)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nsubscriptions = client.webhook_subscriptions.list\nsubscriptions.auto_paging_each { |sub| puts sub.endpoint_url }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nawait foreach (var subscription in client.WebhookSubscriptions.ListAutoPagingAsync())\n{\n    Console.WriteLine($\"{subscription.SubscriptionId} {subscription.EndpointUrl} enabled={subscription.Enabled}\");\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.WebhookSubscription;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nfor (WebhookSubscription subscription :\n    client.webhookSubscriptions().list().autoPagingIterable()) {\n  System.out.println(subscription.getSubscriptionId() + \" \" + subscription.getEndpointUrl());\n}\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh webhook-subscriptions list \\\n  | jq -r '.items[] | [.subscriptionId, .endpointUrl, .enabled] | @tsv'"}]},"post":{"tags":["Webhook Subscriptions"],"operationId":"createWebhookSubscription","security":[{"bearerAuth":["org:admin"]},{"bearerAuth":["webhooks:manage"]}],"summary":"Create a webhook subscription","description":"Subscribes an HTTPS endpoint to event types and creates its signing secret. Requires the `webhooks:manage` or `org:admin` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionCreate"}}}},"responses":{"201":{"description":"Returns the webhook subscription with its signing `secret`. The secret is shown only once: store it now.","headers":{"Location":{"schema":{"type":"string"},"description":"The new subscription's canonical URL."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionCreated"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `org:admin` nor `webhooks:manage`, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization or webhook subscription.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"An in-flight Idempotency-Key duplicate.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body (e.g. a non-https endpoint or an unknown event type), missing Idempotency-Key, or `idempotency_key_reuse`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst subscription = await client.webhookSubscriptions.create({\n  endpointUrl: \"https://example.com/webhooks/teachmehipaa\",\n  eventTypes: [\"learner.certified\"],\n});\n// The API returns subscription.secret only here: store it now.\nconsole.log(subscription.subscriptionId, subscription.secretKeyId);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nsubscription = client.webhook_subscriptions.create(\n    endpoint_url=\"https://example.com/webhooks/teachmehipaa\",\n    event_types=[\"learner.certified\"],\n)\nprint(subscription.subscription_id, subscription.secret_key_id)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nsubscription = client.webhook_subscriptions.create(\n  endpoint_url: \"https://example.com/webhooks/teachmehipaa\",\n  event_types: [\"learner.certified\"],\n)\nputs subscription.secret\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nvar subscription = await client.WebhookSubscriptions.CreateAsync(new WebhookSubscriptionCreateOptions\n{\n    EndpointUrl = \"https://example.com/webhooks/teachmehipaa\",\n    EventTypes = [EventType.LearnerCertified],\n});\nConsole.WriteLine($\"{subscription.SubscriptionId}: store Secret now, it is returned only once\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.EventType;\nimport com.teachmehipaa.model.WebhookSubscriptionCreated;\nimport com.teachmehipaa.param.WebhookSubscriptionCreateParams;\nimport java.util.List;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nWebhookSubscriptionCreated subscription =\n    client\n        .webhookSubscriptions()\n        .create(\n            WebhookSubscriptionCreateParams.builder()\n                .endpointUrl(\"https://example.com/webhooks/teachmehipaa\")\n                .eventTypes(List.of(EventType.LEARNER_CERTIFIED))\n                .build());\nSystem.out.println(subscription.getSubscriptionId() + \" \" + subscription.getSecret());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh webhook-subscriptions create \\\n  --endpoint-url https://example.com/webhooks/teachmehipaa \\\n  --event-types learner.certified \\\n  | jq -r .secret"}]}},"/organizations/{orgId}/webhook-subscriptions/{subscriptionId}":{"get":{"tags":["Webhook Subscriptions"],"operationId":"getWebhookSubscription","security":[{"bearerAuth":["org:admin"]},{"bearerAuth":["webhooks:manage"]}],"summary":"Retrieve a webhook subscription","description":"Retrieves a webhook subscription. Requires the `webhooks:manage` or `org:admin` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"subscriptionId","in":"path","required":true,"description":"The webhook subscription id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},{"$ref":"#/components/parameters/ifNoneMatch"}],"responses":{"200":{"description":"Returns a webhook subscription object if a valid identifier was provided.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on PATCH."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}},"304":{"description":"Not modified (If-None-Match matched)."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `org:admin` nor `webhooks:manage`, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization or webhook subscription.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst subscription = await client.webhookSubscriptions.retrieve(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n);\nconsole.log(subscription.endpointUrl, subscription.enabled);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nsubscription = client.webhook_subscriptions.retrieve(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nprint(subscription.endpoint_url, subscription.event_types)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nsubscription = client.webhook_subscriptions.retrieve(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n)\nputs subscription.enabled\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nWebhookSubscription subscription = await client.WebhookSubscriptions.GetAsync(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nConsole.WriteLine($\"{subscription.EndpointUrl}: {string.Join(\", \", subscription.EventTypes)}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.WebhookSubscription;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nWebhookSubscription subscription =\n    client.webhookSubscriptions().retrieve(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nSystem.out.println(subscription.getEndpointUrl() + \" \" + subscription.getEventTypes());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh webhook-subscriptions retrieve whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \\\n  | jq -r '.eventTypes[]'"}]},"patch":{"tags":["Webhook Subscriptions"],"operationId":"updateWebhookSubscription","security":[{"bearerAuth":["org:admin"]},{"bearerAuth":["webhooks:manage"]}],"summary":"Update a webhook subscription","description":"Updates a webhook subscription; parameters you don't send are left unchanged. Send its current `ETag` in `If-Match`. The signing secret doesn't change. Requires the `webhooks:manage` or `org:admin` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"subscriptionId","in":"path","required":true,"description":"The webhook subscription id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionPatch"}}}},"responses":{"200":{"description":"Returns the updated webhook subscription object.","headers":{"ETag":{"schema":{"type":"string"},"description":"The new strong validator after the write."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `org:admin` nor `webhooks:manage`, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization or webhook subscription.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"412":{"description":"Stale If-Match — re-read and retry with the new ETag.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"PATCH bodies must be `application/merge-patch+json` (RFC 7396).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Malformed JSON or a field outside the allow-list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"428":{"description":"If-Match is required on writes.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst current = await client.webhookSubscriptions.retrieve(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n);\nconst subscription = await client.webhookSubscriptions.update(\n  current.subscriptionId,\n  { enabled: false },\n  { ifMatch: current },\n);\nconsole.log(subscription.enabled);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nsubscription = client.webhook_subscriptions.retrieve(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nupdated = client.webhook_subscriptions.update(\n    \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\", if_match=subscription, enabled=False\n)\nprint(updated.enabled)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\ncurrent = client.webhook_subscriptions.retrieve(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nsubscription = client.webhook_subscriptions.update(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n  if_match: current,\n  enabled: false,\n)\nputs subscription.enabled\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nWebhookSubscription current = await client.WebhookSubscriptions.GetAsync(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nWebhookSubscription updated = await client.WebhookSubscriptions.UpdateAsync(\n    current.SubscriptionId,\n    new WebhookSubscriptionUpdateOptions(current) { Enabled = false });\nConsole.WriteLine($\"Enabled: {updated.Enabled}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.WebhookSubscription;\nimport com.teachmehipaa.param.WebhookSubscriptionUpdateParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nWebhookSubscription current =\n    client.webhookSubscriptions().retrieve(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nWebhookSubscription updated =\n    client\n        .webhookSubscriptions()\n        .update(\n            current.getSubscriptionId(),\n            WebhookSubscriptionUpdateParams.builder().ifMatch(current).enabled(false).build());\nSystem.out.println(updated.isEnabled());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\netag=$(tmh webhook-subscriptions retrieve whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \\\n  --show-headers 2>&1 >/dev/null | sed -n 's/^< Etag: //p')\ntmh webhook-subscriptions update whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \\\n  --enabled=false \\\n  --if-match \"$etag\" \\\n  | jq .enabled"}]},"delete":{"tags":["Webhook Subscriptions"],"operationId":"deleteWebhookSubscription","security":[{"bearerAuth":["org:admin"]},{"bearerAuth":["webhooks:manage"]}],"summary":"Delete a webhook subscription","description":"Deletes a webhook subscription and its signing secret. Requires the `webhooks:manage` or `org:admin` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"subscriptionId","in":"path","required":true,"description":"The webhook subscription id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"204":{"description":"Returns `204` on success."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `org:admin` nor `webhooks:manage`, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization or webhook subscription.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst deleted = await client.webhookSubscriptions.delete(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n);\nconsole.log(deleted.lastResponse.status);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nclient.webhook_subscriptions.delete(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nprint(\"deleted\")\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\ndeleted = client.webhook_subscriptions.delete(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nputs deleted.last_response.status\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nTeachMeHipaaResponse response = await client.WebhookSubscriptions.DeleteAsync(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nConsole.WriteLine($\"Deleted: {response.StatusCode}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.core.EmptyResponse;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nEmptyResponse deleted =\n    client.webhookSubscriptions().delete(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nSystem.out.println(deleted.getLastResponse().statusCode());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh webhook-subscriptions delete whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \\\n  && echo deleted"}]}},"/organizations/{orgId}/webhook-subscriptions/{subscriptionId}:test":{"post":{"tags":["Webhook Subscriptions"],"operationId":"testWebhookSubscription","security":[{"bearerAuth":["org:admin"]},{"bearerAuth":["webhooks:manage"]}],"summary":"Send a test event","description":"Sends a signed test delivery to the subscription's endpoint, so you can check your verifier. Requires the `webhooks:manage` or `org:admin` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"subscriptionId","in":"path","required":true,"description":"The webhook subscription id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"202":{"description":"Returns an operation for the delivery.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `org:admin` nor `webhooks:manage`, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization or webhook subscription.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"An in-flight Idempotency-Key duplicate, or the credentials changed concurrently.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Missing Idempotency-Key, or the key was reused with a different request (`idempotency_key_reuse`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.webhookSubscriptions.test(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n);\nconst done = await operation.wait();\nconsole.log(done.response?._tag);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\noperation = client.webhook_subscriptions.test(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nprint(operation.wait(timeout=60).response)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\noperation = client.webhook_subscriptions.test(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nputs operation.wait.response.tag\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.WebhookSubscriptions.TestAsync(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nWebhookDeliveryResult result = (await operation.WaitAsync()).GetDeliveryResult();\nConsole.WriteLine(result is WebhookDeliverySent sent ? $\"Endpoint answered {sent.ResponseStatus}\" : $\"{result}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.WebhookDeliveryOperation;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nWebhookDeliveryOperation delivery =\n    client.webhookSubscriptions().test(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nSystem.out.println(delivery.waitForCompletion().getDeliveryResult());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh webhook-subscriptions test whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \\\n  --wait \\\n  | jq .response"}]}},"/organizations/{orgId}/webhook-subscriptions/{subscriptionId}:redrive":{"post":{"tags":["Webhook Subscriptions"],"operationId":"redriveWebhookSubscription","security":[{"bearerAuth":["org:admin"]},{"bearerAuth":["webhooks:manage"]}],"summary":"Retry failed deliveries","description":"Delivers the subscription's failed events again. Requires the `webhooks:manage` or `org:admin` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"subscriptionId","in":"path","required":true,"description":"The webhook subscription id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"202":{"description":"Returns an operation for the redelivery.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `org:admin` nor `webhooks:manage`, or the organization is not the token's active org (`org_not_active` — switch and retry).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization or webhook subscription.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"An in-flight Idempotency-Key duplicate, or the credentials changed concurrently.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Missing Idempotency-Key, or the key was reused with a different request (`idempotency_key_reuse`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.webhookSubscriptions.redrive(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n);\nconst done = await operation.wait();\nconsole.log(done.response?._tag);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\noperation = client.webhook_subscriptions.redrive(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\")\nprint(operation.wait().response)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\noperation = client.webhook_subscriptions.redrive(\n  \"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\",\n)\nputs operation.wait.response.tag\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.WebhookSubscriptions.RedriveAsync(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nWebhookDeliveryResult result = (await operation.WaitAsync()).GetDeliveryResult();\nConsole.WriteLine(result);\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.WebhookDeliveryOperation;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nWebhookDeliveryOperation redrive =\n    client.webhookSubscriptions().redrive(\"whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B\");\nSystem.out.println(redrive.waitForCompletion().getDeliveryResult());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh webhook-subscriptions redrive whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \\\n  --wait \\\n  | jq .response"}]}},"/organizations/{orgId}/events":{"get":{"tags":["Events"],"operationId":"listOrgEvents","security":[{"bearerAuth":["webhooks:manage"]},{"bearerAuth":["audit:read"]}],"summary":"List all events","description":"Returns a list of the organization's events from the last 30 days, oldest first. Pass the last `eventId` you processed as `after` to resume where you stopped, and `type` to list one event type.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/limit"},{"name":"after","in":"query","required":false,"description":"Return events after this event id (exclusive). The previous page's `nextCursor`.","schema":{"type":"string","pattern":"^evt_[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"type","in":"query","required":false,"description":"Filter to one event type.","schema":{"type":"string","enum":["enrollment.certified","seat.consumed","seat.freed","learner.invited","learner.started","learner.certified","learner.expiring","learner.expired","learner.removed","invite.bounced","certificate.revoked","seats.low"]}}],"responses":{"200":{"description":"A dictionary with an `items` array of events and a `nextCursor`.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 pagination: `<url>; rel=\"next\"` (carrying `after`) when more remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgEventsPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token holds neither `webhooks:manage` nor `audit:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Malformed `after`, unknown `type`, or bad `limit`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nfor await (const event of client.events.list({ type: \"learner.certified\" })) {\n  console.log(event.eventId, event.occurredAt);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nfor event in client.events.list(type=\"learner.certified\"):\n    print(event.event_id, event.occurred_at)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nevents = client.events.list(type: \"learner.certified\")\nevents.auto_paging_each { |event| puts event.event_id }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nawait foreach (var @event in client.Events.ListAutoPagingAsync(new() { Type = EventType.LearnerCertified }))\n{\n    Console.WriteLine($\"{@event.EventId} at {@event.OccurredAt:u}\");\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Event;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nfor (Event event : client.events().list().autoPagingIterable()) {\n  System.out.println(event.getEventId() + \" \" + event.getEventType());\n}\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh events list \\\n  --type learner.certified \\\n  | jq -r '.items[] | [.occurredAt, .eventId, .data.email] | @tsv'"}]}},"/organizations/{orgId}/learners":{"get":{"tags":["Learners"],"operationId":"listLearners","security":[{"bearerAuth":["learners:read"]}],"summary":"List all learners","description":"Returns a list of the organization's learners in one course, with each learner's status, dates and current certificate. Filter by `status`, or find one learner by `email` or `externalId`.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"email","in":"query","required":false,"schema":{"type":"string","format":"email","maxLength":320}},{"name":"externalId","in":"query","required":false,"description":"The integration's own id for the learner (unique per organization), or the SCIM `externalId` when none was set.","schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/LearnerStatus"}},{"name":"courseId","in":"query","required":false,"description":"The course. Defaults to the organization's default course.","schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"A dictionary with an `items` array of learners and a `nextCursor`.","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 pagination: `<url>; rel=\"next\"` when more remain."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnersPage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid pagination or filter query.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The roster could not be read; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nfor await (const learner of client.learners.list({ status: \"in_progress\" })) {\n  console.log(learner.learnerId, learner.email);\n}\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nfor learner in client.learners.list(status=\"in_progress\"):\n    print(learner.email, learner.status)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nlearners = client.learners.list(status: \"in_progress\")\nlearners.auto_paging_each { |learner| puts learner.email }\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nawait foreach (var learner in client.Learners.ListAutoPagingAsync(new() { Status = LearnerStatus.InProgress }))\n{\n    Console.WriteLine($\"{learner.Name} <{learner.Email}>\");\n}\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Learner;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nfor (Learner learner : client.learners().list().autoPagingIterable()) {\n  System.out.println(learner.getEmail() + \" \" + learner.getStatus());\n}\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners list \\\n  --status in_progress \\\n  | jq -r '.items[] | [.learnerId, .email, .status] | @tsv'"}]},"post":{"tags":["Learners"],"operationId":"createLearner","security":[{"bearerAuth":["learners:write"]}],"summary":"Create a learner","description":"Adds a person to the organization and invites them to a course in one call, using one seat. If the email or `externalId` already belongs to an active learner in the course, nothing is created. With `delivery: \"none\"`, no email is sent and the response includes a `joinUrl` for you to deliver.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerCreateRequest"}}}},"responses":{"200":{"description":"Returns the new learner object with `201`, or the existing learner with `200` (no seat used, no email sent). Fails with `409` `seat_unavailable` when no seat is free.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on writes."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerDto"}}}},"201":{"description":"Returns the new learner object with `201`, or the existing learner with `200` (no seat used, no email sent). Fails with `409` `seat_unavailable` when no seat is free.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on writes."},"Location":{"schema":{"type":"string"},"description":"The new learner's URL."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerCreated"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`seat_unavailable` (no free seat), `external_id_conflict` (the externalId belongs to another learner, or the email and the externalId name two different learners), `seat_already_claimed`, `already_invited`, `enrollment_archived`, or a request with this Idempotency-Key still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body (unknown field, bad email, externalId over 128 characters, unknown `delivery` or `seatPolicy`) or a missing Idempotency-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A store read or write failed; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst learner = await client.learners.create({\n  email: \"dana.whitfield@example.com\",\n  name: \"Dana Whitfield\",\n});\nconsole.log(learner.learnerId, learner.created);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nlearner = client.learners.create(\n    email=\"dana.whitfield@example.com\", name=\"Dana Whitfield\"\n)\nprint(learner.learner_id, learner.created)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nlearner = client.learners.create(\n  email: \"dana.whitfield@example.com\",\n  name: \"Dana Whitfield\",\n)\nputs learner.created? ? \"Invited #{learner.email}\" : \"Already enrolled\"\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nLearnerWriteResult learner = await client.Learners.CreateAsync(new LearnerCreateOptions\n{\n    Email = \"dana.whitfield@example.com\",\n    Name = \"Dana Whitfield\",\n});\nConsole.WriteLine($\"{learner.LearnerId} created: {learner.Created}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.LearnerWriteResult;\nimport com.teachmehipaa.param.LearnerCreateParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nLearnerWriteResult learner =\n    client\n        .learners()\n        .create(\n            LearnerCreateParams.builder()\n                .email(\"dana.whitfield@example.com\")\n                .name(\"Dana Whitfield\")\n                .build());\nSystem.out.println(learner.getLearnerId() + \" created: \" + learner.isCreated());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners create \\\n  --email dana.whitfield@example.com \\\n  --name \"Dana Whitfield\" \\\n  | jq -r .learnerId"}]}},"/organizations/{orgId}/learners/{learnerId}":{"get":{"tags":["Learners"],"operationId":"getLearner","security":[{"bearerAuth":["learners:read"]}],"summary":"Retrieve a learner","description":"Retrieves a learner's status in one course.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"learnerId","in":"path","required":true,"description":"The learner's canonical subject id (sub_… ULID).","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"courseId","in":"query","required":false,"description":"The course. Defaults to the organization's default course.","schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns a learner object if a valid identifier was provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such learner in this organization for the course (including a well-formed id belonging to another tenant).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid `courseId`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The roster could not be read; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst learner = await client.learners.retrieve(\n  \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n);\nconsole.log(learner.name, learner.status);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nlearner = client.learners.retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nprint(learner.name, learner.status)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nlearner = client.learners.retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nputs \"#{learner.name}: #{learner.status}\"\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nLearner learner = await client.Learners.GetAsync(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nConsole.WriteLine($\"{learner.Name} {learner.Status}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Learner;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nLearner learner = client.learners().retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nSystem.out.println(learner.getName() + \" \" + learner.getStatus());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners retrieve sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .status"}]},"patch":{"tags":["Learners"],"operationId":"updateLearner","security":[{"bearerAuth":["learners:write"]}],"summary":"Update a learner","description":"Updates a learner's `name` or `externalId`; parameters you don't send are left unchanged. Send the body as `application/merge-patch+json` with the learner's current `ETag` in `If-Match`.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"learnerId","in":"path","required":true,"description":"The learner's canonical subject id (sub_… ULID).","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}},{"$ref":"#/components/parameters/ifMatch"},{"name":"courseId","in":"query","required":false,"description":"The course. Defaults to the organization's default course.","schema":{"type":"string","minLength":1,"maxLength":64}}],"requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/LearnerPatch"}}}},"responses":{"200":{"description":"Returns the updated learner object. Fails with `409` when the name can't change because the person is an admin (`cannot_rename_admin`) or belongs to more than one organization (`learner_in_multiple_orgs`).","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on writes."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such learner in this organization for the course.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`external_id_conflict`: the externalId belongs to another learner. `cannot_rename_admin` / `learner_in_multiple_orgs`: the rename would reach past this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"412":{"description":"Stale If-Match; re-read and retry with the new ETag.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"The body is not application/merge-patch+json.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unknown field, empty patch, or an invalid value.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"428":{"description":"If-Match is required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A store read or write failed; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst current = await client.learners.retrieve(\n  \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n);\nconst learner = await client.learners.update(\n  current.learnerId,\n  { externalId: \"hr-1042\" },\n  { ifMatch: current },\n);\nconsole.log(learner.externalId);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nlearner = client.learners.retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nupdated = client.learners.update(\n    \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\", if_match=learner, name=\"Dana Whitfield\"\n)\nprint(updated.name)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\ncurrent = client.learners.retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nlearner = client.learners.update(\n  \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n  if_match: current,\n  name: \"Dana Whitfield\",\n)\nputs learner.name\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nLearner learner = await client.Learners.GetAsync(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nLearner updated = await client.Learners.UpdateAsync(\n    learner.LearnerId,\n    new LearnerUpdateOptions(learner) { Name = \"Dana Whitfield\" });\nConsole.WriteLine(updated.Name);\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Learner;\nimport com.teachmehipaa.param.LearnerUpdateParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nLearner current = client.learners().retrieve(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nLearner updated =\n    client\n        .learners()\n        .update(\n            current.getLearnerId(),\n            LearnerUpdateParams.builder().ifMatch(current).externalId(\"hr-1042\").build());\nSystem.out.println(updated.getExternalId());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\netag=$(tmh learners retrieve sub_01JD80AB2C3D4E5F6G7H8J9K0M \\\n  --show-headers 2>&1 >/dev/null | sed -n 's/^< Etag: //p')\ntmh learners update sub_01JD80AB2C3D4E5F6G7H8J9K0M \\\n  --name \"Dana Whitfield\" \\\n  --if-match \"$etag\" \\\n  | jq -r .name"}]}},"/organizations/{orgId}/compliance":{"get":{"tags":["Compliance"],"operationId":"getComplianceSummary","security":[{"bearerAuth":["compliance:read"]}],"summary":"Retrieve the compliance summary","description":"Counts the organization's learners in one course by status. Removed learners aren't counted.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"courseId","in":"query","required":false,"description":"The course. Defaults to the organization's default course.","schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns a compliance summary object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceSummary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `compliance:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid `courseId`, or the organization has more than 10,000 enrollments (`summary_too_large`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The roster could not be read; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst summary = await client.compliance.retrieve({ courseId: \"hipaa-2026\" });\nconsole.log(summary.totals.compliant, \"of\", summary.totals.learners);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nsummary = client.compliance.retrieve(course_id=\"hipaa-2026\")\nprint(f\"{summary.compliant_rate:.0%} compliant\")\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nsummary = client.compliance.retrieve(course_id: \"hipaa-2026\")\nputs \"#{(summary.compliant_rate * 100).round}% compliant\"\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nComplianceSummary summary = await client.Compliance.GetAsync(new() { CourseId = \"hipaa-2026\" });\nConsole.WriteLine($\"{summary.CompliantRate:P0} of {summary.Totals.Learners} Learners are compliant\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.ComplianceSummary;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nComplianceSummary summary = client.compliance().retrieve();\nSystem.out.println(summary.getTotals().getCompliant() + \" of \" + summary.getTotals().getLearners());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh compliance retrieve --course-id hipaa-2026 | jq .compliantRate"}]}},"/organizations/{orgId}/learners/by-external-id/{externalId}":{"put":{"tags":["Learners"],"operationId":"upsertLearnerByExternalId","security":[{"bearerAuth":["learners:write"]}],"summary":"Create or retrieve a learner by your id","description":"Makes sure a learner exists for your own id. Creates and invites the learner the first time, and returns them on every later call, so a sync job can replay it safely. Never uses a second seat.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"externalId","in":"path","required":true,"description":"Your id for the learner, URL-encoded.","schema":{"type":"string","minLength":1,"maxLength":128}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerUpsertRequest"}}}},"responses":{"200":{"description":"Returns the learner object, with `201` when it was created and `200` when it already existed.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on writes."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerDto"}}}},"201":{"description":"Returns the learner object, with `201` when it was created and `200` when it already existed.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on writes."},"Location":{"schema":{"type":"string"},"description":"The new learner's URL."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerCreated"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization, or an empty externalId.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`seat_unavailable` (no free seat), `external_id_conflict` (the externalId belongs to another learner, or the email and the externalId name two different learners), `seat_already_claimed`, `already_invited`, `enrollment_archived`, or a request with this Idempotency-Key still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body or a missing Idempotency-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A store read or write failed; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst learner = await client.learners.upsertByExternalId(\"hr-1042\", {\n  email: \"dana.whitfield@example.com\",\n  name: \"Dana Whitfield\",\n});\nconsole.log(learner.learnerId, learner.created);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nlearner = client.learners.upsert_by_external_id(\n    \"hr-1042\", email=\"dana.whitfield@example.com\", name=\"Dana Whitfield\"\n)\nprint(learner.learner_id, learner.created)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nlearner = client.learners.upsert_by_external_id(\n  \"hr-1042\",\n  email: \"dana.whitfield@example.com\",\n  name: \"Dana Whitfield\",\n)\nputs learner.created? ? \"Invited\" : \"Already enrolled\"\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nLearnerWriteResult learner = await client.Learners.UpsertByExternalIdAsync(\n    \"hr-1042\",\n    new LearnerUpsertByExternalIdOptions { Email = \"dana.whitfield@example.com\" });\nConsole.WriteLine($\"{learner.LearnerId} created: {learner.Created}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.LearnerWriteResult;\nimport com.teachmehipaa.param.LearnerUpsertByExternalIdParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nLearnerWriteResult learner =\n    client\n        .learners()\n        .upsertByExternalId(\n            \"hr-1042\",\n            LearnerUpsertByExternalIdParams.builder()\n                .email(\"dana.whitfield@example.com\")\n                .name(\"Dana Whitfield\")\n                .build());\nSystem.out.println(learner.getLearnerId() + \" created: \" + learner.isCreated());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners upsert-by-external-id hr-1042 \\\n  --email dana.whitfield@example.com \\\n  --name \"Dana Whitfield\" \\\n  | jq -r .learnerId"}]}},"/organizations/{orgId}/learners/{learnerId}:offboard":{"post":{"tags":["Learners"],"operationId":"offboardLearner","security":[{"bearerAuth":["learners:write"]}],"summary":"Offboard a learner","description":"Removes a learner from the organization. A learner who hasn't started has their invite cancelled and the seat returned; a learner who has started keeps their training history and certificates. Releases the learner's `externalId`.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"learnerId","in":"path","required":true,"description":"The learner's canonical subject id (sub_… ULID).","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}},{"$ref":"#/components/parameters/idempotencyKey"},{"name":"If-Match","in":"header","required":false,"description":"Optional: the learner's current ETag. When sent and stale, 412.","schema":{"type":"string"}},{"name":"courseId","in":"query","required":false,"description":"The course. Defaults to the organization's default course.","schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns the learner object with status `removed`. Offboarding a removed learner succeeds again. Fails with `409` `cannot_offboard_admin` for an admin.","headers":{"ETag":{"schema":{"type":"string"},"description":"Strong validator; present it via If-Match on writes."},"Access-Control-Allow-Origin":{"$ref":"#/components/headers/Access-Control-Allow-Origin"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerDto"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such learner in this organization for the course.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`cannot_offboard_admin`, or a request with this Idempotency-Key still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"412":{"description":"Stale If-Match; re-read and retry with the new ETag.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid `courseId` or a missing Idempotency-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A store read or write failed; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst learner = await client.learners.offboard(\n  \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n);\nconsole.log(learner.status);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nlearner = client.learners.offboard(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nprint(learner.status)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nlearner = client.learners.offboard(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nputs learner.status\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nLearner learner = await client.Learners.OffboardAsync(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nConsole.WriteLine($\"{learner.Email} is now {learner.Status}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Learner;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nLearner learner = client.learners().offboard(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nSystem.out.println(learner.getLearnerId() + \" \" + learner.getStatus());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners offboard sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .status"}]}},"/organizations/{orgId}/learners/{learnerId}:remind":{"post":{"tags":["Learners"],"operationId":"remindLearner","security":[{"bearerAuth":["learners:write"]}],"summary":"Remind a learner","description":"Emails the learner a reminder: the invite again if they haven't started, or a nudge to finish if they have.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"learnerId","in":"path","required":true,"description":"The learner's canonical subject id (sub_… ULID).","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}},{"$ref":"#/components/parameters/idempotencyKey"},{"name":"courseId","in":"query","required":false,"description":"The course. Defaults to the organization's default course.","schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"202":{"description":"Returns `202` once the reminder is queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerRemindAccepted"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such learner in this organization for the course.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`illegal_transition` (the learner was removed), `enrollment_archived`, or a request with this Idempotency-Key still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid `courseId` or a missing Idempotency-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A store read or write failed; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst accepted = await client.learners.remind(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nconsole.log(accepted.action);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\naccepted = client.learners.remind(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nprint(accepted.action)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nreminder = client.learners.remind(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nputs reminder.action\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nLearnerRemindAccepted reminder = await client.Learners.RemindAsync(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nConsole.WriteLine($\"{reminder.Action} accepted for {reminder.LearnerId}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.LearnerRemindAccepted;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nLearnerRemindAccepted accepted = client.learners().remind(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nSystem.out.println(accepted.getAction() + \" \" + accepted.getLearnerId());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners remind sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .action"}]}},"/organizations/{orgId}/learners/{learnerId}:createLaunchLink":{"post":{"tags":["Learners"],"operationId":"createLearnerLaunchLink","security":[{"bearerAuth":["learners:write"]}],"summary":"Create a launch link","description":"Creates a link that opens the course with the learner already signed in, for a \"Start training\" button in your product. The link works once and expires after 5 minutes: create it when the learner clicks, then redirect them to it. Never email, store or log it. Only for a learner who has accepted their invite.","parameters":[{"$ref":"#/components/parameters/orgId"},{"name":"learnerId","in":"path","required":true,"description":"The learner's canonical subject id (sub_… ULID).","schema":{"type":"string","pattern":"^sub_[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"courseId","in":"query","required":false,"description":"The course. Defaults to the organization's default course.","schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"201":{"description":"Returns the launch link and when it expires. Fails with `409` for an admin (`cannot_launch_admin`), a removed learner (`learner_removed`) or a learner who hasn't accepted the invite (`learner_not_accepted`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerLaunchLink"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such learner in this organization for the course.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`cannot_launch_admin`, `learner_removed`, `learner_not_accepted`, or `illegal_transition` (the learner's certification expired; renew the enrollment first).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid `courseId`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A store read or write failed; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst link = await client.learners.createLaunchLink(\n  \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\",\n);\nconsole.log(link.url, link.expiresAt);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nlink = client.learners.create_launch_link(\n    \"sub_01JD80AB2C3D4E5F6G7H8J9K0M\", course_id=\"hipaa-2026\"\n)\nprint(link.url, link.expires_at)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nlink = client.learners.create_launch_link(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\")\nputs link.url\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nLearnerLaunchLink link = await client.Learners.CreateLaunchLinkAsync(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nConsole.WriteLine($\"{link.Url} (expires {link.ExpiresAt:u})\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.LearnerLaunchLink;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nLearnerLaunchLink link = client.learners().createLaunchLink(\"sub_01JD80AB2C3D4E5F6G7H8J9K0M\");\nSystem.out.println(link.getUrl() + \" expires \" + link.getExpiresAt());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners create-launch-link sub_01JD80AB2C3D4E5F6G7H8J9K0M \\\n  | jq -r .url"}]}},"/organizations/{orgId}/learners:batchUpsert":{"post":{"tags":["Learners"],"operationId":"batchUpsertLearners","security":[{"bearerAuth":["learners:write"]}],"summary":"Create many learners","description":"Creates or retrieves up to 500 learners in one request. Each item works like creating one learner and succeeds or fails on its own.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnerBatchUpsertRequest"}}}},"responses":{"202":{"description":"Returns a completed operation whose `response` holds one result per item, in order: `created`, `existing` or `failed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:write`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A request with this Idempotency-Key is still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body, more than 500 items (`batch_too_large`), or a missing Idempotency-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A store read or write failed; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.learners.batchUpsert({\n  items: [{ email: \"dana.whitfield@example.com\", externalId: \"hr-1042\" }],\n});\nconst done = await operation.wait();\nconsole.log(done.name, done.done);\n"},{"lang":"python","label":"Python","source":"import os\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\noperation = client.learners.batch_upsert(\n    items=[{\"email\": \"dana.whitfield@example.com\", \"name\": \"Dana Whitfield\"}]\n)\nprint(operation.wait().response)\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\noperation = client.learners.batch_upsert(\n  items: [{ email: \"dana.whitfield@example.com\", name: \"Dana Whitfield\", external_id: \"hr-1042\" }],\n)\nputs operation.wait.done\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.Learners.BatchUpsertAsync(new LearnerBatchUpsertOptions\n{\n    Items = [new() { Email = \"dana.whitfield@example.com\", ExternalId = \"hr-1042\" }],\n});\nOperation done = await operation.WaitAsync();\nConsole.WriteLine($\"Batch finished: {done.Name}\");\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.Operation;\nimport com.teachmehipaa.param.LearnerBatchUpsertParams;\nimport com.teachmehipaa.param.LearnerBatchUpsertRequestItemsItem;\nimport java.util.List;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nOperation upsert =\n    client\n        .learners()\n        .batchUpsert(\n            LearnerBatchUpsertParams.builder()\n                .items(\n                    List.of(\n                        LearnerBatchUpsertRequestItemsItem.builder()\n                            .email(\"dana.whitfield@example.com\")\n                            .name(\"Dana Whitfield\")\n                            .build()))\n                .build());\nSystem.out.println(upsert.waitForCompletion().getResponse());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners batch-upsert \\\n  -d 'items:=[{\"externalId\":\"hr-1042\",\"email\":\"dana.whitfield@example.com\",\"name\":\"Dana Whitfield\"}]' \\\n  --wait \\\n  | jq .response"}]}},"/organizations/{orgId}/learners:export":{"post":{"tags":["Learners"],"operationId":"exportLearners","security":[{"bearerAuth":["learners:read"]}],"summary":"Export learners","description":"Exports the organization's learners in one course as CSV, optionally only those with one `status`. Requires the `learners:read` scope.","parameters":[{"$ref":"#/components/parameters/orgId"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnersExportRequest"}}}},"responses":{"202":{"description":"Returns a completed operation whose `response` holds the CSV file. Fails with `422` `export_too_large` over 10,000 rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Token lacks `learners:read`, or the organization is not the token's active org (`org_not_active`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A request with this Idempotency-Key is still in flight.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Invalid body, `export_too_large`, or a missing Idempotency-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The roster could not be read; retry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-codeSamples":[{"lang":"node","label":"Node.js","source":"import { writeFile } from \"node:fs/promises\";\nimport TeachMeHipaa from \"teachmehipaa\";\n\nconst client = new TeachMeHipaa({\n  clientId: process.env.TMH_CLIENT_ID!,\n  clientSecret: process.env.TMH_CLIENT_SECRET!,\n  environment: \"sandbox\",\n});\n\nconst operation = await client.learners.export({ format: \"csv\" });\nconst done = await operation.wait();\nawait writeFile(\"learners.csv\", done.exportResult().csv);\n"},{"lang":"python","label":"Python","source":"import os\nfrom pathlib import Path\n\nfrom teachmehipaa import TeachMeHipaa\n\nclient = TeachMeHipaa(\n    client_id=os.environ[\"TMH_CLIENT_ID\"],\n    client_secret=os.environ[\"TMH_CLIENT_SECRET\"],\n    environment=\"sandbox\",\n)\n\nexport = client.learners.export(format=\"csv\").wait().export_result()\nPath(\"learners.csv\").write_text(export.csv, newline=\"\")\n"},{"lang":"ruby","label":"Ruby","source":"require \"teachmehipaa\"\n\nclient = TeachMeHipaa::Client.new(\n  client_id: ENV.fetch(\"TMH_CLIENT_ID\"),\n  client_secret: ENV.fetch(\"TMH_CLIENT_SECRET\"),\n  environment: :sandbox,\n)\n\nexport = client.learners.export(format: \"csv\").wait.export_result\nFile.write(export.filename || \"learners.csv\", export.csv)\n"},{"lang":"csharp","label":".NET","source":"using TeachMeHipaa;\n\nvar client = new TeachMeHipaaClient(new TeachMeHipaaClientOptions\n{\n    ClientId = Environment.GetEnvironmentVariable(\"TMH_CLIENT_ID\")!,\n    ClientSecret = Environment.GetEnvironmentVariable(\"TMH_CLIENT_SECRET\")!,\n    Environment = TeachMeHipaaEnvironment.Sandbox,\n});\n\nOperation operation = await client.Learners.ExportAsync(\n    new LearnerExportOptions { Format = LearnersExportRequestFormat.Csv });\nExportResult export = (await operation.WaitAsync()).GetExportResult();\nawait File.WriteAllTextAsync(\"learners.csv\", export.Csv);\n"},{"lang":"java","label":"Java","source":"import com.teachmehipaa.Environment;\nimport com.teachmehipaa.TeachMeHipaaClient;\nimport com.teachmehipaa.model.LearnersExportRequestFormat;\nimport com.teachmehipaa.model.Operation;\nimport com.teachmehipaa.param.LearnerExportParams;\n\nTeachMeHipaaClient client =\n    TeachMeHipaaClient.builder()\n        .clientId(System.getenv(\"TMH_CLIENT_ID\"))\n        .clientSecret(System.getenv(\"TMH_CLIENT_SECRET\"))\n        .environment(Environment.SANDBOX)\n        .build();\n\nOperation export =\n    client\n        .learners()\n        .export(\n            LearnerExportParams.builder().format(LearnersExportRequestFormat.CSV).build());\nSystem.out.println(export.waitForCompletion().getExportResult().csv());\n"},{"lang":"shell","label":"CLI","source":"# Runs as your sandbox profile (tmh login). Add --live for Live.\ntmh learners export --format csv --status expired -o learners.csv"}]}}},"webhooks":{},"x-tagGroups":[{"name":"Access tokens","tags":["Authentication"]},{"name":"Training","tags":["Learners","Enrollments","Certificates","Courses","Compliance"]},{"name":"Organization","tags":["Organizations","Members","Audit Events"]},{"name":"Webhooks","tags":["Webhook Subscriptions","Events"]},{"name":"Bulk operations","tags":["Bulk Operations"]},{"name":"Verification","tags":["Certificate Verification"]}]}