# API versioning and deprecation policy

> Index of all OmniSocials docs pages: https://docs.omnisocials.com/llms.txt

You integrate once and your code runs unattended after that. This page says what can change in the OmniSocials API, and how much warning you get before something breaks.

## The short version

- The version is in the path: `https://api.omnisocials.com/v1`.
- Within v1 we only add things. Your code must ignore fields it does not know.
- A breaking change comes as a new version (`/v2`) or as a deprecation within v1.
- A deprecated endpoint answers with `Deprecation` and `Sunset` headers, and keeps working for **at least 6 months** after the announcement.

## Changes without notice

These changes can ship at any time, because a client that follows the rules below keeps working:

- New endpoints.
- New optional request parameters and body fields.
- New fields in responses.
- New values in an enum, such as a new post status or a new platform.
- New error codes, and new response headers.

So: ignore response fields you do not know, handle enum values you do not know (show them or skip them, do not crash), and branch on the error `code`, not on the `message` text.

## Breaking changes

A breaking change is one that can stop a working client:

- Removing or renaming an endpoint, a field or a parameter.
- Changing the type of a field, or the default of a parameter.
- Making an optional field required.

A breaking change comes as a new version (`/v2`, next to `/v1`) or as a deprecation within v1, never as a silent change.

## How a deprecation is announced

1. Every response of the deprecated endpoint carries a `Deprecation` header ([RFC 9745](https://www.rfc-editor.org/rfc/rfc9745)) with the date of the announcement, for example `Deprecation: @1798761600`, and a `Link` header with `rel="deprecation"` to the changelog entry.
2. Once the removal date is set, it also carries a `Sunset` header ([RFC 8594](https://www.rfc-editor.org/rfc/rfc8594)), for example `Sunset: Thu, 01 Jul 2027 00:00:00 GMT`.
3. The OpenAPI spec marks the operation `deprecated: true`.
4. The [changelog](https://docs.omnisocials.com/changelog.md) gets an entry that says what to use instead.
5. The owners of the API keys that use the endpoint get an email.

Check for the `Deprecation` and `Sunset` headers in your client and log them, so a deprecation never surprises you.

## Notice period

The old behavior keeps working for **at least 6 months** after the deprecation is announced. The `Sunset` date is never earlier than that.

Two exceptions can come sooner:

- Security fixes.
- Changes a social network forces on us, such as a platform that removes a feature from its own API. Those get as much notice as the network gives us.

After the sunset date, the endpoint answers `410 Gone` with a message that names the replacement.
