Administrator

GET /core/v1/admin/audit

Administrator · GET /core/v1/admin/audit

Authentication

Administrator. Session/administrative writes are not executed in the public Playground.

Endpoint

curl --request GET 'https://api.oneaster.ai/core/v1/admin/audit' \
  --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"

Parameters

- page (query, Optional): {"type":"integer","minimum":1,"maximum":1000000,"default":1}

- size (query, Optional): {"type":"integer","minimum":1,"maximum":100,"default":20}

- actor_id (query, Optional): {"type":"string","pattern":"^[0-9]+$"}

- actor_username (query, Optional): {"type":"string","minLength":1,"maxLength":64}

- action (query, Optional): {"type":"string","minLength":1,"maxLength":80}

- object_id (query, Optional): {"type":"string","minLength":1,"maxLength":100}

- object_type (query, Optional): {"enum":["user","key","channel","model","request","task","system"]}

- from (query, Optional): {"type":"string","format":"date-time"} created_at >= from;RFC3339 UTC,最多微秒精度。

- to (query, Optional): {"type":"string","format":"date-time"} created_at < to;RFC3339 UTC,最多微秒精度。from 必须早于 to。

Responses

200

管理员操作日志;只读的已提交操作与安全上下文

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  },
                  "actor_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actor_username": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "action": {
                    "type": "string"
                  },
                  "object_type": {
                    "enum": [
                      "user",
                      "key",
                      "channel",
                      "model",
                      "request",
                      "task",
                      "system"
                    ]
                  },
                  "object_id": {
                    "type": "string"
                  },
                  "details": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "user_id": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      "key_id": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      "provider_id": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      "model_id": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      "version": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "enabled": {
                        "type": "boolean"
                      },
                      "amount_micro": {
                        "type": "string",
                        "pattern": "^[0-9]+$",
                        "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
                      },
                      "budget_micro": {
                        "type": "string",
                        "pattern": "^[0-9]+$",
                        "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
                      },
                      "reference": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "routing_group": {
                        "type": "string"
                      },
                      "admin": {
                        "type": "boolean"
                      }
                    },
                    "required": []
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "id",
                  "actor_id",
                  "actor_username",
                  "action",
                  "object_type",
                  "object_id",
                  "details",
                  "created_at"
                ]
              }
            },
            "total": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "page": {
              "type": "integer",
              "minimum": 0
            },
            "size": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "items",
            "total",
            "page",
            "size"
          ]
        }
      },
      "required": [
        "success",
        "data"
      ]
    }
  }
}

default

错误代码见 core-api.md;供应商/数据库错误已隐藏。

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "type": {
              "const": "oneaster_error"
            }
          },
          "required": [
            "code",
            "message",
            "type"
          ]
        },
        "data": {
          "type": "null"
        }
      },
      "required": [
        "success",
        "error",
        "data"
      ]
    }
  }
}