# Manage service versions and effective dates

In Spark, after an Excel file has been uploaded to Spark and the logic is converted to code, it is referred to as a service. Multiple versions of a service can be added to an existing service, called service versions.

In Spark, each service version can have customized effective start and end dates for each service. This enables the capability for Spark to serve the different service versions of 1 service based upon a date input.

## Define effective start and end dates for a service version

### Choose effective dates for a new service or service version

* When an Excel file [Folder overview](/navigation/folder-overview.md#how-to-add-a-service) or [Folder overview](/navigation/folder-overview.md#add-new-version) is performed in Spark, modals will offer an option to modify the effective dates.
* By default, the effective start date is set to the upload date. The effective end date is 100 years into the future.
* These dates can be modified to align with the start and end dates for a particular calculation change.
* Dates and times are defined in the local time of the logged in user. Check the detected time zone in [Navigation menu](/navigation/navigation-menu.md#user-menu).

### Edit effective dates and times

* See [Service Documentation](/navigation/service-documentation.md#modify-a-service-property).

## Resolve service versions

<figure><img src="/files/3m0WvOE0GPIUABI0l01V" alt=""><figcaption></figcaption></figure>

How versions are specified in the [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md) is explained in the [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#request_meta). The same applies for [Execute API (v4)](/spark-apis/execute-api/execute-api-v4.md) but instead of `transaction_date`, the name of the parameter is `version_by_timestamp.`

The behaviour can be summarized as follows:

* If a specific `version` or `version_id` is being called by the API will ignore the `transaction_date`.
* If the `transaction_date` is specified and no version is specified, it will use the latest version that applies at the time of the `transaction_date`.
* It is important to note that that the Execute API will always resolve the `version_id` parameter first, `service_id` parameter second, and then `service_uri` last. It is possible for an API request that these 3 may refer to different services entirely but Spark will resolve the reference in the same order.

<table><thead><tr><th width="224.33333333333331">Invocation method</th><th>transaction_date</th><th>Version resolution</th></tr></thead><tbody><tr><td><code>version_id</code></td><td>has no impact on version resolution</td><td>Will use the version specified by the API call.</td></tr><tr><td><code>service_id</code> or <code>service_uri</code></td><td>none provided</td><td>Use the latest version that applies where the <code>transaction_date</code> equals the current time.</td></tr><tr><td><code>service_id</code> or <code>service_uri</code></td><td>user provided</td><td>Use the latest version that applies at the <code>transaction_date</code>.<br>If the <code>transaction_date</code> is outside of the Effective Dates for any services then no calculation will be returned.</td></tr></tbody></table>

{% hint style="info" %}
This functionality cannot be tested within the [API Tester](/navigation/api-tester.md) as it is service version specific. Use the [Postman](/integrations/postman.md) to try out the functionality with an API request.
{% endhint %}


---

# 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://docs.coherent.global/build-spark-services/manage-versions-and-effective-dates.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.
