{"openapi":"3.1.0","info":{"title":"CanQuery API","version":"1.0.0","contact":{"email":"support@canquery.com"},"description":"Hosted access to admitted Canadian open-data catalogues, supported tables and bounded maps. Store API keys server-side and send Authorization: Bearer YOUR_API_KEY; never place keys in a URL or browser bundle. Keys share account credits, request rates and expensive-request concurrency. Free allowances use UTC calendar months; Business uses confirmed paid periods. Cached successes count. Failed/interrupted ordinary requests are refunded; newly admitted preparation deducts credits until its final outcome; terminal failure without a published result reverses the original debit once, in its original allowance period. Internal retries keep the debit, and client timeouts do not fail jobs. Successful publication remains charged after expiry or eviction. These are credit returns, not cash refunds. No rollover or automatic overages. Successful JSON routes use data/pagination/meta except /healthz; CSV, tiles and 204 responses are exceptions. Error bodies are not enveloped. Examples use synthetic fixtures, not current observations. Publisher licences remain applicable. See /docs for runnable quickstarts.","x-description-fr":"Accès hébergé aux catalogues canadiens admis, aux tables prises en charge et aux cartes limitées. Gardez les clés côté serveur : Authorization: Bearer YOUR_API_KEY, jamais dans l’URL ou le navigateur. Les clés partagent crédits, fréquence et concurrence du compte. Forfait gratuit : mois UTC; Business : périodes payées confirmées. Les succès en cache comptent. Les requêtes ordinaires échouées/interrompues sont remboursées; les crédits d’admission sont rendus une seule fois à leur période d’origine en cas d’échec définitif sans publication. Les réessais gardent le débit; un délai client n’est pas un échec de tâche. Une préparation réussie reste facturée après expiration. Ce retour de crédits n’est pas un remboursement de paiement. Aucun report ni dépassement automatique. Enveloppe data/pagination/meta sauf /healthz, CSV, tuiles et 204. Erreurs sans enveloppe. Exemples synthétiques. Les licences des éditeurs s’appliquent. Consultez /docs."},"servers":[{"url":"/api/v1","description":"Developer API on this host. /healthz overrides this base."}],"security":[{},{"bearerAuth":[]}],"x-authentication":{"accounts_enabled":true,"anonymous_access":true,"api_key_required_at":null},"x-credit-costs":{"metadata":1,"query":1,"tile":1,"aggregate":10,"profile":10,"map":10,"featured":10,"export":25,"preparation":100,"activity":0},"x-workflow-costs":{"ready":2,"prepare":103,"reuse":2,"direct_query":1,"export":25,"prepare_aggregate":112},"x-limits":{"row_limit":100,"query_offset":10000,"csv_rows":10000,"map_features":1000,"map_bytes":8388608,"keyed_preparations_per_account_hour":20},"tags":[{"name":"Discovery","x-display-name-fr":"Découverte"},{"name":"Query and export","x-display-name-fr":"Requêtes et export"},{"name":"Preparation","x-display-name-fr":"Préparation"},{"name":"Maps","x-display-name-fr":"Cartes"},{"name":"Guides and insights","x-display-name-fr":"Guides et analyses"},{"name":"Operations","x-display-name-fr":"Opérations"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"CanQuery API key","description":"Optional during anonymous compatibility. An explicit invalid key is rejected; omit Authorization only for anonymous requests. Any announced cutoff applies at API_KEY_REQUIRED_AT."}},"schemas":{"Pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"],"description":"Next catalogue offset as a string, or null. Row queries use data.total and offset instead.","x-description-fr":"Décalage suivant du catalogue sous forme de chaîne, ou null. Les requêtes de lignes utilisent plutôt data.total et offset."}},"required":["nextCursor"]},"LocalizedText":{"type":"object","properties":{"en":{"type":["string","null"]},"fr":{"type":["string","null"]}}},"Field":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"original_label":{"type":"string"},"legacy_ids":{"type":"array","items":{"type":"string"}}},"required":["id","type"]},"License":{"type":"object","properties":{"title":{"$ref":"#/components/schemas/LocalizedText"},"url":{"type":"string"},"attribution":{"$ref":"#/components/schemas/LocalizedText"}}},"Provenance":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/ProvenanceSource"}},"primary_license":{"anyOf":[{"$ref":"#/components/schemas/License"},{"type":"null"}]}},"required":["sources","primary_license"]},"ProvenanceSource":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"name":{"$ref":"#/components/schemas/LocalizedText"},"homepage_url":{"type":"string"},"landing_url":{"type":["string","null"]},"upstream":{"type":"string"},"authoritative":{"type":"boolean"},"license":{"anyOf":[{"$ref":"#/components/schemas/License"},{"type":"null"}]}}},"Meta":{"type":"object","properties":{"source":{"type":"string"},"license":{"type":["string","null"]},"upstream":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"string"}},"provenance":{"$ref":"#/components/schemas/Provenance"},"snapshot":{"anyOf":[{"$ref":"#/components/schemas/Snapshot"},{"type":"null"}]},"retrieved_at":{"type":["string","null"],"format":"date-time"},"publisher_modified_at":{"type":["string","null"],"format":"date-time"},"limits":{"type":"object","properties":{"max_page_rows":{"type":"integer","minimum":0},"max_offset":{"type":"integer","minimum":0},"export_max_rows":{"type":"integer","minimum":0}}},"query_mode":{"type":"string","enum":["datastore","ingested","preview"]},"aggregation":{"$ref":"#/components/schemas/Aggregation"},"map":{"$ref":"#/components/schemas/ViewportMetadata"},"search":{"type":"object","properties":{"query":{"type":"string"},"suggestions":{"type":"array","items":{"type":"string"}}}},"total":{"type":["integer","null"],"minimum":0},"facets":{"anyOf":[{"$ref":"#/components/schemas/Facets"},{"type":"null"}]},"period":{"anyOf":[{"type":"object","properties":{"year":{"type":"integer","minimum":0},"month":{"type":"integer","minimum":1,"maximum":12}}},{"type":"null"}]}},"required":["source","license","upstream"]},"FacetValue":{"type":"object","properties":{"value":{"type":"string"},"label":{"$ref":"#/components/schemas/LocalizedText"},"count":{"type":"integer","minimum":0}},"required":["value","count"]},"Facets":{"type":"object","properties":{"level":{"type":"array","items":{"$ref":"#/components/schemas/FacetValue"}},"access":{"type":"array","items":{"$ref":"#/components/schemas/FacetValue"}},"organization":{"type":"array","items":{"$ref":"#/components/schemas/FacetValue"}},"source":{"type":"array","items":{"$ref":"#/components/schemas/FacetValue"}},"format":{"type":"array","items":{"$ref":"#/components/schemas/FacetValue"}},"keyword":{"type":"array","items":{"$ref":"#/components/schemas/FacetValue"},"description":"Most frequent keywords; only selected ones when more than 25,000 datasets match.","x-description-fr":"Mots-clés les plus fréquents; seulement ceux choisis au-delà de 25 000 jeux correspondants."}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"request_id":{"type":"string","description":"Match X-Request-Id when contacting support. Some CORS/rate-limit responses omit this field.","x-description-fr":"Correspond à X-Request-Id pour le soutien. Certaines réponses CORS ou de limite de fréquence omettent ce champ."},"code":{"type":"string","description":"Examples: INVALID_API_KEY, API_KEY_REQUIRED, KEY_DISABLED, ACCOUNT_SUSPENDED, QUOTA_EXCEEDED, RATE_LIMIT, CONCURRENCY_LIMIT, PREPARATION_BUSY, PREPARATION_COOLDOWN, AUTOMATED_CLIENT, SNAPSHOT_UNAVAILABLE, ACCOUNTING_UNAVAILABLE.","x-description-fr":"Exemples : INVALID_API_KEY, API_KEY_REQUIRED, KEY_DISABLED, ACCOUNT_SUSPENDED, QUOTA_EXCEEDED, RATE_LIMIT, CONCURRENCY_LIMIT, PREPARATION_BUSY, PREPARATION_COOLDOWN, AUTOMATED_CLIENT, SNAPSHOT_UNAVAILABLE, ACCOUNTING_UNAVAILABLE."},"retry_after":{"type":"integer","minimum":1},"hint":{"type":"string"},"download_url":{"type":"string"}},"required":["error"]},"PlaceIdentity":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["country","province","territory","region","municipality"]},"name":{"$ref":"#/components/schemas/LocalizedText"},"relationship":{"type":"string","enum":["direct","coverage"]},"includes_descendants":{"type":"boolean"}}},"Location":{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"zoom":{"type":["integer","null"],"minimum":0,"maximum":22}}},"Organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"$ref":"#/components/schemas/LocalizedText"},"dataset_count":{"type":"integer","minimum":0},"queryable_dataset_count":{"type":"integer","minimum":0},"mappable_dataset_count":{"type":"integer","minimum":0},"metadata_modified":{"type":["string","null"],"format":"date-time"},"place":{"anyOf":[{"$ref":"#/components/schemas/PlaceIdentity"},{"type":"null"}]}}},"Place":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["country","province","territory","region","municipality"]},"name":{"$ref":"#/components/schemas/LocalizedText"},"type":{"$ref":"#/components/schemas/LocalizedText"},"featured":{"type":"boolean"},"parent":{"anyOf":[{"$ref":"#/components/schemas/PlaceIdentity"},{"type":"null"}]},"parent_id":{"type":["string","null"]},"location":{"anyOf":[{"$ref":"#/components/schemas/Location"},{"type":"null"}]},"province":{"anyOf":[{"type":"object","properties":{"slug":{"type":"string"},"name":{"$ref":"#/components/schemas/LocalizedText"}},"required":["slug","name"]},{"type":"null"}]},"ancestors":{"type":"array","items":{"$ref":"#/components/schemas/PlaceIdentity"}},"children":{"type":"array","items":{"$ref":"#/components/schemas/Place"}},"dataset_count":{"type":"integer","minimum":0},"direct_dataset_count":{"type":"integer","minimum":0},"mappable_resource_count":{"type":"integer","minimum":0},"mappable_dataset_count":{"type":"integer","minimum":0}}},"Source":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"name":{"$ref":"#/components/schemas/LocalizedText"},"homepage_url":{"type":"string"},"catalog_url":{"type":["string","null"]},"upstream":{"type":"string"},"dataset_count":{"type":"integer","minimum":0},"authoritative_dataset_count":{"type":"integer","minimum":0},"last_synced_at":{"type":["string","null"],"format":"date-time"}}},"Presentation":{"type":"object","properties":{"title":{"$ref":"#/components/schemas/LocalizedText"},"summary":{"$ref":"#/components/schemas/LocalizedText"},"description":{"$ref":"#/components/schemas/LocalizedText"},"context":{"$ref":"#/components/schemas/LocalizedText"},"formats":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"capabilities":{"type":"object"},"fields":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":["string","null"]}}}},"total":{"type":"integer","minimum":0},"source":{"type":["string","null"],"enum":["table","map",null]}}}}},"DatasetSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"$ref":"#/components/schemas/LocalizedText"},"description":{"$ref":"#/components/schemas/LocalizedText"},"preview_resources":{"type":"object","properties":{"map":{"type":["string","null"]},"table":{"type":["string","null"]}}},"organization":{"anyOf":[{"$ref":"#/components/schemas/Organization"},{"type":"null"}]},"metadata_modified":{"type":["string","null"],"format":"date-time"},"resource_count":{"type":"integer","minimum":0},"queryable_count":{"type":"integer","minimum":0},"mappable_count":{"type":"integer","minimum":0},"places":{"type":"array","items":{"$ref":"#/components/schemas/PlaceIdentity"}},"place_match":{"anyOf":[{"type":"object","properties":{"tier":{"type":"string","enum":["exact","parent"]},"depth":{"type":"integer","minimum":0},"relationship":{"type":"string"},"place":{"$ref":"#/components/schemas/PlaceIdentity"}}},{"type":"null"}]},"provenance":{"$ref":"#/components/schemas/Provenance"}},"required":["id","name","title","provenance"]},"Dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"$ref":"#/components/schemas/LocalizedText"},"notes":{"$ref":"#/components/schemas/LocalizedText"},"keywords":{"type":"object","properties":{"en":{"type":"array","items":{"type":"string"}},"fr":{"type":"array","items":{"type":"string"}}}},"metadata_modified":{"type":["string","null"],"format":"date-time"},"organization":{"anyOf":[{"$ref":"#/components/schemas/Organization"},{"type":"null"}]},"places":{"type":"array","items":{"$ref":"#/components/schemas/PlaceIdentity"}},"provenance":{"$ref":"#/components/schemas/Provenance"},"presentation":{"$ref":"#/components/schemas/Presentation"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}}},"required":["id","name","resources","provenance"]},"Preparation":{"type":"object","properties":{"supported":{"type":"boolean"},"enabled":{"type":"boolean"},"freshness":{"type":"string","enum":["unprepared","unknown","current","stale"]},"state":{"type":"string","enum":["unprepared","pending","running","failed","ready"]},"job_id":{"type":["integer","null"],"minimum":1},"retry_at":{"type":["string","null"],"format":"date-time"},"failure_reason":{"type":["string","null"],"enum":["invalid_file","upstream_unavailable","capacity","temporary",null]},"prepared_at":{"type":["string","null"],"format":"date-time"},"publisher_modified_at":{"type":["string","null"],"format":"date-time"}},"required":["supported","enabled","freshness","state","job_id","retry_at","failure_reason","prepared_at","publisher_modified_at"]},"Snapshot":{"type":"object","properties":{"id":{"type":"string","pattern":"^cqs1_[0-9a-f]{64}$"},"prepared_at":{"type":["string","null"],"format":"date-time"},"source_metadata_version":{"type":["string","null"]}},"required":["id","prepared_at","source_metadata_version"]},"Ingestion":{"type":"object","properties":{"status":{"type":"string"},"snapshot_id":{"type":["string","null"]},"row_count":{"type":["number","null"]},"ingested_at":{"type":["string","null"],"format":"date-time"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"byte_size":{"type":["number","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Field"}},{"type":"null"}]},"last_accessed_at":{"type":["string","null"],"format":"date-time"}}},"MapMetadata":{"type":"object","properties":{"available":{"type":"boolean","const":true},"provider":{"type":"string","enum":["arcgis","canquery","pmtiles"]},"geometry_type":{"type":"string","enum":["point","multipoint","polyline","polygon","mixed"]},"extent":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"alias":{"type":"string"},"type":{"type":"string"}}}},"indexed_at":{"type":["string","null"],"format":"date-time"},"version":{"type":"string"},"min_zoom":{"type":"integer","minimum":0},"max_zoom":{"type":"integer","minimum":0},"layer":{"type":"string"},"tiles":{"type":"string","description":"Same-origin template containing {z}, {x}, {y}; use the current version.","x-description-fr":"Modèle de même origine contenant {z}, {x}, {y}; utilisez la version actuelle."}}},"Resource":{"type":"object","properties":{"id":{"type":"string"},"dataset_id":{"type":"string"},"name":{"$ref":"#/components/schemas/LocalizedText"},"format":{"type":["string","null"]},"url":{"type":["string","null"]},"size_bytes":{"type":["number","null"]},"datastore_active":{"type":"boolean"},"language":{"type":["string","null"]},"last_modified":{"type":["string","null"],"format":"date-time"},"query_mode":{"type":"string","enum":["ingested","datastore","ingestable","file-only"],"description":"A ready local snapshot takes precedence. Map availability is independent of table query_mode.","x-description-fr":"La copie locale prête a priorité. La disponibilité cartographique est indépendante du query_mode du tableau."},"preparation":{"$ref":"#/components/schemas/Preparation"},"map":{"anyOf":[{"$ref":"#/components/schemas/MapMetadata"},{"type":"null"}]},"ingestion":{"anyOf":[{"$ref":"#/components/schemas/Ingestion"},{"type":"null"}]},"presentation":{"$ref":"#/components/schemas/Presentation"},"dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"$ref":"#/components/schemas/LocalizedText"},"organization":{"anyOf":[{"$ref":"#/components/schemas/Organization"},{"type":"null"}]}}},"places":{"type":"array","items":{"$ref":"#/components/schemas/PlaceIdentity"}},"provenance":{"$ref":"#/components/schemas/Provenance"}},"required":["id","dataset_id","query_mode","preparation","ingestion","map"]},"QueryResult":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"records":{"type":"array","items":{"type":"object","additionalProperties":true}},"total":{"type":"integer","minimum":0}},"required":["fields","records","total"]},"Aggregation":{"type":"object","properties":{"group_by":{"type":"string"},"agg":{"type":"string","enum":["count","sum","avg","min","max"]},"agg_column":{"type":["string","null"]},"bucket":{"type":["string","null"],"enum":["year","month","day",null]}}},"Profile":{"type":"object","properties":{"row_count":{"type":"integer","minimum":0},"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"distinct":{"type":"integer","minimum":0},"nulls":{"type":"integer","minimum":0},"min":{"type":["string","number","boolean","null"]},"max":{"type":["string","number","boolean","null"]},"avg":{"type":["number","null"]}},"required":["id","type","distinct","nulls"]}}},"required":["row_count","columns"]},"Preview":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"records":{"type":"array","items":{"type":"object","additionalProperties":true}},"truncated":{"type":"boolean","description":"The sample ended before the file did; values are the file’s text, not typed values.","x-description-fr":"L’échantillon s’arrête avant la fin du fichier; les valeurs sont le texte du fichier, non typé."},"sampled_rows":{"type":"integer","minimum":0},"bytes_read":{"type":"integer","minimum":0},"content_length":{"type":["number","null"]}},"required":["fields","records","truncated"]},"PreparationJob":{"type":"object","properties":{"id":{"type":["integer","null"],"minimum":1},"resource_id":{"type":"string"},"status":{"type":"string","enum":["pending","running","done"]},"already_loaded":{"type":"boolean"},"row_count":{"type":["number","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"serving_cached":{"type":"boolean"},"prepared_at":{"type":["string","null"],"format":"date-time"}},"required":["id","resource_id","status"]},"JobProgress":{"type":"object","properties":{"phase":{"type":"string","enum":["downloading","loading","finishing"]},"bytes":{"type":["number","null"]},"content_length":{"type":["number","null"]},"rows":{"type":["number","null"]},"updated_at":{"type":["string","null"],"format":"date-time"}},"required":["phase"]},"Job":{"type":"object","properties":{"id":{"type":["integer","null"],"minimum":1},"resource_id":{"type":"string"},"status":{"type":"string","enum":["pending","running","done","failed"]},"attempts":{"type":"integer","minimum":0},"retry_at":{"type":["string","null"],"format":"date-time"},"failure_reason":{"type":["string","null"],"enum":["invalid_file","upstream_unavailable","capacity","temporary",null]},"error":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"claimed_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"age_seconds":{"type":["number","null"]},"already_loaded":{"type":"boolean"},"row_count":{"type":["number","null"]},"progress":{"description":"Advisory worker progress while running: bytes downloaded against the file length, then rows loaded, then finishing. Null until the first report and for jobs that are not running.","x-description-fr":"Progression indicative pendant l’exécution : octets téléchargés par rapport à la taille du fichier, puis lignes chargées, puis finalisation. Null avant le premier rapport et hors exécution.","anyOf":[{"$ref":"#/components/schemas/JobProgress"},{"type":"null"}]}},"required":["id","resource_id","status","attempts","retry_at","failure_reason","error","created_at","claimed_at","finished_at","age_seconds"]},"FeatureCollection":{"type":"object","properties":{"type":{"type":"string","const":"FeatureCollection"},"features":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"Feature"},"id":{"type":["string","number"]},"geometry":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"coordinates":{"type":"array","items":{}},"geometries":{"type":"array","items":{"type":"object"}}}},{"type":"null"}]},"properties":{"type":"object","additionalProperties":true}},"required":["type","geometry","properties"]}}},"required":["type","features"]},"ViewportMetadata":{"type":"object","properties":{"live":{"type":"boolean"},"provider":{"type":"string","enum":["arcgis","canquery","pmtiles"]},"geometry_type":{"type":"string"},"extent":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"alias":{"type":"string"},"type":{"type":"string"}}}},"returned":{"type":"integer","minimum":0},"truncated":{"type":"boolean"},"indexed_at":{"type":["string","null"],"format":"date-time"}}},"ActivityResource":{"type":"object","properties":{"resource_id":{"type":"string"},"name":{"$ref":"#/components/schemas/LocalizedText"},"format":{"type":["string","null"]},"ingested_at":{"type":["string","null"],"format":"date-time"},"row_count":{"type":["number","null"]},"hits":{"type":"integer","minimum":0},"last_queried_at":{"type":["string","null"],"format":"date-time"},"dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"$ref":"#/components/schemas/LocalizedText"}}}}},"Stats":{"type":"object","properties":{"datasets":{"type":"integer","minimum":0},"resources":{"type":"integer","minimum":0},"datastore_active_resources":{"type":"integer","minimum":0},"ingested_resources":{"type":"integer","minimum":0},"mappable_resources":{"type":"integer","minimum":0},"store_bytes":{"type":"integer","minimum":0},"organizations":{"type":"integer","minimum":0},"places":{"type":"integer","minimum":0},"last_synced_at":{"type":["string","null"],"format":"date-time"}}},"TopDownload":{"type":"object","properties":{"rank":{"type":"integer","minimum":0},"dataset_id":{"type":"string"},"dataset_name":{"type":["string","null"]},"title":{"$ref":"#/components/schemas/LocalizedText"},"department":{"type":["string","null"]},"ministere":{"type":["string","null"]},"downloads":{"type":"integer","minimum":0},"history":{"type":"array","items":{"type":"object"}},"resource_id":{"type":["string","null"]},"ingest_status":{"type":["string","null"]},"row_count":{"type":["number","null"]}}},"FeaturedPreview":{"type":"object","properties":{"dataset_id":{"type":"string"},"title":{"$ref":"#/components/schemas/LocalizedText"},"kind":{"type":"string","enum":["bars","line","donut"]},"points":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"]},"label":{"type":"string"},"value":{"type":"number"}},"required":["key","label","value"]}},"context":{"type":"object","properties":{"resource_id":{"type":"string"},"group_by":{"type":"string"},"agg":{"type":"string","enum":["count","avg"]},"agg_column":{"type":["string","null"]},"bucket":{"type":["string","null"],"enum":["year","month","day",null]},"group_type":{"type":"string"},"snapshot_at":{"type":["string","null"],"format":"date-time"},"snapshot_rows":{"type":"integer","minimum":0},"total_groups":{"type":"integer","minimum":0},"displayed_groups":{"type":"integer","minimum":0},"limited":{"type":"boolean"},"missing_periods":{"type":"array","items":{"type":"string"}}}}}},"Article":{"type":"object","properties":{"id":{"type":"string"},"lang":{"type":"string","enum":["en","fr"]},"slug":{"type":"string"},"path":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"place":{"type":["string","null"]},"placeName":{"type":"string"},"topic":{"type":"string"},"topicName":{"type":"string"},"query":{"type":"string"},"published":{"type":"string","format":"date"},"updated":{"type":"string","format":"date"},"verified":{"type":"string","format":"date"},"author":{"type":"string"},"status":{"type":"string"},"explore":{"type":"string"},"view":{"type":"string","enum":["table","map","download"]},"dataset":{"type":"string"},"datasetId":{"type":"string"},"translations":{"type":"object","properties":{"en":{"type":"string"},"fr":{"type":"string"}}},"bodyHtml":{"type":"string","description":"Present on article detail; sanitized HTML.","x-description-fr":"Présent dans le détail de l’article; HTML assaini."}}},"Health":{"type":"object","properties":{"ok":{"type":"boolean"},"db":{"type":"boolean"},"upstream":{"type":"boolean"}},"required":["ok","db","upstream"]},"Readiness":{"type":"object","properties":{"ok":{"type":"boolean"},"db":{"type":"boolean"}},"required":["ok","db"]},"ComponentHealth":{"type":"object","properties":{"component":{"type":"string","enum":["availability","preparation","maps","sources","commercial","backups","storage"]},"ok":{"type":"boolean"},"status":{"type":"string","enum":["ok","degraded","unavailable","stale"]},"observed_at":{"type":["string","null"],"format":"date-time"},"checks":{"type":"object","additionalProperties":{"type":["boolean","number"]}}},"required":["component","ok","status","observed_at","checks"]},"Operations":{"type":"object","properties":{"ok":{"type":"boolean"},"jobs":{"type":"object","additionalProperties":{"type":"object","properties":{"last_ok_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["ok","pending","failed","stale"]}}}},"maps":{"type":"object","properties":{"pending":{"type":"integer","minimum":0},"deferred":{"type":"integer","minimum":0},"running":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"retrying_sources":{"type":"integer","minimum":0},"oldest_pending_at":{"type":["string","null"],"format":"date-time"},"next_retry_at":{"type":["string","null"],"format":"date-time"},"oldest_running_at":{"type":["string","null"],"format":"date-time"},"last_indexed_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["ok","degraded","stale"]}}},"preparations":{"type":"object","properties":{"pending":{"type":"integer","minimum":0},"running":{"type":"integer","minimum":0},"failed_last_day":{"type":"integer","minimum":0},"completed_last_day":{"type":"integer","minimum":0},"oldest_pending_at":{"type":["string","null"],"format":"date-time"}}}},"required":["ok","jobs","maps","preparations"]}},"responses":{"Error400":{"description":"Invalid parameters, unsupported filter/aggregation, or invalid coordinates.","x-description-fr":"Paramètres, filtres, agrégation ou coordonnées non valides.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invalid parameters, unsupported filter/aggregation, or invalid coordinates.","request_id":"example-request-id"}}}},"Error401":{"description":"Missing required, invalid or revoked API key.","x-description-fr":"Clé requise manquante, non valide ou révoquée.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing required, invalid or revoked API key.","request_id":"example-request-id"}}}},"Error403":{"description":"Disabled key/account or disallowed browser origin.","x-description-fr":"Clé ou compte désactivé, ou origine du navigateur refusée.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Disabled key/account or disallowed browser origin.","request_id":"example-request-id"}}}},"Error429":{"description":"Limit reached. Distinguish QUOTA_EXCEEDED, RATE_LIMIT, CONCURRENCY_LIMIT, PREPARATION_BUSY, PREPARATION_COOLDOWN and AUTOMATED_CLIENT; honour Retry-After.","x-description-fr":"Limite atteinte : crédits, fréquence, concurrence, capacité, délai de préparation ou robot d’indexation. Respectez Retry-After.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Request rate exceeded","request_id":"example-request-id","code":"RATE_LIMIT","retry_after":60}},"text/plain":{"schema":{"type":"string"},"example":"Too many requests, please try again later."}}},"Error500":{"description":"Unexpected server failure. Retain X-Request-Id for support.","x-description-fr":"Erreur du serveur. Conservez X-Request-Id pour le soutien.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Unexpected server failure. Retain X-Request-Id for support.","request_id":"example-request-id"}}}},"Error503":{"description":"Service, accounts, accounting or bounded upstream concurrency temporarily unavailable.","x-description-fr":"Service, comptes, comptabilisation ou capacité temporairement indisponible.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Service, accounts, accounting or bounded upstream concurrency temporarily unavailable.","request_id":"example-request-id"}}}},"Error404":{"description":"The requested identity or tile version was not found.","x-description-fr":"Identité ou version de tuile introuvable.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"The requested identity or tile version was not found.","request_id":"example-request-id"}}}},"Error409":{"description":"No ready local copy, or the serving snapshot changed. Inspect metadata; use /prepare when supported.","x-description-fr":"Aucune copie locale prête, ou copie remplacée. Consultez les métadonnées et utilisez /prepare si disponible.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"No ready local copy, or the serving snapshot changed. Inspect metadata; use /prepare when supported.","request_id":"example-request-id"}}}},"Error422":{"description":"Unsupported capability. Inspect metadata and use the original download when available.","x-description-fr":"Fonction non prise en charge. Consultez les métadonnées et le téléchargement original, si disponible.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Unsupported capability. Inspect metadata and use the original download when available.","request_id":"example-request-id"}}}},"Error502":{"description":"Publisher DataStore, map source or tile storage unavailable.","x-description-fr":"DataStore, source cartographique ou stockage des tuiles indisponible.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Publisher DataStore, map source or tile storage unavailable.","request_id":"example-request-id"}}}},"Error413":{"description":"Viewport exceeds the response/tile bound. Zoom in or reduce the viewport.","x-description-fr":"La vue dépasse la limite de réponse ou de tuiles. Zoomez ou réduisez la zone.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Viewport exceeds the response/tile bound. Zoom in or reduce the viewport.","request_id":"example-request-id"}}}}},"headers":{"RateLimit-Limit":{"description":"Anonymous or failed-credential rate-limit ceiling when supplied by the limiter; keyed account limits are separate.","schema":{"type":"integer","minimum":0},"x-description-fr":"Plafond des requêtes anonymes ou des échecs d’authentification, lorsqu’il est fourni. Les limites du compte avec clé sont distinctes."},"RateLimit-Remaining":{"description":"Requests remaining in the limiter window, when supplied.","schema":{"type":"integer","minimum":0},"x-description-fr":"Requêtes restantes dans la fenêtre du limiteur, lorsqu’il est fourni."},"RateLimit-Reset":{"description":"Seconds until the limiter window resets, when supplied.","schema":{"type":"integer","minimum":0},"x-description-fr":"Secondes avant la réinitialisation de la fenêtre du limiteur, lorsqu’il est fourni."},"Deprecation":{"description":"Anonymous compatibility deprecation timestamp, when a cutoff is announced.","schema":{"type":"string"},"x-description-fr":"Horodatage d’abandon de la compatibilité anonyme, lorsqu’une date limite est annoncée."},"Sunset":{"description":"HTTP date after which metered routes require a key, when announced.","schema":{"type":"string"},"x-description-fr":"Date HTTP après laquelle les routes comptabilisées exigent une clé, lorsqu’elle est annoncée."},"X-Request-Id":{"description":"Request identifier for support and log correlation.","schema":{"type":"string"},"x-description-fr":"Identifiant de requête pour le soutien et la recherche dans les journaux."},"Cache-Control":{"description":"Keyed API responses are private, no-store. Anonymous routes may use public caching.","schema":{"type":"string"},"x-description-fr":"Les réponses avec clé sont privées, no-store. Les routes anonymes peuvent utiliser un cache public."},"X-CanQuery-Credits-Limit":{"description":"Keyed requests: shared account allowance for the current period.","schema":{"type":"integer","minimum":0},"x-description-fr":"Avec clé : allocation partagée du compte pour la période actuelle."},"X-CanQuery-Credits-Remaining":{"description":"Keyed requests: remaining allowance after admission, including all outstanding reservations; not a final usage receipt.","schema":{"type":"integer","minimum":0},"x-description-fr":"Avec clé : solde après admission, comprenant toutes les réservations en cours; ce n’est pas un reçu d’utilisation définitif."},"X-CanQuery-Credits-Reset":{"description":"Keyed requests: current allowance period end (UTC).","schema":{"type":"string","format":"date-time"},"x-description-fr":"Avec clé : fin de la période d’allocation actuelle (UTC)."},"Retry-After":{"description":"When present, minimum seconds before retrying. Exhausted credits may require waiting until the next allowance period.","schema":{"type":"integer","minimum":1},"x-description-fr":"Si présent, nombre minimum de secondes avant un nouvel essai. Des crédits épuisés peuvent imposer d’attendre la prochaine période."},"Content-Disposition":{"description":"Attachment filename.","schema":{"type":"string"},"x-description-fr":"Nom du fichier joint."},"X-CanQuery-Sources":{"description":"Comma-separated source IDs when available.","schema":{"type":"string"},"x-description-fr":"Identifiants de sources séparés par des virgules, si disponibles."},"X-CanQuery-Snapshot":{"description":"Opaque local snapshot identifier, absent for live DataStore.","schema":{"type":"string"},"x-description-fr":"Identifiant opaque de la copie locale; absent pour le DataStore en direct."},"X-CanQuery-Prepared-At":{"description":"Local preparation time when recorded; not publisher freshness.","schema":{"type":["string","null"],"format":"date-time"},"x-description-fr":"Date de préparation locale, lorsqu’elle est connue."},"X-CanQuery-Retrieved-At":{"description":"Time this extraction began.","schema":{"type":["string","null"],"format":"date-time"},"x-description-fr":"Début de cette extraction."},"Link":{"description":"Primary licence URL with rel=\"license\", when available.","schema":{"type":"string"},"x-description-fr":"URL de la licence principale avec rel=\"license\", si disponible."}}},"paths":{"/datasets":{"get":{"operationId":"listDatasets","tags":["Discovery"],"summary":"Search datasets","x-summary-fr":"Rechercher des jeux de données","description":"Discover admitted catalogue records. Availability of metadata does not guarantee a working file, table or map. Catalogue reads never request preparation. Follow pagination.nextCursor until null. Repeated values of one filter match any of them; different filters must all match. With facets, each group is counted without its own filter; counts are null when unavailable.","x-description-fr":"Découvrez les fiches admises. Des métadonnées présentes ne garantissent pas un fichier, tableau ou carte disponible. Aucune préparation automatique. Suivez pagination.nextCursor jusqu’à null. Les valeurs répétées d’un filtre en acceptent une seule; des filtres différents doivent tous correspondre. Avec facets, chaque groupe est compté sans son propre filtre; null si indisponible.","x-credit-cost":1,"parameters":[{"name":"q","in":"query","description":"Catalogue search text, trimmed; at most 200 characters.","x-description-fr":"Texte de recherche, espaces extérieurs retirés; 200 caractères maximum.","schema":{"type":"string","maxLength":200},"example":"permits"},{"name":"org","in":"query","description":"Publisher name or identity; repeatable.","x-description-fr":"Nom ou identifiant de l’éditeur. Répétable.","schema":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20}},{"name":"format","in":"query","description":"Recorded resource format; repeatable.","x-description-fr":"Format de ressource enregistré. Répétable.","schema":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20}},{"name":"keyword","in":"query","description":"Recorded dataset keyword; repeatable.","x-description-fr":"Mot-clé du jeu de données. Répétable.","schema":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20}},{"name":"place","in":"query","description":"Canonical place ID or slug; includes configured inherited coverage.","x-description-fr":"Identifiant ou slug canonique du lieu; inclut la couverture héritée configurée.","schema":{"type":"string","maxLength":200}},{"name":"source","in":"query","description":"Catalogue source ID; repeatable.","x-description-fr":"Identifiant de source du catalogue. Répétable.","schema":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20}},{"name":"level","in":"query","description":"Level of government; provincial includes territorial and municipal includes regional. Repeatable.","x-description-fr":"Ordre de gouvernement; provincial inclut territorial et municipal inclut régional. Répétable.","schema":{"type":"array","items":{"type":"string","enum":["federal","provincial","municipal"]},"maxItems":20}},{"name":"mappable","in":"query","description":"Only datasets with maps. Use true or 1; omit to disable. false is invalid.","x-description-fr":"Jeux avec cartes seulement. Utilisez true ou 1; omettez pour désactiver. false est non valide.","schema":{"type":"string","enum":["true","1"]}},{"name":"queryable","in":"query","description":"Only datasets with a live table or a ready prepared copy. Use true or 1; omit to disable.","x-description-fr":"Jeux avec un tableau en direct ou une copie préparée prête seulement. Utilisez true ou 1; omettez pour désactiver.","schema":{"type":"string","enum":["true","1"]}},{"name":"sort","in":"query","description":"relevance keeps search ranking; title order follows lang.","x-description-fr":"relevance conserve le classement; l’ordre des titres suit lang.","schema":{"type":"string","enum":["relevance","updated","title","title_desc"],"default":"relevance"}},{"name":"lang","in":"query","description":"French when fr; otherwise English.","x-description-fr":"Français avec fr; anglais autrement.","schema":{"type":"string","default":"en"},"example":"en"},{"name":"facets","in":"query","description":"Add meta.total and meta.facets. Use true or 1; omit to disable.","x-description-fr":"Ajoute meta.total et meta.facets. Utilisez true ou 1; omettez pour désactiver.","schema":{"type":"string","enum":["true","1"]}},{"name":"limit","in":"query","description":"Page size; values above 100 are clamped to 100.","x-description-fr":"Taille de page; les valeurs supérieures à 100 sont ramenées à 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","description":"Nonnegative offset. Pass pagination.nextCursor unchanged; omit for the first page.","x-description-fr":"Décalage positif ou nul. Réutilisez pagination.nextCursor; omettez-le à la première page.","schema":{"type":"integer","minimum":0,"default":0},"example":20}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DatasetSummary"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[{"id":"example-dataset","name":"example-permits","title":{"en":"Example permits","fr":"Permis exemples"},"metadata_modified":"2026-01-01T00:00:00.000Z","description":{"en":"Illustrative records.","fr":"Données illustratives."},"resource_count":1,"queryable_count":1,"mappable_count":0,"organization":null,"places":[],"provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}}],"pagination":{"nextCursor":"20"},"meta":{"source":"canquery","license":null,"upstream":null,"search":{"query":"permits","suggestions":[]},"sources":["example-source"],"total":1,"facets":{"level":[{"value":"municipal","count":1}],"access":[{"value":"queryable","count":1},{"value":"mappable","count":0}],"organization":[],"source":[{"value":"example-source","label":{"en":"Example publisher","fr":"Éditeur exemple"},"count":1}],"format":[{"value":"CSV","count":1}],"keyword":[]}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/datasets/{idOrName}":{"get":{"operationId":"getDataset","tags":["Discovery"],"summary":"Get a dataset","x-summary-fr":"Obtenir un jeu de données","description":"Resolve a canonical dataset ID or published name/slug. Includes resources, capabilities and source-specific licence/provenance.","x-description-fr":"Résout un identifiant canonique ou un nom/slug publié. Inclut les ressources, capacités, licences et provenance.","x-credit-cost":1,"parameters":[{"name":"idOrName","in":"path","description":"Canonical dataset ID or published name/slug.","x-description-fr":"Identifiant canonique ou nom/slug publié.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Dataset"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":"example-dataset","name":"example-permits","title":{"en":"Example permits","fr":"Permis exemples"},"metadata_modified":"2026-01-01T00:00:00.000Z","resources":[{"id":"example-resource","dataset_id":"example-dataset","name":{"en":"Example CSV","fr":"CSV exemple"},"format":"CSV","url":"https://example.org/example.csv","size_bytes":null,"datastore_active":true,"language":"en","last_modified":"2026-01-01T00:00:00.000Z","query_mode":"datastore","preparation":{"supported":true,"enabled":true,"freshness":"unprepared","state":"unprepared","job_id":null,"retry_at":null,"failure_reason":null,"prepared_at":null,"publisher_modified_at":"2026-01-01T00:00:00.000Z"},"map":null,"ingestion":null,"dataset":{"id":"example-dataset","name":"example-permits","title":{"en":"Example permits","fr":"Permis exemples"},"metadata_modified":"2026-01-01T00:00:00.000Z"},"places":[],"provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}}],"provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/organizations":{"get":{"operationId":"listOrganizations","tags":["Discovery"],"summary":"List publishers","x-summary-fr":"Lister les éditeurs","description":"Literal bilingual publisher search with optional source/place scope. Uses catalogue pagination.","x-description-fr":"Recherche littérale bilingue des éditeurs, filtrable par source ou lieu. Pagination du catalogue.","x-credit-cost":1,"parameters":[{"name":"q","in":"query","description":"Literal bilingual publisher search.","x-description-fr":"Recherche littérale bilingue des éditeurs.","schema":{"type":"string","maxLength":200}},{"name":"source","in":"query","description":"Catalogue source ID.","x-description-fr":"Identifiant de source.","schema":{"type":"string","maxLength":200}},{"name":"place","in":"query","description":"Canonical place ID or slug; includes configured inherited coverage.","x-description-fr":"Identifiant ou slug canonique du lieu; inclut la couverture héritée configurée.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","description":"Page size; values above 100 are clamped to 100.","x-description-fr":"Taille de page; les valeurs supérieures à 100 sont ramenées à 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","description":"Nonnegative offset. Pass pagination.nextCursor unchanged; omit for the first page.","x-description-fr":"Décalage positif ou nul. Réutilisez pagination.nextCursor; omettez-le à la première page.","schema":{"type":"integer","minimum":0,"default":0},"example":20}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[{"id":"example-org","name":"example-publisher","title":{"en":"Example publisher","fr":"Éditeur exemple"},"dataset_count":1,"place":null}],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/organizations/{name}":{"get":{"operationId":"getOrganization","tags":["Discovery"],"summary":"Get a publisher","x-summary-fr":"Obtenir un éditeur","description":"Publisher identity, catalogue and capability counts, and place context.","x-description-fr":"Identité de l’éditeur, dénombrements du catalogue et des capacités, et lieu associé.","x-credit-cost":1,"parameters":[{"name":"name","in":"path","description":"Publisher name or identity, at most 200 characters.","x-description-fr":"Nom ou identifiant de l’éditeur, 200 caractères maximum.","schema":{"type":"string","maxLength":200},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Organization"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":"example-org","name":"example-publisher","title":{"en":"Example publisher","fr":"Éditeur exemple"},"dataset_count":1,"queryable_dataset_count":1,"mappable_dataset_count":0,"metadata_modified":null,"place":null},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/places":{"get":{"operationId":"listPlaces","tags":["Discovery"],"summary":"List places","x-summary-fr":"Lister les lieux","description":"Search canonical geographical identities and their direct/inherited coverage. Uses catalogue pagination.","x-description-fr":"Recherche des lieux canoniques et de leur couverture directe ou héritée. Pagination du catalogue.","x-credit-cost":1,"parameters":[{"name":"q","in":"query","description":"Catalogue search text, trimmed; at most 200 characters.","x-description-fr":"Texte de recherche, espaces extérieurs retirés; 200 caractères maximum.","schema":{"type":"string","maxLength":200},"example":"permits"},{"name":"kind","in":"query","description":"Place type.","x-description-fr":"Type de lieu.","schema":{"type":"string","enum":["country","province","territory","region","municipality"]}},{"name":"parent","in":"query","description":"Canonical parent ID or slug.","x-description-fr":"Identifiant ou slug canonique du parent.","schema":{"type":"string","maxLength":200}},{"name":"featured","in":"query","description":"Use true or 1 for featured places; omit to disable.","x-description-fr":"Utilisez true ou 1 pour les lieux en vedette; omettez pour désactiver.","schema":{"type":"string","enum":["true","1"]}},{"name":"limit","in":"query","description":"Page size; values above 100 are clamped to 100.","x-description-fr":"Taille de page; les valeurs supérieures à 100 sont ramenées à 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","description":"Nonnegative offset. Pass pagination.nextCursor unchanged; omit for the first page.","x-description-fr":"Décalage positif ou nul. Réutilisez pagination.nextCursor; omettez-le à la première page.","schema":{"type":"integer","minimum":0,"default":0},"example":20}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Place"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[{"id":"example-place","slug":"example-on","kind":"municipality","name":{"en":"Example","fr":"Exemple"},"featured":false,"dataset_count":1}],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/places/{idOrSlug}":{"get":{"operationId":"getPlace","tags":["Discovery"],"summary":"Get a place","x-summary-fr":"Obtenir un lieu","description":"Resolve a canonical ID, slug or durable alias. Includes ancestry, children, viewport and coverage. API lookup does not redirect like an HTML alias.","x-description-fr":"Résout un identifiant, slug ou alias durable. Inclut ascendance, enfants, vue et couverture. Aucun renvoi HTML pour les alias.","x-credit-cost":1,"parameters":[{"name":"idOrSlug","in":"path","description":"Canonical place ID, slug or historical alias.","x-description-fr":"Identifiant, slug ou alias historique du lieu.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Place"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":"example-place","slug":"example-on","kind":"municipality","name":{"en":"Example","fr":"Exemple"},"ancestors":[],"children":[],"dataset_count":1,"direct_dataset_count":1,"mappable_dataset_count":0},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/sources":{"get":{"operationId":"listSources","tags":["Discovery"],"summary":"List catalogue sources","x-summary-fr":"Lister les sources du catalogue","description":"Persisted publisher portals, provenance hosts, catalogue counts and last successful sync. This endpoint is not paginated.","x-description-fr":"Portails, hôtes de provenance, dénombrements et dernière synchronisation réussie. Sans pagination.","x-credit-cost":1,"parameters":[{"name":"place","in":"query","description":"Canonical place ID or slug; includes configured inherited coverage.","x-description-fr":"Identifiant ou slug canonique du lieu; inclut la couverture héritée configurée.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Source"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","catalog_url":"https://example.org/api/3/action","upstream":"example.org","dataset_count":1,"authoritative_dataset_count":1,"last_synced_at":null}],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/{id}":{"get":{"operationId":"getResource","tags":["Discovery"],"summary":"Inspect resource capabilities","x-summary-fr":"Consulter les capacités d’une ressource","description":"Read query_mode, preparation, ingestion, map and provenance before querying. A map can exist on a file-only table resource. Metadata reads neither prepare files nor renew local-copy activity. Preparation time differs from publisher modification time; source changes can remain undiscovered when publisher version metadata is unchanged.","x-description-fr":"Consultez query_mode, preparation, ingestion, map et provenance avant une requête. Une ressource file-only peut avoir une carte. La lecture ne prépare pas de fichier et ne renouvelle pas la copie locale. La date de préparation diffère de celle de l’éditeur; les changements sans modification des métadonnées de version peuvent passer inaperçus.","x-credit-cost":1,"parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Resource"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":"example-resource","dataset_id":"example-dataset","name":{"en":"Example CSV","fr":"CSV exemple"},"format":"CSV","url":"https://example.org/example.csv","size_bytes":null,"datastore_active":true,"language":"en","last_modified":"2026-01-01T00:00:00.000Z","query_mode":"datastore","preparation":{"supported":true,"enabled":true,"freshness":"unprepared","state":"unprepared","job_id":null,"retry_at":null,"failure_reason":null,"prepared_at":null,"publisher_modified_at":"2026-01-01T00:00:00.000Z"},"map":null,"ingestion":null,"dataset":{"id":"example-dataset","name":"example-permits","title":{"en":"Example permits","fr":"Permis exemples"},"metadata_modified":"2026-01-01T00:00:00.000Z"},"places":[],"provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/recently-unlocked":{"get":{"operationId":"listRecentlyPrepared","tags":["Discovery"],"summary":"List recently prepared resources","x-summary-fr":"Lister les ressources récemment préparées","description":"Recent ready local copies. The historical route name is retained. Reading the list does not prepare files.","x-description-fr":"Copies locales prêtes récentes. Le nom historique de la route est conservé. Aucune préparation de fichier.","x-credit-cost":1,"parameters":[{"name":"place","in":"query","description":"Canonical place ID or slug; includes configured inherited coverage.","x-description-fr":"Identifiant ou slug canonique du lieu; inclut la couverture héritée configurée.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","description":"Page size; values above 20 are clamped to 20.","x-description-fr":"Taille de page; les valeurs supérieures à 20 sont ramenées à 20.","schema":{"type":"integer","minimum":1,"maximum":20,"default":6}}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ActivityResource"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[{"resource_id":"example-resource","name":{"en":"Example CSV","fr":"CSV exemple"},"format":"CSV","ingested_at":"2026-01-01T00:00:00.000Z","row_count":1,"dataset":{"id":"example-dataset","name":"example-permits","title":{"en":"Example permits","fr":"Permis exemples"},"metadata_modified":"2026-01-01T00:00:00.000Z"}}],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/popular":{"get":{"operationId":"listPopularResources","tags":["Discovery"],"summary":"List popular resources","x-summary-fr":"Lister les ressources populaires","description":"Counts CanQuery query-log hits, not publisher downloads.","x-description-fr":"Compte les requêtes enregistrées par CanQuery, pas les téléchargements de l’éditeur.","x-credit-cost":1,"parameters":[{"name":"place","in":"query","description":"Canonical place ID or slug; includes configured inherited coverage.","x-description-fr":"Identifiant ou slug canonique du lieu; inclut la couverture héritée configurée.","schema":{"type":"string","maxLength":200}},{"name":"days","in":"query","description":"Lookback days; values above 30 are clamped.","x-description-fr":"Jours précédents; les valeurs supérieures à 30 sont ramenées à 30.","schema":{"type":"integer","minimum":1,"maximum":30,"default":7}},{"name":"limit","in":"query","description":"Page size; values above 20 are clamped to 20.","x-description-fr":"Taille de page; les valeurs supérieures à 20 sont ramenées à 20.","schema":{"type":"integer","minimum":1,"maximum":20,"default":6}}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ActivityResource"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[{"resource_id":"example-resource","hits":3,"last_queried_at":"2026-01-01T00:00:00.000Z","name":{"en":"Example CSV","fr":"CSV exemple"},"format":"CSV","dataset":{"id":"example-dataset","name":"example-permits","title":{"en":"Example permits","fr":"Permis exemples"},"metadata_modified":"2026-01-01T00:00:00.000Z"}}],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/{id}/query":{"get":{"operationId":"queryResource","tags":["Query and export"],"summary":"Query rows or aggregate","x-summary-fr":"Interroger ou agréger les lignes","description":"Ready local snapshots take precedence over live CKAN DataStore. Live DataStore supports equality filters only, with no aggregation. Local aggregates cover the complete filtered snapshot; total then counts groups, not rows. Local reads renew copy activity and successful queries record popularity. Local responses include meta.snapshot, retrieval time and deployment limits. Supply snapshot on subsequent pages to require identical stored rows and schema; 409 requires an explicit new extraction. Catalogue provenance and publisher modification timestamps are observed at retrieval, not frozen at preparation. source_metadata_version is not a downloaded-content checksum. A 409 never automatically enqueues preparation; inspect metadata and explicitly use /prepare when supported. Aggregations have an additional 30 requests/minute limit and consume expensive-request concurrency.","x-description-fr":"La copie locale prête a priorité sur le DataStore CKAN. Le DataStore accepte seulement l’égalité, sans agrégation. Les agrégats locaux couvrent toute la copie filtrée; total compte alors les groupes. Les lectures locales renouvellent l’activité et les requêtes réussies alimentent la popularité. Les réponses locales comprennent meta.snapshot, la date de récupération et les limites. Fournissez snapshot aux pages suivantes pour conserver les mêmes données et champs; un 409 exige une nouvelle extraction explicite. La provenance est observée à la récupération. source_metadata_version ne vérifie pas le contenu du fichier. Un 409 ne lance aucune préparation; consultez les métadonnées et utilisez /prepare explicitement. Les agrégations sont aussi limitées à 30/minute et consomment la concurrence des requêtes coûteuses.","x-credit-cost":"1 row query / 10 aggregation","parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true},{"name":"snapshot","in":"query","description":"Require this exact local snapshot. A replaced or unavailable copy returns 409 SNAPSHOT_UNAVAILABLE; no automatic fallback or preparation. This token does not promise retention or source-content freshness.","x-description-fr":"Exige cette copie locale exacte. Une copie remplacée ou indisponible retourne 409 SNAPSHOT_UNAVAILABLE, sans remplacement ni préparation automatique. Aucun engagement de conservation ou de fraîcheur du fichier source.","schema":{"type":"string","pattern":"^cqs1_[0-9a-f]{64}$"}},{"name":"q","in":"query","description":"Search within resource rows (not catalogue search); at most 200 characters. Local search uses case-insensitive ILIKE patterns.","x-description-fr":"Recherche dans les lignes, distincte du catalogue; 200 caractères maximum. Recherche locale ILIKE insensible à la casse.","schema":{"type":"string","maxLength":200}},{"name":"filters","in":"query","description":"URL-encoded JSON object, at most 2,000 characters and 20 column keys of 1–63 characters. Exact recorded field names; conditions combine with AND. Scalars mean equality. Objects use op and value: eq, lt, gt, lte, gte, contains. Live DataStore supports eq only. eq:null means IS NULL locally; contains preserves % and _ SQL wildcard meanings.","x-description-fr":"Objet JSON encodé dans l’URL : 2 000 caractères, 20 champs de 1 à 63 caractères maximum. Noms exacts, conditions AND. Scalaire = égalité; objets op/value : eq, lt, gt, lte, gte, contains. DataStore : eq seulement. Localement, eq:null signifie IS NULL; contains conserve les jokers SQL % et _.","schema":{"type":"string","maxLength":2000},"example":"{\"STREET_NAME\":\"YONGE\"}"},{"name":"sort","in":"query","description":"Exact field name, optionally followed by asc or desc. Local row sorting also accepts _id; aggregates accept key or value. An exact field name wins over a direction suffix. Live DataStore values are limited to 100 characters.","x-description-fr":"Nom exact du champ, suivi éventuellement de asc ou desc. Lignes locales : _id aussi accepté; agrégats : key ou value. Le nom exact a priorité sur le suffixe. DataStore : 100 caractères maximum.","schema":{"type":"string"},"example":"STREET_NAME asc"},{"name":"group_by","in":"query","description":"Prepared tables only: exact recorded grouping field. Required together with agg.","x-description-fr":"Tables préparées : champ de regroupement exact, obligatoire avec agg.","schema":{"type":"string"},"example":"STREET_NAME"},{"name":"agg","in":"query","description":"Prepared tables only. count forbids agg_column; other functions require it. sum/avg require a numeric field.","x-description-fr":"Tables préparées : count interdit agg_column; les autres fonctions l’exigent. sum/avg exigent un champ numérique.","schema":{"type":"string","enum":["count","sum","avg","min","max"]},"example":"count"},{"name":"agg_column","in":"query","description":"Recorded measure field for sum, avg, min or max; forbidden with count.","x-description-fr":"Champ de mesure pour sum, avg, min ou max; interdit avec count.","schema":{"type":"string"}},{"name":"bucket","in":"query","description":"Optional temporal grouping; group_by must be DATE or TIMESTAMPTZ.","x-description-fr":"Regroupement temporel facultatif; group_by doit être DATE ou TIMESTAMPTZ.","schema":{"type":"string","enum":["year","month","day"]}},{"name":"limit","in":"query","description":"Page size; values above 100 are clamped to 100.","x-description-fr":"Taille de page; les valeurs supérieures à 100 sont ramenées à 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","description":"Row/group offset; independent of catalogue cursor. Avoid relying on a stable snapshot across page calls.","x-description-fr":"Décalage de lignes/groupes, distinct du curseur du catalogue. Aucune copie stable garantie entre les pages.","schema":{"type":"integer","minimum":0,"maximum":10000,"default":0}}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueryResult"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"examples":{"rows":{"summary":"Illustrative live DataStore response","x-summary-fr":"Exemple de réponse DataStore en direct","value":{"data":{"fields":[{"id":"_id","type":"int"},{"id":"STREET_NAME","type":"text"}],"records":[{"_id":1,"STREET_NAME":"EXAMPLE"}],"total":1},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":"example.org","query_mode":"datastore","provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null},"sources":["example-source"]}}},"aggregate":{"summary":"Illustrative complete-snapshot aggregate; numeric database values can be strings","x-summary-fr":"Exemple d’agrégat de la copie complète; les nombres peuvent être des chaînes","value":{"data":{"fields":[{"id":"key","type":"TEXT"},{"id":"value","type":"INTEGER"}],"records":[{"key":"EXAMPLE","value":"2"}],"total":1},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null,"query_mode":"ingested","aggregation":{"group_by":"STREET_NAME","agg":"count","agg_column":null,"bucket":null},"provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}}}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"}},"x-credit-cost-fr":"1 requête de lignes / 10 agrégation"}},"/resources/{id}/query.csv":{"get":{"operationId":"exportResourceCsv","tags":["Query and export"],"summary":"Export a bounded CSV","x-summary-fr":"Exporter un CSV limité","description":"Exports from offset zero, at most 10000 rows (deployment cap; hard maximum 10,000). Same query capabilities as /query, including local full-snapshot aggregation before limiting groups. There is no CSV pagination or full-file guarantee. Use the original download for complete publisher files. Formula-like spreadsheet cells are neutralized. A failure after headers closes the partial response: discard incomplete output and retry within limits. Keyed failed/interrupted exports are refunded. Ten exports/minute plus plan request/concurrency limits.","x-description-fr":"Exporte à partir de zéro, au plus 10000 lignes (limite de déploiement; plafond absolu de 10 000). Mêmes capacités que /query, y compris l’agrégation locale complète avant de limiter les groupes. Aucune pagination CSV ni garantie de fichier complet. Le téléchargement original donne le fichier de l’éditeur. Les formules de tableur sont neutralisées. Une erreur après les en-têtes ferme la réponse partielle : jetez ce fichier et réessayez dans les limites. Les exports authentifiés échoués ou interrompus sont remboursés. Dix exports/minute, sous réserve du forfait.","x-credit-cost":25,"parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true},{"name":"snapshot","in":"query","description":"Require this exact local snapshot. A replaced or unavailable copy returns 409 SNAPSHOT_UNAVAILABLE; no automatic fallback or preparation. This token does not promise retention or source-content freshness.","x-description-fr":"Exige cette copie locale exacte. Une copie remplacée ou indisponible retourne 409 SNAPSHOT_UNAVAILABLE, sans remplacement ni préparation automatique. Aucun engagement de conservation ou de fraîcheur du fichier source.","schema":{"type":"string","pattern":"^cqs1_[0-9a-f]{64}$"}},{"name":"q","in":"query","description":"Search within resource rows (not catalogue search); at most 200 characters. Local search uses case-insensitive ILIKE patterns.","x-description-fr":"Recherche dans les lignes, distincte du catalogue; 200 caractères maximum. Recherche locale ILIKE insensible à la casse.","schema":{"type":"string","maxLength":200}},{"name":"filters","in":"query","description":"URL-encoded JSON object, at most 2,000 characters and 20 column keys of 1–63 characters. Exact recorded field names; conditions combine with AND. Scalars mean equality. Objects use op and value: eq, lt, gt, lte, gte, contains. Live DataStore supports eq only. eq:null means IS NULL locally; contains preserves % and _ SQL wildcard meanings.","x-description-fr":"Objet JSON encodé dans l’URL : 2 000 caractères, 20 champs de 1 à 63 caractères maximum. Noms exacts, conditions AND. Scalaire = égalité; objets op/value : eq, lt, gt, lte, gte, contains. DataStore : eq seulement. Localement, eq:null signifie IS NULL; contains conserve les jokers SQL % et _.","schema":{"type":"string","maxLength":2000},"example":"{\"STREET_NAME\":\"YONGE\"}"},{"name":"sort","in":"query","description":"Exact field name, optionally followed by asc or desc. Local row sorting also accepts _id; aggregates accept key or value. An exact field name wins over a direction suffix. Live DataStore values are limited to 100 characters.","x-description-fr":"Nom exact du champ, suivi éventuellement de asc ou desc. Lignes locales : _id aussi accepté; agrégats : key ou value. Le nom exact a priorité sur le suffixe. DataStore : 100 caractères maximum.","schema":{"type":"string"},"example":"STREET_NAME asc"},{"name":"group_by","in":"query","description":"Prepared tables only: exact recorded grouping field. Required together with agg.","x-description-fr":"Tables préparées : champ de regroupement exact, obligatoire avec agg.","schema":{"type":"string"},"example":"STREET_NAME"},{"name":"agg","in":"query","description":"Prepared tables only. count forbids agg_column; other functions require it. sum/avg require a numeric field.","x-description-fr":"Tables préparées : count interdit agg_column; les autres fonctions l’exigent. sum/avg exigent un champ numérique.","schema":{"type":"string","enum":["count","sum","avg","min","max"]},"example":"count"},{"name":"agg_column","in":"query","description":"Recorded measure field for sum, avg, min or max; forbidden with count.","x-description-fr":"Champ de mesure pour sum, avg, min ou max; interdit avec count.","schema":{"type":"string"}},{"name":"bucket","in":"query","description":"Optional temporal grouping; group_by must be DATE or TIMESTAMPTZ.","x-description-fr":"Regroupement temporel facultatif; group_by doit être DATE ou TIMESTAMPTZ.","schema":{"type":"string","enum":["year","month","day"]}}],"responses":{"200":{"description":"CSV attachment (UTF-8); no JSON envelope.","x-description-fr":"Pièce jointe CSV UTF-8, sans enveloppe JSON.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"},"Content-Disposition":{"$ref":"#/components/headers/Content-Disposition"},"X-CanQuery-Sources":{"$ref":"#/components/headers/X-CanQuery-Sources"},"X-CanQuery-Snapshot":{"$ref":"#/components/headers/X-CanQuery-Snapshot"},"X-CanQuery-Prepared-At":{"$ref":"#/components/headers/X-CanQuery-Prepared-At"},"X-CanQuery-Retrieved-At":{"$ref":"#/components/headers/X-CanQuery-Retrieved-At"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"text/csv":{"schema":{"type":"string"},"example":"_id,STREET_NAME\n1,EXAMPLE\n"}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/{id}/preview":{"get":{"operationId":"previewResource","tags":["Query and export"],"summary":"Preview a file before preparation","x-summary-fr":"Aperçu d’un fichier avant préparation","description":"For a CSV that CanQuery can prepare but has no ready copy and no live DataStore: reads the first 256 KiB of the publisher’s file (a ranged request; nothing is stored) and returns its header with inferred types and up to 50 rows as the file’s text. truncated means the sample ended before the file did. Nothing is prepared, renewed or recorded; the cached sample lasts ten minutes. A successful sample is priced as a metadata read; 409 PREVIEW_NOT_NEEDED (a prepared copy or live table exists), 422 PREVIEW_UNSUPPORTED (other formats or unreadable content) and 502 PREVIEW_UPSTREAM or PREVIEW_TIMEOUT (the publisher fails or stalls) cost nothing but still count toward request limits. Anonymous requests are limited to thirty a minute; keyed requests follow the plan request limit.","x-description-fr":"Pour un CSV préparable sans copie prête ni DataStore en direct : lit les premiers 256 Kio du fichier de l’éditeur (requête partielle; rien n’est conservé) et renvoie l’en-tête avec les types déduits et jusqu’à 50 lignes, en texte brut. truncated signale un échantillon arrêté avant la fin du fichier. Aucune préparation, aucun renouvellement, aucune popularité; l’échantillon est mis en cache dix minutes. Un échantillon réussi coûte une lecture de métadonnées; 409 PREVIEW_NOT_NEEDED (copie prête ou tableau en direct), 422 PREVIEW_UNSUPPORTED (autre format ou contenu illisible) et 502 PREVIEW_UPSTREAM ou PREVIEW_TIMEOUT (éditeur en échec ou sans réponse) ne coûtent rien mais comptent dans la fréquence. Requêtes anonymes limitées à trente par minute; les requêtes avec clé suivent la limite du forfait.","x-credit-cost":1,"parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Preview"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"fields":[{"id":"STREET_NAME","type":"TEXT","original_label":"STREET_NAME"}],"records":[{"STREET_NAME":"Main St"}],"truncated":true,"sampled_rows":1,"bytes_read":262144,"content_length":1048576},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null,"query_mode":"preview","provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/{id}/profile":{"get":{"operationId":"profileResource","tags":["Query and export"],"summary":"Profile a prepared table","x-summary-fr":"Profiler une table préparée","description":"Requires a ready local snapshot. Describes the whole file, not current filters. At most the first 60 recorded non-_id fields; numeric fields add min/max/avg and date fields min/max. Successful reads renew activity. Twenty requests/minute plus plan request/concurrency limits.","x-description-fr":"Exige une copie locale prête. Décrit le fichier entier, sans filtres. Les 60 premiers champs enregistrés hors _id au maximum; champs numériques avec min/max/avg, dates avec min/max. Renouvelle l’activité. Vingt requêtes/minute, sous réserve du forfait.","x-credit-cost":10,"parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true},{"name":"snapshot","in":"query","description":"Require this exact local snapshot. A replaced or unavailable copy returns 409 SNAPSHOT_UNAVAILABLE; no automatic fallback or preparation. This token does not promise retention or source-content freshness.","x-description-fr":"Exige cette copie locale exacte. Une copie remplacée ou indisponible retourne 409 SNAPSHOT_UNAVAILABLE, sans remplacement ni préparation automatique. Aucun engagement de conservation ou de fraîcheur du fichier source.","schema":{"type":"string","pattern":"^cqs1_[0-9a-f]{64}$"}}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Profile"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"row_count":1,"columns":[{"id":"STREET_NAME","type":"TEXT","distinct":1,"nulls":0}]},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null,"query_mode":"ingested","provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/{id}/prepare":{"post":{"operationId":"prepareResource","tags":["Preparation"],"summary":"Prepare or refresh a file","x-summary-fr":"Préparer ou actualiser un fichier","description":"No body. Returns 200 for a current copy or 202 for a new/shared job. Only a newly admitted job deducts preparation credits. A terminal failure without a result published by that job returns the actual debit to its original allowance period exactly once. Retries retain the charge; stopping polling does not fail the job. A failed refresh returns its own charge even if an older copy still serves. A successful empty table counts as success; later expiry or eviction does not return credits. This is an account-credit reversal, not a payment refund. Current copies, joins and polling cost zero but still count toward request limits. Keyed new jobs are capped at 20/account/hour; anonymous admission has a configured per-IP limit. A shared active-queue ceiling and format/size/row/column/storage caps also apply. A stale copy can continue serving during refresh. Paused admission returns 429 even for current copies. Anonymous requests from self-identified crawlers can read current copies and join shared jobs but cannot start new ones (429 AUTOMATED_CLIENT). Honour cooldown Retry-After; a new source version can bypass the old cooldown. No scheduled-refresh guarantee.","x-description-fr":"Sans corps. Retourne 200 pour une copie actuelle ou 202 pour une tâche nouvelle/partagée. Seule une nouvelle admission déduit des crédits. Un échec définitif sans publication par cette tâche rend une seule fois le débit réel à sa période d’origine. Les réessais gardent le débit; arrêter le suivi ne fait pas échouer la tâche. Un renouvellement échoué rend son débit même si une ancienne copie reste disponible. Une table vide valide compte comme un succès; son expiration ultérieure ne rend pas les crédits. Aucun remboursement de paiement. Copie actuelle, tâche partagée et suivi : zéro crédit, mais comptent dans la fréquence. Maximum de 20 admissions/compte/heure avec clé; limite anonyme par IP configurée. La file commune et les plafonds de format, taille, lignes, colonnes et stockage s’appliquent. Une ancienne copie peut rester disponible. Une pause donne 429 même pour une copie actuelle. Sans clé, un robot d’indexation identifié peut lire une copie actuelle ou rejoindre une tâche partagée, mais pas en lancer une nouvelle (429 AUTOMATED_CLIENT). Respectez Retry-After; une nouvelle version peut contourner l’ancien délai. Aucune actualisation planifiée garantie.","x-credit-cost":"100 new job / 0 existing","parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparationJob"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":null,"resource_id":"example-resource","status":"done","already_loaded":true,"row_count":1,"prepared_at":"2026-01-01T00:00:00.000Z"},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"202":{"description":"New or shared job. Poll GET /jobs/{id}, then re-read resource metadata.","x-description-fr":"Tâche nouvelle ou partagée. Suivez GET /jobs/{id}, puis relisez les métadonnées.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparationJob"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":123,"resource_id":"example-resource","status":"pending","created_at":"2026-01-01T00:00:00.000Z","serving_cached":false,"prepared_at":null},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}},"x-credit-cost-fr":"100 nouvelle tâche / 0 existante"}},"/resources/{id}/ingest":{"post":{"operationId":"ingestResourceLegacy","tags":["Preparation"],"summary":"Prepare a file (legacy)","x-summary-fr":"Préparer un fichier (historique)","description":"No body. Compatibility endpoint; new integrations should use /prepare for freshness and refresh. It returns an existing ready copy without refreshing stale data. Five requests/hour, plus shared limits. New-job charging matches /prepare.","x-description-fr":"Sans corps. Compatibilité : utilisez /prepare pour gérer l’actualité et le renouvellement. Renvoie une copie prête sans actualiser une copie ancienne. Cinq requêtes/heure, plus les limites communes. Même coût d’admission que /prepare.","x-credit-cost":"100 new job / 0 existing","parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Job"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":null,"resource_id":"example-resource","status":"done","attempts":0,"retry_at":null,"failure_reason":null,"error":null,"created_at":"2026-01-01T00:00:00.000Z","claimed_at":null,"finished_at":null,"age_seconds":0,"progress":null,"already_loaded":true,"row_count":1},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"202":{"description":"New or shared legacy preparation job.","x-description-fr":"Tâche de préparation historique nouvelle ou partagée.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Job"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":123,"resource_id":"example-resource","status":"pending","attempts":0,"retry_at":null,"failure_reason":null,"error":null,"created_at":"2026-01-01T00:00:00.000Z","claimed_at":null,"finished_at":null,"age_seconds":0,"progress":null},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}},"deprecated":true,"x-credit-cost-fr":"100 nouvelle tâche / 0 existante"}},"/resources/{id}/activity":{"post":{"operationId":"renewResourceActivity","tags":["Preparation"],"summary":"Renew local-copy activity","x-summary-fr":"Renouveler l’activité d’une copie","description":"No body. Renews an existing ready copy without preparing a file or recording popularity. A 409 means the copy is unavailable or replaced; re-read metadata. Zero credits still counts toward request limits.","x-description-fr":"Sans corps. Renouvelle une copie prête, sans préparation ni popularité. Un 409 indique une copie absente ou remplacée : relisez les métadonnées. Zéro crédit compte toujours dans la fréquence.","x-credit-cost":0,"parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Activity renewed; empty body.","x-description-fr":"Activité renouvelée; corps vide.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/jobs/{id}":{"get":{"operationId":"getPreparationJob","tags":["Preparation"],"summary":"Poll a preparation job","x-summary-fr":"Suivre une tâche de préparation","description":"Poll one request at a time with a bounded delay and honour Retry-After on errors. A done job is historical: re-read resource metadata before querying because a prepared copy may expire. Failure messages are sanitized; failure_reason and retry_at explain retry eligibility. Zero credits still counts toward request limits.","x-description-fr":"Une requête de suivi à la fois, avec délai borné; respectez Retry-After en cas d’erreur. Une tâche done est historique : relisez les métadonnées, car une copie peut expirer. Messages assainis; failure_reason et retry_at décrivent le nouvel essai. Zéro crédit compte dans la fréquence.","x-credit-cost":0,"parameters":[{"name":"id","in":"path","description":"Positive job ID returned by preparation.","x-description-fr":"Identifiant positif reçu lors de la préparation.","schema":{"type":"integer","minimum":1},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Job"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":123,"resource_id":"example-resource","status":"pending","attempts":0,"retry_at":null,"failure_reason":null,"error":null,"created_at":"2026-01-01T00:00:00.000Z","claimed_at":null,"finished_at":null,"age_seconds":0,"progress":null},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/{id}/map":{"get":{"operationId":"getMapViewport","tags":["Maps"],"summary":"Get a bounded map viewport","x-summary-fr":"Obtenir une vue cartographique limitée","description":"Enveloped WGS84 GeoJSON for admitted ArcGIS, local PostGIS or PMTiles maps. live=true identifies the viewport interface; it does not promise a publisher fetch on every call. Check returned/truncated; requests are capped at 1,000 features and 8 MiB. PMTiles viewport decoding also bounds tile count. Sixty viewport calls/minute plus plan request/concurrency limits.","x-description-fr":"GeoJSON WGS84 enveloppé pour ArcGIS, PostGIS local ou PMTiles admis. live=true désigne l’interface, pas une lecture de l’éditeur à chaque appel. Consultez returned/truncated : 1 000 entités et 8 Mio maximum. Le décodage PMTiles limite aussi les tuiles. Soixante appels/minute, sous réserve du forfait.","x-credit-cost":10,"parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true},{"name":"bbox","in":"query","description":"Required WGS84 west,south,east,north: -180 ≤ west < east ≤ 180 and -90 ≤ south < north ≤ 90.","x-description-fr":"Requis : ouest,sud,est,nord en WGS84. -180 ≤ ouest < est ≤ 180; -90 ≤ sud < nord ≤ 90.","schema":{"type":"string"},"required":true,"example":"-79.5,43.6,-79.3,43.8"},{"name":"zoom","in":"query","description":"Integer zoom level.","x-description-fr":"Niveau de zoom entier.","schema":{"type":"integer","minimum":0,"maximum":22,"default":11}},{"name":"limit","in":"query","description":"Feature ceiling; out-of-range values return 400.","x-description-fr":"Plafond d’entités; hors limites : 400.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":1000}}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FeatureCollection"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"type":"FeatureCollection","features":[]},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null,"map":{"live":true,"provider":"arcgis","geometry_type":"point","fields":[],"returned":0,"truncated":false,"indexed_at":null},"provenance":{"sources":[{"id":"example-source","kind":"ckan","name":{"en":"Example publisher","fr":"Éditeur exemple"},"homepage_url":"https://example.org/","landing_url":"https://example.org/dataset/example","upstream":"example.org","authoritative":true,"license":null}],"primary_license":null}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"413":{"$ref":"#/components/responses/Error413"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"}}}},"/resources/{id}/map/tiles/{version}/{z}/{x}/{y}.pbf":{"get":{"operationId":"getMapTile","tags":["Maps"],"summary":"Get a vector tile","x-summary-fr":"Obtenir une tuile vectorielle","description":"PMTiles maps only. Copy the current tiles template/version and zoom range from resource metadata. Coordinates must fit the tile grid and archive zoom range. Anonymous successful tiles cache immutably for one year; keyed responses remain private, no-store. Up to 240 tiles/minute, also subject to the keyed plan request limit.","x-description-fr":"Cartes PMTiles seulement. Utilisez le modèle tiles, la version et la plage de zoom des métadonnées. Les coordonnées doivent respecter la grille et l’archive. Cache anonyme immuable d’un an; réponses avec clé privées, no-store. Maximum de 240 tuiles/minute, et limite du forfait avec clé.","x-credit-cost":1,"parameters":[{"name":"id","in":"path","description":"Resource ID from dataset or resource metadata.","x-description-fr":"Identifiant de ressource obtenu dans les métadonnées.","schema":{"type":"string"},"required":true},{"name":"version","in":"path","description":"Current map version from resource metadata.","x-description-fr":"Version actuelle issue des métadonnées.","schema":{"type":"string"},"required":true},{"name":"z","in":"path","description":"Zoom within this archive’s min_zoom/max_zoom (0–22).","x-description-fr":"Zoom dans min_zoom/max_zoom de l’archive (0–22).","schema":{"type":"integer","minimum":0,"maximum":22},"required":true},{"name":"x","in":"path","description":"Tile coordinate from 0 through 2^z − 1.","x-description-fr":"Coordonnée de 0 à 2^z − 1.","schema":{"type":"integer","minimum":0},"required":true},{"name":"y","in":"path","description":"Tile coordinate from 0 through 2^z − 1.","x-description-fr":"Coordonnée de 0 à 2^z − 1.","schema":{"type":"integer","minimum":0},"required":true}],"responses":{"200":{"description":"Vector-tile protobuf bytes; no JSON envelope.","x-description-fr":"Octets protobuf de la tuile, sans enveloppe JSON.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"204":{"description":"No tile at these coordinates; empty body.","x-description-fr":"Aucune tuile à ces coordonnées; corps vide.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"502":{"$ref":"#/components/responses/Error502"},"503":{"$ref":"#/components/responses/Error503"}}}},"/stats":{"get":{"operationId":"getCatalogueStats","tags":["Discovery"],"summary":"Get catalogue statistics","x-summary-fr":"Obtenir les statistiques du catalogue","description":"Briefly cached counts; capabilities overlap. These are dated observations, not guaranteed coverage or publisher availability.","x-description-fr":"Dénombrements brièvement mis en cache; les capacités se chevauchent. Observations datées, sans garantie de couverture ni de disponibilité.","x-credit-cost":1,"parameters":[],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Stats"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"datasets":1,"resources":1,"datastore_active_resources":1,"ingested_resources":0,"mappable_resources":0,"store_bytes":0,"organizations":1,"places":1,"last_synced_at":null},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/insights/top-downloads":{"get":{"operationId":"getTopDownloads","tags":["Guides and insights"],"summary":"Get the publisher download leaderboard","x-summary-fr":"Obtenir le classement des téléchargements","description":"Publisher-reported download statistics with selected representatives. Distinct from CanQuery query popularity; meta.period identifies the reporting month.","x-description-fr":"Statistiques de téléchargements de l’éditeur et ressources représentatives. Distinctes de la popularité CanQuery; meta.period précise le mois.","x-credit-cost":1,"parameters":[{"name":"lang","in":"query","description":"French when fr; otherwise English.","x-description-fr":"Français avec fr; anglais autrement.","schema":{"type":"string","default":"en"},"example":"en"}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TopDownload"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[{"rank":1,"dataset_id":"example-dataset","dataset_name":"example-dataset","title":{"en":"Example permits","fr":"Permis exemples"},"department":"Example","ministere":"Exemple","downloads":10,"history":[],"resource_id":"example-resource","ingest_status":null,"row_count":null}],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null,"period":{"year":2026,"month":1}}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/insights/featured":{"get":{"operationId":"getFeaturedPreviews","tags":["Guides and insights"],"summary":"Get prepared chart previews","x-summary-fr":"Obtenir les aperçus de graphiques","description":"Up to 12 validated previews from already prepared Top 100 representatives. No preparation is admitted. Context gives aggregation, snapshot time, displayed/total groups and known missing metrics; this is neither a chart-rendering API nor a scheduled-refresh service.","x-description-fr":"Jusqu’à 12 aperçus validés de ressources du Top 100 déjà préparées. Aucune préparation. Le contexte précise agrégat, date de copie, groupes et mesures manquantes connues; ce n’est ni une API de rendu ni un service d’actualisation planifiée.","x-credit-cost":10,"parameters":[{"name":"lang","in":"query","description":"French when fr; otherwise English.","x-description-fr":"Français avec fr; anglais autrement.","schema":{"type":"string","default":"en"},"example":"en"}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FeaturedPreview"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/blog":{"get":{"operationId":"listGuides","tags":["Guides and insights"],"summary":"List data guides","x-summary-fr":"Lister les guides de données","description":"Published guide summaries; reads bundled content without querying the catalogue.","x-description-fr":"Résumés des guides publiés; lit le contenu inclus sans consulter le catalogue.","x-credit-cost":1,"parameters":[{"name":"lang","in":"query","description":"Guide language; must be en or fr.","x-description-fr":"Langue des guides : en ou fr.","schema":{"type":"string","enum":["en","fr"],"default":"en"}},{"name":"place","in":"query","description":"Guide place slug.","x-description-fr":"Slug du lieu associé au guide.","schema":{"type":"string"}},{"name":"dataset","in":"query","description":"Canonical dataset ID or published slug.","x-description-fr":"Identifiant canonique ou slug publié du jeu.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Article"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":[],"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/blog/{lang}/{slug}":{"get":{"operationId":"getGuide","tags":["Guides and insights"],"summary":"Get a data guide","x-summary-fr":"Obtenir un guide de données","description":"Published guide edition including sanitized bodyHtml and translation links.","x-description-fr":"Édition publiée avec bodyHtml assaini et liens des traductions.","x-credit-cost":1,"parameters":[{"name":"lang","in":"path","description":"Guide edition language.","x-description-fr":"Langue de l’édition.","schema":{"type":"string","enum":["en","fr"]},"required":true},{"name":"slug","in":"path","description":"Published localized guide slug.","x-description-fr":"Slug localisé du guide publié.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Article"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"id":"example-guide","lang":"en","slug":"example-guide","path":"/blog/example-guide","title":"Example guide","description":"Illustrative guide.","bodyHtml":"<p>Example guide content.</p>","translations":{"en":"/blog/example-guide","fr":"/fr/blog/guide-exemple"}},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/repo":{"get":{"operationId":"getRepositoryMetadata","tags":["Guides and insights"],"summary":"Get repository metadata","x-summary-fr":"Obtenir les métadonnées du dépôt","description":"Cached public GitHub star count. data may be null when GitHub is unavailable.","x-description-fr":"Nombre d’étoiles GitHub publiques en cache. data peut être null si GitHub est indisponible.","x-credit-cost":1,"parameters":[],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"X-CanQuery-Credits-Limit":{"$ref":"#/components/headers/X-CanQuery-Credits-Limit"},"X-CanQuery-Credits-Remaining":{"$ref":"#/components/headers/X-CanQuery-Credits-Remaining"},"X-CanQuery-Credits-Reset":{"$ref":"#/components/headers/X-CanQuery-Credits-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"stars":{"type":"integer","minimum":0}}},{"type":"null"}]},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"stars":1},"pagination":{"nextCursor":null},"meta":{"source":"github","license":null,"upstream":"api.github.com"}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}},"/ops":{"get":{"operationId":"getOperations","tags":["Operations"],"summary":"Inspect job and map health","x-summary-fr":"Consulter la santé des tâches et cartes","description":"Public and unmetered. HTTP 200 or 503 uses the same envelope according to data.ok. Preparation counters alone do not change ok; inspect queue age and worker state separately. Health does not guarantee every file is available.","x-description-fr":"Public, sans crédits. HTTP 200 ou 503 utilise la même enveloppe selon data.ok. Les compteurs de préparation ne changent pas seuls ok; vérifiez séparément l’âge de la file et les processus. Aucune garantie pour chaque fichier.","x-credit-cost":0,"parameters":[],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Operations"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"ok":true,"jobs":{"full":{"last_ok_at":"2026-01-01T00:00:00.000Z","status":"ok"}},"maps":{"pending":0,"deferred":0,"running":0,"ready":0,"skipped":0,"failed":0,"retrying_sources":0,"oldest_pending_at":null,"next_retry_at":null,"oldest_running_at":null,"last_indexed_at":null,"status":"ok"},"preparations":{"pending":0,"running":0,"failed_last_day":0,"completed_last_day":0,"oldest_pending_at":null}},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"description":"A job or map health check is degraded.","x-description-fr":"Une tâche ou une vérification cartographique est dégradée.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Operations"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"ok":false,"jobs":{"full":{"last_ok_at":null,"status":"failed"}},"maps":{"pending":0,"deferred":0,"running":0,"ready":0,"skipped":0,"failed":0,"retrying_sources":0,"oldest_pending_at":null,"next_retry_at":null,"oldest_running_at":null,"last_indexed_at":null,"status":"ok"},"preparations":{"pending":0,"running":0,"failed_last_day":0,"completed_last_day":0,"oldest_pending_at":null}},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}}},"security":[]}},"/healthz":{"get":{"operationId":"getHealth","tags":["Operations"],"summary":"Check database and federal upstream","x-summary-fr":"Vérifier la base et la source fédérale","description":"Site-root path /healthz (not /api/v1/healthz). Public, unmetered, unenveloped reachability check; not a worker or catalogue-wide availability check.","x-description-fr":"Route racine /healthz (pas /api/v1/healthz). Vérification publique sans crédits ni enveloppe; ne vérifie pas les processus ni tous les fichiers.","x-credit-cost":0,"parameters":[],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"},"example":{"ok":true,"db":true,"upstream":true}}}},"503":{"description":"Database or federal upstream probe failed.","x-description-fr":"La base ou la source fédérale ne répond pas.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"},"example":{"ok":false,"db":false,"upstream":true}}}}},"servers":[{"url":"/"}],"security":[]}},"/readyz":{"get":{"operationId":"getReadiness","tags":["Operations"],"summary":"Check application and database availability","x-summary-fr":"Vérifier la disponibilité du service et de la base","description":"Site-root path. Public, unmetered and no-store. Checks database connectivity without requiring an upstream publisher or worker to be healthy.","x-description-fr":"Route racine, publique, sans crédits et sans cache. Vérifie la base sans dépendre de la santé des éditeurs ou des processus.","x-credit-cost":0,"parameters":[],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Readiness"},"example":{"ok":true,"db":true}}}},"503":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Readiness"},"example":{"ok":false,"db":false}}}}},"servers":[{"url":"/"}],"security":[]}},"/ops/components/{component}":{"get":{"operationId":"getComponentHealth","tags":["Operations"],"summary":"Inspect one operational component","x-summary-fr":"Consulter un composant opérationnel","description":"Public, unmetered and no-store. Sanitized host observations older than 180 seconds fail closed with HTTP 503. Independent components separate availability, preparation, maps, sources, commercial backlogs, backups and storage. Existing /ops semantics remain unchanged.","x-description-fr":"Public, sans crédits et sans cache. Les observations de plus de 180 secondes donnent HTTP 503. Sépare disponibilité, préparation, cartes, sources, files commerciales, sauvegardes et stockage. Le comportement de /ops reste inchangé.","x-credit-cost":0,"parameters":[{"name":"component","in":"path","description":"Operational component to inspect.","x-description-fr":"Composant opérationnel à consulter.","schema":{"type":"string","enum":["availability","preparation","maps","sources","commercial","backups","storage"]},"required":true}],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ComponentHealth"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"component":"preparation","ok":true,"status":"ok","observed_at":"2026-01-01T00:00:00.000Z","checks":{"service_active":true,"stale_running":0}},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ComponentHealth"},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","pagination","meta"]},"example":{"data":{"component":"preparation","ok":false,"status":"stale","observed_at":null,"checks":{}},"pagination":{"nextCursor":null},"meta":{"source":"canquery","license":null,"upstream":null}}}}}},"security":[]}},"/openapi.json":{"get":{"operationId":"getOpenApi","tags":["Operations"],"summary":"Download the OpenAPI contract","x-summary-fr":"Télécharger le contrat OpenAPI","description":"Public, unmetered OpenAPI 3.1 document. Import into compatible developer tools. Examples are synthetic and do not establish current publisher data or availability.","x-description-fr":"Document OpenAPI 3.1 public, sans crédits. Importez-le dans vos outils compatibles. Exemples synthétiques, sans garantie de données ou disponibilité actuelles.","x-credit-cost":0,"parameters":[],"responses":{"200":{"description":"Successful response.","x-description-fr":"Réponse réussie.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object"}}}},"429":{"$ref":"#/components/responses/Error429"}},"security":[]}}}}