# API Versioning

The Sway Charts REST API attempts to maintain backward compatibility with the clients provided the following:

* Clients ignore the data they do not understand
* Clients only use the data they need

For example, in case of XML representation, clients must make sure they do not couple their logic with current XML representation in such a way that adding new fields causes their application to malfunction. This allows adding new data to resources without breaking clients.

If any data is removed or data meaning is changed, a new notification API version is introduced. Switch between different versions is based on the URI of the API (e.g. <http://host/api/v1> for version 1 and <http://host/api/v2> for version 2).

*API versioning* supports only *major* integer versions such as 1,2,3 etc. With the API, there is no notion of minor releases.

| Change                                                       | New Version Released?                                                                                                          |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| Addition of a new data field to data representation          |                                                                                                                                |
| Changing the logical meaning of a field                      | <img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png?v8.png" alt="heavy_check_mark" data-size="line"> |
| Removing a field                                             | <img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png?v8.png" alt="heavy_check_mark" data-size="line"> |
| Changing the default representation, currency units etc.     | <img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png?v8.png" alt="heavy_check_mark" data-size="line"> |
| Addition of new independent requests                         |                                                                                                                                |
| New business rules and/or application flow                   | <img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png?v8.png" alt="heavy_check_mark" data-size="line"> |
| New default values for optional request parameters or fields | <img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png?v8.png" alt="heavy_check_mark" data-size="line"> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/api-versioning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
