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

# Apps

> The org-owned application a Sailbox belongs to

An `App` is the application that owns your Sailboxes. Every
[`Sailbox.create`](/sailbox-sdk#sailbox-create) call needs an app, usually
resolved by name with `App.find()`.

<CodeGroup>
  ```python Python theme={null}
  import sail

  app = sail.App.find(name="example-app", mint_if_missing=True)
  print(app.id, app.name)
  ```

  ```typescript TypeScript theme={null}
  import { App } from "@sailresearch/sdk";

  const app = await App.find("example-app", { mintIfMissing: true });
  console.log(app.id, app.name);
  ```

  ```rust Rust theme={null}
  use sail::Client;

  let client = Client::from_env()?;
  let app = client.find_app("example-app", /* mint_if_missing */ true).await?;
  println!("{} {}", app.id, app.name);
  ```
</CodeGroup>

## App.find

<CodeGroup>
  ```python Python theme={null}
  @classmethod
  def find(name: str, *, mint_if_missing: bool = False) -> App
  ```

  ```typescript TypeScript theme={null}
  static find(
    name: string,
    options?: ClientOptions & { mintIfMissing?: boolean }
  ): Promise<App>
  ```

  ```rust Rust theme={null}
  pub async fn find_app(&self, name: &str, mint_if_missing: bool) -> Result<App, SailError>
  ```
</CodeGroup>

Finds an app by name, optionally creating it if it does not exist.

| Parameter         | Default  | Description                                     |
| ----------------- | -------- | ----------------------------------------------- |
| `name`            | required | The app name to look up.                        |
| `mint_if_missing` | `False`  | Create the app if no app with that name exists. |

**Returns** the `App`.

**Raises** a not-found error if the app does not exist and `mint_if_missing`
is `False`, and a permission error on auth failures.

## App.list

<CodeGroup>
  ```python Python theme={null}
  @classmethod
  def list() -> list[App]
  ```

  ```typescript TypeScript theme={null}
  static list(options?: ClientOptions): Promise<App[]>
  ```

  ```rust Rust theme={null}
  pub async fn list_apps(&self) -> Result<Vec<App>, SailError>
  ```
</CodeGroup>

Returns every app the current org owns, newest first. Apps with no Sailboxes
yet are included. The response is not paginated.

## Attributes

| Attribute    | Type       | Description                                                          |
| ------------ | ---------- | -------------------------------------------------------------------- |
| `id`         | `str`      | Stable app identifier.                                               |
| `name`       | `str`      | App name.                                                            |
| `created_at` | `datetime` | Creation timestamp (`Date` in TypeScript, `OffsetDateTime` in Rust). |
