> For the complete documentation index, see [llms.txt](https://docs.coherent.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherent.global/spark-apis/service-apis/publish-service.md).

# Publish service

Complete the actions to create a Spark service after [Upload Excel file to Spark](/spark-apis/service-apis/upload-spark-service.md). Compilation must be complete before publishing, [Check compilation status](/spark-apis/service-apis/check-compilation-status.md).

Returns: `status` of publish job.

{% code overflow="wrap" %}

```shellscript
POST /{tenant}/api/v3/folders/{folder}/services/{service}/publish
```

{% endcode %}

### Authorization

* `Bearer {token}` accessible from [Authorization - Bearer token](/spark-apis/authorization-bearer-token.md) or systematically via [Client credentials](/identity-and-access-management/client-credentials.md).
  * The request headers should include a key for `Authorization` with the value `Bearer {token}`.
* API key created from [Authorization - API keys](/spark-apis/authorization-api-keys.md). It must contain [Manage users](/tenant-administration/manage-users.md#user-groups) that are also assigned to [Permissions - Features permissions](/spark-apis/authorization-api-keys/permissions-features-permissions.md) `Spark.ServicePublish.json` or `Spark.AllEncompassingProxy.json`.
  * The request headers should include the keys `x-synthetic-key` and `x-tenant-name` with the API key and tenant name respectively.

### Path parameters

| Key          | Value                                                                                                                                                                                 |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tenant` \*  | Tenant is part of your [Login and logout](/navigation/login-and-logout.md#log-in-to-spark) URL and also available in the [Navigation menu](/navigation/navigation-menu.md#user-menu). |
| `folder` \*  | Target folder name. This should be the same as in [Upload Excel file to Spark](/spark-apis/service-apis/upload-spark-service.md).                                                     |
| `service` \* | Target folder name. This should be the same as in [Upload Excel file to Spark](/spark-apis/service-apis/upload-spark-service.md).                                                     |

### Request body

`Content-Type: application/json`

| Key                                        | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `request_data.original_file_documentid` \* | `id` from [Upload Excel file to Spark](/spark-apis/service-apis/upload-spark-service.md).                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `request_data.engine_file_documentid` \*   | `id` from [Upload Excel file to Spark](/spark-apis/service-apis/upload-spark-service.md).                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `request_data.draft_service_name` \*       | Target service name overrides `service` from [Upload Excel file to Spark](/spark-apis/service-apis/upload-spark-service.md).                                                                                                                                                                                                                                                                                                                                                                                  |
| `request_data.version_label`               | Text field that attaches to version numbers across the Spark user interface.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `request_data.release_note`                | Text field to describe the purpose of the upload.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `request_data.effective_start_date`        | <p>Timestamp to set the parameters for the</p><p><a data-mention href="/pages/-Mbp9Z03Ck-4xgQWd-9o">/pages/-Mbp9Z03Ck-4xgQWd-9o</a> capability.<br>Use <a href="https://www.timestamp-converter.com/">Timestamp Converter</a> to convert dates to ISO 8601. The value in <a data-mention href="/pages/X9Uq7qE0uvW0E8aNtCCM">/pages/X9Uq7qE0uvW0E8aNtCCM</a> is ignored.<br>Example: <code>2026-01-19T16:05:23.517Z</code></p>                                                                                 |
| `request_data.effective_end_date`          | <p>Timestamp to set the parameters for the</p><p><a data-mention href="/pages/-Mbp9Z03Ck-4xgQWd-9o">/pages/-Mbp9Z03Ck-4xgQWd-9o</a> capability.<br>By default, the Spark UI will use the current date and time for this value. Use the <a href="https://www.timestamp-converter.com/">Timestamp Converter</a> to convert dates to ISO 8601. The value in <a data-mention href="/pages/X9Uq7qE0uvW0E8aNtCCM">/pages/X9Uq7qE0uvW0E8aNtCCM</a> is ignored.<br>Example: <code>2126-01-19T16:05:23.517Z</code></p> |
| `request_data.version_difference`          | <p><code>major</code>, <code>minor</code>, <code>patch</code>, or <code>custom</code><br>method of updating <a href="https://semver.org/">Semantic Versioning</a>.<br>This can be a different value than what was initially provided in <a data-mention href="/pages/X9Uq7qE0uvW0E8aNtCCM">/pages/X9Uq7qE0uvW0E8aNtCCM</a>.</p>                                                                                                                                                                               |
| `request_data.should_trck_user_action`     | <p>"<code>true"</code><br>String boolean to set whether or not an Event would be recorded for this action. Events are visible in the <a data-mention href="/pages/-MbpDetRGEED_VkN4hsY#event-viewer">/pages/-MbpDetRGEED\_VkN4hsY#event-viewer</a>.</p>                                                                                                                                                                                                                                                       |
| `request_data.tags`                        | <p>Comma separated list of tags. If tags are required, then at least one tag must be supplied.<br>Example: <code>abc,def</code></p>                                                                                                                                                                                                                                                                                                                                                                           |
| `request_data.description`                 | Text field to describe the service version.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `request_data.semantic_version`            | <p>Semantic version needs to be populated if<br><code>version\_difference</code> is <code>custom</code>.</p>                                                                                                                                                                                                                                                                                                                                                                                                  |

#### Sample request

```json
{
  "request_data": {
    "draft_service_name": "my service name",
    "version_label": "my service label",
    "effective_start_date": "2024-01-19T12:12:00.000Z",
    "effective_end_date": "2126-01-19T12:12:00.000Z",
    "original_file_documentid": "4c4cef82-3f30-45ae-ade8-b43f4ab29779",
    "engine_file_documentid": "d84bf685-2ed6-4d95-8fb1-d01770a0e0d8",
    "version_difference": "minor",
    "releasenote": "my release note",
    "description": "my description",
    "should_trck_user_action": "true"
  }
}
```

### Sample response

`HTTP 200 OK` `Content-Type: application/json`

If the service name already exists, Spark will raise an error message.

```json
{
    "status": "Success",
    "response_data": {
        "version_id": "7004e077-153f-4561-97ee-eb8124f6eb72"
    },
    "response_meta": {
        "system": "SPARK",
        "request_timestamp": "2023-05-18T21:20:42.498Z"
    },
    "error": null
}
```
