> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/reference/frends-6.1.0/frends-platform-api/platform-api-reference/environments.md).

# Environments

## GET /api/v1/environments

> List all Environments

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"DtoEnvironmentGetIListResponse":{"required":["Data"],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DtoEnvironmentGet"},"description":"Response data","nullable":true}},"additionalProperties":false},"DtoEnvironmentGet":{"required":["AgentGroups","InternalName"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Environment","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Environment","readOnly":true},"agentGroups":{"type":"array","items":{"$ref":"#/components/schemas/DtoAgentGroupGet"},"description":"The Agent Groups that belong to the Environment","readOnly":true},"internalName":{"type":"string","description":"Internal name used by Frends for the Environment","readOnly":true}},"additionalProperties":false},"DtoAgentGroupGet":{"required":["Agents","Environment","InternalName","IsCrossPlatform"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Agent Group","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Agent Group","readOnly":true},"internalName":{"type":"string","description":"Internal name used by Frends for the Agent Group","readOnly":true},"isCrossPlatform":{"type":"boolean","description":"Indicates whether the Agents in the group can be installed on Windows and Linux machines","readOnly":true},"agents":{"type":"array","items":{"type":"string"},"description":"The Agents that belong to the Agent Group","readOnly":true},"environment":{"$ref":"#/components/schemas/DtoEnvironmentBase"},"agentDetails":{"type":"array","items":{"$ref":"#/components/schemas/DtoAgentGet"},"description":"Details about the Agents that belong to the Agent Group","readOnly":true}},"additionalProperties":false},"DtoEnvironmentBase":{"required":["DisplayName","Id"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Environment","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Environment","readOnly":true}},"additionalProperties":false},"DtoAgentGet":{"required":["IsCloudAgent","IsGateway","Name"],"type":"object","properties":{"url":{"type":"string","description":"The hostname or address for the agent. Can either be full URL https://example.org:1234 or hostname subdomain.example.org","readOnly":true},"httpPorts":{"type":"array","items":{"type":"string"},"description":"List of http ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"httpsPorts":{"type":"array","items":{"type":"string"},"description":"List of https ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"id":{"type":"integer","description":"Agent Identifier","format":"int64"},"name":{"type":"string","description":"Agent name","readOnly":true},"isGateway":{"type":"boolean","description":"If the agent is a Gateway Agent. If true, these Agents are the ones that should primarily be accessible from the internet.","readOnly":true},"isCloudAgent":{"type":"boolean","description":"If the agent is a Cloud Agent. If true, these Agents are managed by Frends.","readOnly":true}},"additionalProperties":false}}},"paths":{"/api/v1/environments":{"get":{"tags":["Environments"],"summary":"List all Environments","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DtoEnvironmentGetIListResponse"}}}}}}}}}
```

## GET /api/v1/environments/{environmentId}

> Get single Environment

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"DtoEnvironmentGetResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/DtoEnvironmentGet"}},"additionalProperties":false},"DtoEnvironmentGet":{"required":["AgentGroups","InternalName"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Environment","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Environment","readOnly":true},"agentGroups":{"type":"array","items":{"$ref":"#/components/schemas/DtoAgentGroupGet"},"description":"The Agent Groups that belong to the Environment","readOnly":true},"internalName":{"type":"string","description":"Internal name used by Frends for the Environment","readOnly":true}},"additionalProperties":false},"DtoAgentGroupGet":{"required":["Agents","Environment","InternalName","IsCrossPlatform"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Agent Group","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Agent Group","readOnly":true},"internalName":{"type":"string","description":"Internal name used by Frends for the Agent Group","readOnly":true},"isCrossPlatform":{"type":"boolean","description":"Indicates whether the Agents in the group can be installed on Windows and Linux machines","readOnly":true},"agents":{"type":"array","items":{"type":"string"},"description":"The Agents that belong to the Agent Group","readOnly":true},"environment":{"$ref":"#/components/schemas/DtoEnvironmentBase"},"agentDetails":{"type":"array","items":{"$ref":"#/components/schemas/DtoAgentGet"},"description":"Details about the Agents that belong to the Agent Group","readOnly":true}},"additionalProperties":false},"DtoEnvironmentBase":{"required":["DisplayName","Id"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Environment","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Environment","readOnly":true}},"additionalProperties":false},"DtoAgentGet":{"required":["IsCloudAgent","IsGateway","Name"],"type":"object","properties":{"url":{"type":"string","description":"The hostname or address for the agent. Can either be full URL https://example.org:1234 or hostname subdomain.example.org","readOnly":true},"httpPorts":{"type":"array","items":{"type":"string"},"description":"List of http ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"httpsPorts":{"type":"array","items":{"type":"string"},"description":"List of https ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"id":{"type":"integer","description":"Agent Identifier","format":"int64"},"name":{"type":"string","description":"Agent name","readOnly":true},"isGateway":{"type":"boolean","description":"If the agent is a Gateway Agent. If true, these Agents are the ones that should primarily be accessible from the internet.","readOnly":true},"isCloudAgent":{"type":"boolean","description":"If the agent is a Cloud Agent. If true, these Agents are managed by Frends.","readOnly":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/environments/{environmentId}":{"get":{"tags":["Environments"],"summary":"Get single Environment","parameters":[{"name":"environmentId","in":"path","description":"Environment Identifier","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DtoEnvironmentGetResponse"}}}},"404":{"description":"Environment not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## GET /api/v1/environments/{environmentId}/agent-groups

> List Agent Groups for Environment

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"DtoAgentGroupGetIListResponse":{"required":["Data"],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DtoAgentGroupGet"},"description":"Response data","nullable":true}},"additionalProperties":false},"DtoAgentGroupGet":{"required":["Agents","Environment","InternalName","IsCrossPlatform"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Agent Group","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Agent Group","readOnly":true},"internalName":{"type":"string","description":"Internal name used by Frends for the Agent Group","readOnly":true},"isCrossPlatform":{"type":"boolean","description":"Indicates whether the Agents in the group can be installed on Windows and Linux machines","readOnly":true},"agents":{"type":"array","items":{"type":"string"},"description":"The Agents that belong to the Agent Group","readOnly":true},"environment":{"$ref":"#/components/schemas/DtoEnvironmentBase"},"agentDetails":{"type":"array","items":{"$ref":"#/components/schemas/DtoAgentGet"},"description":"Details about the Agents that belong to the Agent Group","readOnly":true}},"additionalProperties":false},"DtoEnvironmentBase":{"required":["DisplayName","Id"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the Environment","format":"int64","readOnly":true},"displayName":{"type":"string","description":"Display name for the Environment","readOnly":true}},"additionalProperties":false},"DtoAgentGet":{"required":["IsCloudAgent","IsGateway","Name"],"type":"object","properties":{"url":{"type":"string","description":"The hostname or address for the agent. Can either be full URL https://example.org:1234 or hostname subdomain.example.org","readOnly":true},"httpPorts":{"type":"array","items":{"type":"string"},"description":"List of http ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"httpsPorts":{"type":"array","items":{"type":"string"},"description":"List of https ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"id":{"type":"integer","description":"Agent Identifier","format":"int64"},"name":{"type":"string","description":"Agent name","readOnly":true},"isGateway":{"type":"boolean","description":"If the agent is a Gateway Agent. If true, these Agents are the ones that should primarily be accessible from the internet.","readOnly":true},"isCloudAgent":{"type":"boolean","description":"If the agent is a Cloud Agent. If true, these Agents are managed by Frends.","readOnly":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/environments/{environmentId}/agent-groups":{"get":{"tags":["Environments"],"summary":"List Agent Groups for Environment","parameters":[{"name":"environmentId","in":"path","description":"Environment Identifier","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DtoAgentGroupGetIListResponse"}}}},"404":{"description":"Environment not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/reference/frends-6.1.0/frends-platform-api/platform-api-reference/environments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
