# Manage your fleet with Viam's fleet management API

The fleet management API allows you to manage your machine fleet with code the same way you can do in the [web UI](https://app.viam.com/).
With it you can

- create and manage organizations, locations, and individual machines
- manage permissions and authorization
- create and manage fragments

The fleet management API supports the following methods:

| Method Name | Description |
| --- | --- |
| [`GetUserIDByEmail`](https://docs.viam.com/reference/apis/fleet/#getuseridbyemail) | Get the ID of a user by email. |
| [`CreateOrganization`](https://docs.viam.com/reference/apis/fleet/#createorganization) | Create an organization. |
| [`ListOrganizations`](https://docs.viam.com/reference/apis/fleet/#listorganizations) | List the organizations the user is an authorized user of. |
| [`GetOrganizationsWithAccessToLocation`](https://docs.viam.com/reference/apis/fleet/#getorganizationswithaccesstolocation) | Get all organizations that have access to a location. |
| [`ListOrganizationsByUser`](https://docs.viam.com/reference/apis/fleet/#listorganizationsbyuser) | List the organizations a user belongs to. |
| [`GetOrganization`](https://docs.viam.com/reference/apis/fleet/#getorganization) | Retrieve the organization object for the requested organization containing the organization’s ID, name, public namespace, and more. |
| [`GetOrganizationNamespaceAvailability`](https://docs.viam.com/reference/apis/fleet/#getorganizationnamespaceavailability) | Check the availability of an organization namespace. |
| [`UpdateOrganization`](https://docs.viam.com/reference/apis/fleet/#updateorganization) | Updates organization details. |
| [`DeleteOrganization`](https://docs.viam.com/reference/apis/fleet/#deleteorganization) | Delete an organization. |
| [`ListOrganizationMembers`](https://docs.viam.com/reference/apis/fleet/#listorganizationmembers) | List the members and invites of the organization that you are currently authenticated to. |
| [`CreateOrganizationInvite`](https://docs.viam.com/reference/apis/fleet/#createorganizationinvite) | Create an organization invite and send it by email. |
| [`UpdateOrganizationInviteAuthorizations`](https://docs.viam.com/reference/apis/fleet/#updateorganizationinviteauthorizations) | Update (add or remove) the authorizations attached to an organization invite that has already been created. |
| [`DeleteOrganizationMember`](https://docs.viam.com/reference/apis/fleet/#deleteorganizationmember) | Remove a member from the organization you are currently authenticated to. |
| [`DeleteOrganizationInvite`](https://docs.viam.com/reference/apis/fleet/#deleteorganizationinvite) | Delete a pending organization invite to the organization you are currently authenticated to. |
| [`ResendOrganizationInvite`](https://docs.viam.com/reference/apis/fleet/#resendorganizationinvite) | Resend a pending organization invite email. |
| [`GetOrganizationMetadata`](https://docs.viam.com/reference/apis/fleet/#getorganizationmetadata) | Gets the user-defined metadata for an organization. |
| [`UpdateOrganizationMetadata`](https://docs.viam.com/reference/apis/fleet/#updateorganizationmetadata) | Updates the user-defined metadata for an organization. |
| [`CreateLocation`](https://docs.viam.com/reference/apis/fleet/#createlocation) | Create and name a location under the organization you are currently authenticated to. |
| [`GetLocation`](https://docs.viam.com/reference/apis/fleet/#getlocation) | Get a location by its location ID. |
| [`UpdateLocation`](https://docs.viam.com/reference/apis/fleet/#updatelocation) | Change the name of a location and/or assign a parent location to a location. |
| [`DeleteLocation`](https://docs.viam.com/reference/apis/fleet/#deletelocation) | Delete a location. |
| [`ListLocations`](https://docs.viam.com/reference/apis/fleet/#listlocations) | Get a list of all locations under the organization you are currently authenticated to. |
| [`ShareLocation`](https://docs.viam.com/reference/apis/fleet/#sharelocation) | Share a location with an organization. |
| [`UnshareLocation`](https://docs.viam.com/reference/apis/fleet/#unsharelocation) | Stop sharing a location with an organization. |
| [`LocationAuth`](https://docs.viam.com/reference/apis/fleet/#locationauth) | Get a location’s `LocationAuth` (location secret or secrets). |
| [`CreateLocationSecret`](https://docs.viam.com/reference/apis/fleet/#createlocationsecret) | Create a new location secret. |
| [`DeleteLocationSecret`](https://docs.viam.com/reference/apis/fleet/#deletelocationsecret) | Delete a location secret. |
| [`GetLocationMetadata`](https://docs.viam.com/reference/apis/fleet/#getlocationmetadata) | Get the user-defined metadata for a location. |
| [`UpdateLocationMetadata`](https://docs.viam.com/reference/apis/fleet/#updatelocationmetadata) | Update the user-defined metadata for a location. |
| [`GetRobot`](https://docs.viam.com/reference/apis/fleet/#getrobot) | Get a machine by its ID. |
| [`GetRobotAPIKeys`](https://docs.viam.com/reference/apis/fleet/#getrobotapikeys) | Gets the API keys for the machine. |
| [`GetRobotParts`](https://docs.viam.com/reference/apis/fleet/#getrobotparts) | Get a list of all the parts under a specific machine. |
| [`GetRobotPart`](https://docs.viam.com/reference/apis/fleet/#getrobotpart) | Get a specific machine part including its part config, part address, and other information. |
| [`GetRobotPartLogs`](https://docs.viam.com/reference/apis/fleet/#getrobotpartlogs) | Get the logs associated with a specific machine part. |
| [`GetRobotPartByNameAndLocation`](https://docs.viam.com/reference/apis/fleet/#getrobotpartbynameandlocation) | Query a specific robot part by name and location id. |
| [`TailRobotPartLogs`](https://docs.viam.com/reference/apis/fleet/#tailrobotpartlogs) | Get an asynchronous iterator that receives live machine part logs. |
| [`GetRobotPartHistory`](https://docs.viam.com/reference/apis/fleet/#getrobotparthistory) | Get a list containing the history of a machine part. |
| [`UpdateRobotPart`](https://docs.viam.com/reference/apis/fleet/#updaterobotpart) | Change the name of and assign an optional new configuration to a machine part. |
| [`NewRobotPart`](https://docs.viam.com/reference/apis/fleet/#newrobotpart) | Create a new machine part. |
| [`DeleteRobotPart`](https://docs.viam.com/reference/apis/fleet/#deleterobotpart) | Delete the specified machine part. |
| [`MarkPartAsMain`](https://docs.viam.com/reference/apis/fleet/#markpartasmain) | Mark a machine part as the _main_ part of a machine. |
| [`MarkPartForRestart`](https://docs.viam.com/reference/apis/fleet/#markpartforrestart) | Mark a specified machine part for restart. |
| [`CreateRobotPartSecret`](https://docs.viam.com/reference/apis/fleet/#createrobotpartsecret) | Create a machine part secret. |
| [`DeleteRobotPartSecret`](https://docs.viam.com/reference/apis/fleet/#deleterobotpartsecret) | Delete a machine part secret. |
| [`ListRobots`](https://docs.viam.com/reference/apis/fleet/#listrobots) | Get a list of all machines in a specified location. |
| [`NewRobot`](https://docs.viam.com/reference/apis/fleet/#newrobot) | Create a new machine. |
| [`UpdateRobot`](https://docs.viam.com/reference/apis/fleet/#updaterobot) | Update an existing machine’s name and/or location. |
| [`DeleteRobot`](https://docs.viam.com/reference/apis/fleet/#deleterobot) | Delete a specified machine. |
| [`GetRobotMetadata`](https://docs.viam.com/reference/apis/fleet/#getrobotmetadata) | Gets the user-defined metadata for a machine. |
| [`GetRobotPartMetadata`](https://docs.viam.com/reference/apis/fleet/#getrobotpartmetadata) | Gets the user-defined metadata for a machine part. |
| [`UpdateRobotMetadata`](https://docs.viam.com/reference/apis/fleet/#updaterobotmetadata) | Updates the user-defined metadata for a machine. |
| [`UpdateRobotPartMetadata`](https://docs.viam.com/reference/apis/fleet/#updaterobotpartmetadata) | Updates the user-defined metadata for a machine part. |
| [`ListFragments`](https://docs.viam.com/reference/apis/fleet/#listfragments) | Get a list of fragments in the organization you are currently authenticated to. |
| [`ListMachineFragments`](https://docs.viam.com/reference/apis/fleet/#listmachinefragments) | Get a list of top level and nested fragments for a machine, as well as additionally specified fragment IDs. |
| [`ListMachineSummaries`](https://docs.viam.com/reference/apis/fleet/#listmachinesummaries) | Lists machine summaries for an organization, optionally filtered by fragment IDs, location IDs, and limit. |
| [`GetFragment`](https://docs.viam.com/reference/apis/fleet/#getfragment) | Get a fragment by ID. |
| [`CreateFragment`](https://docs.viam.com/reference/apis/fleet/#createfragment) | Create a new private fragment. |
| [`UpdateFragment`](https://docs.viam.com/reference/apis/fleet/#updatefragment) | Update a fragment name and its config and/or visibility. |
| [`DeleteFragment`](https://docs.viam.com/reference/apis/fleet/#deletefragment) | Delete a fragment. |
| [`GetFragmentHistory`](https://docs.viam.com/reference/apis/fleet/#getfragmenthistory) | Get fragment history. |
| [`AddRole`](https://docs.viam.com/reference/apis/fleet/#addrole) | Add a role under the organization you are currently authenticated to. |
| [`RemoveRole`](https://docs.viam.com/reference/apis/fleet/#removerole) | Remove a role under the organization you are currently authenticated to. |
| [`ChangeRole`](https://docs.viam.com/reference/apis/fleet/#changerole) | Changes an existing role to a new role. |
| [`ListAuthorizations`](https://docs.viam.com/reference/apis/fleet/#listauthorizations) | List all authorizations (owners and operators) of a specific resource (or resources) within the organization you are currently authenticated to. |
| [`CheckPermissions`](https://docs.viam.com/reference/apis/fleet/#checkpermissions) | Check if the organization, location, or robot your `ViamClient` is authenticated to is permitted to perform some action or set of actions on the resource you pass to the method. |
| [`GetRegistryItem`](https://docs.viam.com/reference/apis/fleet/#getregistryitem) | Get metadata about a registry item (a module, training script, or ML model) by registry item ID. |
| [`CreateRegistryItem`](https://docs.viam.com/reference/apis/fleet/#createregistryitem) | Create a registry item. |
| [`UpdateRegistryItem`](https://docs.viam.com/reference/apis/fleet/#updateregistryitem) | Update a registry item. |
| [`ListRegistryItems`](https://docs.viam.com/reference/apis/fleet/#listregistryitems) | List the registry items in an organization. |
| [`DeleteRegistryItem`](https://docs.viam.com/reference/apis/fleet/#deleteregistryitem) | Delete a registry item. |
| [`CreateModule`](https://docs.viam.com/reference/apis/fleet/#createmodule) | Create a module under the organization you are currently authenticated to. |
| [`UpdateModule`](https://docs.viam.com/reference/apis/fleet/#updatemodule) | Update the documentation URL, description, models, entrypoint, and/or the visibility of a module. |
| [`UploadModuleFile`](https://docs.viam.com/reference/apis/fleet/#uploadmodulefile) | Upload a module file. |
| [`GetModule`](https://docs.viam.com/reference/apis/fleet/#getmodule) | Get a module by its ID. |
| [`ListModules`](https://docs.viam.com/reference/apis/fleet/#listmodules) | List the modules under the organization you are currently authenticated to. |
| [`CreateKey`](https://docs.viam.com/reference/apis/fleet/#createkey) | Create a new API key. |
| [`DeleteKey`](https://docs.viam.com/reference/apis/fleet/#deletekey) | Delete an API key. |
| [`RotateKey`](https://docs.viam.com/reference/apis/fleet/#rotatekey) | Rotate an API key. |
| [`ListKeys`](https://docs.viam.com/reference/apis/fleet/#listkeys) | List all keys for the organization that you are currently authenticated to. |
| [`RenameKey`](https://docs.viam.com/reference/apis/fleet/#renamekey) | RenameKey renames an API key and returns its ID and name. |
| [`CreateKeyFromExistingKeyAuthorizations`](https://docs.viam.com/reference/apis/fleet/#createkeyfromexistingkeyauthorizations) | Create a new API key with an existing key’s authorizations. |
| [`GetAppContent`](https://docs.viam.com/reference/apis/fleet/#getappcontent) | Retrieve the app content for an organization. |
| [`GetAppBranding`](https://docs.viam.com/reference/apis/fleet/#getappbranding) | Retrieves the app branding for an organization or app. |

## Establish a connection

To use the fleet management API, you need to instantiate a `ViamClient` and then instantiate a `AppClient`.

You need an API key and API key ID at least [Machine operator permissions](https://docs.viam.com/organization/rbac/#organization-settings-and-roles) to use the fleet management API.
To get an API key (and corresponding ID), use the [web UI](https://docs.viam.com/organization/api-keys/#create-an-api-key)
to the [Viam CLI](https://docs.viam.com/cli/).

- [From a client application](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-2-0)
- [From within a Module](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-2-1)

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-1-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-1-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-1-2)

```python

```

Copy

```go

```

Copy

```ts

```

Copy

See [Use platform APIs from within a module](https://docs.viam.com/build-modules/platform-apis/).

Once you have instantiated an `AppClient`, you can run the following [API methods](https://docs.viam.com/reference/apis/fleet/#api) against the `AppClient` object (named `fleet` in the examples).

To instantiate an \`AppClient\` from inside a module, you must authenticate using API keys.
You can use the module environment variables \`VIAM\_API\_KEY\` and \`VIAM\_API\_KEY\_ID\` to access credentials.

## API

### GetUserIDByEmail

Get the ID of a user by email.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-3-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-3-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-3-2)

**Parameters:**

- `email` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The email of the user.

**Returns:**

- ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The ID of the user.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_user_id_by_email).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `email` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetUserIDByEmail).

**Parameters:**

- `email` (string) (required): The email address of the user.

**Returns:**

- (Promise): The user’s ID.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getuseridbyemail).

### CreateOrganization

Create an organization.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-4-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-4-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-4-2)

**Parameters:**

- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The name of the organization.

**Returns:**

- ( [viam.proto.app.Organization](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Organization)): : The created organization.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_organization).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `name` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*Organization)](https://pkg.go.dev/go.viam.com/rdk/app#Organization)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateOrganization).

**Parameters:**

- `name` (string) (required): The name of the new organization.

**Returns:**

- (Promise<undefined \| [Organization](https://ts.viam.dev/classes/appApi.Organization.html) >): The new organization.

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createorganization).

### ListOrganizations

List the organizations the user is an authorized user of.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-5-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-5-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-5-2)

**Parameters:**

- None.

**Returns:**

- ( [List\[viam.proto.app.Organization\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Organization)): : The list of organizations.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_organizations).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.

**Returns:**

- [(\[\]\*Organization)](https://pkg.go.dev/go.viam.com/rdk/app#Organization)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListOrganizations).

**Parameters:**

- None.

**Returns:**

- (Promise< [Organization](https://ts.viam.dev/classes/appApi.Organization.html)\[\]>): The organization list.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listorganizations).

### GetOrganizationsWithAccessToLocation

Get all organizations that have access to a location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-6-0)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-6-1)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the location.

**Returns:**

- ( [List\[viam.proto.app.OrganizationIdentity\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.OrganizationIdentity)): : The list of organizations.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_organizations_with_access_to_location).

**Parameters:**

- `locationId` (string) (required): The ID of the location to query.

**Returns:**

- (Promise< [OrganizationIdentity](https://ts.viam.dev/classes/appApi.OrganizationIdentity.html)\[\]>): The list of locations with access to the requested location.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getorganizationswithaccesstolocation).

### ListOrganizationsByUser

List the organizations a user belongs to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-7-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-7-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-7-2)

**Parameters:**

- `user_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the user. You can retrieve this with the get\_user\_id\_by\_email() method.

**Returns:**

- ( [List\[viam.proto.app.OrgDetails\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.OrgDetails)): : The list of organizations.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_organizations_by_user).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `userID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\[\]\*OrgDetails)](https://pkg.go.dev/go.viam.com/rdk/app#OrgDetails)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListOrganizationsByUser).

**Parameters:**

- `userId` (string) (required): The ID of the user to query.

**Returns:**

- (Promise< [OrgDetails](https://ts.viam.dev/classes/appApi.OrgDetails.html)\[\]>): The list of locations the requested user has access to.

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listorganizationsbyuser).

### GetOrganization

Retrieve the organization object for the requested organization containing the organization’s ID, name, public namespace, and more.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-8-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-8-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-8-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to query. You can retrieve this from the organization settings page.

**Returns:**

- ( [viam.proto.app.Organization](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Organization)): : The requested organization.

**Raises:**

- (GRPCError): If the provided org\_id is invalid, or not currently authed to.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_organization).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*Organization)](https://pkg.go.dev/go.viam.com/rdk/app#Organization)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetOrganization).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization.

**Returns:**

- (Promise<undefined \| [Organization](https://ts.viam.dev/classes/appApi.Organization.html) >): Details about the organization, if it exists.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getorganization).

### GetOrganizationNamespaceAvailability

Check the availability of an organization namespace.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-9-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-9-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-9-2)

**Parameters:**

- `public_namespace` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): Organization namespace to check. Namespaces can only contain lowercase alphanumeric and dash characters.

**Returns:**

- ( [bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)): : True if the provided namespace is available.

**Raises:**

- (GRPCError): If an invalid namespace (for example, “”) is provided.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_organization_namespace_availability).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `namespace` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(bool)](https://pkg.go.dev/builtin#bool)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetOrganizationNamespaceAvailability).

**Parameters:**

- `namespace` (string) (required): The namespace to query for availability.

**Returns:**

- (Promise): A boolean indicating whether or not the namespace is available.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getorganizationnamespaceavailability).

### UpdateOrganization

Updates organization details.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-10-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-10-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-10-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to update.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): If provided, updates the org’s name.
- `public_namespace` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): If provided, sets the org’s namespace if it hasn’t already been set.
- `region` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): If provided, updates the org’s region.
- `cid` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): If provided, update’s the org’s CRM ID.
- `default_fragments` ( [List\[viam.proto.app.FragmentImport\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.FragmentImport)) (optional)

**Returns:**

- ( [viam.proto.app.Organization](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Organization)): : The updated organization.

**Raises:**

- (GRPCError): If the org’s namespace has already been set, or if the provided namespace is already taken.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_organization).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID` [(string)](https://pkg.go.dev/builtin#string)
- `opts` [(\*UpdateOrganizationOptions)](https://pkg.go.dev/go.viam.com/rdk/app#UpdateOrganizationOptions)

**Returns:**

- [(\*Organization)](https://pkg.go.dev/go.viam.com/rdk/app#Organization)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateOrganization).

**Parameters:**

- `organizationId` (string) (required): The id of the organization to update.
- `name` (string) (optional): Optional name to update the organization with.
- `publicNamespace` (string) (optional): Optional namespace to update the organization with.
- `region` (string) (optional): Optional region to update the organization with.
- `cid` (string) (optional): Optional CRM ID to update the organization with.
- `defaultFragments` ( [FragmentImportList](https://ts.viam.dev/classes/appApi.FragmentImportList.html)) (optional): Optional default fragments to set for the
organization.

**Returns:**

- (Promise<undefined \| [Organization](https://ts.viam.dev/classes/appApi.Organization.html) >): The updated organization details.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updateorganization).

### DeleteOrganization

Delete an organization.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-11-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-11-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-11-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization. You can obtain your organization ID from the organization settings page.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_organization).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteOrganization).

**Parameters:**

- `organizationId` (string) (required): The id of the organization to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deleteorganization).

### ListOrganizationMembers

List the members and invites of the organization that you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-12-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-12-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-12-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to list members of. You can obtain your organization ID from the organization settings page.

**Returns:**

- (Tuple\[List\[ [app.OrganizationMember](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.OrganizationMember)\], List\[ [app.OrganizationInvite](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.OrganizationInvite)\]\]): : A tuple containing two lists; the first
\[0\] of organization members, and the second \[1\] of organization invites.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_organization_members).

**Parameters:**

**Returns:**

- [(\[\]\*OrganizationMember)](https://pkg.go.dev/go.viam.com/rdk/app#OrganizationMember)
- [(\[\]\*OrganizationInvite)](https://pkg.go.dev/go.viam.com/rdk/app#OrganizationInvite)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListOrganizationMembers).

**Parameters:**

- `organizationId` (string) (required): The id of the organization to query.

**Returns:**

- (Promise< [ListOrganizationMembersResponse](https://ts.viam.dev/classes/appApi.ListOrganizationMembersResponse.html) >): An object containing organization members, pending invites, and
org ID.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listorganizationmembers).

### CreateOrganizationInvite

Create an organization invite and send it by email.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-13-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-13-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-13-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to create an invite for. You can obtain your organization ID from the organization settings page.
- `email` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The email address to send the invite to.
- `authorizations` ( [List\[viam.proto.app.Authorization\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Authorization)) (optional): Specifications of the authorizations to include in the invite. If not provided, full owner permissions will be granted.
- `send_email_invite` ( [bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (required): Whether or not an email should be sent to the recipient of an invite. The user must accept the email to be added to the associated authorizations. When set to false, the user automatically receives the associated authorization on the next login of the user with the associated email address.

**Returns:**

- ( [app.OrganizationInvite](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.OrganizationInvite)): : The organization invite.

**Raises:**

- (GRPCError): if an invalid email is provided, or if the user is already a member of the org.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_organization_invite).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `email` [(string)](https://pkg.go.dev/builtin#string)
- `authorizations` [(\[\]\*Authorization)](https://pkg.go.dev/go.viam.com/rdk/app#Authorization)
- `opts` [(\*CreateOrganizationInviteOptions)](https://pkg.go.dev/go.viam.com/rdk/app#CreateOrganizationInviteOptions)

**Returns:**

- [(\*OrganizationInvite)](https://pkg.go.dev/go.viam.com/rdk/app#OrganizationInvite)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateOrganizationInvite).

**Parameters:**

- `organizationId` (string) (required): The id of the organization to create the invite for.
- `email` (string) (required): The email address of the user to generate an invite for.
- `authorizations` ( [Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): The authorizations to associate with the new invite.
- `sendEmailInvite` (boolean) (optional): Bool of whether to send an email invite (true) or
automatically add a user. Defaults to true.

**Returns:**

- (Promise<undefined \| [OrganizationInvite](https://ts.viam.dev/classes/appApi.OrganizationInvite.html) >): The organization invite.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createorganizationinvite).

### UpdateOrganizationInviteAuthorizations

Update (add or remove) the authorizations attached to an organization invite that has already been created.
If an invitation has only one authorization and you want to remove it, delete the invitation instead of using this method.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-14-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-14-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-14-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization that the invite is for. You can obtain your organization ID from the organization settings page.
- `email` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): Email of the user the invite was sent to.
- `add_authorizations` ( [List\[viam.proto.app.Authorization\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Authorization)) (optional): Optional list of authorizations to add to the invite.
- `remove_authorizations` ( [List\[viam.proto.app.Authorization\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Authorization)) (optional): Optional list of authorizations to remove from the invite.

**Returns:**

- ( [app.OrganizationInvite](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.OrganizationInvite)): : The updated invite.

**Raises:**

- (GRPCError): If no authorizations are passed or if an invalid combination of authorizations is passed (for example an authorization to remove when the invite only contains one authorization).

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_organization_invite_authorizations).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `email` [(string)](https://pkg.go.dev/builtin#string)
- `addAuthorizations`
- `removeAuthorizations` [(\[\]\*Authorization)](https://pkg.go.dev/go.viam.com/rdk/app#Authorization)

**Returns:**

- [(\*OrganizationInvite)](https://pkg.go.dev/go.viam.com/rdk/app#OrganizationInvite)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateOrganizationInviteAuthorizations).

**Parameters:**

- `organizationId` (string) (required): The id of the organization.
- `email` (string) (required): The email address associated with the invite.
- `addAuthsList` ( [Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): List of authorizations to add to the invite.
- `removeAuthsList` ( [Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): List of authorizations to remove from the invite.

**Returns:**

- (Promise<undefined \| [OrganizationInvite](https://ts.viam.dev/classes/appApi.OrganizationInvite.html) >): The organization invite.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updateorganizationinviteauthorizations).

### DeleteOrganizationMember

Remove a member from the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-15-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-15-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-15-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the org to remove the user from. You can obtain your organization ID from the organization settings page.
- `user_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the user to remove.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_organization_member).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `userID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteOrganizationMember).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization.
- `userId` (string) (required): The ID of the user.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deleteorganizationmember).

### DeleteOrganizationInvite

Delete a pending organization invite to the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-16-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-16-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-16-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization that the invite to delete was for. You can obtain your organization ID from the organization settings page.
- `email` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The email address the pending invite was sent to.

**Returns:**

- None.

**Raises:**

- (GRPCError): If no pending invite is associated with the provided email address.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_organization_invite).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `email` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteOrganizationInvite).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization.
- `email` (string) (required): The email associated with the invite to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deleteorganizationinvite).

### ResendOrganizationInvite

Resend a pending organization invite email.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-17-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-17-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-17-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization that the invite to resend was for. You can obtain your organization ID from the organization settings page.
- `email` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The email address associated with the invite.

**Returns:**

- ( [app.OrganizationInvite](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.OrganizationInvite)): : The organization invite sent.

**Raises:**

- (GRPCError): If no pending invite is associated with the provided email address.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.resend_organization_invite).

**Parameters:**

**Returns:**

- [(\*OrganizationInvite)](https://pkg.go.dev/go.viam.com/rdk/app#OrganizationInvite)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ResendOrganizationInvite).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization.
- `email` (string) (required): The email associated with the invite to resend.

**Returns:**

- (Promise<undefined \| [OrganizationInvite](https://ts.viam.dev/classes/appApi.OrganizationInvite.html) >): The invite.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#resendorganizationinvite).

### GetOrganizationMetadata

Gets the user-defined metadata for an organization.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-18-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-18-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-18-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization with which the user-defined metadata is associated. You can obtain your organization ID from the organization settings page.

**Returns:**

- (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]): : The user-defined metadata converted from JSON to a Python dictionary.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_organization_metadata).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `organizationID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(map\[string\]interface{})](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetOrganizationMetadata).

**Parameters:**

- `id` (string) (required): The ID of the organization.

**Returns:**

- (Promise<Record<string, [JsonValue](https://ts.viam.dev/types/JsonValue.html)»): The metadata associated with the organization.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getorganizationmetadata).

### UpdateOrganizationMetadata

Updates the user-defined metadata for an organization.
User-defined metadata is billed as data.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-19-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-19-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-19-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required)
- `metadata` (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]) (required): The user-defined metadata to upload as a Python dictionary.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_organization_metadata).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `organizationID` [(string)](https://pkg.go.dev/builtin#string)
- `data` (interface{})

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateOrganizationMetadata).

**Parameters:**

- `id` (string) (required): The ID of the organization.
- `data` (Record) (required): The metadata to update.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updateorganizationmetadata).

### CreateLocation

Create and name a location under the organization you are currently authenticated to.
Optionally, put the new location under a specified parent location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-20-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-20-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-20-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to create the location under. You can obtain your organization ID from the organization settings page.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): Name of the location.
- `parent_location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional parent location to put the location under. Defaults to a root-level location if no location ID is provided.

**Returns:**

- ( [viam.proto.app.Location](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Location)): : The newly created location.

**Raises:**

- (GRPCError): If either an invalid name (for example, “”), or parent location ID (for example, a nonexistent ID) is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_location).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `name` [(string)](https://pkg.go.dev/builtin#string)
- `opts` [(\*CreateLocationOptions)](https://pkg.go.dev/go.viam.com/rdk/app#CreateLocationOptions)

**Returns:**

- [(\*Location)](https://pkg.go.dev/go.viam.com/rdk/app#Location)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateLocation).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to create the location
under.
- `name` (string) (required): The name of the location to create.
- `parentLocationId` (string) (optional): Optional name of a parent location to create the
new location under.

**Returns:**

- (Promise<undefined \| [Location](https://ts.viam.dev/classes/appApi.Location.html) >): The location object.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createlocation).

### GetLocation

Get a location by its location ID.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-21-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-21-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-21-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): ID of the location to get. Defaults to the location ID provided at AppClient instantiation.

**Returns:**

- ( [viam.proto.app.Location](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Location)): : The location.

**Raises:**

- (GRPCError): If an invalid location ID is passed or if one isn’t passed and there was no location ID provided at AppClient instantiation.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_location).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `locationID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*Location)](https://pkg.go.dev/go.viam.com/rdk/app#Location)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetLocation).

**Parameters:**

- `locId` (string) (required): The ID of the location to query.

**Returns:**

- (Promise<undefined \| [Location](https://ts.viam.dev/classes/appApi.Location.html) >): The location object.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getlocation).

### UpdateLocation

Change the name of a location and/or assign a parent location to a location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-22-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-22-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-22-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the location to update. Must be specified.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional new name to be updated on the location. Defaults to the empty string “” (that is, the name doesn’t change).
- `parent_location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional ID of new parent location to move the location under. Defaults to the empty string “” (that is, no new parent location is assigned).

**Returns:**

- ( [viam.proto.app.Location](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Location)): : The newly updated location.

**Raises:**

- (GRPCError): If either an invalid location ID, name, or parent location ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_location).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `locationID` [(string)](https://pkg.go.dev/builtin#string)
- `opts` [(\*UpdateLocationOptions)](https://pkg.go.dev/go.viam.com/rdk/app#UpdateLocationOptions)

**Returns:**

- [(\*Location)](https://pkg.go.dev/go.viam.com/rdk/app#Location)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateLocation).

**Parameters:**

- `locId` (string) (required): The ID of the location to update.
- `name` (string) (optional): Optional string to update the location’s name to.
- `parentLocId` (string) (optional): Optional string to update the location’s parent location
to.
- `region` (string) (optional): Optional string to update the location’s region to.

**Returns:**

- (Promise<undefined \| [Location](https://ts.viam.dev/classes/appApi.Location.html) >): The location object.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updatelocation).

### DeleteLocation

Delete a location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-23-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-23-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-23-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the location to delete. Must be specified.

**Returns:**

- None.

**Raises:**

- (GRPCError): If an invalid location ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_location).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteLocation).

**Parameters:**

- `locId` (string) (required): The ID of the location to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deletelocation).

### ListLocations

Get a list of all locations under the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-24-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-24-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-24-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the org to list locations for. You can obtain your organization ID from the organization settings page.

**Returns:**

- ( [List\[viam.proto.app.Location\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Location)): : The list of locations.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_locations).

**Parameters:**

**Returns:**

- [(\[\]\*Location)](https://pkg.go.dev/go.viam.com/rdk/app#Location)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListLocations).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to query.

**Returns:**

- (Promise< [Location](https://ts.viam.dev/classes/appApi.Location.html)\[\]>): A list of locations under the organization.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listlocations).

### ShareLocation

Share a location with an organization.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-25-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-25-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-25-2)

**Parameters:**

- `organization_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization.
- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the location.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.share_location).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `locationID`
- `orgID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ShareLocation).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to share with.
- `locId` (string) (required): The ID of the location to share.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#sharelocation).

### UnshareLocation

Stop sharing a location with an organization.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-26-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-26-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-26-2)

**Parameters:**

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.unshare_location).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UnshareLocation).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to unshare with.
- `locId` (string) (required): The ID of the location to unshare.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#unsharelocation).

### LocationAuth

Get a location’s `LocationAuth` (location secret or secrets).

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-27-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-27-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-27-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): ID of the location to retrieve LocationAuth from. Defaults to the location ID provided at AppClient instantiation.

**Returns:**

- ( [viam.proto.app.LocationAuth](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.LocationAuth)): : The LocationAuth containing location secrets.

**Raises:**

- (GRPCError): If an invalid location ID is passed or if one isn’t passed and there was no location ID provided at AppClient instantiation.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.location_auth).

**Parameters:**

**Returns:**

- [(\*LocationAuth)](https://pkg.go.dev/go.viam.com/rdk/app#LocationAuth)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.LocationAuth).

**Parameters:**

- `locId` (string) (required): The ID of the location to retrieve `LocationAuth` from.

**Returns:**

- (Promise<undefined \| [LocationAuth](https://ts.viam.dev/classes/appApi.LocationAuth.html) >): The `LocationAuth` for the requested location.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#locationauth).

### CreateLocationSecret

Create a new location secret.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-28-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-28-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-28-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): ID of the location to generate a new secret for. Defaults to the location ID provided at AppClient instantiation.

**Returns:**

- ( [viam.proto.app.LocationAuth](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.LocationAuth)): : The specified location’s LocationAuth containing the newly created secret.

**Raises:**

- (GRPCError): If an invalid location ID is passed or one isn’t passed and there was no location ID provided at AppClient instantiation.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_location_secret).

**Parameters:**

**Returns:**

- [(\*LocationAuth)](https://pkg.go.dev/go.viam.com/rdk/app#LocationAuth)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateLocationSecret).

**Parameters:**

- `locId` (string) (required): The ID of the location to create a `LocationAuth` for.

**Returns:**

- (Promise<undefined \| [LocationAuth](https://ts.viam.dev/classes/appApi.LocationAuth.html) >): The newly created `LocationAuth`.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createlocationsecret).

### DeleteLocationSecret

Delete a location secret.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-29-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-29-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-29-2)

**Parameters:**

- `secret_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the secret to delete.
- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): ID of the location to delete secret from. Defaults to the location ID provided at AppClient instantiation.

**Returns:**

- None.

**Raises:**

- (GRPCError): If either an invalid location ID or secret ID is passed or a location ID isn’t passed and there was no location ID provided at AppClient instantiation.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_location_secret).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `locationID`
- `secretID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteLocationSecret).

**Parameters:**

- `locId` (string) (required): The ID of the location to delete the `LocationAuth` from.
- `secretId` (string) (required): The ID of the location secret to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deletelocationsecret).

### GetLocationMetadata

Get the user-defined metadata for a location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-30-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-30-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-30-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the location with which the user-defined metadata is associated. You can obtain your location ID from the location’s page.

**Returns:**

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_location_metadata).

**Parameters:**

**Returns:**

- [(map\[string\]interface{})](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetLocationMetadata).

**Parameters:**

- `id` (string) (required): The ID of the location.

**Returns:**

- (Promise<Record<string, [JsonValue](https://ts.viam.dev/types/JsonValue.html)»): The metadata associated with the location.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getlocationmetadata).

### UpdateLocationMetadata

Update the user-defined metadata for a location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-31-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-31-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-31-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the location with which to associate the user-defined metadata. You can obtain your location ID from the location’s page.
- `metadata` (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]) (required): The user-defined metadata converted from JSON to a Python dictionary.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_location_metadata).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `locationID` [(string)](https://pkg.go.dev/builtin#string)
- `data` (interface{})

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateLocationMetadata).

**Parameters:**

- `id` (string) (required): The ID of the location.
- `data` (Record) (required): The metadata to update.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updatelocationmetadata).

### GetRobot

Get a machine by its ID.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-32-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-32-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-32-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine to get. You can copy this value from the URL of the machine’s page.

**Returns:**

- ( [viam.proto.app.Robot](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Robot)): : The machine.

**Raises:**

- (GRPCError): If an invalid machine ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*Robot)](https://pkg.go.dev/go.viam.com/rdk/app#Robot)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobot).

**Parameters:**

- `id` (string) (required): The ID of the robot.

**Returns:**

- (Promise<undefined \| [appApi](https://ts.viam.dev/modules/appApi.html). [Robot](https://ts.viam.dev/classes/appApi.Robot.html) >): The `Robot` object.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobot).

### GetRobotAPIKeys

Gets the [API keys](https://docs.viam.com/organization/api-keys/) for the machine.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-33-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-33-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-33-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the machine.

**Returns:**

- ( [List\[viam.proto.app.APIKeyWithAuthorizations\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.APIKeyWithAuthorizations)): : The list of API keys.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_api_keys).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `robotID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\[\]\*APIKeyWithAuthorizations)](https://pkg.go.dev/go.viam.com/rdk/app#APIKeyWithAuthorizations)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobotAPIKeys).

**Parameters:**

- `robotId` (string) (required): The ID of the robot to get API keys for.

**Returns:**

- (Promise< [APIKeyWithAuthorizations](https://ts.viam.dev/classes/appApi.APIKeyWithAuthorizations.html)\[\]>): A list of the robot’s API keys.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotapikeys).

### GetRobotParts

Get a list of all the parts under a specific machine.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-34-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-34-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-34-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine to get parts from.

**Returns:**

- ( [List\[RobotPart\]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.RobotPart)): : The list of machine parts.

**Raises:**

- (GRPCError): If an invalid machine ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_parts).

**Parameters:**

**Returns:**

- [(\[\]\*RobotPart)](https://pkg.go.dev/go.viam.com/rdk/app#RobotPart)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobotParts).

**Parameters:**

- `robotId` (string) (required): The ID of the robot to query.

**Returns:**

- (Promise< [RobotPart](https://ts.viam.dev/classes/appApi.RobotPart.html)\[\]>): The list of `RobotPart` objects associated with the robot.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotparts).

### GetRobotPart

Get a specific machine part including its part config, part address, and other information.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-35-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-35-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-35-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to get. You can retrieve this value by navigating to the machine’s page, clicking on the part status dropdown, and clicking the copy icon next to Part ID.
- `dest` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional filepath to write the machine part’s config file in JSON format to.
- `indent` ( [int](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (required): Size (in number of spaces) of indent when writing config to dest. Defaults to 4.

**Returns:**

- ( [RobotPart](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.RobotPart)): : The machine part.

**Raises:**

- (GRPCError): If an invalid machine part ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_part).

**Parameters:**

**Returns:**

- [(\*RobotPart)](https://pkg.go.dev/go.viam.com/rdk/app#RobotPart)
- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobotPart).

**Parameters:**

- `id` (string) (required): The ID of the requested robot part.

**Returns:**

- (Promise< [GetRobotPartResponse](https://ts.viam.dev/classes/appApi.GetRobotPartResponse.html) >): The robot part and a its json config.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotpart).

### GetRobotPartLogs

Get the logs associated with a specific machine part.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-36-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-36-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-36-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to get logs from.
- `filter` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Only include logs with messages that contain the string filter. Defaults to empty string “” (that is, no filter).
- `dest` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional filepath to write the log entries to.
- `log_levels` (List\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)\]) (required): List of log levels for which entries should be returned. Defaults to empty list, which returns all logs.
- `num_log_entries` ( [int](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (required): Number of log entries to return. Passing 0 returns all logs. Defaults to 100. All logs or the first num\_log\_entries logs will be returned, whichever comes first.
- `start` ( [datetime.datetime](https://docs.python.org/3/library/datetime.html)) (optional): Optional start time for log retrieval. Only logs created after this time will be returned.
- `end` ( [datetime.datetime](https://docs.python.org/3/library/datetime.html)) (optional): Optional end time for log retrieval. Only logs created before this time will be returned.

**Returns:**

- ( [List\[LogEntry\]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.LogEntry)): : The list of log entries.

**Raises:**

- (GRPCError): If an invalid robot part ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_part_logs).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id` [(string)](https://pkg.go.dev/builtin#string)
- `opts` [(\*GetRobotPartLogsOptions)](https://pkg.go.dev/go.viam.com/rdk/app#GetRobotPartLogsOptions)

**Returns:**

- [(\[\]\*LogEntry)](https://pkg.go.dev/go.viam.com/rdk/app#LogEntry)
- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobotPartLogs).

**Parameters:**

- `id` (string) (required): The ID of the requested robot part.
- `filter` (string) (optional): Optional string to filter logs on.
- `levels` (string) (optional): Optional array of log levels to return. Defaults to returning
all log levels.
- `start` (Date) (optional): Optional start time for log retrieval. Only logs created after
this time will be returned.
- `end` (Date) (optional): Optional end time for log retrieval. Only logs created before
this time will be returned.
- `pageToken` (string) (optional): Optional string indicating which page of logs to query.
Defaults to the most recent.

**Returns:**

- (Promise< [GetRobotPartLogsResponse](https://ts.viam.dev/classes/appApi.GetRobotPartLogsResponse.html) >): The robot requested logs and the page token for the next page of
logs.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotpartlogs).

### GetRobotPartByNameAndLocation

Query a specific robot part by name and location id.

- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-37-0)

**Parameters:**

- `name` (string) (required): The name of the requested robot part.
- `locationId` (string) (required): The ID of the location of the requested robot part.

**Returns:**

- (Promise< [GetRobotPartByNameAndLocationResponse](https://ts.viam.dev/classes/appApi.GetRobotPartByNameAndLocationResponse.html) >): The robot part.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotpartbynameandlocation).

### TailRobotPartLogs

Get an asynchronous iterator that receives live machine part logs.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-38-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-38-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-38-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to retrieve logs from.
- `errors_only` ( [bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (required): Boolean specifying whether or not to only include error logs. Defaults to True.
- `filter` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Only include logs with messages that contain the string filter. Defaults to empty string “” (that is, no filter).

**Returns:**

- ( [viam.app.\_logs.\_LogsStream\[List\[LogEntry\]\]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.LogEntry)): : The asynchronous iterator receiving live machine part logs.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.tail_robot_part_logs).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id` [(string)](https://pkg.go.dev/builtin#string)
- `errorsOnly` [(bool)](https://pkg.go.dev/builtin#bool)
- `opts` [(\*TailRobotPartLogsOptions)](https://pkg.go.dev/go.viam.com/rdk/app#TailRobotPartLogsOptions)

**Returns:**

- [(\*RobotPartLogStream)](https://pkg.go.dev/go.viam.com/rdk/app#RobotPartLogStream)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.TailRobotPartLogs).

**Parameters:**

- `id` (string) (required): The ID of the requested robot part.
- `queue` ( [LogEntry](https://ts.viam.dev/classes/commonApi.LogEntry.html)) (required): A queue to put the log entries into.
- `filter` (string) (optional): Optional string to filter logs on.
- `errorsOnly` (boolean) (optional): Optional bool to indicate whether or not only error-level
logs should be returned. Defaults to true.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#tailrobotpartlogs).

### GetRobotPartHistory

Get a list containing the history of a machine part.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-39-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-39-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-39-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to retrieve history from.

**Returns:**

- ( [List\[RobotPartHistoryEntry\]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.RobotPartHistoryEntry)): : The list of the machine part’s history.

**Raises:**

- (GRPCError): If an invalid machine part ID is provided.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_part_history).

**Parameters:**

**Returns:**

- [(\[\]\*RobotPartHistoryEntry)](https://pkg.go.dev/go.viam.com/rdk/app#RobotPartHistoryEntry)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobotPartHistory).

**Parameters:**

- `id` (string) (required): The ID of the requested robot part.

**Returns:**

- (Promise< [RobotPartHistoryEntry](https://ts.viam.dev/classes/appApi.RobotPartHistoryEntry.html)\[\]>): The list of the robot part’s history.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotparthistory).

### UpdateRobotPart

Change the name of and assign an optional new configuration to a machine part.
You can only change the name and configuration of the machine part, not the location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-40-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-40-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-40-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the robot part to update.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): New name to be updated on the robot part.
- `robot_config` (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]) (optional): Optional new config represented as a dictionary to be updated on the machine part. The machine part’s config will remain as is (no change) if one isn’t passed.
- `last_known_update` ( [datetime.datetime](https://docs.python.org/3/library/datetime.html)) (optional): Optional time of the last known update to this part’s config. If provided, this will result in a GRPCError if the upstream config has changed since this time, indicating that the local config is out of date. Omitting this parameter will result in an overwrite of the upstream config.
- `robot_config_json` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional raw JSON string of the robot config, preserving user-defined key order. When set, this takes precedence over robot\_config for storage purposes.

**Returns:**

- ( [RobotPart](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.RobotPart)): : The newly updated robot part.

**Raises:**

- (GRPCError): If either an invalid machine part ID, name, or config is passed, or if the upstream config has changed since last\_known\_update.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_robot_part).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id`
- `name` [(string)](https://pkg.go.dev/builtin#string)
- `robotConfig` (interface{})

**Returns:**

- [(\*RobotPart)](https://pkg.go.dev/go.viam.com/rdk/app#RobotPart)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateRobotPart).

**Parameters:**

- `id` (string) (required): The ID of the requested robot part.
- `name` (string) (required): The new name of the robot part.
- `robotConfig` ( [Struct](https://ts.viam.dev/classes/Struct.html)) (required): The new config for the robot part.

**Returns:**

- (Promise<undefined \| [RobotPart](https://ts.viam.dev/classes/appApi.RobotPart.html) >): The updated robot part.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updaterobotpart).

### NewRobotPart

Create a new machine part.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-41-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-41-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-41-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine to create a new part for. See [Find machine ID](https://docs.viam.com/reference/apis/fleet/#find-machine-id) for instructions on retrieving this value.
- `part_name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): Name of the new part.

**Returns:**

- ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The new machine part’s ID.

**Raises:**

- (GRPCError): If either an invalid machine ID or name is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.new_robot_part).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `robotID`
- `partName` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.NewRobotPart).

**Parameters:**

- `robotId` (string) (required): The ID of the robot to create a part for.
- `partName` (string) (required): The name for the new robot part.

**Returns:**

- (Promise): The ID of the newly-created robot part.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#newrobotpart).

### DeleteRobotPart

Delete the specified machine part.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-42-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-42-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-42-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to delete. See [Find part ID](https://docs.viam.com/reference/apis/fleet/#find-part-id) for instructions on retrieving this value.

**Returns:**

- None.

**Raises:**

- (GRPCError): If an invalid machine part ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_robot_part).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `partID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteRobotPart).

**Parameters:**

- `partId` (string) (required): The ID of the part to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deleterobotpart).

### MarkPartAsMain

Mark a machine part as the [_main_ part](https://docs.viam.com/hardware/multi-machine/overview/#machine-parts) of a machine.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-43-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-43-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-43-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to mark as main.

**Returns:**

- None.

**Raises:**

- (GRPCError): If an invalid machine part ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.mark_part_as_main).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.MarkPartAsMain).

**Parameters:**

- `partId` (string) (required): The ID of the part to mark as main.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#markpartasmain).

### MarkPartForRestart

Mark a specified machine part for restart.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-44-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-44-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-44-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to mark for restart.

**Returns:**

- None.

**Raises:**

- (GRPCError): If an invalid machine part ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.mark_part_for_restart).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.MarkPartForRestart).

**Parameters:**

- `partId` (string) (required): The ID of the part to mark for restart.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#markpartforrestart).

### CreateRobotPartSecret

Create a machine part secret.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-45-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-45-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-45-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to create a secret for.

**Returns:**

- ( [RobotPart](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.RobotPart)): : The machine part the new secret was generated for.

**Raises:**

- (GRPCError): If an invalid machine part ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_robot_part_secret).

**Parameters:**

**Returns:**

- [(\*RobotPart)](https://pkg.go.dev/go.viam.com/rdk/app#RobotPart)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateRobotPartSecret).

**Parameters:**

- `partId` (string) (required): The ID of the part to create a secret for.

**Returns:**

- (Promise<undefined \| [RobotPart](https://ts.viam.dev/classes/appApi.RobotPart.html) >): The robot part object.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createrobotpartsecret).

### DeleteRobotPartSecret

Delete a machine part secret.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-46-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-46-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-46-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine part to delete the secret from.
- `secret_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the secret to delete.

**Returns:**

- None.

**Raises:**

- (GRPCError): If an invalid machine part ID or secret ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_robot_part_secret).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `partID`
- `secretID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteRobotPartSecret).

**Parameters:**

- `partId` (string) (required): The ID of the part to delete a secret from.
- `secretId` (string) (required): The ID of the secret to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deleterobotpartsecret).

### ListRobots

Get a list of all machines in a specified location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-47-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-47-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-47-2)

**Parameters:**

- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): ID of the location to retrieve the machines from. Defaults to the location ID provided at AppClient instantiation.

**Returns:**

- ( [List\[viam.proto.app.Robot\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Robot)): : The list of robots.

**Raises:**

- (GRPCError): If an invalid location ID is passed or one isn’t passed and there was no location ID provided at AppClient instantiation.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_robots).

**Parameters:**

**Returns:**

- [(\[\]\*Robot)](https://pkg.go.dev/go.viam.com/rdk/app#Robot)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListRobots).

**Parameters:**

- `locId` (string) (required): The ID of the location to list robots for.

**Returns:**

- (Promise< [appApi](https://ts.viam.dev/modules/appApi.html). [Robot](https://ts.viam.dev/classes/appApi.Robot.html)\[\]>): The list of robot objects.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listrobots).

### NewRobot

Create a new machine.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-48-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-48-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-48-2)

**Parameters:**

- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): Name of the new machine.
- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): ID of the location under which to create the machine. Defaults to the current authorized location.

**Returns:**

- ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The new robot’s ID.

**Raises:**

- (GRPCError): If an invalid location ID is passed or one isn’t passed and there was no location ID provided at AppClient instantiation.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.new_robot).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `name`
- `location` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.NewRobot).

**Parameters:**

- `locId` (string) (required): The ID of the location to create the robot in.
- `name` (string) (required): The name of the new robot.

**Returns:**

- (Promise): The new robot’s ID.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#newrobot).

### UpdateRobot

Update an existing machine’s name and/or location.

You can change:

- The machine’s name (within the same location)
- The machine’s location (within the same organization)
- Both name and location simultaneously

**Requirements for location changes:**

- You must be an organization owner, or have owner permissions for both the current and destination locations
- The destination location must be within the same organization
- No other machine in the destination location can have the same name

#### Important

Moving a machine has several important implications:

- **Machine address changes**: The machine’s network address will change to `<machine-main-part-name>.<new-location-id>.viam.cloud`. You’ll need to update any code that references the old address.
- **Permission changes**: Access permissions will be updated. Users with access to the current location lose access, and users with access to the new location gain access to the machine.
- **Data access**: Users in the new location cannot access historical data from when the machine was in the previous location.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-49-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-49-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-49-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine to update. See [Find machine ID](https://docs.viam.com/reference/apis/fleet/#find-machine-id) for instructions on retrieving this value.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): New name to be updated on the machine.
- `location_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): ID of the location under which the machine exists. Defaults to the location ID provided at AppClient instantiation.

**Returns:**

- ( [viam.proto.app.Robot](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Robot)): : The newly updated machine.

**Raises:**

- (GRPCError): If either an invalid machine ID, name, or location ID is passed or a location ID isn’t passed and there was no location ID provided at AppClient instantiation.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_robot).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id`
- `name`
- `location` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*Robot)](https://pkg.go.dev/go.viam.com/rdk/app#Robot)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateRobot).

**Parameters:**

- `robotId` (string) (required): The ID of the robot to update.
- `locId` (string) (required): The ID of the location where the robot is.
- `name` (string) (required): The name to update the robot to.

**Returns:**

- (Promise<undefined \| [appApi](https://ts.viam.dev/modules/appApi.html). [Robot](https://ts.viam.dev/classes/appApi.Robot.html) >): The newly-modified robot object.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updaterobot).

### DeleteRobot

Delete a specified machine.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-50-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-50-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-50-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the machine to delete. See [Find machine ID](https://docs.viam.com/reference/apis/fleet/#find-machine-id) for instructions on retrieving this value.

**Returns:**

- None.

**Raises:**

- (GRPCError): If an invalid machine ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_robot).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteRobot).

**Parameters:**

- `id` (string) (required): The ID of the robot to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deleterobot).

### GetRobotMetadata

Gets the user-defined metadata for a machine.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-51-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-51-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-51-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the robot with which the user-defined metadata is associated. You can obtain your robot ID from the machine page.

**Returns:**

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_metadata).

**Parameters:**

**Returns:**

- [(map\[string\]interface{})](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobotMetadata).

**Parameters:**

- `id` (string) (required): The ID of the robot.

**Returns:**

- (Promise<Record<string, [JsonValue](https://ts.viam.dev/types/JsonValue.html)»): The metadata associated with the robot.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotmetadata).

### GetRobotPartMetadata

Gets the user-defined metadata for a machine part.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-52-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-52-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-52-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the robot part with which the user-defined metadata is associated. You can obtain your robot part ID from the machine page.

**Returns:**

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_part_metadata).

**Parameters:**

**Returns:**

- [(map\[string\]interface{})](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRobotPartMetadata).

**Parameters:**

- `id` (string) (required): The ID of the robot part.

**Returns:**

- (Promise<Record<string, [JsonValue](https://ts.viam.dev/types/JsonValue.html)»): The metadata associated with the robot part.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getrobotpartmetadata).

### UpdateRobotMetadata

Updates the user-defined metadata for a machine.
User-defined metadata is billed as data.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-53-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-53-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-53-2)

**Parameters:**

- `robot_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the robot with which to associate the user-defined metadata. You can obtain your robot ID from the machine page.
- `metadata` (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]) (required): The user-defined metadata converted from JSON to a Python dictionary.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_robot_metadata).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `robotID` [(string)](https://pkg.go.dev/builtin#string)
- `data` (interface{})

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateRobotMetadata).

**Parameters:**

- `id` (string) (required): The ID of the robot.
- `data` (Record) (required): The metadata to update.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updaterobotmetadata).

### UpdateRobotPartMetadata

Updates the user-defined metadata for a machine part.
User-defined metadata is billed as data.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-54-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-54-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-54-2)

**Parameters:**

- `robot_part_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required)
- `metadata` (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]) (required): The user-defined metadata converted from JSON to a Python dictionary.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_robot_part_metadata).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateRobotPartMetadata).

**Parameters:**

- `id` (string) (required): The ID of the robot part.
- `data` (Record) (required): The metadata to update.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updaterobotpartmetadata).

### ListFragments

Get a list of fragments in the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-55-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-55-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-55-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to list fragments for. You can obtain your organization ID from the organization settings page.
- `show_public` ( [bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (required): Optional boolean specifying whether or not to only show public fragments. If True, only public fragments will return. If False, only private fragments will return. Defaults to True. Deprecated since version 0.25.0: Use visibilities instead.
- `visibilities` ( [List\[Fragment\]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.Fragment.Visibility)) (optional): List of FragmentVisibilities specifying which types of fragments to include in the results. If empty, by default only public fragments will be returned.

**Returns:**

- ( [List\[Fragment\]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.Fragment)): : The list of fragments.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_fragments).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID` [(string)](https://pkg.go.dev/builtin#string)
- `showPublic` [(bool)](https://pkg.go.dev/builtin#bool)
- `fragmentVisibility` [(\[\]FragmentVisibility)](https://pkg.go.dev/go.viam.com/rdk/app#FragmentVisibility)

**Returns:**

- [(\[\]\*Fragment)](https://pkg.go.dev/go.viam.com/rdk/app#Fragment)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListFragments).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to list fragments for.
- `publicOnly` (boolean) (optional): Optional, deprecated boolean. Use fragmentVisibilities
instead. If true then only public fragments will be listed. Defaults to
true.
- `fragmentVisibility` ( [FragmentVisibility](https://ts.viam.dev/enums/appApi.FragmentVisibility.html)) (optional)

**Returns:**

- (Promise< [Fragment](https://ts.viam.dev/classes/appApi.Fragment.html)\[\]>): The list of fragment objects.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listfragments).

### ListMachineFragments

Get a list of top level and nested fragments for a machine, as well as additionally specified fragment IDs.

- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-56-0)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-56-1)

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `machineID` [(string)](https://pkg.go.dev/builtin#string)
- `additionalIDs` [(\[\]string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\[\]\*Fragment)](https://pkg.go.dev/go.viam.com/rdk/app#Fragment)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListMachineFragments).

**Parameters:**

- `machineId` (string) (required): The machine ID used to filter fragments defined in a
machine’s parts. Also returns any fragments nested within the fragments
defined in parts.
- `additionalFragmentIds` (string) (optional): Additional fragment IDs to append to the
response. Useful when needing to view fragments that will be
provisionally added to the machine alongside existing fragments.

**Returns:**

- (Promise< [Fragment](https://ts.viam.dev/classes/appApi.Fragment.html)\[\]>): The list of top level and nested fragments for a machine, as well
as additionally specified fragment IDs.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listmachinefragments).

### ListMachineSummaries

Lists machine summaries for an organization, optionally filtered by fragment IDs, location IDs, and limit.

- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-57-0)

**Parameters:**

- `organizationId` (string) (required): The ID of the organization.
- `fragmentIds` (string) (optional): Optional list of fragment IDs to filter machines.
- `locationIds` (string) (optional): Optional list of location IDs to filter machines.
- `limit` (number) (optional): Optional max number of machines to return.

**Returns:**

- (Promise< [LocationSummary](https://ts.viam.dev/classes/appApi.LocationSummary.html)\[\]>): The list of location summaries.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listmachinesummaries).

### GetFragment

Get a fragment by ID.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-58-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-58-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-58-2)

**Parameters:**

- `fragment_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the fragment to get.
- `version` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional specification of the fragment version to get (revision or tag).

**Returns:**

- ( [Fragment](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.Fragment)): : The fragment.

**Raises:**

- (GRPCError): If an invalid fragment ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_fragment).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id`
- `version` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*Fragment)](https://pkg.go.dev/go.viam.com/rdk/app#Fragment)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetFragment).

**Parameters:**

- `id` (string) (required): The ID of the fragment to look up.

**Returns:**

- (Promise<undefined \| [Fragment](https://ts.viam.dev/classes/appApi.Fragment.html) >): The requested fragment.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getfragment).

### CreateFragment

Create a new private fragment.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-59-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-59-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-59-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to create the fragment within. You can obtain your organization ID from the organization settings page.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): Name of the fragment.
- `config` (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]) (optional): Optional Dictionary representation of new config to assign to specified fragment. Can be assigned by updating the fragment.

**Returns:**

- ( [Fragment](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.Fragment)): : The newly created fragment.

**Raises:**

- (GRPCError): If an invalid name is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_fragment).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `name` [(string)](https://pkg.go.dev/builtin#string)
- `config` [(map\[string\]interface{})](https://pkg.go.dev/builtin#string)
- `opts` [(\*CreateFragmentOptions)](https://pkg.go.dev/go.viam.com/rdk/app#CreateFragmentOptions)

**Returns:**

- [(\*Fragment)](https://pkg.go.dev/go.viam.com/rdk/app#Fragment)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateFragment).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to create the fragment
under.
- `name` (string) (required): The name of the new fragment.
- `config` ( [Struct](https://ts.viam.dev/classes/Struct.html)) (required): The new fragment’s config.

**Returns:**

- (Promise<undefined \| [Fragment](https://ts.viam.dev/classes/appApi.Fragment.html) >): The newly created fragment.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createfragment).

### UpdateFragment

Update a fragment name and its config and/or visibility.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-60-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-60-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-60-2)

**Parameters:**

- `fragment_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the fragment to update.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): New name to associate with the fragment.
- `config` (Mapping\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any\]) (optional): Optional Dictionary representation of new config to assign to specified fragment. Not passing this parameter will leave the fragment’s config unchanged.
- `public` ( [bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (optional): Boolean specifying whether the fragment is public. Not passing this parameter will leave the fragment’s visibility unchanged. A fragment is private by default when created. Deprecated since version 0.25.0: Use visibility instead.
- `visibility` ( [Fragment](https://python.viam.dev/autoapi/viam/gen/app/v1/app_pb2/index.html#viam.gen.app.v1.app_pb2.FragmentVisibility)) (optional): Optional FragmentVisibility list specifying who should be allowed to view the fragment. Not passing this parameter will leave the fragment’s visibility unchanged. A fragment is private by default when created.
- `last_known_update` ( [datetime.datetime](https://docs.python.org/3/library/datetime.html)) (optional): Optional time of the last known update to this fragment’s config. If provided, this will result in a GRPCError if the upstream config has changed since this time, indicating that the local config is out of date. Omitting this parameter will result in an overwrite of the upstream config.

**Returns:**

- ( [Fragment](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.Fragment)): : The newly updated fragment.

**Raises:**

- (GRPCError): if an invalid ID, name, or config is passed, or if the upstream fragment config has changed since last\_known\_update.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_fragment).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id`
- `name` [(string)](https://pkg.go.dev/builtin#string)
- `config` [(map\[string\]interface{})](https://pkg.go.dev/builtin#string)
- `opts` [(\*UpdateFragmentOptions)](https://pkg.go.dev/go.viam.com/rdk/app#UpdateFragmentOptions)

**Returns:**

- [(\*Fragment)](https://pkg.go.dev/go.viam.com/rdk/app#Fragment)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateFragment).

**Parameters:**

- `id` (string) (required): The ID of the fragment to update.
- `name` (string) (required): The name to update the fragment to.
- `config` ( [Struct](https://ts.viam.dev/classes/Struct.html)) (required): The config to update the fragment to.
- `makePublic` (boolean) (optional): Optional, deprecated boolean specifying whether the
fragment should be public or not. If not passed, the visibility will be
unchanged. Fragments are private by default when created.
- `visibility` ( [FragmentVisibility](https://ts.viam.dev/enums/appApi.FragmentVisibility.html)) (optional): Optional FragmentVisibility specifying the updated
fragment visibility. If not passed, the visibility will be unchanged. If
visibility is not set and makePublic is set, makePublic takes effect. If
makePublic and visibility are set, they must not be conflicting. If
neither is set, the fragment visibility will remain unchanged.

**Returns:**

- (Promise<undefined \| [Fragment](https://ts.viam.dev/classes/appApi.Fragment.html) >): The updated fragment.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updatefragment).

### DeleteFragment

Delete a fragment.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-61-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-61-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-61-2)

**Parameters:**

- `fragment_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the fragment to delete.

**Returns:**

- None.

**Raises:**

- (GRPCError): If an invalid fragment ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_fragment).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteFragment).

**Parameters:**

- `id` (string) (required): The ID of the fragment to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deletefragment).

### GetFragmentHistory

Get fragment history.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-62-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-62-1)

**Parameters:**

- `id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the fragment to fetch history for.
- `page_token` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str) \| None) (optional): the page token for the fragment history collection.
- `page_limit` ( [int](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): the number of fragment history documents to return in the result. The default page limit is 10.

**Returns:**

- ( [List\[FragmentHistoryEntry\]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.FragmentHistoryEntry)): : A list of documents with the fragment history.

**Raises:**

- (GRPCError): if an invalid fragment id, page token or page limit is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_fragment_history).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id` [(string)](https://pkg.go.dev/builtin#string)
- `opts` [(\*GetFragmentHistoryOptions)](https://pkg.go.dev/go.viam.com/rdk/app#GetFragmentHistoryOptions)

**Returns:**

- [(\[\]\*FragmentHistoryEntry)](https://pkg.go.dev/go.viam.com/rdk/app#FragmentHistoryEntry)
- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetFragmentHistory).

### AddRole

Add a role under the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-63-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-63-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-63-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to create the role in. You can obtain your organization ID from the organization settings page.
- `identity_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the entity the role belongs to (for example, a user ID).
- `role` (Literal\[‘owner’\] \| Literal\[‘operator’\]) (required): The role to add (either `"owner"` or `"operator"`).
- `resource_type` (Literal\[‘organization’\] \| Literal\[’location’\] \| Literal\[‘robot’\]) (required): The type of the resource to add the role to (either `"organization"`, `"location"`, or `"robot"`). Must match the type of the `resource_id`’s resource.
- `resource_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the resource the role applies to (the ID of either an organization, location, or machine.).

**Returns:**

- None.

**Raises:**

- (GRPCError): If either an invalid identity ID, role ID, resource type, or resource ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.add_role).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `identityID` [(string)](https://pkg.go.dev/builtin#string)
- `role` [(AuthRole)](https://pkg.go.dev/go.viam.com/rdk/app#AuthRole)
- `resourceType` [(AuthResourceType)](https://pkg.go.dev/go.viam.com/rdk/app#AuthResourceType)
- `resourceID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.AddRole).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to create the role under.
- `entityId` (string) (required): The ID of the entity the role belongs to (for example a
user ID).
- `role` (string) (required): The role to add (“owner” or “operator”).
- `resourceType` (string) (required): The type of resource to create the role for (“robot”,
“location”, or “organization”).
- `resourceId` (string) (required): The ID of the resource the role is being created for.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#addrole).

### RemoveRole

Remove a role under the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-64-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-64-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-64-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization the role exists in. You can obtain your organization ID from the organization settings page.
- `identity_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the entity the role belongs to (for example, a user ID).
- `role` (Literal\[‘owner’\] \| Literal\[‘operator’\]) (required): The role to remove.
- `resource_type` (Literal\[‘organization’\] \| Literal\[’location’\] \| Literal\[‘robot’\]) (required): Type of the resource the role is being removed from. Must match resource\_id.
- `resource_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the resource the role applies to (that is, either an organization, location, or robot ID).

**Returns:**

- None.

**Raises:**

- (GRPCError): If either an invalid identity ID, role ID, resource type, or resource ID or is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.remove_role).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `authorization` [(\*Authorization)](https://pkg.go.dev/go.viam.com/rdk/app#Authorization)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.RemoveRole).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to remove the role from.
- `entityId` (string) (required): The ID of the entity the role belongs to (for example a
user ID).
- `role` (string) (required): The role to remove (“owner” or “operator”).
- `resourceType` (string) (required): The type of resource to remove the role from (“robot”,
“location”, or “organization”).
- `resourceId` (string) (required): The ID of the resource the role is being removes from.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#removerole).

### ChangeRole

Changes an existing role to a new role.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-65-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-65-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-65-2)

**Parameters:**

- `organization_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the organization.
- `old_identity_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the entity the role belongs to (for example, a user ID).
- `old_role` (Literal\[‘owner’\] \| Literal\[‘operator’\]) (required): The role to be changed.
- `old_resource_type` (Literal\[‘organization’\] \| Literal\[’location’\] \| Literal\[‘robot’\]) (required): Type of the resource the role is added to. Must match old\_resource\_id.
- `old_resource_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the resource the role applies to (that is, either an organization, location, or robot ID).
- `new_identity_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): New ID of the entity the role belongs to (for example, a user ID).
- `new_role` (Literal\[‘owner’\] \| Literal\[‘operator’\]) (required): The new role.
- `new_resource_type` (Literal\[‘organization’\] \| Literal\[’location’\] \| Literal\[‘robot’\]) (required): Type of the resource to add role to. Must match new\_resource\_id.
- `new_resource_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): New ID of the resource the role applies to (that is, either an organization, location, or robot ID).

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.change_role).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `oldAuthorization` [(\*Authorization)](https://pkg.go.dev/go.viam.com/rdk/app#Authorization)
- `newOrgID`
- `newIdentityID` [(string)](https://pkg.go.dev/builtin#string)
- `newRole` [(AuthRole)](https://pkg.go.dev/go.viam.com/rdk/app#AuthRole)
- `newResourceType` [(AuthResourceType)](https://pkg.go.dev/go.viam.com/rdk/app#AuthResourceType)
- `newResourceID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ChangeRole).

**Parameters:**

- `oldAuthorization` ( [Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): The existing authorization.
- `newAuthorization` ( [Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): The new authorization to change to.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#changerole).

### ListAuthorizations

List all authorizations (owners and operators) of a specific resource (or resources) within the organization you are currently authenticated to.
If no resource IDs are provided, all resource authorizations within the organizations are returned.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-66-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-66-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-66-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to list authorizations for.
- `resource_ids` (List\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)\]) (optional): IDs of the resources to retrieve authorizations from. If None, defaults to all resources.

**Returns:**

- ( [List\[viam.proto.app.Authorization\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Authorization)): : The list of authorizations.

**Raises:**

- (GRPCError): If an invalid resource ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_authorizations).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID` [(string)](https://pkg.go.dev/builtin#string)
- `resourceIDs` [(\[\]string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\[\]\*Authorization)](https://pkg.go.dev/go.viam.com/rdk/app#Authorization)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListAuthorizations).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to list authorizations for.
- `resourceIds` (string) (optional): Optional list of IDs of resources to list authorizations
for. If not provided, all resources will be included.

**Returns:**

- (Promise< [Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)\[\]>): The list of authorizations.

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listauthorizations).

### CheckPermissions

Check if the organization, location, or robot your `ViamClient` is authenticated to is permitted to perform some action or set of actions on the resource you pass to the method.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-67-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-67-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-67-2)

**Parameters:**

- `permissions` ( [List\[viam.proto.app.AuthorizedPermissions\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.AuthorizedPermissions)) (required): the permissions to validate (for example, “read\_organization”, “control\_robot”).

**Returns:**

- ( [List\[viam.proto.app.AuthorizedPermissions\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.AuthorizedPermissions)): : The permissions argument, with invalid permissions filtered out.

**Raises:**

- (GRPCError): If the list of permissions to validate is empty.

**Example:**

```python

```

Copy

Valid arguments for permissions are as follows:

##### Click to see permissions strings available

```python
"read_organization"
"write_organization"
"read_fragment"
"write_fragment"
"read_location"
"write_location"
"read_location_secret"
"read_robot_secret"
"read_robot"
"read_robot_config"
"read_robot_logs"
"write_robot"
"control_robot"
"read_organization_data_management"
"read_location_data_management"
"read_robot_data_management"
"write_organization_data_management"
"write_location_data_management"
"write_robot_data_management"
"read_robot_history"
"read_mapping_sessions"
"create_maps"
"write_private_registry_item"
"write_public_registry_item"
"read_private_registry_item"
"train_models"
"read_packages"
"write_packages"
"delete_packages"
"configure_database_user"
"get_database_connection"
"create_dataset"
"list_dataset"
"rename_dataset"
"delete_dataset"
```

Copy

For more information about managing permissions, see [Role-Based Access Control](https://docs.viam.com/organization/rbac/).

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.check_permissions).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `permissions` [(\[\]\*AuthorizedPermissions)](https://pkg.go.dev/go.viam.com/rdk/app#AuthorizedPermissions)

**Returns:**

- [(\[\]\*AuthorizedPermissions)](https://pkg.go.dev/go.viam.com/rdk/app#AuthorizedPermissions)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CheckPermissions).

**Parameters:**

- `permissions` ( [AuthorizedPermissions](https://ts.viam.dev/classes/appApi.AuthorizedPermissions.html)) (required): A list of permissions to check.

**Returns:**

- (Promise< [AuthorizedPermissions](https://ts.viam.dev/classes/appApi.AuthorizedPermissions.html)\[\]>): A filtered list of the authorized permissions.

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#checkpermissions).

### GetRegistryItem

Get metadata about a registry item (a module, training script, or ML model) by registry item ID.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-68-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-68-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-68-2)

**Parameters:**

- `item_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the registry item. This is the namespace and name of the item in the form namespace:name. For example, Viam’s csi-cam-pi module’s item ID would be viam:csi-cam-pi. You can also use org-id:name. For example, abc01234-0123-4567-ab12-a11a00a2aa22:training-script.
- `include_markdown_documentation` ( [bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (required)

**Returns:**

- ( [viam.proto.app.RegistryItem](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.RegistryItem)): : The registry item.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_registry_item).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `itemID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*RegistryItem)](https://pkg.go.dev/go.viam.com/rdk/app#RegistryItem)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetRegistryItem).

**Parameters:**

- `itemId` (string) (required): The ID of the item to get.

**Returns:**

- (Promise<undefined \| [RegistryItem](https://ts.viam.dev/classes/appApi.RegistryItem.html) >): The requested item.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getregistryitem).

### CreateRegistryItem

Create a registry item.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-69-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-69-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-69-2)

**Parameters:**

- `organization_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The organization to create the registry item under.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The name of the registry item, which must be unique within your org.
- `type` (viam.proto.app.packages.PackageType.ValueType) (required): The type of the item in the registry.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_registry_item).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `name` [(string)](https://pkg.go.dev/builtin#string)
- `packageType` [(PackageType)](https://pkg.go.dev/go.viam.com/rdk/app#PackageType)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateRegistryItem).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to create the registry
item under.
- `name` (string) (required): The name of the registry item.
- `type` (PackageType) (required): The type of the item in the registry.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createregistryitem).

### UpdateRegistryItem

Update a registry item.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-70-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-70-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-70-2)

**Parameters:**

- `item_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the registry item, containing either the namespace and module name (for example, my-org:my-module) or organization ID and module name (org-id:my-module).
- `type` (viam.proto.app.packages.PackageType.ValueType) (required): The type of the item in the registry.
- `description` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The description of the registry item.
- `visibility` (viam.proto.app.Visibility.ValueType) (required): The visibility of the registry item.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_registry_item).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `itemID` [(string)](https://pkg.go.dev/builtin#string)
- `packageType` [(PackageType)](https://pkg.go.dev/go.viam.com/rdk/app#PackageType)
- `description` [(string)](https://pkg.go.dev/builtin#string)
- `visibility` [(Visibility)](https://pkg.go.dev/go.viam.com/rdk/app#Visibility)
- `opts` [(\*UpdateRegistryItemOptions)](https://pkg.go.dev/go.viam.com/rdk/app#UpdateRegistryItemOptions)

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateRegistryItem).

**Parameters:**

- `itemId` (string) (required): The ID of the registry item to update.
- `type` (PackageType) (required): The PackageType to update the item to.
- `description` (string) (required): A description of the item.
- `visibility` ( [Visibility](https://ts.viam.dev/enums/appApi.Visibility.html)) (required): A visibility value to update to.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updateregistryitem).

### ListRegistryItems

List the registry items in an organization.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-71-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-71-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-71-2)

**Parameters:**

- `organization_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to return registry items for.
- `types` (List\[viam.proto.app.packages.PackageType.ValueType\]) (required): The types of registry items.
- `visibilities` (List\[viam.proto.app.Visibility.ValueType\]) (required): The visibilities of registry items.
- `platforms` (List\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)\]) (required): The platforms of registry items.
- `statuses` (List\[viam.proto.app.RegistryItemStatus.ValueType\]) (required): The types of the items in the registry.
- `search_term` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): The search term of the registry items.
- `page_token` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): The page token of the registry items.

**Returns:**

- ( [List\[viam.proto.app.RegistryItem\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.RegistryItem)): : The list of registry items.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_registry_items).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID` [(\*string)](https://pkg.go.dev/builtin#string)
- `types` [(\[\]PackageType)](https://pkg.go.dev/go.viam.com/rdk/app#PackageType)
- `visibilities` [(\[\]Visibility)](https://pkg.go.dev/go.viam.com/rdk/app#Visibility)
- `platforms` [(\[\]string)](https://pkg.go.dev/builtin#string)
- `statuses` [(\[\]RegistryItemStatus)](https://pkg.go.dev/go.viam.com/rdk/app#RegistryItemStatus)
- `opts` [(\*ListRegistryItemsOptions)](https://pkg.go.dev/go.viam.com/rdk/app#ListRegistryItemsOptions)

**Returns:**

- [(\[\]\*RegistryItem)](https://pkg.go.dev/go.viam.com/rdk/app#RegistryItem)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListRegistryItems).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to query registry items
for.
- `types` (PackageType) (required): A list of types to query. If empty, will not filter on type.
- `visibilities` ( [Visibility](https://ts.viam.dev/enums/appApi.Visibility.html)) (required): A list of visibilities to query for. If empty, will not
filter on visibility.
- `platforms` (string) (required): A list of platforms to query for. If empty, will not
filter on platform.
- `statuses` ( [RegistryItemStatus](https://ts.viam.dev/enums/appApi.RegistryItemStatus.html)) (required): A list of statuses to query for. If empty, will not filter
on status.
- `searchTerm` (string) (optional): Optional search term to filter on.
- `pageToken` (string) (optional): Optional page token for results. If not provided, will
return all results.

**Returns:**

- (Promise< [RegistryItem](https://ts.viam.dev/classes/appApi.RegistryItem.html)\[\]>): The list of registry items.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listregistryitems).

### DeleteRegistryItem

Delete a registry item.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-72-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-72-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-72-2)

**Parameters:**

- `item_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the deleted registry item, containing either the namespace and module name (for example, my-org:my-module) or organization ID and module name (org-id:my-module).

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_registry_item).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteRegistryItem).

**Parameters:**

- `itemId` (string) (required): The ID of the item to delete.

**Returns:**

- (Promise)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deleteregistryitem).

### CreateModule

Create a module under the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-73-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-73-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-73-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to create the module under. You can obtain your organization ID from the organization settings page.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The name of the module. Must be unique within your organization.

**Returns:**

- (Tuple\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)\]): : A tuple containing the ID \[0\] of the new module and its URL \[1\].

**Raises:**

- (GRPCError): If an invalid name (for example, “”) is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_module).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID`
- `name` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(string)](https://pkg.go.dev/builtin#string)
- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateModule).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to create the module under.
- `name` (string) (required): The name of the module.

**Returns:**

- (Promise< [CreateModuleResponse](https://ts.viam.dev/classes/appApi.CreateModuleResponse.html) >): The module ID and a URL to its detail page.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createmodule).

### UpdateModule

Update the documentation URL, description, models, entrypoint, and/or the visibility of a module.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-74-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-74-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-74-2)

**Parameters:**

- `module_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the module being updated, containing either the namespace and module name (for example, my-org:my-module) or organization ID and module name (org-id:my-module).
- `url` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The url to reference for documentation and code (NOT the url of the module itself).
- `description` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): A short description of the module that explains its purpose.
- `models` ( [List\[viam.proto.app.Model\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Model)) (optional): list of models that are available in the module.
- `entrypoint` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The executable to run to start the module program.
- `public` ( [bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (required): The visibility that should be set for the module. Defaults to False (private).

**Returns:**

- ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The URL of the newly updated module.

**Raises:**

- (GRPCError): If either an invalid module ID, URL, list of models, or organization ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.update_module).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `moduleID` [(string)](https://pkg.go.dev/builtin#string)
- `visibility` [(Visibility)](https://pkg.go.dev/go.viam.com/rdk/app#Visibility)
- `url`
- `description` [(string)](https://pkg.go.dev/builtin#string)
- `models` [(\[\]\*Model)](https://pkg.go.dev/go.viam.com/rdk/app#Model)
- `apps` [(\[\]\*App)](https://pkg.go.dev/go.viam.com/rdk/app#App)
- `entrypoint` [(string)](https://pkg.go.dev/builtin#string)
- `opts` [(\*UpdateModuleOptions)](https://pkg.go.dev/go.viam.com/rdk/app#UpdateModuleOptions)

**Returns:**

- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UpdateModule).

**Parameters:**

- `moduleId` (string) (required): The ID of the module to update.
- `visibility` ( [Visibility](https://ts.viam.dev/enums/appApi.Visibility.html)) (required): The visibility to set for the module.
- `url` (string) (required): The url to reference for documentation, code, etc.
- `description` (string) (required): A short description of the module.
- `models` ( [Model](https://ts.viam.dev/classes/appApi.Model.html)) (required): A list of models available in the module.
- `entrypoint` (string) (required): The executable to run to start the module program.

**Returns:**

- (Promise): The module URL.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#updatemodule).

### UploadModuleFile

Upload a module file.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-75-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-75-1)

**Parameters:**

- `module_file_info` ( [viam.proto.app.ModuleFileInfo](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.ModuleFileInfo)) (required): Relevant metadata.
- `file` ( [bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects)) (required): Bytes of file to upload.

**Returns:**

- ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : URL of uploaded file.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.upload_module_file).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `fileInfo` [(ModuleFileInfo)](https://pkg.go.dev/go.viam.com/rdk/app#ModuleFileInfo)
- `file` [(\[\]byte)](https://pkg.go.dev/builtin#byte)

**Returns:**

- [(string)](https://pkg.go.dev/builtin#string)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.UploadModuleFile).

### GetModule

Get a module by its ID.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-76-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-76-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-76-2)

**Parameters:**

- `module_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the module being retrieved, containing either the namespace and module name (for example, my-org:my-module) or organization ID and module name (org-id:my-module).

**Returns:**

- ( [viam.proto.app.Module](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Module)): : The module.

**Raises:**

- (GRPCError): If an invalid module ID is passed.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_module).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `moduleID` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

- [(\*Module)](https://pkg.go.dev/go.viam.com/rdk/app#Module)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.GetModule).

**Parameters:**

- `moduleId` (string) (required): The ID of the module.

**Returns:**

- (Promise<undefined \| [Module](https://ts.viam.dev/classes/appApi.Module.html) >): The requested module.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getmodule).

### ListModules

List the modules under the organization you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-77-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-77-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-77-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to list modules for. You can obtain your organization ID from the organization settings page.

**Returns:**

- ( [List\[viam.proto.app.Module\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Module)): : The list of modules.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_modules).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `opts` [(\*ListModulesOptions)](https://pkg.go.dev/go.viam.com/rdk/app#ListModulesOptions)

**Returns:**

- [(\[\]\*Module)](https://pkg.go.dev/go.viam.com/rdk/app#Module)
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListModules).

**Parameters:**

- `organizationId` (string) (required): The ID of the organization to query.

**Returns:**

- (Promise< [Module](https://ts.viam.dev/classes/appApi.Module.html)\[\]>): The organization’s modules.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listmodules).

### CreateKey

Create a new [API key](https://docs.viam.com/organization/api-keys/).

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-78-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-78-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-78-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to create the key for. You can obtain your organization ID from the organization settings page.
- `authorizations` ( [List\[APIKeyAuthorization\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.Authorization)) (required): A list of authorizations to associate with the key.
- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): A name for the key. If None, defaults to the current timestamp.

**Returns:**

- (Tuple\[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)\]): : The api key and api key ID.

**Raises:**

- (GRPCError): If the authorizations list is empty.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_key).

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `orgID` [(string)](https://pkg.go.dev/builtin#string)
- `keyAuthorizations` [(\[\]APIKeyAuthorization)](https://pkg.go.dev/go.viam.com/rdk/app#APIKeyAuthorization)
- `name` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.CreateKey).

**Parameters:**

- `authorizations` ( [Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): The list of authorizations to provide for the API key.
- `name` (string) (optional): An optional name for the key. If none is passed, defaults to
present timestamp.

**Returns:**

- (Promise< [CreateKeyResponse](https://ts.viam.dev/classes/appApi.CreateKeyResponse.html) >): The new key and ID.

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createkey).

### DeleteKey

Delete an [API key](https://docs.viam.com/organization/api-keys/).

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-79-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-79-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-79-2)

**Parameters:**

- `id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the API key.

**Returns:**

- None.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.delete_key).

**Parameters:**

**Returns:**

- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.DeleteKey).

**Parameters:**

- `id` (string) (required): The ID of the key to delete.

**Returns:**

- (Promise< [DeleteKeyResponse](https://ts.viam.dev/classes/appApi.DeleteKeyResponse.html) >)

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#deletekey).

### RotateKey

Rotate an [API key](https://docs.viam.com/organization/api-keys/#rotate-a-key).

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-80-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-80-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-80-2)

**Parameters:**

- `id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the key to be rotated.

**Returns:**

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.rotate_key).

**Parameters:**

**Returns:**

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.RotateKey).

**Parameters:**

- `id` (string) (required): The ID of the key to rotate.

**Returns:**

- (Promise< [RotateKeyResponse](https://ts.viam.dev/classes/appApi.RotateKeyResponse.html) >): The updated key and ID.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#rotatekey).

### ListKeys

List all keys for the organization that you are currently authenticated to.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-81-0)
- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-81-1)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-81-2)

**Parameters:**

- `org_id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to list API keys for. You can obtain your organization ID from the organization settings page.

**Returns:**

- ( [List\[viam.proto.app.APIKeyWithAuthorizations\]](https://python.viam.dev/autoapi/viam/proto/app/index.html#viam.proto.app.APIKeyWithAuthorizations)): : The existing API keys and authorizations.

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_keys).

**Parameters:**

**Returns:**

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.ListKeys).

**Parameters:**

- `orgId` (string) (required): The ID of the organization to query.

**Returns:**

- (Promise< [APIKeyWithAuthorizations](https://ts.viam.dev/classes/appApi.APIKeyWithAuthorizations.html)\[\]>): The list of API keys.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#listkeys).

### RenameKey

RenameKey renames an API key and returns its ID and name.

- [Go](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-82-0)

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `id`
- `name` [(string)](https://pkg.go.dev/builtin#string)

**Returns:**

**Example:**

```go

```

Copy

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/app#AppClient.RenameKey).

### CreateKeyFromExistingKeyAuthorizations

Create a new API key with an existing key’s authorizations.

- [Python](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-83-0)
- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-83-1)

**Parameters:**

- `id` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): the ID of the API key to duplication authorizations from.

**Returns:**

**Example:**

```python

```

Copy

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.create_key_from_existing_key_authorizations).

**Parameters:**

- `id` (string) (required): The ID of the key to duplicate.

**Returns:**

- (Promise< [CreateKeyFromExistingKeyAuthorizationsResponse](https://ts.viam.dev/classes/appApi.CreateKeyFromExistingKeyAuthorizationsResponse.html) >): The new key and ID.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#createkeyfromexistingkeyauthorizations).

### GetAppContent

Retrieve the app content for an organization.

- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-84-0)

**Parameters:**

- `publicNamespace` (string) (required): The public namespace of the organization.
- `name` (string) (required): The name of the app.

**Returns:**

- (Promise< [GetAppContentResponse](https://ts.viam.dev/classes/appApi.GetAppContentResponse.html) >): The blob path and entrypoint of the app content.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getappcontent).

### GetAppBranding

Retrieves the app branding for an organization or app.

- [TypeScript](https://docs.viam.com/reference/apis/fleet/#tabset-referenceapisfleet-85-0)

**Parameters:**

- `publicNamespace` (string) (required): The public namespace of the organization.
- `name` (string) (required): The name of the app.

**Returns:**

- (Promise< [GetAppBrandingResponse](https://ts.viam.dev/classes/appApi.GetAppBrandingResponse.html) >): The branding information for the app.

**Example:**

```ts

```

Copy

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/interfaces/AppClient.html#getappbranding).

## Find part ID

To copy the ID of your machine part, select the part status dropdown to the right of your machine’s location and name on the top of its page and click the copy icon next to **Part ID**:

## Find machine ID

To copy the ID of your machine, click the **…** (Actions) button in the upper-right corner of your machine’s page, then click **Copy machine ID**:

Ask AI

Was this page helpful?

YesNo

Glad to hear it! If you have any other feedback please let us know:

Send

We're sorry about that. To help us improve, please tell us what we can do better:

Send

Thank you!
