Facebook Pixel
Fit'DistanceDocumentation
Ouvrir l'app

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

NomTypeDescription
sincequerystringAn 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.
typesquerystringA comma list of event types. Default: every type the key can read.
cursorquerystringnext_cursor of the previous page: the last event id seen.
limitqueryinteger1–200, default 50
curl "https://api.fitdistance.io/api/partner/v1/events?limit=50" \
  -H "Authorization: Bearer fd_live_xxxxxxxx"
200 · une page de EventEnvelope
{
  "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
}
403 · SCOPE_MISSING
{
  "error": {
    "name": "PARTNER_API",
    "message": "SCOPE_MISSING"
  }
}

200 · une page de EventEnvelope

NomTypeDescription
id requisstringThe event id (ULID): grows with time, the cursor of GET /events. Deduplicate on it.
type requisstringparmi : 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.inactiveThe event type. A ping delivery carries ping with empty data; GET /events never lists it.
api_version requisstringparmi : 2026-10
occurred_at requisdate-time
coach_id requisinteger
data requisobjectThe event's data: see the « webhooks » tag for each type.

Erreurs

StatutCodeQuand
400VALIDATIONParamètres ou corps invalides.non facturé
401UNAUTHORIZEDClé absente, inconnue ou révoquée.non facturé
403SCOPE_MISSINGLa clé n'a pas le périmètre demandé.non facturé
403PLAN_NOT_ELIGIBLETon offre n'ouvre pas l'API.non facturé
429RATE_LIMITEDTrop 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"
200 · Me
{
  "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
  }
}
403 · SCOPE_MISSING
{
  "error": {
    "name": "PARTNER_API",
    "message": "SCOPE_MISSING"
  }
}

200 · Me

NomTypeDescription
coach requisobject
tier requisstringparmi : free, starter, maestro, elite
state requisstringparmi : active, trialing, past_due, scheduled_cancellation, paused, expired, none
eligible requisboolean
billing_mode requisstringparmi : observe, enforceobserve: calls are journaled, nothing is refused nor debited. enforce: credits are debited and a zero balance answers 402.
key requisobject
credits requisobject

Erreurs

StatutCodeQuand
401UNAUTHORIZEDClé absente, inconnue ou révoquée.non facturé
403SCOPE_MISSINGLa clé n'a pas le périmètre demandé.non facturé
403PLAN_NOT_ELIGIBLETon offre n'ouvre pas l'API.non facturé
429RATE_LIMITEDTrop 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"
Réponse
{
  "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

NomTypeDescription
data requisOperationManifest[]
api_version requisstring