Website API reference

Version 1.0 · 19 endpoints · OpenAPI 3.1 file (openapi.yaml)

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.

Two things to know first. Every provider has its own Trainiq address, so every example below starts with 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 Origin header 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-request and POST /api/programmes/{slug}/apply share one pair of counters: 120 per hour per IP and 20 per hour per e-mail address. A refusal is 429 with a Retry-After header (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. Their 429 has no Retry-After header.
  • 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-request and POST .../incompany-request: a non-empty field named website, or a form_loaded_at (Unix seconds, when the form was shown) less than 2 seconds before the post, gives 200 with request_id: null.
  • POST /api/programmes/{slug}/apply: a non-empty website gives 200 {"success": true} without dossier_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/json on 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 are HH: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.

GET /api/courses

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

NameInDescription
course
string
queryComma-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

200The courses.
[
  {
    "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": []
  }
]
401The 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}'

Try it

GET /api/courses/{slug}/text

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

NameInDescription
slug required
string
pathCourse slug. A slug that does not match the pattern matches no route (see the general note on 404).

What you get

200The text.
{
  "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"
    }
  ]
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404No course with this slug.
{
  "error": "Course not found"
}

curl

curl -s 'https://{your-trainiq-domain}/api/courses/{slug}/text' \
  -H 'X-Api-Key: {your-website-key}'

Try it

GET /api/combi-courses

List the combis (course bundles)

Active combis, each with its courses, bundle price and recommended extra courses. Dutch alias /api/combicursussen.

What you get

200The combis.
[
  {
    "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
      }
    ]
  }
]
401The 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}'

Try it

GET /api/programmes

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

200The programmes.
[
  {
    "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"
      }
    ]
  }
]
401The 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}'

Try it

Availability

Dates and free places.

GET /api/sessions-overview

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

200An object keyed by course slug. An empty result is an empty JSON array [], 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"
        }
      ]
    }
  ]
}
401The 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}'

Try it

GET /api/courses/{slug}/availability

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

NameInDescription
slug required
string
pathCourse slug, as in /api/courses.
include
string
queryOptional 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.
from
string
queryStart date. When given, month is not used for the selection. Dutch alias vanaf.
month
string
queryCalendar month. Defaults to the current month. Dutch alias maand. Echoed back in month.
location_id
integer
queryOnly sessions at this location (an id from /api/locations). Dutch alias locatie_id.

What you get

200The course and its sessions.
{
  "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"
    }
  ]
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404No course with this slug.
{
  "error": "Course not found"
}
422from 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}'

Try it

GET /api/locations

The provider's locations

All locations of the provider, ordered by city. Name and city only, no address. No Dutch alias.

What you get

200The locations.
[
  {
    "id": 4,
    "name": "Breda",
    "city": "Breda"
  },
  {
    "id": 1,
    "name": "Leslokaal Den Haag",
    "city": "Den Haag"
  }
]
401The 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}'

Try it

GET /api/combi-courses/{slug}/availability

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

NameInDescription
slug required
string
pathSlug of an active combi.
include
string
queryOptional 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.
month
string
queryCalendar month, defaults to the current month. Dutch alias maand.

What you get

200The combi and its bookable dates.
{
  "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
          }
        ]
      }
    }
  ]
}
400month is not YYYY-MM.
{
  "error": "Invalid month format"
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404No active combi with this slug.
{
  "error": "Combi course not found"
}

curl

curl -s 'https://{your-trainiq-domain}/api/combi-courses/{slug}/availability' \
  -H 'X-Api-Key: {your-website-key}'

Try it

Booking

Booking, discount codes, waitlist and booking status.

POST /api/bookings

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_url is Trainiq's own invoice page; when invoice_mailed is true the invoice was mailed for a bank transfer.
  • invoice: a course paid on invoice. The provider confirms first; payment_url is empty.
  • free: total is zero. Confirmed at once, no invoice, payment_url is 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

FieldDescription
first_name required
string
Trimmed.
last_name required
string
Trimmed.
email required
string
Trimmed and lowercased. Must be valid and on a domain that can receive mail. Identifies the participant.
phone required
string
Required, non-empty.
company_name
string or null
date_of_birth
string or null
street
string or null
The address is stored only when street is given.
house_number
string or null
house_number_suffix
string or null
postal_code
string or null
city
string or null
note
string
A note for the provider, stored on each booking.
form
string
Key of the booking form the booking came through (the form.key from /api/widget-config). Leave out for the standard flow.
employer
object
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_email
string 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_code
string or null
Checked again by the server; a code that does not apply refuses the booking (422).
items required
array 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

201The bookings were made.
{
  "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
}
400The request is incomplete or inconsistent. Fixed English texts, among them: 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"
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404A session, course or combi in an item does not exist. A session that is not open for public booking (reserved for a company, at the customer's site, cancelled, in the past) answers the same way.
{
  "error": "items[0]: session 120 not found"
}
409A session is full (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."
}
422Refused by a business rule, with a translated text: a course priced on request, a discount code that does not apply, an invalid course option, an incomplete employer block (for a form where the employer pays), or an invalid invoice_email.
{
  "error": "This discount code doesn't apply to this course."
}
429A sign-up limit was hit: 120 per hour per IP, or 20 per hour per e-mail address, shared by the booking, the two preferred-date requests and the programme application. Nothing was stored. Try again after the number of seconds in 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]}]}'
GET /api/bookings/{token}/status

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

NameInDescription
token required
string
pathThe booking's qr_token.

What you get

200The booking.
{
  "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"
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404No booking with this token.
{
  "error": "Booking not found"
}

curl

curl -s 'https://{your-trainiq-domain}/api/bookings/{token}/status' \
  -H 'X-Api-Key: {your-website-key}'

Try it

GET /api/discount-codes/check

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

NameInDescription
code required
string
queryThe code as typed. Leading and trailing spaces are removed.
course required
integer
queryCourse id (the id from /api/courses), not the slug.
combi
boolean
queryTrue when the course is being booked as part of a combi.
locale
string
queryLanguage code for translated texts (for example en). Used only when the tenant has that language on.
X-Trainiq-Locale
string
headerSame as ?locale=; the query parameter wins when both are sent.

What you get

200Whether the code applies. A code that does not apply is also a 200.
{
  "applies": false,
  "message": "Deze kortingscode bestaat niet of is niet meer geldig."
}
400code is empty or course is not a positive number.
{
  "error": "code and course are required"
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
429More than 30 checks in 15 minutes from this IP address.
{
  "error": "Too many requests"
}

curl

curl -s 'https://{your-trainiq-domain}/api/discount-codes/check?code=&course=' \
  -H 'X-Api-Key: {your-website-key}'

Try it

POST /api/sessions/{id}/waitlist

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

NameInDescription
id required
integer
pathSession id.

What you send

FieldDescription
first_name required
string
Stored up to 100 characters.
last_name required
string
Stored up to 100 characters.
email required
string
Lowercased. Must be valid and on a domain that can receive mail.
phone
string
Optional. Stored up to 30 characters.
course_slug
string
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

200This address was already on this session's waitlist. Nothing new is stored or mailed.
{
  "success": true,
  "already": true
}
201Added to the waitlist.
{
  "success": true,
  "already": false
}
400First name, last name or e-mail is missing, or the e-mail address is invalid (translated text).
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404The waitlist is switched off, the session does not exist or has no public waitlist, or course_slug is not a course of this session.
{
  "error": "Not found"
}
409The session has a free place; book it instead (translated text).
429Rate limit hit (translated text).
{
  "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.

POST /api/programmes/{slug}/apply

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

NameInDescription
slug required
string
pathProgramme slug from /api/programmes.

What you send

FieldDescription
first_name required
string
last_name required
string
email required
string
phone
string
dob
string
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_id
integer or string
Id of one of the programme's starts. Required when the programme has any.
start
string
Preferred start date (same formats as dob). Required when the programme has no starts.
prior required
string
Whether the applicant has prior education ("ja" = yes, "nee" = no).
prior_which
string
Which prior education. Required when prior is "ja".
note
string
payment
string
"ineens" = at once, "termijnen" = in instalments. Required only when the programme has a price and offers instalments (installments is not null).
terms
boolean or string
Must be true (or "1") when the school has terms (terms_url in /api/widget-config is not null).
website
string
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

200The application was stored. A filled honeypot (website) also gets {"success": true}, without dossier_id, and nothing is stored.
{
  "success": true,
  "dossier_id": 41,
  "first_name": "Firstname"
}
400The body is not a JSON object.
{
  "error": "Invalid JSON body"
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404No public programme with this slug, or the tenant has no programmes module.
{
  "error": "Programme not found"
}
422One or more fields were refused.
{
  "success": false,
  "errors": {
    "email": "<translated message>",
    "prior": "<translated message>"
  }
}
429A sign-up limit was hit: 120 per hour per IP, or 20 per hour per e-mail address, shared by the booking, the two preferred-date requests and the programme application. Nothing was stored. Try again after the number of seconds in 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}'
POST /api/courses/{slug}/price-request

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

NameInDescription
slug required
string
pathCourse slug, as in /api/courses.

What you send

FieldDescription
website
string
Honeypot. Leave it out or empty; a filled value gets a fake success and nothing is stored.
form_loaded_at
integer 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 required
string
last_name required
string
email required
string
Lowercased; must be a valid address.
phone
string
company_name
string
number_of_people required
integer
preferred_date
string
Optional. Anything that is not YYYY-MM-DD is silently dropped.
message
string
street
string
Optional address, stored on the participant's record.
house_number
string
postal_code
string
city
string

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

200Stored. A submission that looks like a bot (see 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."
}
400The body is not a JSON object (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."
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404No course with this slug.
{
  "error": "Course not found"
}
429Rate limit hit (translated text).
{
  "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."}'
POST /api/courses/{slug}/incompany-request

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

NameInDescription
slug required
string
pathCourse slug, as in /api/courses.

What you send

FieldDescription
website
string
Honeypot. Leave it out or empty; a filled value gets a fake success and nothing is stored.
form_loaded_at
integer 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 required
string
contact_name required
string
email required
string
Contact address; lowercased, must be valid.
phone required
string
kvk_number
string
Dutch Chamber of Commerce number. Used to find an existing company.
number_of_people
integer
Used only when employees is empty or absent.
preferred_date required
string
Required, YYYY-MM-DD.
location_id
integer or null
One of the provider's locations (/api/locations). Null, absent or unknown means at the company's own site.
employees
array 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.
street
string
Company address, optional.
house_number
string
postal_code
string
city
string
message
string
reference
string
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

200Stored. A submission that looks like a bot gets the same answer with request_id: null.
{
  "success": true,
  "request_id": 23,
  "message": "Request received — we'll get in touch within 1 business day."
}
400The body is not a JSON object (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.
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
404No course with this slug.
{
  "error": "Course not found"
}
429Rate limit hit (translated text).
{
  "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":""}'
POST /api/courses/{slug}/student-request

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

NameInDescription
slug required
string
pathCourse slug, as in /api/courses.

What you send

FieldDescription
first_name required
string
last_name required
string
email required
string
Lowercased. Identifies the participant.
phone required
string
company_name
string
street required
string
house_number required
string
postal_code required
string
city required
string
preferred_date required
string
Today or later.
notes
string

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

201Stored.
{
  "success": true,
  "request_id": 9,
  "message": "Request received — we'll get in touch within 1 business day to schedule the session."
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
403The course does not take preferred-date requests.
{
  "error": "Preferred-date requests are disabled for this course"
}
404No course with this slug.
{
  "error": "Course not found"
}
422A field was refused (translated texts): a required field is missing (first name, last name, e-mail, phone, date), 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."
}
429A sign-up limit was hit: 120 per hour per IP, or 20 per hour per e-mail address, shared by the booking, the two preferred-date requests and the programme application. Nothing was stored. Try again after the number of seconds in 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"}'
POST /api/combis/{slug}/student-request

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

NameInDescription
slug required
string
pathSlug of an active combi.

What you send

FieldDescription
first_name required
string
last_name required
string
email required
string
Lowercased. Identifies the participant.
phone required
string
company_name
string
street required
string
house_number required
string
postal_code required
string
city required
string
preferred_date required
string
Today or later.
notes
string

What you get

201Stored.
{
  "success": true,
  "message": "<translated confirmation>",
  "requests": 2
}
401The X-Api-Key header is missing or is not the key of an active integration.
{
  "error": "Unauthorized"
}
403No course in the combi takes preferred-date requests.
{
  "error": "No course in this combi accepts preferred-date requests"
}
404No active combi with this slug.
{
  "error": "Combi not found"
}
422The same field checks as the single-course request (translated texts), the combi has no courses (Combi has no member courses, fixed English text), or a course of the combi is priced on request.
429A sign-up limit was hit: 120 per hour per IP, or 20 per hour per e-mail address, shared by the booking, the two preferred-date requests and the programme application. Nothing was stored. Try again after the number of seconds in 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.

GET /api/pingno key needed

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

200The tenant.
{
  "platform": "trainiq",
  "name": "Example Training Company",
  "version": "1.0",
  "locale": "nl"
}

curl

curl -s 'https://{your-trainiq-domain}/api/ping'

Try it

GET /api/widget-config

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

NameInDescription
form
string
queryKey of one of the tenant's booking forms. An unknown or missing key falls back to the tenant's standard form.
locale
string
queryLanguage code for translated texts (for example en). Used only when the tenant has that language on.
X-Trainiq-Locale
string
headerSame as ?locale=; the query parameter wins when both are sent.

What you get

200The configuration.
{
  "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
}
401The 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}'

Try it

Questions about the API, or something that does not work as written here? Mail info@trainiq.nl.