Xeonr Developer Docs

Lookup User By Username

POST
/xeonr.auth.api.v1.UsersService/LookupUserByUsername

Resolves a username to its user within the caller's organisation — the reverse of BatchGetUsers, for surfaces addressed by username (public profiles). Unlike BatchGetUsers this is organisation-scoped rather than enrollment-scoped: the person being looked up need not have used the calling application. Usernames are not uniquely indexed; an ambiguous username answers not_found.

Required scopes: profile or auth:users:lookup

AuthorizationBearer <token>

JWT access token obtained via OAuth2 flow or service account

In: header

Header Parameters

Connect-Protocol-Version*number

Define the version of the Connect protocol

Value in1
Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

username?string
Length1 <= length <= 64
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://auth.xeonr.io/xeonr.auth.api.v1.UsersService/LookupUserByUsername" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "user": {
    "userId": "urn:xeonr:auth:uid:user:123",
    "username": "johndoe",
    "avatarUrl": "https://cdn.example.com/avatars/abc123",
    "createdAt": "2023-01-15T01:30:15.01Z",
    "isAdmin": true
  }
}
{
  "code": "not_found",
  "message": "string",
  "details": [
    {
      "type": "string",
      "value": "string",
      "debug": {}
    }
  ]
}