# Replace script module assignments

Source: https://www.jawsdeploy.net/rest-api/projects-script-modules-replace | Section: Projects

Set the full list of script modules imported by a project.

`PUT /api/project/script-modules`

Replaces the project's script module assignments. Modules not present in `scriptModuleIds` get unimported; new ones get imported.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `projectId` | body | string | yes | ID of the project. |
| `scriptModuleIds` | body | array<string> | no | IDs of every script module the project should import. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `projectId`. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks the required role. |

Example request:

```
PUT /api/project/script-modules

{ "projectId": "prj_abc123", "scriptModuleIds": ["sm_1", "sm_2"] }
```

Example response:

```
{}
```

