# Move a step in or out of a rolling group

Source: https://www.jawsdeploy.net/rest-api/project-step-rolling-group | Section: Rolling Groups

Move one step into a group, or out of the group it is in.

`PUT /api/project/step/rolling-group`

Moves one step into a rolling group, or takes it out when `rollingGroupId` is omitted, null or empty.

Membership and position are applied together, because changing one without the other cannot be expressed validly: taking a step out of the middle of a run would leave the members either side of it no longer adjacent. A step joining is appended to the end of the group's run, and a step leaving is placed immediately after the group, so the remaining members stay consecutive.

**A group left with no members is removed.** The steps themselves are never deleted.

Returns an empty body. Call [List rolling groups](https://www.jawsdeploy.net/rest-api/rolling-groups-list) or [List project steps](https://www.jawsdeploy.net/rest-api/projects-steps-list) to read back the resulting membership and order.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `projectId` | body | string | yes | The project the step belongs to. |
| `projectStepId` | body | string | yes | The step to move. |
| `rollingGroupId` | body | string | no | The group to move the step into. Omit, or send null or an empty string, to take the step out of its group. |

### Response body

None. Success is the `200` status code and the body is empty.

## Errors

| Status | Meaning |
|---|---|
| 400 | `projectStepId` was missing or blank - `invalid project step ID`. |
| 400 | `That rolling group does not belong to this project.` |
| 400 | The step would not end up next to the group's other members. The message names the steps sitting in between. |
| 400 | The step does not run on target machines - the message names it and its `runOn`. |
| 401 | Missing or invalid Basic auth credentials, or the service account may not edit this project. |

Example request:

```
PUT /api/project/step/rolling-group HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>
Content-Type: application/json

{
  "projectId": "prj_42",
  "projectStepId": "step-5",
  "rollingGroupId": "rg_7a1"
}

# Take the step back out:
{
  "projectId": "prj_42",
  "projectStepId": "step-5",
  "rollingGroupId": ""
}
```

Example response:

```
HTTP/1.1 200 OK

(empty body)
```

