Versioning

The API version is part of the URL path:

https://api.directiq.com/v2/senders
                        └┬┘
                      version

Available versions

VersionPathStatus
v2/v2/...Current. Use it for every new integration.
v1no prefix, for example /template/get/{id}Supported. Endpoints are being deprecated as their v2 replacements ship.
🚧

Requests without a version prefix are v1

An unversioned path is always v1, never the latest version. To use v2, put /v2/ in the path.

What can change within a version

Within a major version we only make backwards-compatible changes, such as:

  • new endpoints;
  • new optional request parameters or fields;
  • new fields in responses;
  • new values in code and in status fields.

Make your client ignore response fields it doesn't recognize. Breaking changes, such as removing or renaming a field or changing its type, go into a new major version.

Unsupported versions

A path with a version that doesn't exist, such as /v9/senders, returns 400 with code unsupported_api_version. The api-supported-versions response header lists the versions that do exist.

📘

The api-version header

Earlier integrations selected a version with an api-version header. The header still works for v1 requests, but you don't need it anymore. The path decides the version.

Deprecation and retirement

When an endpoint is replaced, we deprecate it before we retire it. A deprecated endpoint keeps working and adds these headers to every response:

Deprecation: @1793491200
Sunset: Mon, 01 Nov 2027 00:00:00 GMT
Link: </v2/templates/42>; rel="successor-version"
HeaderMeaning
DeprecationWhen the endpoint was deprecated, as a Unix timestamp.
SunsetWhen the endpoint will stop working.
Link (rel="successor-version")The endpoint that replaces it.

An endpoint goes through three stages:

  1. Deprecated. It works normally and returns the headers above.
  2. Brownouts. Before the sunset date, we switch it off for short scheduled periods. During a brownout it returns 410 with code endpoint_brownout.
  3. Retired. After the sunset date, it always returns 410 with code endpoint_retired.
👍

Catch deprecations early

Log a warning whenever a response includes a Deprecation header. You will find out what needs migrating long before the sunset date.