# Create a lifecycle

Source: https://www.jawsdeploy.net/rest-api/lifecycles-create | Section: Lifecycles

Create a new release lifecycle.

`POST /api/lifecycle`

Creates a new lifecycle. Pass `phases` to seed the lifecycle in one call - each phase lists environments and an optional progress requirement (`AllMustComplete`, `MinimumNumberToComplete`, `OptionalPhase`). Phases can also be added or edited later via the `/api/lifecycle/phase` endpoints.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `workspaceId` | body | string | yes | ID of the workspace. |
| `name` | body | string | yes | Lifecycle name. |
| `description` | body | string | no | Optional description. |
| `phases` | body | array<object> | no | Ordered phases. See [phase add](https://www.jawsdeploy.net/rest-api/lifecycle-phase-add) for the phase object shape. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `workspaceId`, validation failure, or one of the referenced environment IDs not in the workspace. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks the required role. |

Example request:

```
POST /api/lifecycle

{ "workspaceId": "ws_abc", "name": "default", "phases": [ { "name": "Dev", "environments": [ { "environmentId": "env_a", "howToTrigger": "Automatic" } ] } ] }
```

Example response:

```
{ "lifecycleId": "lc_1" }
```

