# 25005: The provided user's username is invalid

Log Type: APPLICATION

Log Level: ERROR

## Description

This error occurs when your managed user request has a missing or invalid `userName`. A username is invalid when it is shorter than 2 characters or longer than 255 characters. Twilio also returns 25005 in the SCIM API when `userName` is not present in a user update request.

### Possible causes

* The request did not include `userName`.
* The supplied username is fewer than 2 characters long.
* The supplied username is longer than 255 characters.

### Possible solutions

* Include `userName` in the request body when you create or update a managed user. The SCIM API requires `userName` and `emails` when you create a user.
* Keep `userName` between 2 and 255 characters.
* For SCIM requests, make sure `userName` matches `emails[primary=true].value`.
* Provision users through the Organizations SCIM endpoints only for organization-managed users.

#### Additional resources

* [SCIM API reference](/docs/iam/scim/api-reference)
* [Managed users](/docs/iam/organizations/managed-users)
* [Domains](/docs/iam/organizations/domains)
