Account session

POST /core/v1/me/sessions/revoke-others

Account session · POST /core/v1/me/sessions/revoke-others

复用本人当前密码重新认证限流,不要求新密码规则;每次操作撤销当时的其他有效会话,保留当前会话,不使用 Idempotency-Key。超时后先刷新概览,重试可能撤销期间新登录的会话。

Authentication

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

Endpoint

curl --request POST 'https://api.oneaster.ai/core/v1/me/sessions/revoke-others' \
  --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN" \
  --header 'Content-Type: application/json' \
  --data "$REQUEST_BODY_JSON"

Parameters

—

Request JSON Schema

application/json

{
  "schema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "current_password": {
        "type": "string",
        "maxLength": 128,
        "writeOnly": true,
        "description": "验证已有密码,服务端按 UTF-8 字节限制;不适用新密码规则。"
      }
    },
    "required": [
      "current_password"
    ]
  }
}

Responses

200

验证当前密码并退出本人其他有效会话,保留当前会话

{
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "success": {
            "const": true
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "revoked_session_count": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "current_session_preserved": {
                "type": "boolean"
              }
            },
            "required": [
              "revoked_session_count",
              "current_session_preserved"
            ]
          }
        },
        "required": [
          "success",
          "data"
        ]
      }
    }
  },
  "headers": {}
}

429

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

{
  "content": {
    "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"
        ]
      }
    }
  },
  "headers": {
    "Retry-After": {
      "schema": {
        "type": "string"
      }
    }
  }
}

default

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

{
  "content": {
    "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"
        ]
      }
    }
  },
  "headers": {}
}