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

# List running environments (external)

> List the currently-running external-owned environments for this agent, to rediscover an env to attach to. Only external-owned environments are ever returned: an agent's execution- and astro-owned environments are private to those owners.



## OpenAPI

````yaml https://odyssey.asteroid.ai/agents/v2/openapi.yaml get /agents/{agentId}/environments
openapi: 3.1.0
info:
  title: Agent Service
  version: v1
servers:
  - description: V2 API
    url: https://odyssey.asteroid.ai/agents/v2
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
  - name: Environments
  - name: Execution
  - name: Files
  - name: Agent Profiles
  - name: Agent Profile Pools
  - name: Workflows
  - name: Schema
  - name: Documentation
  - name: Context
  - name: Admin Customer Activity
paths:
  /agents/{agentId}/environments:
    get:
      tags:
        - Environments
      summary: List running environments (external)
      description: >-
        List the currently-running external-owned environments for this agent,
        to rediscover an env to attach to. Only external-owned environments are
        ever returned: an agent's execution- and astro-owned environments are
        private to those owners.
      operationId: AgentEnvironmentsList
      parameters:
        - description: The agent whose environments to list.
          in: path
          name: agentId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Agents.Environment.ListEnvironmentsResponse
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.BadRequestErrorBody'
          description: The server could not understand the request due to invalid syntax.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.UnauthorizedErrorBody'
          description: Access is unauthorized.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.ForbiddenErrorBody'
          description: Access is forbidden.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.NotFoundErrorBody'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.InternalServerErrorBody'
          description: Server error
components:
  schemas:
    Common.uuid:
      format: uuid
      type: string
    Agents.Environment.ListEnvironmentsResponse:
      description: >-
        Response for the list endpoint. Astro hits this when it doesn't have an
        environment id in slip state and wants to see what it can attach to
        before deciding to start fresh.
      properties:
        environments:
          description: >-
            All currently-running envs owned by the agent in question, ordered
            by createdAt DESC. Empty array when no envs are running.
          items:
            $ref: '#/components/schemas/Agents.Environment.RunningEnvironment'
          type: array
      required:
        - environments
      type: object
    Common.BadRequestErrorBody:
      properties:
        code:
          enum:
            - 400
          type: number
          x-enum-varnames:
            - BadRequest
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.UnauthorizedErrorBody:
      properties:
        code:
          enum:
            - 401
          type: number
          x-enum-varnames:
            - Unauthorized
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.ForbiddenErrorBody:
      properties:
        code:
          enum:
            - 403
          type: number
          x-enum-varnames:
            - Forbidden
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.NotFoundErrorBody:
      properties:
        code:
          enum:
            - 404
          type: number
          x-enum-varnames:
            - NotFound
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.InternalServerErrorBody:
      properties:
        code:
          enum:
            - 500
          type: number
          x-enum-varnames:
            - InternalServerError
        message:
          type: string
      required:
        - code
        - message
      type: object
    Agents.Environment.RunningEnvironment:
      description: >-
        Lightweight summary of a running environment for the list endpoint.
        Owner-agnostic — covers both execution- and astro-owned envs; narrow
        with the `ownerType` query param if you only want one kind. Connection
        details (cdpUrl/cua/credentials) are intentionally omitted — callers
        fetch those via GET /environments/{id}/live-environment once they pick
        one to attach to.
      properties:
        agentProfileId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: Profile snapshot the env was booted against, if any.
        conversationId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: >-
            Populated for astro-owned envs — the conversation that booted the
            env.
        createdAt:
          description: When the env row was created.
          format: date-time
          type: string
        environmentId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: Environment identifier.
        environmentType:
          allOf:
            - $ref: '#/components/schemas/Agents.Workflow.EnvironmentType'
          description: Browser or OS.
        executionId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: >-
            Populated for execution-owned envs — the execution that booted the
            env.
        expiresAt:
          description: >-
            When the reaper will tear the env down if no graceful Stop arrives
            first.
          format: date-time
          type: string
        ownerType:
          allOf:
            - $ref: '#/components/schemas/Agents.Environment.EnvironmentOwnerType'
          description: Polymorphic owner kind (execution or astro).
        readyAt:
          description: When the env first became ready, if it has reached that state.
          format: date-time
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/Agents.Environment.RunningEnvironmentStatus'
          description: Current status — always one of the non-terminal values.
      required:
        - environmentId
        - environmentType
        - ownerType
        - status
        - createdAt
        - expiresAt
      type: object
    Agents.Workflow.EnvironmentType:
      description: Type of execution environment
      enum:
        - browser
        - os
      type: string
    Agents.Environment.EnvironmentOwnerType:
      description: >-
        Environment owner kind. Mirrors the storage-side discriminator on
        agent_environment.owner_type. `execution` covers envs booted via the
        legacy execution-paused path; `astro` covers envs booted by the
        execution-free live_environment flow.
      enum:
        - execution
        - astro
        - external
      type: string
    Agents.Environment.RunningEnvironmentStatus:
      description: >-
        Status of a running environment. Mirrors the StatusRequested /
        StatusProvisioning / StatusReady values of the env subdomain's status
        machine — terminal states (stopped/failed/dead) are intentionally
        excluded because the list endpoint only returns envs astro could attach
        to.
      enum:
        - requested
        - provisioning
        - ready
      type: string
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-Asteroid-Agents-Api-Key
      type: apiKey

````