# Lock workspace

Create a manual lock on a workspace.

Endpoint: POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier}/actions/lock
Version: 1.0
Security: x-api-key

## Path parameters:

  - `org` (string, required)
    Org is the organisation identifier.
    Example: "5b"

  - `project` (string, required)
    Project is the project identifier.
    Example: "0ij"

  - `identifier` (string, required)
    Identifier is the project identifier.
    Example: "mj"

## Header parameters:

  - `Harness-Account` (string, required)
    Account is the internal customer account ID.
    Example: "1gk"

## Request fields (application/json):

  - `reason` (string)
    Reason for locking the workspace (optional)
    Example: "Q2 freeze"

## Response 200 fields (application/json):

  - `id` (string, required)
    Lock ID
    Example: "aed2792f-e130-473c-acea-068f906838b7"

  - `locked_by_display_name` (string, required)
    Display name of who locked
    Example: "Aut omnis dolorem similique aut."

  - `locked_by_principal_id` (string, required)
    Principal ID who locked
    Example: "Sit rem."

  - `locked_by_principal_type` (string, required)
    Type of principal
    Example: "Commodi aliquam voluptas."

  - `manual` (boolean, required)
    Whether the lock is manual (user-initiated). true = manual lock, false = automatic lock

  - `reason` (string, required)
    Reason for lock
    Example: "Sit sapiente qui."

  - `workspace` (string, required)
    Workspace identifier
    Example: "Fugiat modi non laboriosam ducimus vero impedit."

## Response 400 fields (application/vnd.goa.error):

  - `fault` (boolean, required)
    Is the error a server-side fault?

  - `id` (string, required)
    ID is a unique identifier for this particular occurrence of the problem.
    Example: "123abc"

  - `message` (string, required)
    Message is a human-readable explanation specific to this occurrence of the problem.
    Example: "parameter 'p' must be an integer"

  - `name` (string, required)
    Name is the name of this class of errors.
    Example: "bad_request"

  - `temporary` (boolean, required)
    Is the error temporary?

  - `timeout` (boolean, required)
    Is the error a timeout?
    Example: true


