POST/api/v1/me/contacts绑定一个联系方式

先经 otp/send(scene=bind)向目标发码并 otp/verify 取得已验证工单,再绑定。

Request

Headers

NameData TypeRequiredDescription
AuthorizationstringYes会话令牌认证,格式 `Bearer <sessionToken>`
Content-TypestringYes请求体内容类型(默认值 "application/json")
type RequestHeaders = {
  /** 会话令牌认证,格式 `Bearer <sessionToken>` */
  Authorization: string
  /** 请求体内容类型,默认值 "application/json" */
  Content-Type: string
}
{
  "Authorization": "Bearer st_7c1f9e05b28d4a63",
  "Content-Type": "application/json"
}

Body

NameData TypeRequiredDescription
channelstringYes通道:phone / email
targetstringYes手机号或邮箱
verifyTicketstringYesOTP 已验证工单(scene=bind)
type RequestBody = {
  /** 通道:phone / email */
  channel: string
  /** 手机号或邮箱 */
  target: string
  /** OTP 已验证工单(scene=bind) */
  verifyTicket: string
}
{
  "channel": "email",
  "target": "chen.lin@example.com",
  "verifyTicket": "otv_2b74ce91f5608d3a"
}

Response

Body

NameData TypeRequiredDescription
contactIdstringYes联系方式 ID
channelstringYes通道:phone / email
targetstringYes号码 / 邮箱(脱敏展示)
verifiedbooleanYes绑定即已验证,恒为 true
boundAtstringYes绑定时间(ISO 8601 UTC)
type ContactDTO = {
  /** 联系方式 ID */
  contactId: string
  /** 通道:phone / email */
  channel: string
  /** 号码 / 邮箱(脱敏展示) */
  target: string
  /** 绑定即已验证,恒为 true */
  verified: boolean
  /** 绑定时间(ISO 8601 UTC) */
  boundAt: string
}
{
  "contactId": "01JD8SNP6N8Q1W7XQ2U5XDK9V3E",
  "channel": "phone",
  "target": "+861380000****",
  "verified": true,
  "boundAt": "2026-10-14T11:00:00Z"
}

HTTP Code

HTTP Status Meaning Notes
200 成功 返回新联系方式
409 已被占用 该手机号 / 邮箱已绑定到其他账号

Response Code

响应使用统一信封 {id, code, messages, result},其 code 字段:

code Meaning Notes
0 成功 返回新联系方式
2009 目标已被占用 该手机号 / 邮箱属于其他账号
2202 OTP 工单无效 verifyTicket 无效、过期或用途不符

Examples

POST /api/v1/me/contacts
Authorization: Bearer st_7c1f9e05b28d4a63
Content-Type: application/json

{
  "channel": "email",
  "target": "chen.lin@example.com",
  "verifyTicket": "otv_2b74ce91f5608d3a"
}
{
  "id": "01JD8SOEJY3F6G2MG",
  "code": 0,
  "messages": [],
  "result": {
    "contactId": "01JD8SNP7N9R2W8YR3V6YEL0W4G",
    "channel": "email",
    "target": "chen.lin@example.com",
    "verified": true,
    "boundAt": "2026-10-14T11:10:00Z"
  }
}