# Users

## Endpoints

## Get All Users

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/organization/users`

Gets all users who are currently a member of the organization.

Tasks and other records may refer to users who are removed from the organization or who are client portal users. Use [#get-users-by-id](#get-users-by-id "mention") endpoint to get their details.

{% tabs %}
{% tab title="200: OK User list" %}

```javascript
User[]
```

{% endtab %}
{% endtabs %}

## Get Users By Id

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/users`

Returns multiple users whose ids are given.

Cubicl keeps data created by (sent chat messages, task comments, etc.) and related (tasks assigned, etc.) to users even after they are removed from the organization account. In order to access their details, you can use this endpoint.

User ids in the records can belong to not only Cubicl users but also Client Portal users or email senders. This endpoint will return them too.

The email address is not included in the response.

#### Query Parameters

| Name                                  | Type   | Description                 |
| ------------------------------------- | ------ | --------------------------- |
| ids<mark style="color:red;">\*</mark> | string | Comma-separated list of ids |

{% tabs %}
{% tab title="200: OK User list" %}

```javascript
{
    _id : string;
    firstname: string;
    lastname: string;
    profile: string; // URL for profile photo
}[]
```

{% endtab %}
{% endtabs %}

## Get Me

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/app/me`

Returns information related to the currently authenticated user.

{% tabs %}
{% tab title="200: OK User Info" %}

```javascript
{
    _id : string;
    firstname: string;
    lastname: string;
    profile: string; // URL for profile photo
    jobTitle: string | null;
    language: string;
    localization: {
        dateFormat: string;
        timeFormat: string;
        timezone: number;
    };
    org: {
        name: string;
        countryCode: string;
        // Admin user ids
        admins: string[];
        isAdmin: boolean;
    }
}
```

{% endtab %}
{% endtabs %}

## Data

#### Users

```typescript
type User = {
    _id : string;
    firstname: string;
    lastname: string;
    email: string;
    profile: string; // URL for profile photo
}
```
