跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

GET /v1/environments 列出当前账户下所有未归档的环境,支持分页。

请求头

头部必选说明
AuthorizationBearer <PAT>

查询参数

参数类型必选说明
limitinteger每页返回数量(默认 20)
after_idstring游标分页:返回此 ID 之后的记录
before_idstring游标分页:返回此 ID 之前的记录
完整分页规范详见 分页

示例请求

curl -s -X GET "https://openapi.qoder.sh/api/v1/cloud/environments" \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK
{
  "data": [
    {
      "id": "env_019e3bb39b6774d8878cd0b9d237574b",
      "type": "environment",
      "name": "doc-test-env",
      "description": "",
      "status": "ready",
      "config": {
        "type": "cloud",
        "networking": {
          "type": "limited"
        },
        "packages": {
          "apt": ["curl"]
        }
      },
      "created_at": "2026-05-18T15:28:07.017808Z",
      "updated_at": "2026-05-18T15:28:07.017808Z"
    },
    {
      "id": "env_019e2590d33f711fabf42f2857cecd8a",
      "type": "environment",
      "name": "default",
      "description": "",
      "status": "ready",
      "config": {
        "type": "cloud",
        "networking": {
          "allow_package_managers": true,
          "type": "limited"
        },
        "packages": {}
      },
      "created_at": "2026-05-14T08:18:28.800813Z",
      "updated_at": "2026-05-14T08:18:28.800813Z"
    }
  ],
  "first_id": "env_019e3bb39b6774d8878cd0b9d237574b",
  "has_more": false,
  "last_id": "env_019e2590d33f711fabf42f2857cecd8a"
}

响应字段

字段类型说明
dataarray环境对象数组
first_idstring当前页第一条记录的 ID
last_idstring当前页最后一条记录的 ID
has_moreboolean是否还有更多数据可供翻页

错误码

HTTPtype说明
401authentication_error认证失败,PAT 无效或过期
403permission_error无权访问此资源