Skip to content

Username availability ​

Checks whether an email can be used as a new username.

POST /fieldservicegateway/usermanagement/v3/oauth/username-availability

Request ​

FieldTypeRequiredDescription
usernamestringyesEmail address to check, 3–255 characters

Example ​

json
{
  "username": "user@example.com"
}

cURL ​

bash
curl --request POST 'https://[BASE_URL]/fieldservicegateway/usermanagement/v3/oauth/username-availability' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: {{x-api-key}}' \
  --header 'Authorization: {{Authorization}}' \
  --header 'Asurion-correlationid: correlation-id' \
  --header 'Asurion-enduser: end-user' \
  --header 'Asurion-sourcesystem: source-system' \
  --header 'Asurion-serviceprovider: company-id' \
  --header 'Asurion-client: default' \
  --data '{
    "username": "user@example.com"
  }'

Response ​

200 OK

available is true only when the email is unused in both the identity store and the user record.

json
{
  "available": true,
  "username": "user@example.com",
  "existsInKratos": false,
  "existsInDatabase": false
}
FieldTypeDescription
availablebooleantrue when the username can be used
usernamestringEmail that was checked
existsInKratosbooleantrue when an identity already uses this email
existsInDatabasebooleantrue when a user record already uses this email

Errors ​

StatusCodeWhen
400VALIDATION_ERRORusername is missing or is not an email
500INTERNAL_ERRORSomething unexpected failed