跳到正文
API 参考
API 参考

列出 Guardrail 分配

列出当前 Management API 密钥可见的分配。

列出当前 Management API 密钥可见的分配。

端点

GET /api/v1/guardrail_assignments
基础 URL
https://runapi.ai
API 版本
v1
身份验证
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
授权
账户管理员可以查看所有分配;非管理员用户只能查看其自身 API 密钥上的分配。
02

请求

JSON 请求体

只能在列出的请求位置发送值。

查询参数2 个字段
limitinteger
可选

Maximum assignments returned per page.

默认值: 20 范围: 1 - 100
pageinteger
可选

Offset page number. Values start at 1.

默认值: 1 边界: 1
03

成功响应

HTTP 200

GET /api/v1/guardrail_assignments

JSON
{
  "guardrail_assignments": [
    {
      "account_user_id": null,
      "api_token_id": "token_123",
      "created_at": "2026-07-27T10:00:00.000Z",
      "guardrail_id": "guardrail_123",
      "id": "guardrail_assignment_123"
    }
  ],
  "pagination": {
    "limit": 20,
    "page": 1,
    "pages": 1,
    "total": 1
  }
}
04

错误响应 (401)

HTTP 401
响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Authentication required"
}
05

错误响应 (403)

HTTP 403
响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Management API key required"
}
06

错误响应 (400)

HTTP 400
响应 Schema
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Human-readable error message.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Human-readable validation summary.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Validation messages keyed by public request field, with an array of human-readable strings for each field.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

响应示例

JSON
{
  "error": "page must be an integer"
}
07

cURL 示例

CURL
curl -X GET https://runapi.ai/api/v1/guardrail_assignments?page=1&limit=20 \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY'