# Update a script module

Source: https://www.jawsdeploy.net/rest-api/script-modules-update | Section: Script Modules

Update a script module's body, language, or metadata.

`PUT /api/script-module`

Updates the script module. Pass only the fields to change.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `scriptModuleId` | body | string | yes | ID of the script module. |
| `name` | body | string | no | New name. |
| `description` | body | string | no | New description. |
| `script` | body | string | no | New script body. |
| `scriptLanguage` | body | string | no | New script language. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `scriptModuleId` or validation failure. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks the required role. |

Example request:

```
PUT /api/script-module

{ "scriptModuleId": "sm_1", "script": "function Get-Token { ... new body ... }" }
```

Example response:

```
{}
```

