# WebAssembly module API

Get the WebAssembly module (Wasm) ZIP bundle for a Spark service. This can be used to run Spark services locally.

Returns: Wasm ZIP bundle file.

{% code overflow="wrap" %}

```shellscript
## Depending on the desired reference parameter, different URI are available.
GET /{tenant}/api/v3/nodegen/getnodegenzipbyId/folders/{folder}/services/{service}
GET /{tenant}/api/v3/nodegen/getnodegenzipbyId/version/{versionId}
GET /{tenant}/api/v3/nodegen/getnodegenzipbyId/service/{serviceId}
GET /{tenant}/api/v3/nodegen/public/getnodegenzipbyId/folders/{folder}/services/{service}
GET /{tenant}/api/v3/nodegen/public/getnodegenzipbyId/version/{versionId}
GET /{tenant}/api/v3/nodegen/public/getnodegenzipbyId/service/{serviceId}
```

{% 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).\
  The [Authorization - API keys](/spark-apis/authorization-api-keys.md#api-key-groups) 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.GetNodegenZip.json` or `Spark.AllEncompassingProxy.json`.
  * The request headers should include the keys `x-synthetic-key` and `x-tenant-name` with the values of the API key and tenant name respectively.
* No Authorization is required for [Authorization - Public APIs](/spark-apis/authorization-public-apis.md).

### Path parameters

| Key              | Value                                                                                                                                                                                  |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `environment` \* | Environment is part of your [Login and logout](/navigation/login-and-logout.md#log-in-to-spark) URL.                                                                                   |
| `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). |
| `versionId` \*   | `version_id` of the requested service version.                                                                                                                                         |
| `serviceId` \*   | `service_id` of the requested service. The Wasm from the latest service version will be downloaded.                                                                                    |
| `folder` \*      | Folder associated with the Wasm.                                                                                                                                                       |
| `service` \*     | Service associated with the Wasm. The Wasm from the latest service version will be downloaded.                                                                                         |

### Response

`HTTP 200 OK` `Content-Type: application/octet-stream`&#x20;

Returns the Wasm ZIP bundle.


---

# 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/spark-apis/webassembly-module-api.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.
