> For the complete documentation index, see [llms.txt](https://docs.cubicl.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cubicl.io/api-integration/users.md).

# Users

Returns organization users and the authenticated account. User IDs on tasks and other records may belong to Cubicl users, customer portal users, or email senders. Cubicl keeps data created by users who left the organization; fetch their details with an ID list.

## List all users

> Returns all users currently in the organization. Tasks and other records may refer to users who left the organization or to customer portal users. Use \*\*List users by IDs\*\* to get their details.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Users","description":"Returns organization users and the authenticated account. User IDs on tasks and other records may belong to Cubicl users, customer portal users, or email senders. Cubicl keeps data created by users who left the organization; fetch their details with an ID list."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"UserList":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"User":{"type":"object","description":"`User`, `PortalUser`, and `EmailUser` share this format. If the profile path is `/assets/img/...`, prefix `https://cubicl.io`.","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string","description":"Profile photo URL"}}},"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}}}},"paths":{"/organization/users":{"get":{"tags":["Users"],"summary":"List all users","description":"Returns all users currently in the organization. Tasks and other records may refer to users who left the organization or to customer portal users. Use **List users by IDs** to get their details.","operationId":"listOrganizationUsers","responses":{"200":{"description":"User list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"}}}},"403":{"$ref":"#/components/responses/Forbidden"}}}}}}
```

## List users by IDs

> Returns the users for the given IDs.\
> \
> Cubicl keeps data created by users (chat messages, task comments, and so on) and related data (assigned tasks, and so on) even after they leave the organization. Use this endpoint to get their details.\
> \
> User IDs on records may belong to Cubicl users, customer portal users, or email senders. This endpoint returns those as well.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Users","description":"Returns organization users and the authenticated account. User IDs on tasks and other records may belong to Cubicl users, customer portal users, or email senders. Cubicl keeps data created by users who left the organization; fetch their details with an ID list."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"UserList":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"User":{"type":"object","description":"`User`, `PortalUser`, and `EmailUser` share this format. If the profile path is `/assets/img/...`, prefix `https://cubicl.io`.","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string","description":"Profile photo URL"}}},"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/users":{"get":{"tags":["Users"],"summary":"List users by IDs","description":"Returns the users for the given IDs.\n\nCubicl keeps data created by users (chat messages, task comments, and so on) and related data (assigned tasks, and so on) even after they leave the organization. Use this endpoint to get their details.\n\nUser IDs on records may belong to Cubicl users, customer portal users, or email senders. This endpoint returns those as well.","operationId":"listUsersByIds","parameters":[{"name":"ids","in":"query","required":true,"description":"Comma-separated ID list","schema":{"type":"string"}}],"responses":{"200":{"description":"User list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"}}}}}}
```

## Get my user info

> Returns information about the authenticated user.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Users","description":"Returns organization users and the authenticated account. User IDs on tasks and other records may belong to Cubicl users, customer portal users, or email senders. Cubicl keeps data created by users who left the organization; fetch their details with an ID list."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"CurrentUser":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"language":{"type":"string"},"jobTitle":{"type":"string","nullable":true},"localization":{"type":"object","properties":{"dateFormat":{"type":"string"},"timeFormat":{"type":"string"},"timezone":{"type":"number"}}},"org":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"isAdmin":{"type":"boolean"}}},"presence":{"type":"object","properties":{"status":{"type":"string","enum":["busy","in-meeting","dnd","on-leave","none"]},"doNotDisturb":{"type":"object","description":"Present when `status = dnd`.","properties":{"mode":{"type":"string","enum":["off","duration","customHours"]},"preset":{"type":"string","enum":["off","15m","30m","1h","2h","4h","untilDisabled","custom"]},"customStart":{"type":"number"},"customEnd":{"type":"number"}}}}}}}]},"User":{"type":"object","description":"`User`, `PortalUser`, and `EmailUser` share this format. If the profile path is `/assets/img/...`, prefix `https://cubicl.io`.","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string","description":"Profile photo URL"}}},"ObjectId":{"type":"string","description":"MongoDB ObjectId"}}},"paths":{"/app/me":{"get":{"tags":["Users"],"summary":"Get my user info","operationId":"getCurrentUser","responses":{"200":{"description":"Authenticated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentUser"}}}}},"description":"Returns information about the authenticated user."}}}}
```

## List sessions

> Returns session records of the authenticated user. Successful sessions are in \`active\`; suspicious or failed sessions from the last two months are in \`suspicious\`.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Users","description":"Returns organization users and the authenticated account. User IDs on tasks and other records may belong to Cubicl users, customer portal users, or email senders. Cubicl keeps data created by users who left the organization; fetch their details with an ID list."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"LoginSessionLists":{"type":"object","properties":{"active":{"type":"array","items":{"$ref":"#/components/schemas/LoginSession"}},"suspicious":{"type":"array","items":{"$ref":"#/components/schemas/LoginSession"}}}},"LoginSession":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"device":{"type":"string"},"deviceType":{"type":"string","enum":["desktop","phone","tablet","robot","other"]},"os":{"type":"string"},"browser":{"type":"string"},"loginTime":{"$ref":"#/components/schemas/UnixTimestamp"},"ipAddress":{"type":"string"},"location":{"type":"string"},"isSuccessful":{"type":"boolean"},"failureType":{"type":"string","enum":["wrong-password","two-fa-code-invalid","unknown-location"]},"isUserConfirmed":{"type":"boolean"}}},"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"}}},"paths":{"/users/self/sessions":{"get":{"tags":["Users"],"summary":"List sessions","operationId":"listCurrentUserSessions","description":"Returns session records of the authenticated user. Successful sessions are in `active`; suspicious or failed sessions from the last two months are in `suspicious`.","responses":{"200":{"description":"Session lists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginSessionLists"}}}}}}}}}
```
