Account session

GET /core/v1/me

Account session · GET /core/v1/me

Authentication

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

Endpoint

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

Parameters

—

Responses

200

本人账户与余额

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "email": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "email"
                },
                {
                  "type": "null"
                }
              ]
            },
            "email_verified_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "id": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "username": {
              "type": "string"
            },
            "admin": {
              "type": "boolean"
            },
            "platform_owner": {
              "type": "boolean"
            },
            "auth_version": {
              "type": "integer",
              "minimum": 0
            },
            "issuer": {
              "type": "string",
              "format": "uuid"
            },
            "currency": {
              "const": "CREDITS"
            },
            "micro_per_credit": {
              "const": 10000
            },
            "balance_micro": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
            },
            "reserved_micro": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
            }
          },
          "required": [
            "email",
            "email_verified_at",
            "id",
            "username",
            "admin",
            "platform_owner",
            "auth_version",
            "issuer",
            "currency",
            "micro_per_credit",
            "balance_micro",
            "reserved_micro"
          ]
        }
      },
      "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"
      ]
    }
  }
}