# Get a user profile by name

`GET /api/user/by-name/{name}`

URL: https://repsona.com/api/get-user-by-name-name

Old UserController.byName compatible. Cross-space names are not found.

## Parameters

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `name` | path | string | required | Username (@name) of the user, without the @. |

## Request

```sh
curl -X GET "https://<space>.repsona.com/api/user/by-name/{name}" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## Responses

- 200: User profile
- 401: Authentication is required
- 404: User not found in this space

## Example response

```json
{
  "user": {
    "id": 1128,
    "name": "mia",
    "fullName": "Mia Chen",
    "avatarUrl": null,
    "color": null,
    "backgroundUrl": null,
    "role": "member",
    "whatAreYouDoing": "Testing the mobile app",
    "state": "active"
  }
}
```
