# Me Actions
Details on the various actions that can be performed on the
Me resource, including the expected
parameters and the potential responses.
##### Contents
* [Add Recent Item](#add-recent-item)
* [Change Password](#change-password)
* [Delete](#delete)
* [Device Counts](#device-counts)
* [Disable Two Factor Auth](#disable-two-factor-auth)
* [Disconnect Github](#disconnect-github)
* [Enable Two Factor Auth](#enable-two-factor-auth)
* [Fetch Recent Items](#fetch-recent-items)
* [Generate Two Factor Auth](#generate-two-factor-auth)
* [Get](#get)
* [Invite](#invite)
* [Invites](#invites)
* [Notebook Minute Counts](#notebook-minute-counts)
* [Patch](#patch)
* [Payload Counts](#payload-counts)
* [Payload Counts Breakdown](#payload-counts-breakdown)
* [Refresh Token](#refresh-token)
* [Respond to Invite](#respond-to-invite)
* [Transfer Resources](#transfer-resources)
* [Verify Email](#verify-email)
## Add Recent Item
Adds an item to a recent item list
```ruby
result = client.me.add_recent_item(data: my_data)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.addRecentItem.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| data | [Recent Item](_schemas.md#recent-item) | Y | Object containing recent item info | | [Recent Item Example](_schemas.md#recent-item-example) |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Recent Item List](_schemas.md#recent-item-list) | Updated recent item list |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Change Password
Changes the current user's password and optionally logs out all other sessions
```ruby
result = client.me.change_password(data: my_data)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.changePassword.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| data | [Change Password](_schemas.md#change-password) | Y | Object containing the password change info | | [Change Password Example](_schemas.md#change-password-example) |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Authenticated User](_schemas.md#authenticated-user) | A new, valid, auth token (potentially all previous tokens are now invalid) |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Delete
Deletes the current user
```ruby
result = client.me.delete(credentials: my_credentials)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.delete.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| credentials | [User Credentials](_schemas.md#user-credentials) | Y | User authentication credentials | | [User Credentials Example](_schemas.md#user-credentials-example) |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Success](_schemas.md#success) | If the user was successfully deleted |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Device Counts
Returns device counts by day for the time range specified for all applications the current user owns
```ruby
result = client.me.device_counts(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, all.User.read, me.*, or me.deviceCounts.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| start | string | N | Start of range for device count query (ms since epoch) | | 0 |
| end | string | N | End of range for device count query (ms since epoch) | | 1465790400000 |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Device Counts](_schemas.md#device-counts) | Device counts by day |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Disable Two Factor Auth
Disables two factor auth for the current user
```ruby
result = client.me.disable_two_factor_auth(data: my_data)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.disableTwoFactorAuth.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| data | [Disable Two Factor Auth](_schemas.md#disable-two-factor-auth) | Y | Object containing two factor auth properties | | [Disable Two Factor Auth Example](_schemas.md#disable-two-factor-auth-example) |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Me](_schemas.md#me) | Updated user information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Disconnect Github
Disconnects the user from Github
```ruby
result = client.me.disconnect_github(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.disconnectGithub.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Me](_schemas.md#me) | Updated user information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Enable Two Factor Auth
Enables two factor auth for the current user
```ruby
result = client.me.enable_two_factor_auth(data: my_data)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.enableTwoFactorAuth.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| data | [Enable Two Factor Auth](_schemas.md#enable-two-factor-auth) | Y | Object containing two factor auth properties | | [Enable Two Factor Auth Example](_schemas.md#enable-two-factor-auth-example) |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Me](_schemas.md#me) | Updated user information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Fetch Recent Items
Gets a recent item list
```ruby
result = client.me.fetch_recent_items(itemType: my_item_type)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, all.User.read, me.*, or me.fetchRecentItems.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| parentId | string | N | Parent id of the recent list | | 575ec8687ae143cd83dc4a97 |
| itemType | undefined | Y | Item type to get the recent list of. Accepted values are: application, device, flow, dashboard, organization | | application |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Recent Item List](_schemas.md#recent-item-list) | Recent item list |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Generate Two Factor Auth
Returns the two factor auth key for a user
```ruby
result = client.me.generate_two_factor_auth(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.generateTwoFactorAuth.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Two Factor Auth Info](_schemas.md#two-factor-auth-info) | Updated user information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Get
Retrieves information on the current user
```ruby
result = client.me.get(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, all.User.read, me.*, or me.get.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| includeRecent | undefined | N | Should the user include recent app/dashboard info | | true |
| summaryExclude | string | N | Comma-separated list of summary fields to exclude from user summary | | payloadCount |
| summaryInclude | string | N | Comma-separated list of summary fields to include in user summary | | payloadCount |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Me](_schemas.md#me) | Current user information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
## Invite
Retrieves information for an invitation to an organization
```ruby
result = client.me.invite(inviteId: my_invite_id)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.invite.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| inviteId | string | Y | ID associated with the invitation | | 575ec8687ae143cd83dc4a97 |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization Invitation Information For User](_schemas.md#organization-invitation-information-for-user) | Information about invitation |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if invite not found |
## Invites
Retrieves pending organization invitations for a user
```ruby
result = client.me.invites(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.invites.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [User Organization Invitations](_schemas.md#user-organization-invitations) | Information about invitations |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Notebook Minute Counts
Returns notebook execution usage by day for the time range specified for all applications the current user owns
```ruby
result = client.me.notebook_minute_counts(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, all.User.read, me.*, or me.notebookMinuteCounts.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| start | string | N | Start of range for notebook execution query (ms since epoch) | | 0 |
| end | string | N | End of range for notebook execution query (ms since epoch) | | 1465790400000 |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Notebook Minute Counts](_schemas.md#notebook-minute-counts) | Notebook usage information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Patch
Updates information about the current user
```ruby
result = client.me.patch(user: my_user)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.patch.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| user | [Me Patch](_schemas.md#me-patch) | Y | Object containing new user properties | | [Me Patch Example](_schemas.md#me-patch-example) |
| summaryExclude | string | N | Comma-separated list of summary fields to exclude from user summary | | payloadCount |
| summaryInclude | string | N | Comma-separated list of summary fields to include in user summary | | payloadCount |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Me](_schemas.md#me) | Updated user information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Payload Counts
Returns payload counts for the time range specified for all applications the current user owns
```ruby
result = client.me.payload_counts(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, all.User.read, me.*, or me.payloadCounts.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| start | string | N | Start of range for payload count query (ms since epoch) | | 0 |
| end | string | N | End of range for payload count query (ms since epoch) | | 1465790400000 |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Payload Stats](_schemas.md#payload-stats) | Payload counts, by type and source |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Payload Counts Breakdown
Returns payload counts per resolution in the time range specified for all applications the current user owns
```ruby
result = client.me.payload_counts_breakdown(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, all.User.read, me.*, or me.payloadCountsBreakdown.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| start | string | N | Start of range for payload count query (ms since epoch) | | 0 |
| end | string | N | End of range for payload count query (ms since epoch) | | 1465790400000 |
| resolution | string | N | Resolution in milliseconds. Accepted values are: 86400000, 3600000 | 86400000 | 86400000 |
| asBytes | string | N | If the resulting stats should be returned as bytes | false | true |
| includeNonBillable | string | N | If non-billable payloads should be included in the result | false | true |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Payload Counts Breakdown](_schemas.md#payload-counts-breakdown) | Sum of payload counts by date |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Refresh Token
Returns a new auth token based on the current auth token
```ruby
result = client.me.refresh_token(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, or me.*.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Authenticated User](_schemas.md#authenticated-user) | Successful token regeneration |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 401 | [Error](_schemas.md#error) | Unauthorized error if authentication fails |
## Respond to Invite
Accepts or rejects an invitation to an organization
```ruby
result = client.me.respond_to_invite(
inviteId: my_invite_id,
response: my_response)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.respondToInvite.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| inviteId | string | Y | ID associated with the invitation | | 575ec8687ae143cd83dc4a97 |
| response | [Organization Invitation Action For User](_schemas.md#organization-invitation-action-for-user) | Y | Response to invitation | | [Organization Invitation Action For User Example](_schemas.md#organization-invitation-action-for-user-example) |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization Invitation Result For User](_schemas.md#organization-invitation-result-for-user) | Acceptance or rejection of invitation |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if invitation not found |
| 410 | [Error](_schemas.md#error) | Error if invitation has expired |
## Transfer Resources
Moves resources to a new owner
```ruby
result = client.me.transfer_resources(transfer: my_transfer)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.transferResources.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| transfer | [Resource Transfer](_schemas.md#resource-transfer) | Y | Object containing properties of the transfer | | [Resource Transfer Example](_schemas.md#resource-transfer-example) |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Success](_schemas.md#success) | If resource transfer was successful |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
## Verify Email
Sends an email verification to the user
```ruby
result = client.me.verify_email(optional_params)
puts result
```
#### Authentication
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.User, me.*, or me.verifyEmail.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Success](_schemas.md#success) | If email verification was successfully sent |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |