> 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/upload-spark-service.md).

# Upload Excel file to Spark

Upload Excel file to Spark.

Returns: `nodegen_compilation_jobid`, `original_file_documentid`, and `engine_file_documentid` which are needed to [Publish service](/spark-apis/service-apis/publish-service.md).

{% code overflow="wrap" %}

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

{% 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.ServiceUpload.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.                                                                                                                                                                   |
| `service` \* | Target service name.                                                                                                                                                                  |

### Request body

`Content-Type: multipart/form-data`

| Key                            | Value                                                                                                                                                                                             |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceFile` \*               | Service file to be uploaded. When using Postman, remember to change the key type from *Text* to *File*.                                                                                           |
| `engineUploadRequestEntity` \* | Stringified JSON content of the request parameters described below. Use the example placeholder as the settings are overridden in [Publish service](/spark-apis/service-apis/publish-service.md). |

#### `engineUploadRequestEntity` parameter

| Key                                    | Value                                                                                                                                                                                                                                                                         |
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `request_data.version_difference` \*   | <p><code>minor</code><br>Parameter is required but ignored. Value is set in <a data-mention href="/pages/iNjYexgTVj59F0lONsjn">/pages/iNjYexgTVj59F0lONsjn</a>.</p>                                                                                                           |
| `request_data.effective_start_date` \* | <p><code>2010-01-01</code><br>Parameter is required but ignored. Value is set in <a data-mention href="/pages/iNjYexgTVj59F0lONsjn">/pages/iNjYexgTVj59F0lONsjn</a>.</p>                                                                                                      |
| `request_data.effective_end_date` \*   | <p><code>2120-01-01</code></p><p>Parameter is required but ignored. Value is set in <a data-mention href="/pages/iNjYexgTVj59F0lONsjn">/pages/iNjYexgTVj59F0lONsjn</a>.</p>                                                                                                   |
| `request_data.compiler_version`        | <p><a data-mention href="/pages/qc2ynJ5gnthNAqVrFQRg">/pages/qc2ynJ5gnthNAqVrFQRg</a> version to use for compilation if specified. Reference <a data-mention href="/pages/6KSg4ILon6IcoRfdy6jv">/pages/6KSg4ILon6IcoRfdy6jv</a>.<br>Example: <code>Neuron\_v1.25.0</code></p> |
| `request_data.compiler_type`           | `MaintainVersion`, `TenantDefault`, `StableLatest`, or `ReleaseCandidate` sets the default method to choose the [Neuron](/build-spark-services/neuron.md) version for the next upload.                                                                                        |

### Sample request

```shellscript
curl --location 'https://excel.myenvironment.coherent.global/mytenant/api/v3/folders/myfolder/services/myservice/upload' \
--header 'Authorization: Bearer {token}' \
--form 'engineUploadRequestEntity="{
    \"request_data\":
        {
            \"version_difference\":\"minor\",
            \"effective_start_date\":\"2000-01-01\",
            \"effective_end_date\":\"2100-01-01\"
        }
}"' \
--form 'serviceFile=@"/path/to/file"'
```

### Sample response <a href="#api-response" id="api-response"></a>

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

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

Take note of the `nodegen_compilation_jobid`, `original_file_documentid`, and `engine_file_documentid` as this information is needed to check the upload status and publish the service.

```json
{
    "status": "Success",
    "response_data": {
        "lines_of_code": 11.0,
        "hours_saved": 0.02107043788185858,
        "nodegen_compilation_jobid": "19bd64d6-f567-0bd4-c73f-190ed4bc49c3",
        "original_file_documentid": "265ddaee-89b9-42ff-96af-3cf08ceaf344",
        "engine_file_documentid": "f15269d5-0104-4269-8c46-ba5996b5b1c4",
        "hash_signature_chain": false,
        "warnings": [],
        "infos": [],
        "current_statistics": null,
        "no_of_sheets": 1,
        "no_of_inputs": 2,
        "no_of_outputs": 1,
        "no_of_formulas": 1,
        "no_of_cellswithdata": 15
    },
    "response_meta": {
        "service_id": null,
        "version_id": "b4555085-1535-4058-8335-212216c89044",
        "version": "0.1.0",
        "process_time": 1138,
        "call_id": null,
        "compiler_type": "Neuron",
        "compiler_version": null,
        "source_hash": null,
        "engine_id": null,
        "correlation_id": null,
        "parameterset_version_id": null,
        "system": "SPARK",
        "request_timestamp": "2026-01-19T12:49:16.092Z"
    },
    "error": null
}
```
