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:

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.

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();

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();
HeaderMeaning
Myle-API-VersionThe date you asked for.
DeprecationSince when this behavior is superseded (RFC 9745): a Unix time, here midnight UTC on 2027-03-01.
SunsetWhen 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

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.