Général
Les routes sans famille : ta clé, le contrat, le catalogue.
GET /events
The coach's recorded events, to catch up after missed deliveries. Free.
The events of the key's coach, ascending id, as a delivery posts them. Free: no credit and no call row, but the per-key rate limits apply. The key lists the types its scopes can read: every type with webhooks:read, else the types of its family read scopes; none answers 403 SCOPE_MISSING naming webhooks:read, and a requested type outside them answers 403 SCOPE_MISSING naming its family's read scope. Events are recorded only while the coach has an enabled webhook, kept 30 days, and an event becomes visible here about three seconds after it is recorded. A ping is never listed.
- Gratuit
- Lecture
- Stable
Paramètres
| Nom | Type | Description |
|---|---|---|
sincequery | string | An event id (the events after it), or an ISO 8601 date with an offset (Z or ±hh:mm): the events that occurred at or after it. A date without an offset is refused. |
typesquery | string | A comma list of event types. Default: every type the key can read. |
cursorquery | string | next_cursor of the previous page: the last event id seen. |
limitquery | integer1–200, default 50 |
curl "https://api.fitdistance.io/api/partner/v1/events?limit=50" \
-H "Authorization: Bearer fd_live_xxxxxxxx"{
"data": [
{
"id": "string",
"type": "student.activated",
"api_version": "2026-10",
"occurred_at": "2026-10-24T09:12:00Z",
"coach_id": 4821,
"data": {}
}
],
"next_cursor": null,
"has_more": false
}{
"error": {
"name": "PARTNER_API",
"message": "SCOPE_MISSING"
}
}200 · une page de EventEnvelope
| Nom | Type | Description |
|---|---|---|
id requis | string | The event id (ULID): grows with time, the cursor of GET /events. Deduplicate on it. |
type requis | stringparmi : student.activated, student.requested, student.left, workout.started, workout.completed, program.assigned, program.completed, bilan.submitted, form.submitted, habit.logged, message.received, appointment.booked, appointment.cancelled, contract.ending_soon, contract.ended, student.inactive | The event type. A ping delivery carries ping with empty data; GET /events never lists it. |
api_version requis | stringparmi : 2026-10 | |
occurred_at requis | date-time | |
coach_id requis | integer | |
data requis | object | The event's data: see the « webhooks » tag for each type. |
Erreurs
| Statut | Code | Quand |
|---|---|---|
400 | VALIDATION | Paramètres ou corps invalides.non facturé |
401 | UNAUTHORIZED | Clé absente, inconnue ou révoquée.non facturé |
403 | SCOPE_MISSING | La clé n'a pas le périmètre demandé.non facturé |
403 | PLAN_NOT_ELIGIBLE | Ton offre n'ouvre pas l'API.non facturé |
429 | RATE_LIMITED | Trop d'appels : 10 par seconde, 300 par minute, 60 écritures et 20 suppressions par minute.non facturé |
GET /me
The key, its coach, plan and credits. Free.
- Gratuit
- Lecture
- Stable
curl "https://api.fitdistance.io/api/partner/v1/me" \
-H "Authorization: Bearer fd_live_xxxxxxxx"{
"coach": {
"id": 4821,
"first_name": "Camille",
"last_name": "Roux"
},
"tier": "maestro",
"state": "active",
"eligible": true,
"billing_mode": "enforce",
"key": {
"uid": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
"name": "string",
"prefix": "string",
"scopes": [
"string"
],
"created_at": "2026-10-24T09:12:00Z"
},
"credits": {
"plan_remaining": 4821,
"plan_included": 4821,
"plan_resets_at": "2026-10-24T09:12:00Z",
"bonus_remaining": 4821,
"lifetime_used": 4821
}
}{
"error": {
"name": "PARTNER_API",
"message": "SCOPE_MISSING"
}
}200 · Me
| Nom | Type | Description |
|---|---|---|
coach requis | object | |
tier requis | stringparmi : free, starter, maestro, elite | |
state requis | stringparmi : active, trialing, past_due, scheduled_cancellation, paused, expired, none | |
eligible requis | boolean | |
billing_mode requis | stringparmi : observe, enforce | observe: calls are journaled, nothing is refused nor debited. enforce: credits are debited and a zero balance answers 402. |
key requis | object | |
credits requis | object |
Erreurs
| Statut | Code | Quand |
|---|---|---|
401 | UNAUTHORIZED | Clé absente, inconnue ou révoquée.non facturé |
403 | SCOPE_MISSING | La clé n'a pas le périmètre demandé.non facturé |
403 | PLAN_NOT_ELIGIBLE | Ton offre n'ouvre pas l'API.non facturé |
429 | RATE_LIMITED | Trop d'appels : 10 par seconde, 300 par minute, 60 écritures et 20 suppressions par minute.non facturé |
GET /openapi.json
This document. Free, no key.
- Sans clé
- Gratuit
- Lecture
- Stable
curl "https://api.fitdistance.io/api/partner/v1/openapi.json"GET /operations
The operations a key can run. Free, no key.
- Sans clé
- Gratuit
- Lecture
- Stable
curl "https://api.fitdistance.io/api/partner/v1/operations"{
"data": [
{
"name": "string",
"tool": "string",
"title": "string",
"description": "string",
"family": "students",
"kind": "read",
"kind_by_action": {},
"scope": "string",
"sensitive": [
"string"
],
"exposed": true,
"stability": "raw",
"confirmable": true,
"input_schema": {},
"output_schema": null
}
],
"api_version": "string"
}Réponse
| Nom | Type | Description |
|---|---|---|
data requis | OperationManifest[] | |
api_version requis | string |