# Org Actions
Details on the various actions that can be performed on the
Org resource, including the expected
parameters and the potential responses.
##### Contents
* [Delete](#delete)
* [Get](#get)
* [Invite Member](#invite-member)
* [Modify Member](#modify-member)
* [Patch](#patch)
* [Payload Counts](#payload-counts)
* [Pending Invites](#pending-invites)
* [Remove Member](#remove-member)
* [Revoke Invite](#revoke-invite)
* [Transfer Resources](#transfer-resources)
## Delete
Deletes an organization
```ruby
result = client.org.delete(orgId: my_org_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.Organization, all.User, org.*, or org.delete.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Success](_schemas.md#success) | If organization was successfully deleted |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization was not found |
## Get
Retrieves information on an organization
```ruby
result = client.org.get(orgId: my_org_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.Organization, all.Organization.read, all.User, all.User.read, org.*, or org.get.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| summaryExclude | string | N | List of summary fields to exclude from org summary | | payloadCount |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization](_schemas.md#organization) | Organization information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization not found |
## Invite Member
Invites a person to an organization
```ruby
result = client.org.invite_member(
orgId: my_org_id,
invite: my_invite)
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.Organization, all.User, org.*, or org.inviteMember.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| invite | [Organization Invitation Post](_schemas.md#organization-invitation-post) | Y | Object containing new invite info | | [Organization Invitation Post Example](_schemas.md#organization-invitation-post-example) |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization Invitations](_schemas.md#organization-invitations) | Invitation information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization not found |
## Modify Member
Modifies a current org member's role
```ruby
result = client.org.modify_member(
orgId: my_org_id,
member: my_member)
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.Organization, all.User, org.*, or org.modifyMember.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| member | [Organization Member Patch](_schemas.md#organization-member-patch) | Y | Object containing new member pair | | [Organization Member Patch Example](_schemas.md#organization-member-patch-example) |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization](_schemas.md#organization) | Updated organization information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization not found |
## Patch
Updates information about an organization
```ruby
result = client.org.patch(
orgId: my_org_id,
organization: my_organization)
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.Organization, all.User, org.*, or org.patch.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| organization | [Organization Patch](_schemas.md#organization-patch) | Y | Object containing new organization properties | | [Organization Patch Example](_schemas.md#organization-patch-example) |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization](_schemas.md#organization) | Updated organization information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization was not found |
## Payload Counts
Returns payload counts for the time range specified for all applications this organization owns
```ruby
result = client.org.payload_counts(orgId: my_org_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.Organization, all.Organization.read, all.User, all.User.read, org.*, or org.payloadCounts.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| 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 |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Payload Counts](_schemas.md#payload-counts) | Payload counts, by type and source |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization was not found |
## Pending Invites
Gets the current pending invites
```ruby
result = client.org.pending_invites(orgId: my_org_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.Organization, all.Organization.read, all.User, all.User.read, org.*, or org.pendingInvites.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization Invitations](_schemas.md#organization-invitations) | Invitation information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization not found |
## Remove Member
Removes a member from the org
```ruby
result = client.org.remove_member(
orgId: my_org_id,
userId: my_user_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.Organization, all.User, org.*, or org.removeMember.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| userId | string | Y | Id of user to remove | | 575ed70c7ae143cd83dc4aa9 |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization](_schemas.md#organization) | Updated organization information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization not found |
## Revoke Invite
Revokes an existing invite
```ruby
result = client.org.revoke_invite(
orgId: my_org_id,
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.Organization, all.User, org.*, or org.revokeInvite.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| inviteId | string | Y | Id of invite to revoke | | 575ed71e7ae143cd83dc4aaa |
#### Successful Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 200 | [Organization Invitations](_schemas.md#organization-invitations) | Invitation information |
#### Error Responses
| Code | Type | Description |
| ---- | ---- | ----------- |
| 400 | [Error](_schemas.md#error) | Error if malformed request |
| 404 | [Error](_schemas.md#error) | Error if organization not found |
## Transfer Resources
Moves resources to a new owner
```ruby
result = client.org.transfer_resources(
orgId: my_org_id,
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.Organization, all.User, org.*, or org.transferResources.
#### Available Parameters
| Name | Type | Required | Description | Default | Example |
| ---- | ---- | -------- | ----------- | ------- | ------- |
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
| transfer | [Resource Transfer](_schemas.md#resource-transfer) | Y | Object containing properties of the transfer | | [Resource Transfer Example](_schemas.md#resource-transfer-example) |
#### 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 |
| 404 | [Error](_schemas.md#error) | Error if organization was not found |