Versioning
The API evolves by adding. When an operation must break, the old behavior stays available through a date header, is announced in the changelog, and lasts at least six months.
Evolution first
Paths never carry a version number. These changes ship at any time, without notice, and must not break your integration:
- a new operation or a new resource;
- a new optional parameter or header;
- a new field in a response;
- a new enum value;
- a new error code, or a new member in an error's
context.
So: ignore the fields you do not know, tolerate unknown enum values, and fall back on the HTTP status for an unknown error code (see Conventions).
Anything else is a breaking change: removing or
renaming a field, changing its type or meaning, making a parameter
required, changing a code's status. Those go through
Myle-API-Version.
Myle-API-Version
CLI
#!/usr/bin/env bash
# versioning-header: the myle CLI (key from `myle login` or MYLE_API_KEY).
# The CLI always sends a Myle-API-Version: by default the date it was built against,
# so upgrading the CLI is how you move to newer behaviors.
myle version # the CLI's version and its Myle-API-Version
myle me --version 2026-12-01 # another date, for one call
myle config --set api_version 2026-12-01 # or pinned for the project
HTTP
Myle-API-Version: 2026-12-01
TypeScript
import { API_VERSION, Myle } from '@myleapp/myle';
// The SDK always sends a Myle-API-Version: by default the date it was generated against,
// so upgrading the SDK is how you move to newer behaviors. Pin another date explicitly:
const myle = new Myle({ apiVersion: '2026-12-01' });
console.log(`built against ${API_VERSION}`);
await myle.me.get();
Python
from myle import API_VERSION, Myle
# The SDK always sends a Myle-API-Version: by default the date it was generated against,
# so upgrading the SDK is how you move to newer behaviors. Pin another date explicitly:
myle = Myle(api_version="2026-12-01")
print(f"built against {API_VERSION}")
myle.me.get()
Go
package main
import (
"context"
"fmt"
"log"
myle "github.com/myleapp/myle-go"
)
func main() {
// The SDK always sends a Myle-API-Version: by default the date it was generated against,
// so upgrading the SDK is how you move to newer behaviors. Pin another date explicitly:
client := myle.NewClient(myle.WithAPIVersion("2026-12-01"))
fmt.Println("built against", myle.APIVersion)
if _, err := client.Me.Get(context.Background()); err != nil {
log.Fatal(err)
}
}
Java
import fr.myleapp.myle.MyleClient;
public class Example {
public static void main(String[] args) {
// The SDK always sends a Myle-API-Version: by default the date it was generated against,
// so upgrading the SDK is how you move to newer behaviors. Pin another date explicitly:
MyleClient client = MyleClient.builder().apiVersion("2026-12-01").build();
System.out.println("built against " + MyleClient.API_VERSION);
client.me().get();
}
}
Scala
import fr.myleapp.myle.{MyleClient, MyleConfig, Version}
object VersioningHeader {
def main(args: Array[String]): Unit = {
// The SDK always sends a Myle-API-Version: by default the date it was generated against,
// so upgrading the SDK is how you move to newer behaviors. Pin another date explicitly:
val myle = MyleClient(MyleConfig(apiVersion = "2026-12-01"))
println(s"built against ${Version.api}")
myle.me.get()
}
}
PHP
<?php
require __DIR__ . '/vendor/autoload.php';
use Myle\Client;
use Myle\Version;
// The SDK always sends a Myle-API-Version: by default the date it was generated against,
// so upgrading the SDK is how you move to newer behaviors. Pin another date explicitly:
$myle = new Client(apiVersion: '2026-12-01');
echo 'built against ', Version::API_VERSION, "\n";
$myle->me->get();
C#
using Myle;
// The SDK always sends a Myle-API-Version: by default the date it was generated against,
// so upgrading the SDK is how you move to newer behaviors. Pin another date explicitly:
using var client = new MyleClient(new MyleClientOptions { ApiVersion = "2026-12-01" });
Console.WriteLine($"built against {MyleClient.DefaultApiVersion}");
await client.Me.GetAsync();
-
The value is a date,
YYYY-MM-DD: the contract your integration was built and tested against. - Absent, you get the latest behavior of every operation. That suits a quick test with curl, not a production integration: a breaking change would reach it on the day it ships.
- Present, each operation applies its most recent behavior dated on or before your date.
-
A date older than the oldest behavior an operation still supports,
or a value that is not a date, answers
400 core.api-version-unsupported, with the minimum incontext.minimum. - An operation that never broke ignores the header. That is the usual case.
In production, always send Myle-API-Version,
set to the day you last tested. Move it forward when you have read
the changelog and adapted your code. The official SDKs send the date
of the API document they were generated from.
Deprecation and sunset headers
When your date gets an older behavior, the response says so, with the date of the change that replaced it and where to read about it:
CLI
#!/usr/bin/env bash
# versioning-deprecation: the myle CLI (key from `myle login` or MYLE_API_KEY).
# When the API serves a call with an older behavior, the CLI prints a warning on stderr
# (`--log-level error` silences it; with --format json it is off unless --log-level warn, then a JSON line):
# warning: GET /me answered with the deprecated behavior of Myle-API-Version 2026-12-01, served until …
myle me --version 2026-12-01
HTTP
HTTP/1.1 201 Created
Myle-API-Version: 2026-12-01
Deprecation: @1803859200
Sunset: Wed, 01 Sep 2027 00:00:00 GMT
Link: <https://developers.myleapp.fr/changelog/2027-03-01>; rel="deprecation"
TypeScript
import { Myle } from '@myleapp/myle';
// Called once per operation when the API serves it with an older behavior
// (a Node DeprecationWarning by default; null to stay silent).
const myle = new Myle({
apiVersion: '2026-12-01',
onDeprecation: (notice) => {
console.warn(`${notice.method} ${notice.path}: deprecated, sunset ${notice.sunset}, read ${notice.link}`);
},
});
await myle.me.get();
Python
from myle import DeprecationNotice, Myle
# Called once per operation when the API serves it with an older behavior
# (a MyleDeprecationWarning by default; None to stay silent).
def warn(notice: DeprecationNotice) -> None:
print(f"{notice.method} {notice.path}: deprecated, sunset {notice.sunset}, read {notice.link}")
myle = Myle(api_version="2026-12-01", on_deprecation=warn)
myle.me.get()
Go
package main
import (
"context"
"fmt"
"log"
myle "github.com/myleapp/myle-go"
)
func main() {
// Called once per operation when the API serves it with an older behavior
// (a line on the standard logger by default; nil to stay silent).
client := myle.NewClient(
myle.WithAPIVersion("2026-12-01"),
myle.WithDeprecationHandler(func(notice myle.DeprecationNotice) {
fmt.Printf("%s %s: deprecated, sunset %s, read %s\n", notice.Method, notice.Path, notice.Sunset, notice.Link)
}),
)
if _, err := client.Me.Get(context.Background()); err != nil {
log.Fatal(err)
}
}
Java
import fr.myleapp.myle.MyleClient;
public class Example {
public static void main(String[] args) {
// Called once per operation when the API serves it with an older behavior
// (a System.Logger warning by default; null to stay silent).
MyleClient client = MyleClient.builder()
.apiVersion("2026-12-01")
.onDeprecation(notice -> System.err.println(notice.method() + " " + notice.path()
+ ": deprecated, sunset " + notice.sunset() + ", read " + notice.link()))
.build();
client.me().get();
}
}
Scala
import fr.myleapp.myle.{DeprecationNotice, MyleClient, MyleConfig}
object VersioningDeprecation {
def main(args: Array[String]): Unit = {
// Called once per operation when the API serves it with an older behavior
// (a System.Logger warning by default; None to stay silent).
val warn = (notice: DeprecationNotice) =>
System.err.println(s"${notice.method} ${notice.path}: deprecated, sunset ${notice.sunset.getOrElse("")}, read ${notice.link.getOrElse("")}")
val myle = MyleClient(MyleConfig(apiVersion = "2026-12-01", onDeprecation = Some(warn)))
myle.me.get()
}
}
PHP
<?php
require __DIR__ . '/vendor/autoload.php';
use Myle\Client;
use Myle\DeprecationNotice;
// Called once per operation when the API serves it with an older behavior
// (an E_USER_DEPRECATED by default; null to stay silent).
$myle = new Client(
apiVersion: '2026-12-01',
onDeprecation: function (DeprecationNotice $notice): void {
echo "{$notice->method} {$notice->path}: deprecated, sunset {$notice->sunset}, read {$notice->link}\n";
},
);
$myle->me->get();
C#
using Myle;
// Called once per operation when the API serves it with an older behavior
// (a line on the standard error by default; null to stay silent).
using var client = new MyleClient(new MyleClientOptions
{
ApiVersion = "2026-12-01",
OnDeprecation = notice =>
Console.Error.WriteLine($"{notice.Method} {notice.Path}: deprecated, sunset {notice.Sunset}, read {notice.Link}"),
});
await client.Me.GetAsync();
| Header | Meaning |
|---|---|
Myle-API-Version | The date you asked for. |
Deprecation | Since when this behavior is superseded (RFC 9745): a Unix time, here midnight UTC on 2027-03-01. |
Sunset | When it will stop being served (RFC 8594), once a date is set. |
Link; rel="deprecation" | The changelog page of the change: what changed and how to migrate. |
The latest behavior carries none of them. Watch for
Deprecation in your logs: it is your signal to read the
changelog.
The changelog and the six-month notice
-
Every breaking change has its own page in the
changelog, at
developers.myleapp.fr/changelog/YYYY-MM-DD, the date of the change: what changed, which operations, theMyle-API-Versionbefore and after, theDeprecationandSunsetdates, and the migration steps. -
The
Sunsetdate is at least six months after the change is announced. Until then, the old behavior keeps working for every request that asks for it. -
After the sunset, the old behavior is removed: the operation's
oldest supported date moves forward, and an older
Myle-API-Versionanswers400 core.api-version-unsupported.
Released and internal operations
Only the operations in the OpenAPI document, api.myleapp.fr/openapi.json, and in the reference are released. They are a contract and follow the rules above. An operation that answers but is not in the document is internal: its shape can still change without notice, so do not build on it. The document describes the current behavior of each operation.