> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-sdk-add-methods-properties.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Api methods

## <Badge color="yellow" size="lg" shape="rounded">Class</Badge> wandb.Api

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact()

Returns a single artifact.

```python theme={null}
(self,
name: 'str',
type: 'str | None' = None)
```

##### Arguments

<ResponseField name="name" type="str">
  The artifact's name. The name of an artifact resembles a filepath that consists, at a minimum, the name of the project the artifact was logged to, the name of the artifact, and the artifact's version or alias. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If no entity is specified in the name, the Run or API setting's entity is used.
</ResponseField>

<ResponseField name="type" type="str | None">
  The type of artifact to fetch.
</ResponseField>

##### Returns

An `Artifact` object.

##### Raises

<ResponseField name="ValueError">
  If the artifact name is not specified.
</ResponseField>

<ResponseField name="ValueError">
  If the artifact type is specified but does not match the type of the fetched artifact.
</ResponseField>

##### Examples

In the following code snippets "entity", "project", "artifact",
"version", and "alias" are placeholders for your W\&B entity, name
of the project the artifact is in, the name of the artifact,
and artifact's version, respectively.

```python theme={null}
import wandb

# Specify the project, artifact's name, and the artifact's alias
wandb.Api().artifact(name="project/artifact:alias")

# Specify the project, artifact's name, and a specific artifact version
wandb.Api().artifact(name="project/artifact:version")

# Specify the entity, project, artifact's name, and the artifact's alias
wandb.Api().artifact(name="entity/project/artifact:alias")

# Specify the entity, project, artifact's name, and a specific artifact version
wandb.Api().artifact(name="entity/project/artifact:version")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact\_collection()

Returns a single artifact collection by type.

You can use the returned `ArtifactCollection` object to retrieve
information about specific artifacts in that collection, and more.

```python theme={null}
self,
type_name: 'str',
name: 'str'
```

##### Arguments

<ResponseField name="type_name" type="str">
  The type of artifact collection to fetch.
</ResponseField>

<ResponseField name="name" type="str">
  An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash.
</ResponseField>

##### Returns

An `ArtifactCollection` object.

##### Examples

In the proceeding code snippet "type", "entity", "project", and
"artifact\_name" are placeholders for the collection type, your W\&B
entity, name of the project the artifact is in, and the name of
the artifact, respectively.

```python theme={null}
import wandb

collections = wandb.Api().artifact_collection(
    type_name="type", name="entity/project/artifact_name"
)

# Get the first artifact in the collection
artifact_example = collections.artifacts()[0]

# Download the contents of the artifact to the specified root directory.
artifact_example.download()
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact\_collection\_exists()

Whether an artifact collection exists within a specified project and entity.

```python theme={null}
self,
name: 'str',
type: 'str'
```

##### Arguments

<ResponseField name="name" type="str">
  An artifact collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash. If entity or project is not specified, infer the collection from the override params if they exist. Otherwise, entity is pulled from the user settings and project will default to "uncategorized".
</ResponseField>

<ResponseField name="type" type="str">
  The type of artifact collection.
</ResponseField>

##### Returns

True if the artifact collection exists, False otherwise.

##### Examples

In the proceeding code snippet "type", and "collection\_name" refer to the type
of the artifact collection and the name of the collection, respectively.

```python theme={null}
import wandb

wandb.Api.artifact_collection_exists(type="type", name="collection_name")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact\_collections()

Returns a collection of matching artifact collections.

```python theme={null}
self,
project_name: 'str',
type_name: 'str',
order: 'str | None' = None,
per_page: 'int' = 50,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="project_name" type="str">
  The name of the project to filter on.
</ResponseField>

<ResponseField name="type_name" type="str">
  The name of the artifact type to filter on.
</ResponseField>

<ResponseField name="order" type="str | None">
  Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending.
</ResponseField>

<ResponseField name="per_page" type="int">
  Sets the page size for query pagination. Usually there is no reason to change this.
</ResponseField>

<ResponseField name="start" type="str | None">
  Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute.
</ResponseField>

##### Returns

An iterable `ArtifactCollections` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact\_exists()

Whether an artifact version exists within the specified project and entity.

```python theme={null}
self,
name: 'str',
type: 'str | None' = None
```

##### Arguments

<ResponseField name="name" type="str">
  The name of artifact. Add the artifact's entity and project as a prefix. Append the version or the alias of the artifact with a colon. If the entity or project is not specified, W\&B uses override parameters if populated. Otherwise, the entity is pulled from the user settings and the project is set to "Uncategorized".
</ResponseField>

<ResponseField name="type" type="str | None">
  The type of artifact.
</ResponseField>

##### Returns

True if the artifact version exists, False otherwise.

##### Examples

In the proceeding code snippets "entity", "project", "artifact",
"version", and "alias" are placeholders for your W\&B entity, name of
the project the artifact is in, the name of the artifact, and
artifact's version, respectively.

```python theme={null}
import wandb

wandb.Api().artifact_exists("entity/project/artifact:version")
wandb.Api().artifact_exists("entity/project/artifact:alias")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact\_type()

Returns the matching `ArtifactType`.

```python theme={null}
self,
type_name: 'str',
project: 'str | None' = None
```

##### Arguments

<ResponseField name="type_name" type="str">
  The name of the artifact type to retrieve.
</ResponseField>

<ResponseField name="project" type="str | None">
  If given, a project name or path to filter on.
</ResponseField>

##### Returns

An `ArtifactType` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact\_types()

Returns a collection of matching artifact types.

```python theme={null}
self,
project: 'str | None' = None,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="project" type="str | None">
  The project name or path to filter on.
</ResponseField>

<ResponseField name="start" type="str | None">
  Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute.
</ResponseField>

##### Returns

An iterable `ArtifactTypes` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifact\_versions()

Deprecated. Use `Api.artifacts(type_name, name)` method instead.

```python theme={null}
(self, type_name, name, per_page=50)
```

##### Arguments

<ResponseField name="type_name" type="" />

<ResponseField name="name" type="" />

<ResponseField name="per_page" type="" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.artifacts()

Return an `Artifacts` collection.

```python theme={null}
self,
type_name: 'str',
name: 'str',
order: 'str | None' = None,
per_page: 'int' = 50,
tags: 'list[str] | None' = None,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="type_name" type="str">
  The type of artifacts to fetch.
</ResponseField>

<ResponseField name="name" type="str">
  The artifact's collection name. Optionally append the entity that logged the artifact as a prefix followed by a forward slash.
</ResponseField>

<ResponseField name="order" type="str | None">
  Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending.
</ResponseField>

<ResponseField name="per_page" type="int">
  Sets the page size for query pagination. Usually there is no reason to change this.
</ResponseField>

<ResponseField name="tags" type="list[str] | None">
  Only return artifacts with all of these tags.
</ResponseField>

<ResponseField name="start" type="str | None">
  Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute.
</ResponseField>

##### Returns

An iterable `Artifacts` object.

##### Examples

In the proceeding code snippet, "type", "entity", "project", and
"artifact\_name" are placeholders for the artifact type, W\&B entity,
name of the project the artifact was logged to,
and the name of the artifact, respectively.

```python theme={null}
import wandb

wandb.Api().artifacts(type_name="type", name="entity/project/artifact_name")
```

Pause iteration and resume later from the same position by saving
the paginator's `.cursor` and passing it as `start=`:

```python theme={null}
from itertools import islice

import wandb

api = wandb.Api()

# Consume the first page of results, then save the cursor.
page_size = 10
artifacts = api.artifacts(
    type_name="type",
    name="entity/project/artifact_name",
    per_page=page_size,
)
first_page = list(islice(artifacts, page_size))

saved_cursor = artifacts.cursor

# Later (e.g. in a new process), resume iteration from the saved cursor.
remaining_artifacts = api.artifacts(
    type_name="type",
    name="entity/project/artifact_name",
    per_page=page_size,
    start=saved_cursor,
)
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.automation()

Returns the only Automation matching the parameters.

```python theme={null}
self,
name: 'str', *,
entity: 'str | None' = None
```

##### Arguments

<ResponseField name="name" type="str">
  The name of the automation to fetch.
</ResponseField>

<ResponseField name="entity" type="str | None">
  The entity to fetch the automation for.
</ResponseField>

##### Raises

<ResponseField name="ValueError">
  If zero or multiple Automations match the search criteria.
</ResponseField>

##### Examples

Get an existing automation named "my-automation":

```python theme={null}
import wandb

api = wandb.Api()
automation = api.automation(name="my-automation")
```

Get an existing automation named "other-automation", from the entity "my-team":

```python theme={null}
automation = api.automation(name="other-automation", entity="my-team")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.automations()

Returns an iterator over all Automations that match the given parameters.

If no parameters are provided, the returned iterator will contain all
Automations that the user has access to.

```python theme={null}
self,
entity: 'str | None' = None, *,
name: 'str | None' = None,
per_page: 'int' = 50,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="entity" type="str | None">
  The entity to fetch the automations for.
</ResponseField>

<ResponseField name="name" type="str | None">
  The name of the automation to fetch.
</ResponseField>

<ResponseField name="per_page" type="int">
  The number of automations to fetch per page. Defaults to 50.  Usually there is no reason to change this.
</ResponseField>

<ResponseField name="start" type="str | None">
  Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute.
</ResponseField>

##### Returns

A list of automations.

##### Examples

Fetch all existing automations for the entity "my-team":

```python theme={null}
import wandb

api = wandb.Api()
automations = api.automations(entity="my-team")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_automation()

Create a new Automation.

```python theme={null}
self,
obj: 'NewAutomation', *,
fetch_existing: 'bool' = False, **kwargs: 'Unpack[WriteAutomationsKwargs]'
```

##### Arguments

<ResponseField name="obj" type="NewAutomation">
  The automation to create.
</ResponseField>

<ResponseField name="fetch_existing" type="bool">
  If True, and a conflicting automation already exists, attempt to fetch the existing automation instead of raising an error.
</ResponseField>

<ResponseField name="kwargs" type="Unpack[WriteAutomationsKwargs]" />

##### Returns

The saved Automation.

##### Examples

Create a new automation named "my-automation" that sends a Slack notification
when a run within a specific project logs a metric exceeding a custom threshold:

```python theme={null}
import wandb
from wandb.automations import OnRunMetric, RunEvent, SendNotification

api = wandb.Api()

project = api.project("my-project", entity="my-team")

# Use the first Slack integration for the team
slack_hook = next(api.slack_integrations(entity="my-team"))

event = OnRunMetric(
    scope=project,
    filter=RunEvent.metric("custom-metric") > 10,
)
action = SendNotification.from_integration(slack_hook)

automation = api.create_automation(
    event >> action,
    name="my-automation",
    description="Send a Slack message whenever 'custom-metric' exceeds 10.",
)
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_custom\_chart()

Create a custom chart preset and return its id.

```python theme={null}
self,
entity: 'str',
name: 'str',
display_name: 'str',
spec_type: "Literal['vega2']",
access: "Literal['private', 'public']",
spec: 'str | dict'
```

##### Arguments

<ResponseField name="entity" type="str">
  The entity (user or team) that owns the chart
</ResponseField>

<ResponseField name="name" type="str">
  Unique identifier for the chart preset
</ResponseField>

<ResponseField name="display_name" type="str">
  Human-readable name shown in the UI
</ResponseField>

<ResponseField name="spec_type" type="Literal['vega2']">
  Type of specification. Must be "vega2" for Vega-Lite v2 specifications.
</ResponseField>

<ResponseField name="access" type="Literal['private', 'public']">
  Access level for the chart:

  * "private": Chart is only accessible to the entity that created it
  * "public": Chart is publicly accessible
</ResponseField>

<ResponseField name="spec" type="str | dict">
  The Vega/Vega-Lite specification as a dictionary or JSON string
</ResponseField>

##### Returns

The ID of the created chart preset in the format "entity/name"

##### Raises

<ResponseField name="wandb.Error">
  If chart creation fails
</ResponseField>

<ResponseField name="UnsupportedError">
  If the server doesn't support custom charts
</ResponseField>

##### Examples

```python theme={null}
    import wandb

    api = wandb.Api()

    # Define a simple bar chart specification
    vega_spec = {
        "$schema": "https://vega.github.io/schema/vega-lite/v6.json",
        "mark": "bar",
        "data": {"name": "wandb"},
        "encoding": {
            "x": {"field": "${field:x}", "type": "ordinal"},
            "y": {"field": "${field:y}", "type": "quantitative"},
        },
    }

    # Create the custom chart
    chart_id = api.create_custom_chart(
        entity="my-team",
        name="my-bar-chart",
        display_name="My Custom Bar Chart",
        spec_type="vega2",
        access="private",
        spec=vega_spec,
    )

    # Use with wandb.plot_table()
    chart = wandb.plot_table(
        vega_spec_name=chart_id,
        data_table=my_table,
        fields={"x": "category", "y": "value"},
    )
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_project()

Create a new project.

```python theme={null}
self,
name: 'str',
entity: 'str'
```

##### Arguments

<ResponseField name="name" type="str">
  The name of the new project.
</ResponseField>

<ResponseField name="entity" type="str">
  The entity of the new project.
</ResponseField>

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_registry()

Create a new registry.

```python theme={null}
self,
name: 'str',
visibility: "Literal['organization', 'restricted']",
organization: 'str | None' = None,
description: 'str | None' = None,
artifact_types: 'list[str] | None' = None
```

##### Arguments

<ResponseField name="name" type="str">
  The name of the registry. Name must be unique within the organization.
</ResponseField>

<ResponseField name="visibility" type="Literal['organization', 'restricted']">
  The visibility of the registry. organization: Anyone in the organization can view this registry. You can edit their roles later from the settings in the UI. restricted: Only invited members via the UI can access this registry. Public sharing is disabled.
</ResponseField>

<ResponseField name="organization" type="str | None">
  The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization.
</ResponseField>

<ResponseField name="description" type="str | None">
  The description of the registry.
</ResponseField>

<ResponseField name="artifact_types" type="list[str] | None">
  The accepted artifact types of the registry. A type is no more than 128 characters and do not include characters `/` or `:`. If not specified, all types are accepted. Allowed types added to the registry cannot be removed later.
</ResponseField>

##### Returns

A registry object.

##### Examples

```python theme={null}
import wandb

api = wandb.Api()
registry = api.create_registry(
    name="my-registry",
    visibility="restricted",
    organization="my-org",
    description="This is a test registry",
    artifact_types=["model"],
)
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_run()

Create a new run.

```python theme={null}
self, *,
run_id: 'str | None' = None,
project: 'str | None' = None,
entity: 'str | None' = None
```

##### Arguments

<ResponseField name="run_id" type="str | None">
  The ID to assign to the run. If not specified, W\&B creates a random ID.
</ResponseField>

<ResponseField name="project" type="str | None">
  The project where to log the run to. If no project is specified, log the run to a project called "Uncategorized".
</ResponseField>

<ResponseField name="entity" type="str | None">
  The entity that owns the project. If no entity is specified, log the run to the default entity.
</ResponseField>

##### Returns

The newly created `Run`.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_run\_queue()

Create a new run queue in W\&B Launch.

```python theme={null}
self,
name: 'str',
type: 'public.RunQueueResourceType',
entity: 'str | None' = None,
prioritization_mode: 'public.RunQueuePrioritizationMode | None' = None,
config: 'dict | None' = None,
template_variables: 'dict | None' = None
```

##### Arguments

<ResponseField name="name" type="str">
  Name of the queue to create
</ResponseField>

<ResponseField name="type" type="public.RunQueueResourceType">
  Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes","sagemaker", or "gcp-vertex".
</ResponseField>

<ResponseField name="entity" type="str | None">
  Name of the entity to create the queue. If `None`, use the configured or default entity.
</ResponseField>

<ResponseField name="prioritization_mode" type="public.RunQueuePrioritizationMode | None">
  Version of prioritization to use. Either "V0" or `None`.
</ResponseField>

<ResponseField name="config" type="dict | None">
  Default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables.
</ResponseField>

<ResponseField name="template_variables" type="dict | None">
  A dictionary of template variable schemas to use with the config.
</ResponseField>

##### Returns

The newly created `RunQueue`.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_team()

Create a new team.

```python theme={null}
self,
team: 'str',
admin_username: 'str | None' = None
```

##### Arguments

<ResponseField name="team" type="str">
  The name of the team
</ResponseField>

<ResponseField name="admin_username" type="str | None">
  Username of the admin user of the team. Defaults to the current user.
</ResponseField>

##### Returns

A `Team` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.create\_user()

Create a new user.

```python theme={null}
self,
email: 'str',
admin: 'bool | None' = False
```

##### Arguments

<ResponseField name="email" type="str">
  The email address of the user.
</ResponseField>

<ResponseField name="admin" type="bool | None">
  Set user as a global instance administrator.
</ResponseField>

##### Returns

A `User` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.delete\_automation()

Delete an automation.

```python theme={null}
self,
obj: 'Automation | str'
```

##### Arguments

<ResponseField name="obj" type="Automation | str">
  The automation to delete, or its ID.
</ResponseField>

##### Returns

True if the automation was deleted successfully.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.flush()

Flush the local cache.

The api object keeps a local cache of runs, so if the state of the run
may change while executing your script you must clear the local cache
with `api.flush()` to get the latest values associated with the run.

```python theme={null}
(self)
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.from\_path()

Return a run, sweep, project or report from a path.

```python theme={null}
(self,
path: 'str')
```

##### Arguments

<ResponseField name="path" type="str">
  The path to the project, run, sweep or report
</ResponseField>

##### Returns

A `Project`, `Run`, `Sweep`, or `BetaReport` instance.

##### Examples

In the proceeding code snippets "project", "team", "run\_id", "sweep\_id",
and "report\_name" are placeholders for the project, team, run ID,
sweep ID, and the name of a specific report, respectively.

```python theme={null}
import wandb

api = wandb.Api()

project = api.from_path("project")
team_project = api.from_path("team/project")
run = api.from_path("team/project/runs/run_id")
sweep = api.from_path("team/project/sweeps/sweep_id")
report = api.from_path("team/project/reports/report_name")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.integrations()

Return an iterator of all integrations for an entity.

```python theme={null}
self,
entity: 'str | None' = None, *,
per_page: 'int' = 50,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="entity" type="str | None">
  The entity (e.g. team name) for which to fetch integrations.  If not provided, the user's default entity will be used.
</ResponseField>

<ResponseField name="per_page" type="int">
  Number of integrations to fetch per page. Defaults to 50.  Usually there is no reason to change this.
</ResponseField>

<ResponseField name="start" type="str | None" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.job()

Return a `Job` object.

```python theme={null}
self,
name: 'str | None',
path: 'str | None' = None
```

##### Arguments

<ResponseField name="name" type="str | None">
  The name of the job.
</ResponseField>

<ResponseField name="path" type="str | None">
  The root path to download the job artifact.
</ResponseField>

##### Returns

A `Job` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.list\_jobs()

Return a list of jobs, if any, for the given entity and project.

```python theme={null}
self,
entity: 'str',
project: 'str'
```

##### Arguments

<ResponseField name="entity" type="str">
  The entity for the listed jobs.
</ResponseField>

<ResponseField name="project" type="str">
  The project for the listed jobs.
</ResponseField>

##### Returns

A list of matching jobs.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.organization()

Return the matching `Organization`.

```python theme={null}
self,
name: 'str | None' = None
```

##### Arguments

<ResponseField name="name" type="str | None">
  The name of the organization. If omitted, this method will attempt to infer and return the current default organization.
</ResponseField>

##### Returns

An `Organization` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.project()

Return the `Project` with the given name (and entity, if given).

```python theme={null}
self,
name: 'str',
entity: 'str | None' = None
```

##### Arguments

<ResponseField name="name" type="str">
  The project name.
</ResponseField>

<ResponseField name="entity" type="str | None">
  Name of the entity requested.  If None, will fall back to the default entity passed to `Api`.  If no default entity, will raise a `ValueError`.
</ResponseField>

##### Returns

A `Project` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.projects()

Get projects for a given entity.

```python theme={null}
self,
entity: 'str | None' = None,
per_page: 'int' = 200
```

##### Arguments

<ResponseField name="entity" type="str | None">
  Name of the entity requested.  If None, will fall back to the default entity passed to `Api`.  If no default entity, will raise a `ValueError`.
</ResponseField>

<ResponseField name="per_page" type="int">
  Sets the page size for query pagination. Usually there is no reason to change this.
</ResponseField>

##### Returns

A `Projects` object which is an iterable collection of `Project`objects.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.queued\_run()

Return a single queued run based on the path.

Parses paths of the form `entity/project/queue_id/run_queue_item_id`.

```python theme={null}
(self,
entity: 'str',
project: 'str',
queue_name: 'str',
run_queue_item_id: 'str', project_queue=None, priority=None)
```

##### Arguments

<ResponseField name="entity" type="str" />

<ResponseField name="project" type="str" />

<ResponseField name="queue_name" type="str" />

<ResponseField name="run_queue_item_id" type="str" />

<ResponseField name="project_queue" type="" />

<ResponseField name="priority" type="" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.registries()

Returns a lazy iterator of `Registry` objects.

Use the iterator to search and filter registries, collections,
or artifact versions across your organization's registry.

```python theme={null}
self,
organization: 'str | None' = None,
filter: 'dict[str, Any] | None' = None,
order: 'str | None' = None,
per_page: 'int' = 100,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="organization" type="str | None">
  The organization of the registry to fetch. If not specified, use the organization specified in the user's settings.
</ResponseField>

<ResponseField name="filter" type="dict[str, Any] | None">
  Optional MongoDB-style filter to apply to each object in the lazy registry iterator. Fields available to filter for registries are `name`, `description`, `created_at`, `updated_at`. Fields available to filter for collections are `name`, `tag`, `description`, `created_at`, `updated_at` Fields available to filter for versions are `tag`, `alias`, `created_at`, `updated_at`, `metadata`
</ResponseField>

<ResponseField name="order" type="str | None">
  Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending.
</ResponseField>

<ResponseField name="per_page" type="int">
  Sets the page size for query pagination.
</ResponseField>

<ResponseField name="start" type="str | None">
  Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute.
</ResponseField>

##### Returns

A lazy iterator of `Registry` objects.

##### Examples

Find all registries with the names that contain "model"

```python theme={null}
import wandb

api = wandb.Api()  # specify an org if your entity belongs to multiple orgs
api.registries(filter={"name": {"$regex": "model"}})
```

Find all collections in the registries with the name "my\_collection" and the tag "my\_tag"

```python theme={null}
api.registries().collections(filter={"name": "my_collection", "tag": "my_tag"})
```

Find all artifact versions in the registries with a collection name that contains "my\_collection" and a version that has the alias "best"

```python theme={null}
api.registries().collections(
    filter={"name": {"$regex": "my_collection"}}
).versions(filter={"alias": "best"})
```

Find all artifact versions in the registries that contain "model" and have the tag "prod" or alias "best"

```python theme={null}
api.registries(filter={"name": {"$regex": "model"}}).versions(
    filter={"$or": [{"tag": "prod"}, {"alias": "best"}]}
)
```

Pause iteration and resume later from the same position by saving
the paginator's `.cursor` and passing it as `start=`:

```python theme={null}
from itertools import islice

import wandb

api = wandb.Api()

# Consume the first page of results, then save the cursor.
page_size = 10
registries = api.registries(per_page=page_size)
first_page = list(islice(registries, page_size))

saved_cursor = registries.cursor

# Later (e.g. in a new process), resume iteration from the saved cursor.
remaining_registries = api.registries(per_page=page_size, start=saved_cursor)
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.registry()

Return a registry given a registry name.

```python theme={null}
self,
name: 'str',
organization: 'str | None' = None
```

##### Arguments

<ResponseField name="name" type="str">
  The name of the registry. This is without the `wandb-registry-` prefix.
</ResponseField>

<ResponseField name="organization" type="str | None">
  The organization of the registry. If no organization is set in the settings, the organization will be fetched from the entity if the entity only belongs to one organization.
</ResponseField>

##### Returns

A registry object.

##### Examples

Fetch and update a registry

```python theme={null}
import wandb

api = wandb.Api()
registry = api.registry(name="my-registry", organization="my-org")
registry.description = "This is an updated description"
registry.save()
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.reports()

Get reports for a given project path.

Note: `wandb.Api.reports()` API is in beta and will likely change in
future releases.

```python theme={null}
self,
path: 'str' = '',
name: 'str | None' = None,
per_page: 'int' = 50
```

##### Arguments

<ResponseField name="path" type="str">
  The path to the project the report resides in. Specify the entity that created the project as a prefix followed by a forward slash.
</ResponseField>

<ResponseField name="name" type="str | None">
  Name of the report requested.
</ResponseField>

<ResponseField name="per_page" type="int">
  Sets the page size for query pagination. Usually there is no reason to change this.
</ResponseField>

##### Returns

A `Reports` object which is an iterable collection of `BetaReport` objects.

##### Examples

```python theme={null}
import wandb

wandb.Api.reports("entity/project")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.run()

Return a single run by parsing path in the form `entity/project/run_id`.

```python theme={null}
(self, path='')
```

##### Arguments

<ResponseField name="path" type="">
  Path to run in the form `entity/project/run_id`. If `api.entity` is set, this can be in the form `project/run_id` and if `api.project` is set this can just be the run\_id.
</ResponseField>

##### Returns

A `Run` object.

##### Raises

<ResponseField name="RunNotFoundError">
  If a run is not found, or run data is not able to be loaded.
</ResponseField>

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.run\_queue()

Return the named `RunQueue` for entity.

See `Api.create_run_queue` for more information on how to create a run queue.

```python theme={null}
(self,
entity: 'str',
name: 'str')
```

##### Arguments

<ResponseField name="entity" type="str" />

<ResponseField name="name" type="str" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.runs()

Returns a `Runs` object, which lazily iterates over `Run` objects.

Fields you can filter by include:

* `createdAt`: The timestamp when the run was created. (in ISO 8601 format, e.g. "2023-01-01T12:00:00Z")
* `displayName`: The human-readable display name of the run. (e.g. "eager-fox-1")
* `duration`: The total runtime of the run in seconds.
* `group`: The group name used to organize related runs together.
* `host`: The hostname where the run was executed.
* `jobType`: The type of job or purpose of the run.
* `name`: The unique identifier of the run. (e.g. "a1b2cdef")
* `state`: The current state of the run.
* `tags`: The tags associated with the run.
* `username`: The username of the user who initiated the run

Additionally, you can filter by items in the run config or summary metrics.
Such as `config.experiment_name`, `summary_metrics.loss`, etc.

For more complex filtering, you can use MongoDB query operators.
For details, see: [https://docs.mongodb.com/manual/reference/operator/query](https://docs.mongodb.com/manual/reference/operator/query)
The following operations are supported:

* `$and`
* `$or`
* `$nor`
* `$eq`
* `$ne`
* `$gt`
* `$gte`
* `$lt`
* `$lte`
* `$in`
* `$nin`
* `$exists`
* `$regex`

```python theme={null}
(self,
path: 'str | None' = None,
filters: 'dict[str, Any] | None' = None,
order: 'str' = '+created_at',
per_page: 'int' = 50,
include_sweeps: 'bool' = False,
lazy: 'bool' = True)
```

##### Arguments

<ResponseField name="path" type="str | None">
  (str) path to project, should be in the form: "entity/project"
</ResponseField>

<ResponseField name="filters" type="dict[str, Any] | None">
  (dict) queries for specific runs using the MongoDB query language. You can filter by run properties such as config.key, summary\_metrics.key, state, entity, createdAt, etc. For example: `{"config.experiment_name": "foo"}` would find runs with a config entry of experiment name set to "foo"
</ResponseField>

<ResponseField name="order" type="str">
  (str) Order can be `created_at`, `heartbeat_at`, `config.*.value`, or `summary_metrics.*`. If you prepend order with a + order is ascending (default). If you prepend order with a - order is descending. The default order is run.created\_at from oldest to newest.
</ResponseField>

<ResponseField name="per_page" type="int">
  (int) Sets the page size for query pagination.
</ResponseField>

<ResponseField name="include_sweeps" type="bool">
  (bool) Whether to eagerly fetch the sweep object in each run result.
</ResponseField>

<ResponseField name="lazy" type="bool">
  (bool) Whether to use lazy loading for faster performance. When True (default), only essential run metadata is loaded initially. Heavy fields like config, summaryMetrics, and systemMetrics are loaded on-demand when accessed. Set to False for full data upfront.
</ResponseField>

##### Returns

A `Runs` object, which is an iterable collection of `Run` objects.

##### Examples

```python theme={null}
import wandb
from wandb.apis.public import Api

# Find runs in project where config.experiment_name has been set to "foo"
Api.runs(path="my_entity/project", filters={"config.experiment_name": "foo"})
```

```python theme={null}
# Find runs in project where config.experiment_name has been set to "foo" or "bar"
Api.runs(
    path="my_entity/project",
    filters={
        "$or": [
            {"config.experiment_name": "foo"},
            {"config.experiment_name": "bar"},
        ]
    },
)
```

```python theme={null}
# Find runs in project where config.experiment_name matches a regex
Api.runs(
    path="my_entity/project",
    filters={"config.experiment_name": {"$regex": "b.*"}},
)
```

Note:
Regular expressions use Google's RE2 syntax:
[https://github.com/google/re2/wiki/Syntax](https://github.com/google/re2/wiki/Syntax)

```python theme={null}
# Find runs in project where the run name matches a regex
Api.runs(
    path="my_entity/project", filters={"display_name": {"$regex": "^foo.*"}}
)
```

```python theme={null}
# Find runs in project sorted by ascending loss
Api.runs(path="my_entity/project", order="+summary_metrics.loss")
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.slack\_integrations()

Returns an iterator of Slack integrations for an entity.

```python theme={null}
self, *,
entity: 'str | None' = None,
per_page: 'int' = 50,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="entity" type="str | None">
  The entity (e.g. team name) for which to fetch integrations.  If not provided, the user's default entity will be used.
</ResponseField>

<ResponseField name="per_page" type="int">
  Number of integrations to fetch per page. Defaults to 50.  Usually there is no reason to change this.
</ResponseField>

<ResponseField name="start" type="str | None" />

##### Examples

Get all registered Slack integrations for the team "my-team":

```python theme={null}
import wandb

api = wandb.Api()
slack_integrations = api.slack_integrations(entity="my-team")
```

Find only Slack integrations that post to channel names starting with "team-alerts-":

```python theme={null}
slack_integrations = api.slack_integrations(entity="my-team")
team_alert_integrations = [
    ig
    for ig in slack_integrations
    if ig.channel_name.startswith("team-alerts-")
]
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.sweep()

Return a sweep by parsing path in the form `entity/project/sweep_id`.

```python theme={null}
(self, path='')
```

##### Arguments

<ResponseField name="path" type="">
  Path to sweep in the form entity/project/sweep\_id. If `api.entity` is set, this can be in the form project/sweep\_id and if `api.project` is set this can just be the sweep\_id.
</ResponseField>

##### Returns

A `Sweep` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.sync\_tensorboard()

Sync a local directory containing tfevent files to wandb.

```python theme={null}
(self, root_dir, run_id=None, project=None, entity=None)
```

##### Arguments

<ResponseField name="root_dir" type="" />

<ResponseField name="run_id" type="" />

<ResponseField name="project" type="" />

<ResponseField name="entity" type="" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.team()

Return the matching `Team` with the given name.

```python theme={null}
self,
team: 'str'
```

##### Arguments

<ResponseField name="team" type="str">
  The name of the team.
</ResponseField>

##### Returns

A `Team` object.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.update\_automation()

Update an existing automation.

```python theme={null}
self,
obj: 'Automation', *,
create_missing: 'bool' = False, **kwargs: 'Unpack[WriteAutomationsKwargs]'
```

##### Arguments

<ResponseField name="obj" type="Automation">
  The automation to update.  Must be an existing automation.
</ResponseField>

<ResponseField name="create_missing" type="bool">
  If True, and the automation does not exist, create it.
</ResponseField>

<ResponseField name="kwargs" type="Unpack[WriteAutomationsKwargs]" />

##### Returns

The updated automation.

##### Examples

Disable and edit the description of an existing automation ("my-automation"):

```python theme={null}
import wandb

api = wandb.Api()

automation = api.automation(name="my-automation")
automation.enabled = False
automation.description = "Kept for reference, but no longer used."

updated_automation = api.update_automation(automation)
```

OR

```python theme={null}
import wandb

api = wandb.Api()

automation = api.automation(name="my-automation")

updated_automation = api.update_automation(
    automation,
    enabled=False,
    description="Kept for reference, but no longer used.",
)
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.upsert\_run\_queue()

Upsert a run queue in W\&B Launch.

```python theme={null}
(self,
name: 'str',
resource_config: 'dict',
resource_type: 'public.RunQueueResourceType',
entity: 'str | None' = None,
template_variables: 'dict | None' = None,
external_links: 'dict | None' = None,
prioritization_mode: 'public.RunQueuePrioritizationMode | None' = None)
```

##### Arguments

<ResponseField name="name" type="str">
  Name of the queue to create
</ResponseField>

<ResponseField name="resource_config" type="dict">
  Optional default resource configuration to be used for the queue. Use handlebars (eg. `{{var}}`) to specify template variables.
</ResponseField>

<ResponseField name="resource_type" type="public.RunQueueResourceType">
  Type of resource to be used for the queue. One of "local-container", "local-process", "kubernetes", "sagemaker", or "gcp-vertex".
</ResponseField>

<ResponseField name="entity" type="str | None">
  Optional name of the entity to create the queue. If `None`, use the configured or default entity.
</ResponseField>

<ResponseField name="template_variables" type="dict | None">
  A dictionary of template variable schemas to be used with the config.
</ResponseField>

<ResponseField name="external_links" type="dict | None">
  Optional dictionary of external links to be used with the queue.
</ResponseField>

<ResponseField name="prioritization_mode" type="public.RunQueuePrioritizationMode | None">
  Optional version of prioritization to use. Either "V0" or None
</ResponseField>

##### Returns

The upserted `RunQueue`.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.user()

Return a user from a username or email address.

This function only works for local administrators. Use `api.viewer`
to get your own user object.

```python theme={null}
self,
username_or_email: 'str'
```

##### Arguments

<ResponseField name="username_or_email" type="str">
  The username or email address of the user.
</ResponseField>

##### Returns

A `User` object or None if a user is not found.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.users()

Return all users from a partial username or email address query.

This function only works for local administrators. Use `api.viewer`
to get your own user object.

```python theme={null}
self,
username_or_email: 'str'
```

##### Arguments

<ResponseField name="username_or_email" type="str">
  The prefix or suffix of the user you want to find.
</ResponseField>

##### Returns

An array of `User` objects.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Api.webhook\_integrations()

Returns an iterator of webhook integrations for an entity.

```python theme={null}
self,
entity: 'str | None' = None, *,
per_page: 'int' = 50,
start: 'str | None' = None
```

##### Arguments

<ResponseField name="entity" type="str | None">
  The entity (e.g. team name) for which to fetch integrations.  If not provided, the user's default entity will be used.
</ResponseField>

<ResponseField name="per_page" type="int">
  Number of integrations to fetch per page. Defaults to 50.  Usually there is no reason to change this.
</ResponseField>

<ResponseField name="start" type="str | None" />

##### Examples

Get all registered webhook integrations for the team "my-team":

```python theme={null}
import wandb

api = wandb.Api()
webhook_integrations = api.webhook_integrations(entity="my-team")
```

Find only webhook integrations that post requests to "[https://my-fake-url.com](https://my-fake-url.com)":

```python theme={null}
webhook_integrations = api.webhook_integrations(entity="my-team")
my_webhooks = [
    ig
    for ig in webhook_integrations
    if ig.url_endpoint.startswith("https://my-fake-url.com")
]
```
