---
title: "Get running containers for workspace agent"
method: GET
path: "/api/v2/workspaceagents/{workspaceagent}/containers"
tags: ["Agents"]
---

# Get running containers for workspace agent

`GET /api/v2/workspaceagents/{workspaceagent}/containers`

## Path parameters

- `workspaceagent` string, uuid, required

## Query parameters

- `label` string, key=value, required

## Response `200`

OK

- CodersdkWorkspaceAgentListContainersResponse
  - `containers` CodersdkWorkspaceAgentContainer[] — Containers is a list of containers visible to the workspace agent.
    - `created_at` string, date-time — CreatedAt is the time the container was created.
    - `id` string — ID is the unique identifier of the container.
    - `image` string — Image is the name of the container image.
    - `labels` object — Labels is a map of key-value pairs of container labels.
    - `name` string — FriendlyName is the human-readable name of the container.
    - `ports` CodersdkWorkspaceAgentContainerPort[] — Ports includes ports exposed by the container.
      - `host_ip` string — HostIP is the IP address of the host interface to which the port is bound. Note that this can be an IPv4 or IPv6 address.
      - `host_port` integer — HostPort is the port number *outside* the container.
      - `network` string — Network is the network protocol used by the port (tcp, udp, etc).
      - `port` integer — Port is the port number *inside* the container.
    - `running` boolean — Running is true if the container is currently running.
    - `status` string — Status is the current status of the container. This is somewhat implementation-dependent, but should generally be a human-readable string.
    - `volumes` object — Volumes is a map of "things" mounted into the container. Again, this is somewhat implementation-dependent.
  - `devcontainers` CodersdkWorkspaceAgentDevcontainer[] — Devcontainers is a list of devcontainers visible to the workspace agent.
    - `agent` CodersdkWorkspaceAgentDevcontainerAgent
      - `directory` string
      - `id` string, uuid
      - `name` string
    - `config_path` string
    - `container` CodersdkWorkspaceAgentContainer
      - `created_at` string, date-time — CreatedAt is the time the container was created.
      - `id` string — ID is the unique identifier of the container.
      - `image` string — Image is the name of the container image.
      - `labels` object — Labels is a map of key-value pairs of container labels.
      - `name` string — FriendlyName is the human-readable name of the container.
      - `ports` CodersdkWorkspaceAgentContainerPort[] — Ports includes ports exposed by the container.
        - `host_ip` string — HostIP is the IP address of the host interface to which the port is bound. Note that this can be an IPv4 or IPv6 address.
        - `host_port` integer — HostPort is the port number *outside* the container.
        - `network` string — Network is the network protocol used by the port (tcp, udp, etc).
        - `port` integer — Port is the port number *inside* the container.
      - `running` boolean — Running is true if the container is currently running.
      - `status` string — Status is the current status of the container. This is somewhat implementation-dependent, but should generally be a human-readable string.
      - `volumes` object — Volumes is a map of "things" mounted into the container. Again, this is somewhat implementation-dependent.
    - `dirty` boolean
    - `error` string
    - `id` string, uuid
    - `name` string
    - `status` 'running' | 'stopped' | 'starting' | 'stopping' | 'deleting' | 'error'
    - `subagent_id` UuidNullUUID
      - `uuid` string
      - `valid` boolean — Valid is true if UUID is not NULL
    - `workspace_folder` string
  - `warnings` string[] — Warnings is a list of warnings that may have occurred during the process of listing containers. This should not include fatal errors.

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
