> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User

[View source](https://github.com/wandb/wandb/blob/main/wandb/apis/public/users.py#L26)

## Class wandb.apis.public.User

A user on a W\&B instance.

This allows managing a user's API keys and accessing information like
team memberships. The `create` class method can be used to create a new
user.

## Properties

**api\_keys** `list[str]`

Names of the user's API keys.

This property returns the names of the API keys, *not* the secret
associated with the key. The name of the key cannot be used as an API
key.

The list is empty if the user has no API keys or if API keys have not
been loaded.

**teams** `list[str]`

Names of the user's teams.

This is an empty list if the user has no team memberships or if teams
data was not loaded.

**user\_api** `Api | None`

A `wandb.Api` instance using the user's credentials.

## Methods

### method User.create()

```python theme={"system"}
api: 'Api',
email: 'str',
admin: 'bool | None' = False
```

Create a new user.

This is an internal method. Use the `create_user()` method of
`wandb.Api` instead.

##### Arguments

**api** `Api`

The API instance to use to create the user.

**email** `str`

The email for the user.

**admin** `bool | None`

Whether this user should be a global instance admin.

### method User.delete\_api\_key()

```python theme={"system"}
self,
api_key: 'str'
```

Delete a user's API key.

Only the owner of the key or an admin can delete it.

##### Arguments

**api\_key** `str`

The name of the API key to delete. Use one of the names returned by the `api_keys` property.

### method User.generate\_api\_key()

```python theme={"system"}
self,
description: 'str | None' = None
```

Generate a new API key.

##### Arguments

**description** `str | None`

A description for the new API key. This can be used to identify the purpose of the API key.
