Developers and agents
Versioning, deprecation and rate limits, written down so you can build against the Martialytics API without watching for surprises. Applies to https://api.mtly.app and to the machine endpoints on this site.
Versions live in the URL path. Every route is under a major version segment, currently /v1/, on the origin declared in the servers entry of openapi.json. There is no version header to negotiate; the path is the contract.
What changes without a new version. Within a major version we only make additive, backwards-compatible changes: new endpoints, new optional request fields and query parameters, new fields in responses, new enum values on fields documented as open, and new webhook event types. Clients must ignore response fields they do not recognise.
What forces a new version. Removing or renaming an endpoint, field or parameter, changing a field's type or meaning, making an optional input required, tightening validation on existing inputs, or changing authentication. These ship under a new major path (/v2/) while the previous version keeps working through its deprecation period.
Where to see what changed. The OpenAPI document carries the current API version in info.version (today 2.0.0); the interactive reference at https://api.mtly.app/docs always describes the live surface, and the per-module Markdown docs behind https://api.mtly.app/llms.txt are generated from the same schema.
Notice period. When an endpoint, field or whole major version is deprecated it keeps working for at least 12 months from the announcement before it is removed. Security fixes that cannot be made compatibly are the one exception, and those are communicated directly to affected API-key holders.
How you find out. Deprecated resources are signalled in-band on every response, using the standard header fields:
Deprecation: @1767225600 # RFC 9745: the date the resource was deprecated Sunset: Sat, 01 Jan 2028 00:00:00 GMT # RFC 8594: the date it stops responding Link: <https://www.martialytics.com/developers/api-policy>; rel="deprecation"; type="text/html"
The OpenAPI document marks the same operations and properties with deprecated: true, and the change is described in the interactive reference. Key holders also receive an email to the address on the school account at announcement and again 30 days before sunset.
What to do. Watch for the Deprecation header in your client (most HTTP libraries expose it in one line) and log it. Migrate before the Sunset date; after it the resource returns 410 Gone with the usual JSON error envelope and a recovery block pointing at the replacement.
Product API. Limits are applied per API key and reported on every response in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. When a limit is exceeded the API answers 429 with Retry-After and the JSON error envelope; wait for the reset and retry with backoff. Bulk work should be spread across the window rather than burst.
Machine endpoints on this site. The MCP server at /mcp and the spec at /openapi.json are rate limited per client address and advertise the limit with the IETF RateLimit fields (draft-ietf-httpapi-ratelimit-headers) alongside the same X-RateLimit-* trio:
RateLimit-Policy: "mcp";q=120;w=60 # 120 requests per 60 seconds
RateLimit: "mcp";r=118;t=41 # 118 left, window resets in 41 seconds
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 118
X-RateLimit-Reset: 41
# When exceeded
HTTP/1.1 429 Too Many Requests
Retry-After: 41
Content-Type: application/json; charset=utf-8
{ "success": false, "error": { "code": "RATE_LIMITED", "message": "...", "recovery": { "suggestion": "Wait 41 seconds (Retry-After) and retry", "actions": [ ... ] } } }| Policy | Applies to | Quota |
|---|---|---|
| mcp | POST /mcp | 120 requests per 60 seconds per client |
| machine | /openapi.json and JSON error responses on API-shaped paths | 300 requests per 60 seconds per client |
Errors are always JSON. On the API and on the machine endpoints here, failures come back as { "success": false, "error": { "code", "message", "recovery": { "suggestion", "actions" } } }, with a stable code you can branch on and actions naming the concrete next request. Never an HTML error page.
Discovery links. Responses from /openapi.json and /mcp carry RFC 8631 Link relations: service-desc (the OpenAPI document), service-doc (/developers) and service-meta (this page). Every HTML page links the spec the same way.
Questions. Anything unclear, or a change you need warning about, goes to support@martialytics.com with "API" in the subject line. A founder replies.