OpenMax
免费试用

Apps API · Me

Me: 3 个接口

← 全部分组

GET /api/v1/me

Get current user

权限(scope): org:me:read · 调用方式: appToken · operationId: get-me

Required app scope: org:me:read.

Returns the authenticated identity context, including the login email (email), the UNVERIFIED contact_email and the primary phone (phone_cc / phone_number) — the same response as the web. Personal access tokens and app tokens need org:me:read (implicit for every app); org:me.email:read does not apply here (it only governs the app token endpoint user.email and the id_token email claim). When the JWT is org-scoped, display_name and avatar_url come from the current member and the response also includes organization, member, and role info. With an identity-only JWT, display_name is empty and avatar_url is null. Response wrapped in standard envelope.

回包

PATCH /api/v1/me

Update own profile

权限(scope): org:me:write · 调用方式: appToken · operationId: update-me

Required app scope: org:me:write.

Updates the authenticated member profile for the current org scope (display name, avatar). avatar_url must be "" (restore the default avatar; saved as null) or a URL returned by POST /api/v1/avatars/uploads/finalize in the current organization, else 400 AVATAR_URL_NOT_ALLOWED (503 when avatar storage is not configured). Identity-only JWTs cannot update member display attributes because those live on members, but CAN update the identity-level fields (locale, phone, contact_email). Writes only the caller's own identity/member — there is no way to address another identity through this endpoint. contact_email is UNVERIFIED contact information and never becomes a login or verification address; send an empty string to clear it. Response wrapped in standard envelope.

请求体

application/json · UpdateMeRequestBody

字段 类型 必填 说明
avatar_url string Avatar URL from POST /api/v1/avatars/uploads/finalize in the current organization, or "" to restore the default avatar
contact_email string Update the UNVERIFIED contact email on the caller's own identity. Send a valid address to set it; send an empty string to CLEAR it. Omitting the field (or sending JSON null, which is indistinguishable from omitted) leaves the stored value unchanged. Invalid non-empty values are rejected with 400. This never becomes a login or verification address — see the contact_email field on the response.
display_name string Update display name
locale string: en, zh Update identity-level preferred language (org independent)
phone_cc string Update primary phone country calling code (digits only, no +, 1-4 digits). Must be sent together with phone_number.
phone_number string Update primary phone national number (digits only, 4-15). Must be sent together with phone_cc.

回包

PATCH /api/v1/me/display-name

Update own member display name

权限(scope): org:me:write · 调用方式: appToken · operationId: update-me-display-name

Required app scope: org:me:write.

Updates the authenticated user's org-level member display name in the current organization. Response wrapped in standard envelope.

请求体

application/json · UpdateMemberDisplayNameRequestBody

字段 类型 必填 说明
display_name string 是 Org-level member display name

回包