Appearance
Username availability
Checks whether an email can be used as a new username.
POST /fieldservicegateway/usermanagement/v3/oauth/username-availability
Request
| Field | Type | Required | Description |
|---|---|---|---|
username | string | yes | Email 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
}| Field | Type | Description |
|---|---|---|
available | boolean | true when the username can be used |
username | string | Email that was checked |
existsInKratos | boolean | true when an identity already uses this email |
existsInDatabase | boolean | true when a user record already uses this email |
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_ERROR | username is missing or is not an email |
| 500 | INTERNAL_ERROR | Something unexpected failed |