Website API reference
This is the API behind the Trainiq booking widget and the WordPress plugin. A training provider's own website, or the web agency building it, can use it to show the provider's courses, dates and free places, and to post bookings and requests straight into the provider's Trainiq.
https://{your-trainiq-domain}: ask the provider for theirs. And every call except the ping carries the provider's website key in the X-Api-Key header. The provider finds it in Trainiq under Instellingen > Connect (Settings > Connect), tab Widget. That key is public by nature (it sits in the website's JavaScript), so treat it as an identifier, not a password.
Try it against your own Trainiq
Fill in the provider's Trainiq address and website key, then use "Send" on any GET endpoint below. Your browser calls that address directly; nothing goes through trainiq.nl and nothing is stored. Only reading endpoints can be tried here: a try never makes a booking or a request.
Endpoints
How the API works
Read the course catalogue, dates and availability of one training provider (a Trainiq tenant) and post bookings and requests from that provider's own website.
Every tenant has its own Trainiq address; there is no shared host. All paths start with /api.
Version 1.0. Within v1, fields are only added, never renamed or removed. Ignore fields you do not know.
Authentication
Send the tenant's website key in the X-Api-Key header on every call except GET /api/ping.
The website key is the one the provider finds in Trainiq under Instellingen > Connect, tab Widget
("Widget voor andere websites", /admin/integrations), with a button to copy it. It is the UUID of an
integration.
How the key is checked, as the code does it:
- The header value must equal the UUID of an integration whose status is
active. Nothing else is checked. - The key is not bound to an origin, a domain, an IP address or a referrer. The
Originheader is never read. - There are no scopes: any active key may call every endpoint in this document, read and write.
- A missing, unknown or revoked key gives
401 {"error":"Unauthorized"}. - The key is only read from the header. A key in the query string is ignored (401).
- The key is public by nature: it sits in the website's JavaScript for every visitor to read. Treat it as an identifier, not as a secret. Anyone who has it can call this API as that website.
CORS
Every response under /api/ carries Access-Control-Allow-Origin: *,
Access-Control-Allow-Methods: GET, POST, OPTIONS and
Access-Control-Allow-Headers: Content-Type, X-Api-Key, X-Trainiq-Locale.
A preflight OPTIONS on any /api/ path answers 204 with the same headers and
Access-Control-Max-Age: 3600, without a key. Calls from a browser on any origin therefore work.
Only the three headers above are allowed in a cross-origin call; cookies are not used.
Language
Translated texts (error messages, message fields, the labels in /api/widget-config) come in the
tenant's main language. Ask for another language with ?locale=xx or the X-Trainiq-Locale header;
it is honoured only when the tenant has that language switched on, otherwise the main language is used.
Some error messages are fixed English strings (noted per endpoint).
Rate limits
Fixed windows, counted per client IP address as Trainiq sees it (the visitor's own address), and per e-mail address where one is posted (compared in lower case):
- The sign-ups:
POST /api/bookings,POST /api/courses/{slug}/student-request,POST /api/combis/{slug}/student-requestandPOST /api/programmes/{slug}/applyshare one pair of counters: 120 per hour per IP and 20 per hour per e-mail address. A refusal is429with aRetry-Afterheader (whole seconds until the window opens again) and is counted before the key and the fields are checked, so nothing is stored. POST .../price-request,POST .../incompany-request,POST /api/sessions/{id}/waitlist: these three share another pair, 10 per hour per IP and 3 per hour per e-mail address. Their429has noRetry-Afterheader.GET /api/discount-codes/check: 30 per 15 minutes per IP.- The other endpoints have no limit in the application.
A limit that is hit gives 429 with {"error": "..."} (translated text). No X-RateLimit-* headers are set.
Note for server-side callers: when your web server calls these endpoints for your visitors, all of
them count as one IP address. Calling from the visitor's browser, as the widget does, avoids that.
Spam checks: the honeypot
Warning. Some request forms treat certain posts as a bot and answer them with a quiet success: the normal success answer, but nothing is stored and nothing is mailed. Your integration cannot tell from the status code.
POST .../price-requestandPOST .../incompany-request: a non-empty field namedwebsite, or aform_loaded_at(Unix seconds, when the form was shown) less than 2 seconds before the post, gives200withrequest_id: null.POST /api/programmes/{slug}/apply: a non-emptywebsitegives200 {"success": true}withoutdossier_id.
So never send a field named website from a real form, and if you send form_loaded_at, send the real
moment the form was shown. A success without an id means the post was taken for a bot.
Conventions
- Request and response bodies are JSON. Send
Content-Type: application/jsonon a POST. - Money is a decimal string with two digits (
"75.00"), excluding VAT unless the name says otherwise. - Dates are
YYYY-MM-DD, times areHH:MM(24 hour, the tenant's local time, no time zone). - An error is
{"error": "<text>"}unless stated otherwise. - Many endpoints also exist under a Dutch path (noted per endpoint). Both give the same answer; use the English one.
- There is no version in the path and no version header. This document is version 1.0: within v1, fields are only added, never renamed or removed, so ignore fields you do not know.
Catalogue
Courses, combis, programmes and their texts.
List the courses
All courses that are not hidden from the catalogue, ordered by name. A hidden course is included only when you name its slug. Dutch alias: /api/cursussen.
Parameters
| Name | In | Description |
|---|---|---|
coursestring | query | Comma-separated course slugs. Adds these courses to the list even when they are hidden. It does not filter: all visible courses are still returned. Dutch alias: cursus. |
What you get
[
{
"id": 15,
"name": "EHBO Basis",
"slug": "ehbo-basis",
"category": "Veiligheid",
"price_excl_vat": "0.00",
"duration_minutes": 150,
"day_count": 1,
"max_participants": 12,
"certificate_validity_months": null,
"code95_hours": null,
"allow_preferred_date_request": false,
"price_on_request": false,
"is_elearning": false,
"elearning_session_id": null,
"delivery_mode": "physical",
"paid_on_invoice": false,
"excerpt": null,
"image_url": "https://example.trainiq.nl/media/course-images/15.webp?v=1795638612",
"featured": false,
"featured_order": null,
"options": []
}
]
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
curl
curl -s 'https://{your-trainiq-domain}/api/courses' \
-H 'X-Api-Key: {your-website-key}'
One course's description and facts
The course description as cleaned HTML and a list of facts (duration, Code 95 hours, certificate validity, the provider's own course fields). A course hidden from the catalogue still answers by its slug. No Dutch alias. The WordPress plugin fetches this on the server and caches it for an hour.
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Course slug. A slug that does not match the pattern matches no route (see the general note on 404). |
What you get
{
"slug": "bhv-basis",
"name": "BHV Basis",
"html": "<p>Voor medewerkers die bedrijfshulpverlener worden: brand, ontruimen en eerste hulp.</p>",
"facts": [
{
"label": "Duur",
"value": "3,5 uur"
}
]
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Course not found"
}
curl
curl -s 'https://{your-trainiq-domain}/api/courses/{slug}/text' \
-H 'X-Api-Key: {your-website-key}'
List the combis (course bundles)
Active combis, each with its courses, bundle price and recommended extra courses. Dutch alias /api/combicursussen.
What you get
[
{
"id": 2,
"slug": "pakket-bhv",
"name": "Pakket BHV: basis + ploegleider",
"description": null,
"total_price_excl_vat": "100.00",
"discounted_price_excl_vat": "85.00",
"savings_excl_vat": "15.00",
"total_duration_minutes": 300,
"courses": [
{
"id": 5,
"slug": "ploegleider-bhv",
"name": "Ploegleider BHV",
"price_excl_vat": "50.00",
"duration_minutes": 150,
"max_participants": 12,
"is_elearning": false,
"elearning_session_id": null,
"price_on_request": false,
"paid_on_invoice": false,
"proportional_price_excl_vat": "42.50",
"allow_preferred_date_request": false
}
],
"recommended_courses": [
{
"id": 7,
"slug": "reanimatie-aed",
"name": "Reanimatie en AED",
"price_excl_vat": "50.00",
"duration_minutes": 150,
"max_participants": 12,
"is_elearning": false,
"elearning_session_id": null,
"price_on_request": false,
"paid_on_invoice": true
}
]
}
]
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
curl
curl -s 'https://{your-trainiq-domain}/api/combi-courses' \
-H 'X-Api-Key: {your-website-key}'
List the public programmes (diploma tracks)
Programmes ("trajecten", "opleidingen") marked public that have a slug, ordered by name. Always an empty list for a tenant without the programmes module. No Dutch alias.
What you get
[
{
"name": "Example programme",
"slug": "example-programme",
"crebo": "25000",
"level": 4,
"leerweg": "BBL",
"duration_years": 3,
"public_description": null,
"price": "4500.00",
"price_on_request": false,
"installments": {
"count": 10,
"total": "4750.00"
},
"starts": [
{
"id": 3,
"date": "2027-02-01"
},
{
"id": 4,
"date": "2027-09-01",
"price": "4700.00",
"installments_total": "4950.00"
}
]
}
]
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
curl
curl -s 'https://{your-trainiq-domain}/api/programmes' \
-H 'X-Api-Key: {your-website-key}'
Availability
Dates and free places.
Upcoming dates with a free place, for all courses
Scheduled public sessions from today up to 365 days ahead that still have a free place, grouped by course slug, soonest first. A session given for several courses appears under each of them. Hidden courses and e-learning placeholder sessions are left out. Dutch alias: /api/sessies-overzicht. The widget still sends ?days=; it is ignored.
What you get
[], not {}.{
"bhv-basis": [
{
"id": 120,
"date": "2026-11-30",
"start_time": "08:00",
"end_time": "11:30",
"city": "Zwolle",
"is_incompany": false,
"available_slots": 10,
"max_participants": 16,
"availability": "available",
"is_multi_day": false,
"end_date": "2026-11-30",
"day_count": 1,
"days": [
{
"date": "2026-11-30",
"start_time": "08:00",
"end_time": "11:30"
}
]
}
]
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
curl
curl -s 'https://{your-trainiq-domain}/api/sessions-overview' \
-H 'X-Api-Key: {your-website-key}'
Dates of one course
Scheduled public sessions of one course at one of the provider's locations, soonest first. Two modes:
from=YYYY-MM-DD: every session from that date up to 365 days later.month=YYYY-MM(the default, current month): every session in that calendar month, past days included.
Full sessions are included (availability: full), so a waitlist can be offered. A course priced on
request returns no sessions and price_on_request: true. A course hidden from the catalogue still
answers. Dutch alias: /api/cursussen/{slug}/beschikbaarheid.
Each session's instructor is sent only when asked for with include=instructor.
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Course slug, as in /api/courses. |
includestring | query | Optional parts to add to the answer, as a comma-separated list. Known: instructor, which adds each session's instructor: the instructor's full name (first and last name), or the fixed Dutch text "Nog te bepalen" ("to be decided") when none is set. A part is left out unless it is asked for; a value the endpoint does not know is ignored. |
fromstring | query | Start date. When given, month is not used for the selection. Dutch alias vanaf. |
monthstring | query | Calendar month. Defaults to the current month. Dutch alias maand. Echoed back in month. |
location_idinteger | query | Only sessions at this location (an id from /api/locations). Dutch alias locatie_id. |
What you get
{
"course": {
"id": 1,
"name": "BHV Basis",
"slug": "bhv-basis",
"price_excl_vat": "75.00",
"duration_minutes": 210,
"delivery_mode": "physical",
"allow_preferred_date_request": false
},
"month": "2026-11",
"sessions": [
{
"id": 120,
"date": "2026-11-30",
"start_time": "08:00",
"end_time": "11:30",
"is_multi_day": false,
"end_date": "2026-11-30",
"day_count": 1,
"days": [
{
"date": "2026-11-30",
"start_time": "08:00",
"end_time": "11:30"
}
],
"location": {
"id": 3,
"name": "Zwolle",
"city": "Zwolle"
},
"available_slots": 10,
"max_participants": 16,
"occupancy_pct": 38,
"availability": "available"
}
]
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Course not found"
}
from is not a date.{
"error": "Invalid vanaf date"
}
curl
curl -s 'https://{your-trainiq-domain}/api/courses/{slug}/availability' \
-H 'X-Api-Key: {your-website-key}'
The provider's locations
All locations of the provider, ordered by city. Name and city only, no address. No Dutch alias.
What you get
[
{
"id": 4,
"name": "Breda",
"city": "Breda"
},
{
"id": 1,
"name": "Leslokaal Den Haag",
"city": "Den Haag"
}
]
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
curl
curl -s 'https://{your-trainiq-domain}/api/locations' \
-H 'X-Api-Key: {your-website-key}'
Dates on which a whole combi can be booked
The dates in one month on which every course of the combi has an open session with a free place, with the sessions per course. Dutch alias /api/combicursussen/{slug}/beschikbaarheid. Each session's instructor is sent only when asked for with include=instructor.
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Slug of an active combi. |
includestring | query | Optional parts to add to the answer, as a comma-separated list. Known: instructor, which adds each session's instructor: the instructor's full name (first and last name), or the fixed Dutch text "Nog te bepalen" ("to be decided") when none is set. A part is left out unless it is asked for; a value the endpoint does not know is ignored. |
monthstring | query | Calendar month, defaults to the current month. Dutch alias maand. |
What you get
{
"combi": {
"id": 2,
"slug": "pakket-bhv",
"name": "Pakket BHV"
},
"month": "2026-12",
"available_dates": [
{
"date": "2026-12-10",
"sessions_by_course": {
"5": [
{
"session_id": 201,
"course_id": 5,
"course_name": "Ploegleider BHV",
"start_time": "09:00",
"end_time": "11:30",
"city": "Utrecht",
"available_slots": 8
}
]
}
}
]
}
month is not YYYY-MM.{
"error": "Invalid month format"
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Combi course not found"
}
curl
curl -s 'https://{your-trainiq-domain}/api/combi-courses/{slug}/availability' \
-H 'X-Api-Key: {your-website-key}'
Booking
Booking, discount codes, waitlist and booking status.
Book one or more sessions for one person
Books a cart of sessions for one participant ("cursist") and returns how to pay. One call makes one
booking per session and, unless the total is zero, one invoice for the whole cart.
Dutch alias: /api/boekingen.
What happens after the call depends on provider in the answer:
- a payment provider name: send the visitor to
payment_url(the provider's checkout). manual: no online checkout.payment_urlis Trainiq's own invoice page; wheninvoice_mailedis true the invoice was mailed for a bank transfer.invoice: a course paid on invoice. The provider confirms first;payment_urlis empty.free: total is zero. Confirmed at once, no invoice,payment_urlis empty.
The participant is found by e-mail address or created. Prices, VAT and option prices are always set by the server; the request carries ids only.
Sign-up rate limit: 120 per hour per IP, 20 per hour per e-mail address, shared with the preferred-date requests and the programme application. There is no honeypot on this endpoint.
What you send
| Field | Description |
|---|---|
first_name requiredstring | Trimmed. |
last_name requiredstring | Trimmed. |
email requiredstring | Trimmed and lowercased. Must be valid and on a domain that can receive mail. Identifies the participant. |
phone requiredstring | Required, non-empty. |
company_namestring or null | |
date_of_birthstring or null | |
streetstring or null | The address is stored only when street is given. |
house_numberstring or null | |
house_number_suffixstring or null | |
postal_codestring or null | |
citystring or null | |
notestring | A note for the provider, stored on each booking. |
formstring | Key of the booking form the booking came through (the form.key from /api/widget-config). Leave out for the standard flow. |
employerobject | Read only when form names a form where the employer pays (form.payer is employer); ignored otherwise. All fields except house_number_suffix are then required. |
invoice_emailstring or null | Send the invoice of this booking to another address (at most 180 characters, valid, deliverable domain). Ignored when equal to email or when the employer pays. |
discount_codestring or null | Checked again by the server; a code that does not apply refuses the booking (422). |
items requiredarray of object or object |
Example request body
{
"first_name": "Firstname",
"last_name": "Lastname",
"email": "participant@example.com",
"phone": "0600000000",
"street": "Examplestreet",
"house_number": "1",
"postal_code": "1234 AB",
"city": "Utrecht",
"note": "",
"discount_code": null,
"items": [
{
"type": "course",
"session_id": 120,
"option_ids": []
},
{
"type": "combi",
"combi_slug": "example-combi",
"session_ids": [
45,
67
],
"addon_session_ids": [
89
]
}
]
}
What you get
{
"invoice_id": 310,
"invoice_number": null,
"invoice_token": "0123456789abcdef0123456789abcdef",
"amount_excl_vat": "75.00",
"vat_amount": "15.75",
"total_amount": "90.75",
"bookings": [
{
"id": 512,
"session_id": 120,
"course_name": "BHV Basis",
"date": "2026-11-30",
"qr_token": "abcdef0123456789",
"amount_excl_vat": "75.00",
"combi_slug": null
}
],
"payment_url": "https://checkout.example.com/pay/abc",
"provider": "mollie",
"free": false,
"invoice_mailed": false,
"booking_id": 512
}
Invalid JSON (also for an empty object), Missing required fields: first_name, last_name, email, phone,
Invalid email, At least one item is required, items[N]: unknown type '...',
items[N]: session_id is required, items[N]: session X appears more than once in the cart,
items[N]: session X is not bookable for course '...',
items[N]: combi_slug and session_ids are required,
items[N]: combi '...' needs exactly K sessions (one per course),
items[N]: session X does not belong to combi '...',
items[N]: combi '...' has duplicate session for the same course,
items[N]: add-on session X is not a recommended course for combi '...',
No valid booking specs resolved from items.
A translated text is returned when the e-mail domain cannot receive mail.{
"error": "Missing required fields: first_name, last_name, email, phone"
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "items[0]: session 120 not found"
}
items[N]: session X is full), or this e-mail address already has a booking for a session in the cart (translated text). In the second case, when the earlier booking is still unpaid, Trainiq mails the payment link again to that address; the response never contains it.{
"error": "You are already signed up for this session. Check your email for the confirmation."
}
invoice_email.{
"error": "This discount code doesn't apply to this course."
}
Retry-After. Counted before the key and the fields are checked.Header Retry-After: Whole seconds until the window opens again (rounded up, at most 3601).
{
"error": "Too many requests from this network. Please try again later."
}
curl
curl -s -X POST 'https://{your-trainiq-domain}/api/bookings' \
-H 'X-Api-Key: {your-website-key}' \
-H 'Content-Type: application/json' \
-d '{"first_name":"Firstname","last_name":"Lastname","email":"participant@example.com","phone":"0600000000","street":"Examplestreet","house_number":"1","postal_code":"1234 AB","city":"Utrecht","note":"","discount_code":null,"items":[{"type":"course","session_id":120,"option_ids":[]},{"type":"combi","combi_slug":"example-combi","session_ids":[45,67],"addon_session_ids":[89]}]}'
Status of one booking
Looks a booking up by its qr_token (from the booking response) and returns its status, for a "thank you" page after payment. Returns no personal details. No Dutch alias.
Parameters
| Name | In | Description |
|---|---|---|
token requiredstring | path | The booking's qr_token. |
What you get
{
"booking_id": 512,
"token": "abcdef0123456789",
"status": "paid",
"course": "BHV Basis",
"date": "2026-11-30",
"location": "Zwolle",
"amount": "90.75",
"paid_at": "2026-11-20T14:03:11+01:00"
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Booking not found"
}
curl
curl -s 'https://{your-trainiq-domain}/api/bookings/{token}/status' \
-H 'X-Api-Key: {your-website-key}'
Check a discount code for one course
Tells what a typed code does for one course, before booking. The booking checks the code again. Limited to 30 calls per 15 minutes per IP address. Codes never apply to a combi or to a course priced on request. No Dutch alias.
Parameters
| Name | In | Description |
|---|---|---|
code requiredstring | query | The code as typed. Leading and trailing spaces are removed. |
course requiredinteger | query | Course id (the id from /api/courses), not the slug. |
combiboolean | query | True when the course is being booked as part of a combi. |
localestring | query | Language code for translated texts (for example en). Used only when the tenant has that language on. |
X-Trainiq-Localestring | header | Same as ?locale=; the query parameter wins when both are sent. |
What you get
{
"applies": false,
"message": "Deze kortingscode bestaat niet of is niet meer geldig."
}
code is empty or course is not a positive number.{
"error": "code and course are required"
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Too many requests"
}
curl
curl -s 'https://{your-trainiq-domain}/api/discount-codes/check?code=&course=' \
-H 'X-Api-Key: {your-website-key}'
Join the waitlist of a full session
Puts a person on the waitlist of a full session and mails them a confirmation. Only for tenants with the waitlist switched on (waitlist: true in /api/widget-config), and only for a scheduled, public session today or later. Shares its rate limit with the request forms (10 per hour per IP, 3 per hour per e-mail address). No Dutch alias.
Parameters
| Name | In | Description |
|---|---|---|
id requiredinteger | path | Session id. |
What you send
| Field | Description |
|---|---|
first_name requiredstring | Stored up to 100 characters. |
last_name requiredstring | Stored up to 100 characters. |
email requiredstring | Lowercased. Must be valid and on a domain that can receive mail. |
phonestring | Optional. Stored up to 30 characters. |
course_slugstring | The course the visitor chose the date under, for a session given for several courses. Without it the session's own course is used. |
Example request body
{
"first_name": "Firstname",
"last_name": "Lastname",
"email": "participant@example.com",
"phone": "0600000000"
}
What you get
{
"success": true,
"already": true
}
{
"success": true,
"already": false
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
course_slug is not a course of this session.{
"error": "Not found"
}
{
"error": "Too many requests from this network. Please try again later."
}
curl
curl -s -X POST 'https://{your-trainiq-domain}/api/sessions/{id}/waitlist' \
-H 'X-Api-Key: {your-website-key}' \
-H 'Content-Type: application/json' \
-d '{"first_name":"Firstname","last_name":"Lastname","email":"participant@example.com","phone":"0600000000"}'
Requests
Forms that end in a request for the provider, not in a booking.
Apply for a programme
Creates an application ("aanmelding") for a public programme and mails the applicant and the provider. Field errors come back translated and keyed by field name. No Dutch alias. Sign-up rate limit: 120 per hour per IP, 20 per hour per e-mail address, shared with the booking and the preferred-date requests. Honeypot: a non-empty website gets a quiet {"success": true} and nothing is stored (see the introduction).
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Programme slug from /api/programmes. |
What you send
| Field | Description |
|---|---|
first_name requiredstring | |
last_name requiredstring | |
email requiredstring | |
phonestring | |
dobstring | Date of birth. Optional, but must be a real date when sent: YYYY-MM-DD, DD-MM-YYYY, D/M/YYYY or DD.MM.YYYY style. |
start_idinteger or string | Id of one of the programme's starts. Required when the programme has any. |
startstring | Preferred start date (same formats as dob). Required when the programme has no starts. |
prior requiredstring | Whether the applicant has prior education ("ja" = yes, "nee" = no). |
prior_whichstring | Which prior education. Required when prior is "ja". |
notestring | |
paymentstring | "ineens" = at once, "termijnen" = in instalments. Required only when the programme has a price and offers instalments (installments is not null). |
termsboolean or string | Must be true (or "1") when the school has terms (terms_url in /api/widget-config is not null). |
websitestring | Honeypot. Leave it out or empty; a filled value is treated as a bot. |
Example request body
{
"first_name": "Firstname",
"last_name": "Lastname",
"email": "applicant@example.com",
"phone": "0600000000",
"dob": "2000-01-31",
"start_id": 3,
"prior": "nee",
"payment": "ineens",
"terms": true
}
What you get
website) also gets {"success": true}, without dossier_id, and nothing is stored.{
"success": true,
"dossier_id": 41,
"first_name": "Firstname"
}
{
"error": "Invalid JSON body"
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Programme not found"
}
{
"success": false,
"errors": {
"email": "<translated message>",
"prior": "<translated message>"
}
}
Retry-After. Counted before the key and the fields are checked.Header Retry-After: Whole seconds until the window opens again (rounded up, at most 3601).
{
"error": "Too many requests from this network. Please try again later."
}
curl
curl -s -X POST 'https://{your-trainiq-domain}/api/programmes/{slug}/apply' \
-H 'X-Api-Key: {your-website-key}' \
-H 'Content-Type: application/json' \
-d '{"first_name":"Firstname","last_name":"Lastname","email":"applicant@example.com","phone":"0600000000","dob":"2000-01-31","start_id":3,"prior":"nee","payment":"ineens","terms":true}'
Ask for a price (course priced on request)
For a course with price_on_request: true. Stores a price request and mails the visitor and the provider. Rate limit, shared with incompany request and waitlist: 10 per hour per IP, 3 per hour per e-mail address. Dutch alias /api/cursussen/{slug}/prijs-aanvraag.
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Course slug, as in /api/courses. |
What you send
| Field | Description |
|---|---|
websitestring | Honeypot. Leave it out or empty; a filled value gets a fake success and nothing is stored. |
form_loaded_atinteger or string | Optional Unix timestamp (seconds) of when the form was shown. A submit within 2 seconds of it is treated as a bot. Leaving it out is accepted. Older name formLoadedAt. |
first_name requiredstring | |
last_name requiredstring | |
email requiredstring | Lowercased; must be a valid address. |
phonestring | |
company_namestring | |
number_of_people requiredinteger | |
preferred_datestring | Optional. Anything that is not YYYY-MM-DD is silently dropped. |
messagestring | |
streetstring | Optional address, stored on the participant's record. |
house_numberstring | |
postal_codestring | |
citystring |
Example request body
{
"first_name": "Firstname",
"last_name": "Lastname",
"email": "contact@example.com",
"phone": "0600000000",
"company_name": "Example B.V.",
"number_of_people": 8,
"preferred_date": "2027-01-15",
"message": "We would like a morning session."
}
What you get
website and form_loaded_at) gets the same answer with request_id: null and nothing is stored.{
"success": true,
"request_id": 17,
"message": "Request received — we'll get in touch within 1 business day."
}
Invalid JSON body), the course has a fixed price, first or last name is missing, the e-mail address is invalid, or number_of_people is below 1 (translated texts).{
"error": "First and last name are required."
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Course not found"
}
{
"error": "Too many requests from this network. Please try again later."
}
curl
curl -s -X POST 'https://{your-trainiq-domain}/api/courses/{slug}/price-request' \
-H 'X-Api-Key: {your-website-key}' \
-H 'Content-Type: application/json' \
-d '{"first_name":"Firstname","last_name":"Lastname","email":"contact@example.com","phone":"0600000000","company_name":"Example B.V.","number_of_people":8,"preferred_date":"2027-01-15","message":"We would like a morning session."}'
Ask for a session for a company
A company asks for its own session of a course, at its own site or at one of the provider's locations. Stores a company request, finds or creates the company (by contact e-mail or KvK number) and mails both sides. Rate limit, shared with price request and waitlist: 10 per hour per IP, 3 per hour per e-mail address. Dutch alias /api/cursussen/{slug}/incompany-aanvraag.
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Course slug, as in /api/courses. |
What you send
| Field | Description |
|---|---|
websitestring | Honeypot. Leave it out or empty; a filled value gets a fake success and nothing is stored. |
form_loaded_atinteger or string | Optional Unix timestamp (seconds) of when the form was shown. A submit within 2 seconds of it is treated as a bot. Leaving it out is accepted. Older name formLoadedAt. |
company_name requiredstring | |
contact_name requiredstring | |
email requiredstring | Contact address; lowercased, must be valid. |
phone requiredstring | |
kvk_numberstring | Dutch Chamber of Commerce number. Used to find an existing company. |
number_of_peopleinteger | Used only when employees is empty or absent. |
preferred_date requiredstring | Required, YYYY-MM-DD. |
location_idinteger or null | One of the provider's locations (/api/locations). Null, absent or unknown means at the company's own site. |
employeesarray of object | The participants. Every row must be complete and valid or the whole request is refused (400). Every row needs its own e-mail address: two rows with the same address also refuse the whole request (400), so remove duplicates before you post. |
streetstring | Company address, optional. |
house_numberstring | |
postal_codestring | |
citystring | |
messagestring | |
referencestring | The company's own reference or PO number; the first 100 characters are kept. |
Example request body
{
"company_name": "Example B.V.",
"contact_name": "Firstname Lastname",
"email": "contact@example.com",
"phone": "0600000000",
"preferred_date": "2027-01-15",
"location_id": null,
"employees": [
{
"first_name": "Firstname",
"last_name": "Lastname",
"email": "employee1@example.com"
}
],
"message": ""
}
What you get
request_id: null.{
"success": true,
"request_id": 23,
"message": "Request received — we'll get in touch within 1 business day."
}
Invalid JSON body), or a field was refused (translated text): company name, contact name, a valid e-mail and phone are required; at least one participant; every row in employees must be complete and have its own e-mail address (a duplicate address refuses the request); preferred_date is required and must be a date.X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Course not found"
}
{
"error": "Too many requests from this network. Please try again later."
}
curl
curl -s -X POST 'https://{your-trainiq-domain}/api/courses/{slug}/incompany-request' \
-H 'X-Api-Key: {your-website-key}' \
-H 'Content-Type: application/json' \
-d '{"company_name":"Example B.V.","contact_name":"Firstname Lastname","email":"contact@example.com","phone":"0600000000","preferred_date":"2027-01-15","location_id":null,"employees":[{"first_name":"Firstname","last_name":"Lastname","email":"employee1@example.com"}],"message":""}'
Ask for a preferred date (one course)
For a course with allow_preferred_date_request: true. A visitor asks for a date on which no session is planned yet. Stores the request at the course price, finds or creates the participant by e-mail and mails both sides. No payment is started by this call. Dutch alias /api/cursussen/{slug}/student-request. Sign-up rate limit: 120 per hour per IP, 20 per hour per e-mail address, shared with the booking, the combi request and the programme application. No honeypot.
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Course slug, as in /api/courses. |
What you send
| Field | Description |
|---|---|
first_name requiredstring | |
last_name requiredstring | |
email requiredstring | Lowercased. Identifies the participant. |
phone requiredstring | |
company_namestring | |
street requiredstring | |
house_number requiredstring | |
postal_code requiredstring | |
city requiredstring | |
preferred_date requiredstring | Today or later. |
notesstring |
Example request body
{
"first_name": "Firstname",
"last_name": "Lastname",
"email": "participant@example.com",
"phone": "0600000000",
"street": "Examplestreet",
"house_number": "1",
"postal_code": "1234 AB",
"city": "Utrecht",
"preferred_date": "2027-01-15"
}
What you get
{
"success": true,
"request_id": 9,
"message": "Request received — we'll get in touch within 1 business day to schedule the session."
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "Preferred-date requests are disabled for this course"
}
{
"error": "Course not found"
}
email is not a valid e-mail address, the address is incomplete, preferred_date is no date or is in the past. Also when the course is priced on request. A body that is not JSON is read as empty and ends here too.{
"error": "Fill in a valid email address."
}
Retry-After. Counted before the key and the fields are checked.Header Retry-After: Whole seconds until the window opens again (rounded up, at most 3601).
{
"error": "Too many requests from this network. Please try again later."
}
curl
curl -s -X POST 'https://{your-trainiq-domain}/api/courses/{slug}/student-request' \
-H 'X-Api-Key: {your-website-key}' \
-H 'Content-Type: application/json' \
-d '{"first_name":"Firstname","last_name":"Lastname","email":"participant@example.com","phone":"0600000000","street":"Examplestreet","house_number":"1","postal_code":"1234 AB","city":"Utrecht","preferred_date":"2027-01-15"}'
Ask for a preferred date (a combi)
The same request for a whole combi: one request per course of the combi is stored, all with the same date. The provider plans and invoices it by hand afterwards. Note the path: /api/combis/..., not /api/combi-courses/.... No Dutch alias. Sign-up rate limit: 120 per hour per IP, 20 per hour per e-mail address, shared with the booking, the course request and the programme application. No honeypot.
Parameters
| Name | In | Description |
|---|---|---|
slug requiredstring | path | Slug of an active combi. |
What you send
| Field | Description |
|---|---|
first_name requiredstring | |
last_name requiredstring | |
email requiredstring | Lowercased. Identifies the participant. |
phone requiredstring | |
company_namestring | |
street requiredstring | |
house_number requiredstring | |
postal_code requiredstring | |
city requiredstring | |
preferred_date requiredstring | Today or later. |
notesstring |
What you get
{
"success": true,
"message": "<translated confirmation>",
"requests": 2
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
{
"error": "No course in this combi accepts preferred-date requests"
}
{
"error": "Combi not found"
}
Combi has no member courses, fixed English text), or a course of the combi is priced on request.Retry-After. Counted before the key and the fields are checked.Header Retry-After: Whole seconds until the window opens again (rounded up, at most 3601).
{
"error": "Too many requests from this network. Please try again later."
}
curl
curl -s -X POST 'https://{your-trainiq-domain}/api/combis/{slug}/student-request' \
-H 'X-Api-Key: {your-website-key}'
Setup
Ping and widget configuration.
Check that an address is a Trainiq
Public, no key needed. Tells whether the address is a Trainiq, the tenant's name and its main language.
What you get
{
"platform": "trainiq",
"name": "Example Training Company",
"version": "1.0",
"locale": "nl"
}
curl
curl -s 'https://{your-trainiq-domain}/api/ping'
Branding and settings for an embed
Brand colour, name, currency, language, the texts of Trainiq's own booking flow and the booking form a page asked for. Call it once when your block starts.
Parameters
| Name | In | Description |
|---|---|---|
formstring | query | Key of one of the tenant's booking forms. An unknown or missing key falls back to the tenant's standard form. |
localestring | query | Language code for translated texts (for example en). Used only when the tenant has that language on. |
X-Trainiq-Localestring | header | Same as ?locale=; the query parameter wins when both are sent. |
What you get
{
"labels": {
"add": "Add to your booking",
"add_another": "Add another course"
},
"labels_locale": "nl",
"form": null,
"discount_codes": false,
"pays_online": false,
"primary_color": "#0d697c",
"brand_name": "Example Training Company",
"currency_symbol": "€",
"currency": "EUR",
"locale": "nl",
"waitlist": true,
"booking_page": "https://example.trainiq.nl/book",
"terms_url": null
}
X-Api-Key header is missing or is not the key of an active integration.{
"error": "Unauthorized"
}
curl
curl -s 'https://{your-trainiq-domain}/api/widget-config' \
-H 'X-Api-Key: {your-website-key}'
Questions about the API, or something that does not work as written here? Mail info@trainiq.nl.