# List machines

Source: https://www.jawsdeploy.net/rest-api/machines-list | Section: Machines

List the machines in a workspace with the environments each one is assigned to.

`GET /api/machine`

Lists every machine (deployment agent) in the workspace, each with the environments it is assigned to and the tags it carries.

Machines are **not created through this API**. A machine appears here once the Jaws agent has been installed on it and has completed its handshake with the server, which is also where its URL, credentials and communication mode are settled. What the API owns is the assignment: which environments the machine takes part in.

Use this endpoint to resolve the `machineId` values the other endpoints in this group take. Deleted machines are never returned.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `workspaceId` | query | string | yes | ID of the workspace. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `workspaceId`. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks permission to manage machines in this workspace. |

Example request:

```
GET /api/machine?workspaceId=ws_abc HTTP/1.1
Authorization: Basic <base64(...)>
```

Example response:

```
{
  "workspaceId": "ws_abc",
  "machines": [
    {
      "machineId": "mch_web01",
      "name": "web-01",
      "description": "Front-end web server",
      "isActive": true,
      "environments": [
        { "environmentId": "env_prod", "name": "Production", "enabled": true }
      ],
      "tags": [
        { "tagId": "tag_web", "name": "web" }
      ]
    }
  ]
}
```

