# Get User

> `GET /users/{user_id}`

Web page: https://reference.earthclassmail.com/v1/rest-api/spec/operations/getuser/

URL: `GET https://api.earthclassmail.com/v1/users/{user_id}`

Returns the details of a specific user by their user ID.

## Authorization

Send your API key in the `x-api-key` header.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `user_id` | path | yes | string |  |

## Responses

### 200

Success

Content type: `application/json`

Type: `User`

Example:

```json
{
  "id": 5001,
  "admin_account_ids": [
    100,
    200
  ],
  "created_at": "2024-01-10T08:00:00Z",
  "email": "jane.doe@example.com",
  "first_name": "Jane",
  "is_admin": true,
  "last_name": "Doe",
  "phone": "15551234567",
  "updated_at": "2024-06-01T12:00:00Z",
  "username": "jane.doe@example.com"
}
```

### 401

The `x-api-key` header is missing or the key is not valid, or the caller can't access an ID in the request. IDs that don't exist return the same response as IDs the caller can't access.

Content type: `application/json`

Type: `Error`

Example — Missing API key:

```json
{
  "error": {
    "code": 401,
    "message": "The request does not include a valid access token. Please provide a valid access token.",
    "type": "Authorization"
  }
}
```

Example — Invalid API key:

```json
{
  "error": {
    "code": 401,
    "message": "x-api-key: x-api-key is invalid",
    "type": "REST"
  }
}
```

Example — No access to resource:

```json
{
  "error": {
    "code": 401,
    "message": "User does not have access to requested resource.",
    "type": "Authorization"
  }
}
```

## Schemas

### Error

Error envelope returned with 4xx and 5xx responses.

- `error` (object)
  - `code` (integer): Usually the HTTP status code. It can differ; a request to an unknown path returns HTTP 400 with code 500.
  - `message` (string): Human-readable description of the error.
  - `type` (string): The kind of error, for example `Authorization` or `REST`.
  - `fields` (object): Returned only with `422` responses. It may give more details about what failed validation, as lists of messages keyed by the name of the input.

### User

- `id` (integer)
- `created_at` (string<date-time>)
- `updated_at` (string<date-time>)
- `uuid` (string)
- `first_name` (string)
- `last_name` (string)
- `email` (string<email>)
- `username` (string)
- `phone` (string)
- `is_admin` (boolean)
- `admin_account_ids` (array of integer)
