Account session

POST /core/v1/me/email

Account session · POST /core/v1/me/email

Authentication

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

Endpoint

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

Parameters

—

Request JSON Schema

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "token": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true
    }
  },
  "required": [
    "token"
  ]
}

Responses

200

验证本人及原认证版本的证明后绑定邮箱并注销原会话

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "updated": {
              "const": true
            }
          },
          "required": [
            "updated"
          ]
        }
      },
      "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"
      ]
    }
  }
}