tmh <resource> <method> [<id>...] [flags]
One section per Developer API operation: 45 commands over 13 resources, generated from API release trimmed-2026-11-15. Under each command, a table gives the HTTP route, the Scopes it needs, what it prints and whether tmh retries it, followed by an example. The command reference has every flag with its default, and Requests shows how arguments, flags and -d turn into a request.
Routes are relative to the Environment’s base URL: https://api.tme.so/v1 for Live, https://sandbox.api.tme.so/v1 for Sandbox. {orgId} never appears on the command line; tmh reads it from your credentials. tmh events tail, tmh events resend and the raw tmh get, post, put, patch and delete belong to tmh itself and call no single operation, so they have no section here.
tmh audit-events: listtmh auth: introspecttmh certificate-verifications: retrievetmh certificates: download-pdf, export, list, retrieve, retrieve-linkstmh compliance: retrievetmh courses: list, retrievetmh enrollments: batch, batch-by-filter, cancel, create, export, import, list, preview-import, remind, renew, resend-invite, retrievetmh events: listtmh learners: batch-upsert, create, create-launch-link, export, list, offboard, remind, retrieve, update, upsert-by-external-idtmh members: list, retrievetmh operations: retrievetmh seats: retrievetmh webhook-subscriptions: create, delete, list, redrive, retrieve, test, updatetmh whoami lists the Scopes your API client holds. Where a command names more than one set, any one set is enough. A missing Scope fails the command with exit code 2; see Login.
| Scope | Allows |
|---|---|
audit:read |
Read the organization’s audit-event trail and event log. |
certificates:read |
Read certificates and download certificate artifacts. |
compliance:read |
API clients: read the compliance summary. |
enrollments:read |
Read enrollments, invitations, seats, and member sub-resources. |
enrollments:write |
Create and transition enrollments and assessment attempts. |
learners:read |
API clients: read learners. |
learners:write |
API clients: create and update learners. |
members:read |
Read organization members and the organization record. |
webhooks:manage |
API clients: manage webhook subscriptions and read the event log. |
tmh audit-eventstmh audit-events listList all audit events
Returns a list of the organization’s audit events, newest first. Filter by type, transition, subjectId, or a since and until range.
tmh audit-events list [flags]
| HTTP | GET /organizations/{orgId}/audit-events |
| Scopes | audit:read |
| Prints | A page of AuditEvent as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 100. Defaults to 20. |
--cursor |
The nextCursor from the previous page. |
--type |
Filter to one audit-event family; one of: 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 |
--transition |
Filter to one lifecycle transition; one of: bounce, start, beginAssessment, submitAssessment, certify, revokeCert, archive, unarchive, reinvite, cancelInvite |
--subject-id |
Filter to one member (canonical subject id). |
--since |
Inclusive lower bound on at (ISO-8601 instant). |
--until |
Inclusive upper bound on at (ISO-8601 instant). |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh audit-events list \
--type learner.updated \
| jq -r '.items[] | [.at, .type, .actorSubjectId] | @tsv'
All flags: tmh audit-events list.
tmh authtmh auth introspectRetrieve the current token
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.
tmh auth introspect [flags]
| HTTP | GET /auth/introspection |
| Scopes | Any Access token |
| Prints | TokenIntrospection as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh auth introspect | jq -r '.scopes[]'
All flags: tmh auth introspect.
tmh certificate-verificationstmh certificate-verifications retrieveVerify a certificate
Verifies the certificate behind a https://tme.so/{tinyId} link. Needs no access token. Limited to 60 requests a minute per IP address.
tmh certificate-verifications retrieve <tinyId> [flags]
| HTTP | GET /certificate-verifications/{tinyId} |
| Scopes | None (public): runs before tmh login |
| Prints | CertificateVerification as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Public: works before tmh login.
tmh certificate-verifications retrieve a7Kq2Z | jq -r .status
All flags: tmh certificate-verifications retrieve.
tmh certificatestmh certificates download-pdfDownload a certificate
Downloads the certificate as a PDF. Revoked and expired certificates are watermarked. Requires the certificates:read scope.
tmh certificates download-pdf <certId> [flags]
| HTTP | GET /organizations/{orgId}/certificates/{certId}/content |
| Scopes | certificates:read |
| Prints | The application/pdf file; -o <file> saves it, -o - writes it to stdout |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh certificates download-pdf cert_01JD8F3G5H7J9K1M3N5P7Q9R1S \
-o certificate.pdf
All flags: tmh certificates download-pdf.
tmh certificates exportExport certificates
Exports the organization’s certificate records as CSV. Requires the certificates:read scope.
tmh certificates export [flags]
| HTTP | POST /organizations/{orgId}/certificates:export |
| Scopes | certificates:read |
| Prints | An Operation as JSON; --wait waits until it is done, and -o <file> saves the finished CSV |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--format |
The file format. Only csv today; one of: csv, zip (required) |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh certificates export --format csv -o certificates.csv
All flags: tmh certificates export.
tmh certificates listList all certificates
Returns a list of the organization’s certificates. Pass subjectId to list one learner’s.
tmh certificates list [flags]
| HTTP | GET /organizations/{orgId}/certificates |
| Scopes | certificates:read |
| Prints | A page of Certificate as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 100. Defaults to 20. |
--cursor |
The nextCursor from the previous page. |
--subject-id |
Filter to one holder (canonical subject id). |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh certificates list \
--subject-id sub_01JD80AB2C3D4E5F6G7H8J9K0M \
| jq -r '.items[] | [.certificateId, .status, .expiresAt] | @tsv'
All flags: tmh certificates list.
tmh certificates retrieveRetrieve a certificate
Retrieves a certificate.
tmh certificates retrieve <certId> [flags]
| HTTP | GET /organizations/{orgId}/certificates/{certId} |
| Scopes | certificates:read |
| Prints | Certificate as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh certificates retrieve cert_01JD8F3G5H7J9K1M3N5P7Q9R1S \
| jq -r .expiresAt
All flags: tmh certificates retrieve.
tmh certificates retrieve-linksRetrieve certificate links
Retrieves the certificate’s LinkedIn add-to-profile link and its public tme.so verification link. Requires the certificates:read scope.
tmh certificates retrieve-links <certId> [flags]
| HTTP | GET /organizations/{orgId}/certificates/{certId}/credentials |
| Scopes | certificates:read |
| Prints | CertificateLinks as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh certificates retrieve-links cert_01JD8F3G5H7J9K1M3N5P7Q9R1S \
| jq -r .shortLink
All flags: tmh certificates retrieve-links.
tmh compliancetmh compliance retrieveRetrieve the compliance summary
Counts the organization’s learners in one course by status. Removed learners aren’t counted.
tmh compliance retrieve [flags]
| HTTP | GET /organizations/{orgId}/compliance |
| Scopes | compliance:read |
| Prints | ComplianceSummary as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--course-id |
The course. Defaults to the organization’s default course. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh compliance retrieve --course-id hipaa-2026 | jq .compliantRate
All flags: tmh compliance retrieve.
tmh coursestmh courses listList all courses
Returns a list of the courses in the public catalog. Needs no access token.
tmh courses list [flags]
| HTTP | GET /courses |
| Scopes | None (public): runs before tmh login |
| Prints | A page of Course as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 100. Defaults to 20. |
--cursor |
The nextCursor from the previous page. |
Example:
# Public: works before tmh login.
tmh courses list | jq -r '.items[] | [.courseId, .title] | @tsv'
All flags: tmh courses list.
tmh courses retrieveRetrieve a course
Retrieves a course from the public catalog.
tmh courses retrieve <courseId> [flags]
| HTTP | GET /courses/{courseId} |
| Scopes | None (public): runs before tmh login |
| Prints | Course as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Public: works before tmh login.
tmh courses retrieve hipaa-2026 | jq -r .title
All flags: tmh courses retrieve.
tmh enrollmentstmh enrollments batchUpdate many enrollments
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.
tmh enrollments batch [flags]
| HTTP | POST /organizations/{orgId}/enrollments:batch |
| Scopes | enrollments:write |
| Prints | EnrollmentsBatchResults as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--operation |
What to do to each enrollment: remind, resendInvite, cancel, recertify, archive or unarchive; one of: remind, resendInvite, cancel, recertify, archive, unarchive (required) |
--select.enrollment-ids |
Enrollment ids (required) |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments batch \
--operation remind \
--select.enrollment-ids enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \
| jq -r '.results[] | [.enrollmentId, .outcome] | @tsv'
All flags: tmh enrollments batch.
tmh enrollments batch-by-filterUpdate many enrollments
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.
tmh enrollments batch-by-filter [flags]
| HTTP | POST /organizations/{orgId}/enrollments:batch |
| Scopes | enrollments:write |
| Prints | An Operation as JSON; --wait waits until it is done |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--operation |
What to do to each enrollment: remind, resendInvite, cancel, recertify, archive or unarchive; one of: remind, resendInvite, cancel, recertify, archive, unarchive (required) |
--select.filter.status |
Status; one of: INVITED, EMAIL_BOUNCED, STARTED, ASSESSMENT_IN_PROGRESS, CERTIFIED, CANCELLED, EXPIRING, EXPIRED, ARCHIVED |
--select.filter.course-id |
Course id |
--select.filter.archived |
Archived |
All flags: tmh enrollments batch-by-filter.
tmh enrollments cancelCancel an enrollment
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.
tmh enrollments cancel <enrollmentId> [flags]
| HTTP | POST /organizations/{orgId}/enrollments/{enrollmentId}:cancel |
| Scopes | enrollments:write |
| Prints | CancelEnrollmentResponse as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--refund |
Refund the seat to the card that paid for it instead of returning it to the pool. Defaults to false. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments cancel enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \
--refund \
| jq -r .status
All flags: tmh enrollments cancel.
tmh enrollments createCreate an enrollment
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.
tmh enrollments create [flags]
| HTTP | POST /organizations/{orgId}/enrollments |
| Scopes | enrollments:write |
| Prints | Enrollment as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--email |
The learner’s email address. (required) |
--name |
The learner’s full name. |
--course-id |
The course to invite them to. Defaults to hipaa. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments create \
--email dana.whitfield@example.com \
--course-id hipaa-2026 \
| jq -r .enrollmentId
All flags: tmh enrollments create.
tmh enrollments exportExport enrollments
Exports the organization’s enrollments as CSV. Requires the enrollments:read scope.
tmh enrollments export [flags]
| HTTP | POST /organizations/{orgId}/enrollments:export |
| Scopes | enrollments:read |
| Prints | An Operation as JSON; --wait waits until it is done, and -o <file> saves the finished CSV |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--format |
The file format. Only csv today; one of: csv, xlsx (required) |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments export --format csv -o enrollments.csv
All flags: tmh enrollments export.
tmh enrollments importImport learners from CSV
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.
tmh enrollments import [flags]
| HTTP | POST /organizations/{orgId}/enrollments:import |
| Scopes | enrollments:write |
| Prints | An Operation as JSON; --wait waits until it is done |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Preview | --preview runs tmh enrollments preview-import instead, which checks the input and changes nothing |
| Flag | Description |
|---|---|
--file <path> |
The text/csv file to upload; - reads stdin |
--options.course-id |
The course to invite everyone to. Defaults to the organization’s default course. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments import --file roster.csv --wait | jq .response
All flags: tmh enrollments import.
tmh enrollments listList all enrollments
Returns a list of the organization’s enrollments. Filter by status, courseId or archived. Requires the enrollments:read scope.
tmh enrollments list [flags]
| HTTP | GET /organizations/{orgId}/enrollments |
| Scopes | enrollments:read |
| Prints | A page of OrgEnrollmentListItem as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 1000. Defaults to 20. |
--cursor |
The nextCursor from the previous page. |
--status |
Filter on the derived effectiveStatus; one of: INVITED, EMAIL_BOUNCED, STARTED, ASSESSMENT_IN_PROGRESS, CERTIFIED, CANCELLED, EXPIRING, EXPIRED, ARCHIVED |
--course-id |
Course id |
--archived |
Archived; one of: true, false |
--include |
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; one of: priorCertificate |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments list \
--status CERTIFIED \
| jq -r '.items[] | [.enrollmentId, .subjectId, .expiresAt] | @tsv'
All flags: tmh enrollments list.
tmh enrollments preview-importImport learners from CSV
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.
tmh enrollments preview-import [flags]
| HTTP | POST /organizations/{orgId}/enrollments:import |
| Scopes | enrollments:write |
| Prints | ImportPreview as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--file <path> |
The text/csv file to upload; - reads stdin |
--options.course-id |
The course to invite everyone to. Defaults to the organization’s default course. |
All flags: tmh enrollments preview-import.
tmh enrollments remindRemind an enrollment
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.
tmh enrollments remind <enrollmentId> [flags]
| HTTP | POST /organizations/{orgId}/enrollments/{enrollmentId}:remind |
| Scopes | enrollments:write |
| Prints | EnrollmentActionAccepted as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments remind enr_01JD8K2M4N6P8Q0R2S4T6V8W0X | jq -r .action
All flags: tmh enrollments remind.
tmh enrollments renewRenew an enrollment
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.
tmh enrollments renew <enrollmentId> [flags]
| HTTP | POST /organizations/{orgId}/enrollments/{enrollmentId}:renew |
| Scopes | enrollments:write |
| Prints | Enrollment as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments renew enr_01JD8K2M4N6P8Q0R2S4T6V8W0X | jq .cycle
All flags: tmh enrollments renew.
tmh enrollments resend-inviteResend an invite
Sends a pending invite again, within the same cycle. To invite a certified learner again, renew the enrollment. Requires the enrollments:write scope.
tmh enrollments resend-invite <enrollmentId> [flags]
| HTTP | POST /organizations/{orgId}/enrollments/{enrollmentId}:resendInvite |
| Scopes | enrollments:write |
| Prints | EnrollmentActionAccepted as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments resend-invite enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \
| jq -r .action
All flags: tmh enrollments resend-invite.
tmh enrollments retrieveRetrieve an enrollment
Retrieves an enrollment. Requires the enrollments:read scope.
tmh enrollments retrieve <enrollmentId> [flags]
| HTTP | GET /organizations/{orgId}/enrollments/{enrollmentId} |
| Scopes | enrollments:read |
| Prints | Enrollment as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh enrollments retrieve enr_01JD8K2M4N6P8Q0R2S4T6V8W0X \
| jq -r .effectiveStatus
All flags: tmh enrollments retrieve.
tmh eventstmh events listList all events
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.
tmh events list [flags]
| HTTP | GET /organizations/{orgId}/events |
| Scopes | webhooks:manage or audit:read |
| Prints | A page of Event as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 100. Defaults to 20. |
--after |
Return events after this event id (exclusive). The previous page’s nextCursor. |
--type |
Filter to one event type; one of: enrollment.certified, seat.consumed, seat.freed, learner.invited, learner.started, learner.certified, learner.expiring, learner.expired, learner.removed, invite.bounced, certificate.revoked, seats.low |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh events list \
--type learner.certified \
| jq -r '.items[] | [.occurredAt, .eventId, .data.email] | @tsv'
All flags: tmh events list.
tmh learnerstmh learners batch-upsertCreate many learners
Creates or retrieves up to 500 learners in one request. Each item works like creating one learner and succeeds or fails on its own.
tmh learners batch-upsert [flags]
| HTTP | POST /organizations/{orgId}/learners:batchUpsert |
| Scopes | learners:write |
| Prints | An Operation as JSON; --wait waits until it is done |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--delivery |
Applies to every item. email (default) sends invites; none sends nothing; one of: email, none |
--seat-policy |
Applies to every item. require_available fails an item when no seat is free; one of: require_available |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners batch-upsert \
-d 'items:=[{"externalId":"hr-1042","email":"dana.whitfield@example.com","name":"Dana Whitfield"}]' \
--wait \
| jq .response
All flags: tmh learners batch-upsert.
tmh learners createCreate a learner
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.
tmh learners create [flags]
| HTTP | POST /organizations/{orgId}/learners |
| Scopes | learners:write |
| Prints | Learner, or LearnerCreated when it was created, as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--email |
The learner’s email address. (required) |
--name |
The learner’s full name. |
--external-id |
Your own id for the learner, unique within the organization. |
--course-id |
The course to invite them to. Defaults to the organization’s default course. |
--delivery |
email (default) sends the invite email. none sends nothing and returns joinUrl for you to deliver; one of: email, none |
--seat-policy |
require_available fails with 409 when no seat is free; one of: require_available |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners create \
--email dana.whitfield@example.com \
--name "Dana Whitfield" \
| jq -r .learnerId
All flags: tmh learners create.
tmh learners create-launch-linkCreate a launch link
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.
tmh learners create-launch-link <learnerId> [flags]
| HTTP | POST /organizations/{orgId}/learners/{learnerId}:createLaunchLink |
| Scopes | learners:write |
| Prints | LearnerLaunchLink as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--course-id |
The course. Defaults to the organization’s default course. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners create-launch-link sub_01JD80AB2C3D4E5F6G7H8J9K0M \
| jq -r .url
All flags: tmh learners create-launch-link.
tmh learners exportExport learners
Exports the organization’s learners in one course as CSV, optionally only those with one status. Requires the learners:read scope.
tmh learners export [flags]
| HTTP | POST /organizations/{orgId}/learners:export |
| Scopes | learners:read |
| Prints | An Operation as JSON; --wait waits until it is done, and -o <file> saves the finished CSV |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--format |
The file format. Only csv today; one of: csv (required) |
--course-id |
The course to export. Defaults to the organization’s default course. |
--status |
Only export learners with this status; one of: not_started, invite_bounced, in_progress, compliant, expiring_soon, expired, removed |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners export --format csv --status expired -o learners.csv
All flags: tmh learners export.
tmh learners listList all learners
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.
tmh learners list [flags]
| HTTP | GET /organizations/{orgId}/learners |
| Scopes | learners:read |
| Prints | A page of Learner as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 100. Defaults to 20. |
--cursor |
The nextCursor from the previous page. |
--email |
|
--external-id |
The integration’s own id for the learner (unique per organization), or the SCIM externalId when none was set. |
--status |
Status; one of: not_started, invite_bounced, in_progress, compliant, expiring_soon, expired, removed |
--course-id |
The course. Defaults to the organization’s default course. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners list \
--status in_progress \
| jq -r '.items[] | [.learnerId, .email, .status] | @tsv'
All flags: tmh learners list.
tmh learners offboardOffboard a learner
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.
tmh learners offboard <learnerId> [flags]
| HTTP | POST /organizations/{orgId}/learners/{learnerId}:offboard |
| Scopes | learners:write |
| Prints | Learner as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Conditional | --if-match <etag> makes the write conditional |
| Flag | Description |
|---|---|
--course-id |
The course. Defaults to the organization’s default course. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners offboard sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .status
All flags: tmh learners offboard.
tmh learners remindRemind a learner
Emails the learner a reminder: the invite again if they haven’t started, or a nudge to finish if they have.
tmh learners remind <learnerId> [flags]
| HTTP | POST /organizations/{orgId}/learners/{learnerId}:remind |
| Scopes | learners:write |
| Prints | LearnerRemindAccepted as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--course-id |
The course. Defaults to the organization’s default course. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners remind sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .action
All flags: tmh learners remind.
tmh learners retrieveRetrieve a learner
Retrieves a learner’s status in one course.
tmh learners retrieve <learnerId> [flags]
| HTTP | GET /organizations/{orgId}/learners/{learnerId} |
| Scopes | learners:read |
| Prints | Learner as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--course-id |
The course. Defaults to the organization’s default course. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners retrieve sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .status
All flags: tmh learners retrieve.
tmh learners updateUpdate a learner
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.
tmh learners update <learnerId> [flags]
| HTTP | PATCH /organizations/{orgId}/learners/{learnerId} |
| Scopes | learners:write |
| Prints | Learner as JSON |
| Retries | Never retried |
| Idempotency | None |
| Conditional | --if-match <etag> is required |
| Flag | Description |
|---|---|
--course-id |
The course. Defaults to the organization’s default course. |
--name |
The learner’s full name. |
--external-id |
Your own id for the learner. Set it to null to clear it. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
etag=$(tmh learners retrieve sub_01JD80AB2C3D4E5F6G7H8J9K0M \
--show-headers 2>&1 >/dev/null | sed -n 's/^< Etag: //p')
tmh learners update sub_01JD80AB2C3D4E5F6G7H8J9K0M \
--name "Dana Whitfield" \
--if-match "$etag" \
| jq -r .name
All flags: tmh learners update.
tmh learners upsert-by-external-idCreate or retrieve a learner by your id
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.
tmh learners upsert-by-external-id <externalId> [flags]
| HTTP | PUT /organizations/{orgId}/learners/by-external-id/{externalId} |
| Scopes | learners:write |
| Prints | Learner, or LearnerCreated when it was created, as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--email |
The learner’s email address. (required) |
--name |
The learner’s full name. |
--course-id |
The course to invite them to. Defaults to the organization’s default course. |
--delivery |
email (default) sends the invite email. none sends nothing and returns joinUrl for you to deliver; one of: email, none |
--seat-policy |
require_available fails with 409 when no seat is free; one of: require_available |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh learners upsert-by-external-id hr-1042 \
--email dana.whitfield@example.com \
--name "Dana Whitfield" \
| jq -r .learnerId
All flags: tmh learners upsert-by-external-id.
tmh memberstmh members listList all members
Returns a list of the organization’s members, its admins and learners. Pass role=admin to list only admins.
tmh members list [flags]
| HTTP | GET /organizations/{orgId}/members |
| Scopes | members:read |
| Prints | A page of MemberListItem as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 1000. Defaults to 20. |
--cursor |
The nextCursor from the previous page. |
--include |
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. |
--role |
Only admins (paginated); one of: admin |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh members list \
--role admin \
| jq -r '.items[] | [.email, .name] | @tsv'
All flags: tmh members list.
tmh members retrieveRetrieve a member
Retrieves a member of the organization.
tmh members retrieve <subjectId> [flags]
| HTTP | GET /organizations/{orgId}/members/{subjectId} |
| Scopes | members:read |
| Prints | Member as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh members retrieve sub_01JD80AB2C3D4E5F6G7H8J9K0M | jq -r .role
All flags: tmh members retrieve.
tmh operationstmh operations retrieveRetrieve an operation
Retrieves a bulk operation and its result. Operations are kept for 24 hours.
tmh operations retrieve <operationId> [flags]
| HTTP | GET /organizations/{orgId}/operations/{operationId} |
| Scopes | Any Access token |
| Prints | An Operation as JSON; --wait waits until it is done |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh operations retrieve op_01JD8T4V6W8X0Y2Z4A6B8C0D2E | jq .done
All flags: tmh operations retrieve.
tmh seatstmh seats retrieveRetrieve the seat inventory
Retrieves how many seats the organization has, how many are assigned and how many are available for new invites. Requires the enrollments:read scope.
tmh seats retrieve [flags]
| HTTP | GET /organizations/{orgId}/seats |
| Scopes | enrollments:read |
| Prints | SeatsInventory as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh seats retrieve | jq .available
All flags: tmh seats retrieve.
tmh webhook-subscriptionstmh webhook-subscriptions createCreate a webhook subscription
Subscribes an HTTPS endpoint to event types and creates its signing secret. Requires the webhooks:manage or org:admin scope.
tmh webhook-subscriptions create [flags]
| HTTP | POST /organizations/{orgId}/webhook-subscriptions |
| Scopes | org:admin or webhooks:manage |
| Prints | WebhookSubscriptionCreated as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
| Flag | Description |
|---|---|
--endpoint-url |
The HTTPS URL to deliver events to. (required) |
--event-types |
The event types to deliver; one of: enrollment.certified, seat.consumed, seat.freed, learner.invited, learner.started, learner.certified, learner.expiring, learner.expired, learner.removed, invite.bounced, certificate.revoked, seats.low (required) |
--description |
A description for your own reference. |
--seats-low-threshold |
Send seats.low when available seats drop to this number. Defaults to 5. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh webhook-subscriptions create \
--endpoint-url https://example.com/webhooks/teachmehipaa \
--event-types learner.certified \
| jq -r .secret
All flags: tmh webhook-subscriptions create.
tmh webhook-subscriptions deleteDelete a webhook subscription
Deletes a webhook subscription and its signing secret. Requires the webhooks:manage or org:admin scope.
tmh webhook-subscriptions delete <subscriptionId> [flags]
| HTTP | DELETE /organizations/{orgId}/webhook-subscriptions/{subscriptionId} |
| Scopes | org:admin or webhooks:manage |
| Prints | Nothing |
| Retries | Never retried |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh webhook-subscriptions delete whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \
&& echo deleted
All flags: tmh webhook-subscriptions delete.
tmh webhook-subscriptions listList all webhook subscriptions
Returns a list of the organization’s webhook subscriptions. Signing secrets are never returned. Requires the webhooks:manage or org:admin scope.
tmh webhook-subscriptions list [flags]
| HTTP | GET /organizations/{orgId}/webhook-subscriptions |
| Scopes | org:admin or webhooks:manage |
| Prints | A page of WebhookSubscription as JSON; --all follows every page and --ndjson prints one item per line |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
| Flag | Description |
|---|---|
--limit |
How many objects to return, between 1 and 100. Defaults to 20. |
--cursor |
The nextCursor from the previous page. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh webhook-subscriptions list \
| jq -r '.items[] | [.subscriptionId, .endpointUrl, .enabled] | @tsv'
All flags: tmh webhook-subscriptions list.
tmh webhook-subscriptions redriveRetry failed deliveries
Delivers the subscription’s failed events again. Requires the webhooks:manage or org:admin scope.
tmh webhook-subscriptions redrive <subscriptionId> [flags]
| HTTP | POST /organizations/{orgId}/webhook-subscriptions/{subscriptionId}:redrive |
| Scopes | org:admin or webhooks:manage |
| Prints | An Operation as JSON; --wait waits until it is done |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh webhook-subscriptions redrive whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \
--wait \
| jq .response
All flags: tmh webhook-subscriptions redrive.
tmh webhook-subscriptions retrieveRetrieve a webhook subscription
Retrieves a webhook subscription. Requires the webhooks:manage or org:admin scope.
tmh webhook-subscriptions retrieve <subscriptionId> [flags]
| HTTP | GET /organizations/{orgId}/webhook-subscriptions/{subscriptionId} |
| Scopes | org:admin or webhooks:manage |
| Prints | WebhookSubscription as JSON |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | None |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh webhook-subscriptions retrieve whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \
| jq -r '.eventTypes[]'
All flags: tmh webhook-subscriptions retrieve.
tmh webhook-subscriptions testSend a test event
Sends a signed test delivery to the subscription’s endpoint, so you can check your verifier. Requires the webhooks:manage or org:admin scope.
tmh webhook-subscriptions test <subscriptionId> [flags]
| HTTP | POST /organizations/{orgId}/webhook-subscriptions/{subscriptionId}:test |
| Scopes | org:admin or webhooks:manage |
| Prints | An Operation as JSON; --wait waits until it is done |
| Retries | Retried on connection errors, 409 conflict, 429 and 5xx (--max-retries) |
| Idempotency | tmh generates an Idempotency-Key and reuses it on retries; --idempotency-key sets your own |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
tmh webhook-subscriptions test whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \
--wait \
| jq .response
All flags: tmh webhook-subscriptions test.
tmh webhook-subscriptions updateUpdate a webhook subscription
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.
tmh webhook-subscriptions update <subscriptionId> [flags]
| HTTP | PATCH /organizations/{orgId}/webhook-subscriptions/{subscriptionId} |
| Scopes | org:admin or webhooks:manage |
| Prints | WebhookSubscription as JSON |
| Retries | Never retried |
| Idempotency | None |
| Conditional | --if-match <etag> is required |
| Flag | Description |
|---|---|
--endpoint-url |
The HTTPS URL to deliver events to. |
--event-types |
The event types to deliver; one of: enrollment.certified, seat.consumed, seat.freed, learner.invited, learner.started, learner.certified, learner.expiring, learner.expired, learner.removed, invite.bounced, certificate.revoked, seats.low |
--enabled |
Turn deliveries on or off. |
--description |
A description for your own reference. |
--seats-low-threshold |
Send seats.low when available seats drop to this number. |
Example:
# Runs as your sandbox profile (tmh login). Add --live for Live.
etag=$(tmh webhook-subscriptions retrieve whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \
--show-headers 2>&1 >/dev/null | sed -n 's/^< Etag: //p')
tmh webhook-subscriptions update whs_01JD8Q5R7S9T1V3W5X7Y9Z1A3B \
--enabled=false \
--if-match "$etag" \
| jq .enabled
All flags: tmh webhook-subscriptions update.