> ## Documentation Index
> Fetch the complete documentation index at: https://docs.classquill.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refresh Isochrones

> (Re)compute the org's in-person tutors' drive-time isochrones from Mapbox, caching
them for the accurate coverage overlay + the gate's ST_Contains leg.

Skips serves_all_areas / online tutors (no bounded reach to model) and any tutor
whose home coordinate has not moved since its cached isochrone (the skip-guard), so
repeat calls cost nothing. When MAPBOX_TOKEN is unset, `enabled` is false and nothing
is computed — the map keeps using the max_travel_km radius circle. Intended for a
cron / Hermes trigger; bounded by MAPBOX_ISOCHRONE_MAX_PER_REFRESH per call.



## OpenAPI

````yaml /openapi.json post /v1/coverage/isochrones/refresh
openapi: 3.1.0
info:
  title: ClassQuill Public API
  description: >-
    REST API for ClassQuill tutoring organisations. Pipe your sessions,
    invoices, payments, tutor earnings, students, and more into your own tools.
    Most endpoints are reads; a focused set of writes (each gated by a *:write
    scope) create or update data, including creating student/tutor/parent
    accounts.


    Authenticate every request with an org API key:

        Authorization: Token token=ei_live_...

    Mint keys in the ClassQuill app under Settings → Developers.
  version: 1.0.0
servers: []
security:
  - ApiKeyAuth: []
tags:
  - name: General
  - name: Sessions
  - name: Tutors
  - name: Students & Parents
  - name: Billing
  - name: Curriculum
  - name: Coursework
  - name: Operations
  - name: Pricing
  - name: Bookings
  - name: Blog
  - name: Reports
paths:
  /v1/coverage/isochrones/refresh:
    post:
      tags:
        - General
      summary: Refresh Isochrones
      description: >-
        (Re)compute the org's in-person tutors' drive-time isochrones from
        Mapbox, caching

        them for the accurate coverage overlay + the gate's ST_Contains leg.


        Skips serves_all_areas / online tutors (no bounded reach to model) and
        any tutor

        whose home coordinate has not moved since its cached isochrone (the
        skip-guard), so

        repeat calls cost nothing. When MAPBOX_TOKEN is unset, `enabled` is
        false and nothing

        is computed — the map keeps using the max_travel_km radius circle.
        Intended for a

        cron / Hermes trigger; bounded by MAPBOX_ISOCHRONE_MAX_PER_REFRESH per
        call.
      operationId: refresh_isochrones_v1_coverage_isochrones_refresh_post
      parameters:
        - name: subject
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Only refresh tutors who teach this subject id
            title: Subject
          description: Only refresh tutors who teach this subject id
        - name: minutes
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 60
                minimum: 5
              - type: 'null'
            description: Drive-time contour in minutes (default from config)
            title: Minutes
          description: Drive-time contour in minutes (default from config)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IsochroneRefreshResult'
        '401':
          description: Missing, malformed, revoked, or expired credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: The credential lacks the scope this endpoint requires.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: Validation error — `error.details.errors` lists the fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: >-
            Rate limit exceeded — honour Retry-After and the RateLimit-*
            headers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    IsochroneRefreshResult:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: false
        considered:
          type: integer
          title: Considered
          default: 0
        computed:
          type: integer
          title: Computed
          default: 0
        cached:
          type: integer
          title: Cached
          default: 0
        failed:
          type: integer
          title: Failed
          default: 0
      type: object
      title: IsochroneRefreshResult
      description: >-
        Outcome of POST /v1/coverage/isochrones/refresh. `enabled` is false when
        no

        MAPBOX_TOKEN is configured (nothing was computed; the map uses radius
        circles).

        `computed` were fetched from Mapbox, `cached` were already fresh
        (skip-guard),

        `failed` errored, `considered` is how many in-person tutors were in
        scope.
    ApiError:
      description: Canonical error envelope for every /v1 error response (4xx/5xx).
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      title: ApiError
      type: object
    ApiErrorBody:
      description: The `error` object every /v1 error response carries.
      properties:
        code:
          description: >-
            Stable machine-readable error code: bad_request, unauthorized,
            forbidden, not_found, conflict, validation_error, rate_limited, or
            internal_error.
          examples:
            - not_found
          title: Code
          type: string
        message:
          description: Human-readable explanation, safe to surface to end users.
          examples:
            - Session not found
          title: Message
          type: string
        status:
          description: The HTTP status code, repeated in the body.
          examples:
            - 404
          title: Status
          type: integer
        details:
          additionalProperties: true
          description: >-
            Error-specific context. 422 carries the field errors under `errors`;
            429 carries `retry_after_seconds`.
          title: Details
          type: object
      required:
        - code
        - message
        - status
      title: ApiErrorBody
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Org API key as `Token token=ei_live_...`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.