# Storing a query with no version - correct behavior when the query already exists?

**URL:** https://discourse.openehr.org/t/storing-a-query-with-no-version-correct-behavior-when-the-query-already-exists/3634
**Category:** ITS
**Tags:** rest-apis
**Created:** [1 March 2023 14:45 UTC](https://discourse.openehr.org/t/storing-a-query-with-no-version-correct-behavior-when-the-query-already-exists/3634 "2023-03-01T14:45:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![joseph.kane](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@joseph.kane](https://discourse.openehr.org/u/joseph.kane)
#### Post date: [1 March 2023 14:45 UTC](https://discourse.openehr.org/t/storing-a-query-with-no-version-correct-behavior-when-the-query-already-exists/3634/1 "2023-03-01T14:45:51Z")

</div>

The API [spec](https://specifications.openehr.org/releases/ITS-REST/latest/definition.html#tag/Query/operation/definition_query_store.yaml) does not define a 409 response for this operation. If a query already exists with the specified name, what is the correct behavior of the endpoint? My guess is to increment the patch number in the semver, but I’d like confirmation.

---

<div class="post-metadata">

### Author: ![sebastian.iancu](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sebastian.iancu/32/31_2.png) [@sebastian.iancu](https://discourse.openehr.org/u/sebastian.iancu)
#### Post date: [5 March 2023 19:55 UTC](https://discourse.openehr.org/t/storing-a-query-with-no-version-correct-behavior-when-the-query-already-exists/3634/2 "2023-03-05T19:55:14Z")

</div>

Hi,  
Your remark and question are rightful. The assumption of incrementing the internal version sounds also reasonable, but might be tricky to define semantic of a major vs minor vs patch content on a query to fully rely on semver automation. But unfortunately I cannot answer with certainty to your assumption yet: I will first need to clarify it in the SEC (Specifications Editorial Committee).  
I am analyzing the necessary changes to be done on an upcoming release on REST API specs, so I will add your remark and suggestion to the list of issues. Hopefully you will see a change soon on the specifications on this subject.
