> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alforse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow

> Advance a contract's lifecycle stage and lock it against edits.

All endpoints are nested under a specific contract: `/contracts/:id/workflow/*`.

| Endpoint                                  | Body                                       | Requires               | Notes                                                                                                                                                 |
| ----------------------------------------- | ------------------------------------------ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST /contracts/:id/workflow/transition` | `{ note?, transitionCode?, toStageCode? }` | `contract_edit` (edit) | Requires the tenant's `workflowAutomation` feature flag. Advances the contract along a configured lifecycle transition, or directly to `toStageCode`. |
| `POST /contracts/:id/workflow/lock`       | `{ locked?: boolean, note? }`              | `admin` (edit)         | Requires `workflowAutomation`. A locked contract blocks core-field edits until unlocked by a role with sufficient workflow control.                   |
| `GET /contracts/:id/workflow/events`      | —                                          | `contract_view` (view) | Full stage/lock event trail for the contract.                                                                                                         |

See [Roles & Permissions](/concepts/roles-and-permissions#workflow-controls) for how workflow
control levels (`none` / `view` / `edit` / `approve` / `sign` / `admin`) gate transitions
separately from module permissions, and [Contract Workspace](/guides/contract-workspace) for the
product-level view.
