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

# apps

> Hosted web applications — client.apps.

An app is **org-level**: it belongs to the organization, not to an agent, and outlives any session. Thirty-eight methods: twenty on an app itself, plus `installs.apply` / `installs.list` / `installs.update` / `installs.context` / `installs.remove` / `installs.preview` for the declaration a project is applied from and what its crew knows, `artifacts.list` for the catalog it is applied out of, `companyTemplates.draft` / `companyTemplates.create` / `companyTemplates.list` for a company saved as a private template, `listings.list` / `listings.checks` for the company's marketplace listings and what a new one would send, `listings.seller` for where the person stands as a seller, `profile.get` / `profile.update` for the public profile its listings credit, `freeSite.get` / `freeSite.update` for the site Start puts live, and `earnings.setUpPayouts` for where its earnings are paid. API detail: [Apps](https://vetta.sh/docs/api/apps.md).

## create

```ts theme={"system"}
client.apps.create(body: AppCreate): Promise<App>
```

`POST /v1/apps`. `AppCreate` is `{ name, description?, type?, mcp? }` — `type` is `"frontend_only"` (default) or `"fullstack"`; `mcp` is the path of the MCP endpoint a `fullstack` app serves (`"/mcp"`), refused on `frontend_only`. Idempotent on the name.

## list

```ts theme={"system"}
client.apps.list(query?: ListQuery): Promise<Page<App>>
```

`GET /v1/apps`, cursor-paginated.

## get

```ts theme={"system"}
client.apps.get(id: string): Promise<App>
```

`GET /v1/apps/{id}`. A `fullstack` app's backend advances on read — poll here until `status` is terminal.

## update

```ts theme={"system"}
client.apps.update(id: string, body: AppPatch): Promise<App>
```

`PATCH /v1/apps/{id}`. `AppPatch` is `{ description?: string | null, mcp?: string | null }`. Setting `mcp` mints the app's `VETTA_MCP_TOKEN` secret and connects every agent that can access the app to its tools as `<app>.<tool>`; `null` removes both. See [Tools from your apps](https://vetta.sh/docs/capabilities/tools.md#tools-from-your-apps).

## delete

```ts theme={"system"}
client.apps.delete(id: string): Promise<Deleted>
```

`DELETE /v1/apps/{id}`. Tears down the hosting project and, for `fullstack`, the app database. Irreversible.

## deploy

```ts theme={"system"}
client.apps.deploy(id: string, files: Record<string, AppFile>, content_hash?: string): Promise<AppDeployment>
```

`POST /v1/apps/{id}/deployments`. `files` maps paths to base64 contents, or to `{ content, encoding: "utf8" }` for a text file sent as it is; the build runs asynchronously. `content_hash` is an opaque digest of `files` you compute (up to 128 characters). The platform stores it as sent, never checks it, and echoes it on every deployment read, so you can compare it against the newest deployment and skip uploading an unchanged site.

## redeploy

```ts theme={"system"}
client.apps.redeploy(id: string, fromDeployment: string): Promise<AppDeployment>
```

`POST /v1/apps/{id}/deployments` with `{ from_deployment }`. Ships one of the app's earlier deployments again, as a new deployment, from the files the platform kept — nothing is uploaded, so a site of any deployable size comes back. Poll [`deployments`](#deployments) as for `deploy`.

## deploymentFiles

```ts theme={"system"}
client.apps.deploymentFiles(id: string, deploymentId: string, query?: { encoding?: "base64" | "utf8" }): Promise<AppDeploymentFiles>
```

`GET /v1/apps/{id}/deployments/{deployment_id}/files`. The file map a deployment shipped: `{ object: "app_deployment_files", deployment_id, files }`, path → base64; with `encoding: "utf8"` each text file comes back as `{ content, encoding: "utf8" }`. `not_found` for a build made before files were kept.

## deployments

```ts theme={"system"}
client.apps.deployments(id: string, query?: { limit?: number }): Promise<Page<AppDeployment>>
```

`GET /v1/apps/{id}/deployments`. Non-terminal builds advance on read.

## setSecret

```ts theme={"system"}
client.apps.setSecret(id: string, body: { name: string; value: string }): Promise<AppSecret>
```

`POST /v1/apps/{id}/secrets`. Write-only: the value never comes back on any read. Overwrites an existing name. The names the platform manages itself — a `fullstack` app's `DATABASE_*` variables and `VETTA_MCP_TOKEN` (set through [`update`](#update)'s `mcp`) — are refused `forbidden`.

## secrets

```ts theme={"system"}
client.apps.secrets(id: string): Promise<{ object: "list"; data: AppSecret[] }>
```

`GET /v1/apps/{id}/secrets` — names and timestamps only, never values.

## deleteSecret

```ts theme={"system"}
client.apps.deleteSecret(id: string, name: string): Promise<{ object: "app_secret"; name: string; deleted: boolean }>
```

`DELETE /v1/apps/{id}/secrets/{name}`. A platform-managed name (see [`setSecret`](#setsecret)) is refused `forbidden`.

## connectDomain

```ts theme={"system"}
client.apps.connectDomain(id: string, domainId: string): Promise<AppDomain>
```

`POST /v1/apps/{id}/domains`. The domain must already exist at [`client.domains`](https://vetta.sh/docs/sdk/domains); connecting is pointing, never registering.

## domains

```ts theme={"system"}
client.apps.domains(id: string): Promise<{ object: "list"; data: AppDomain[] }>
```

`GET /v1/apps/{id}/domains`.

## disconnectDomain

```ts theme={"system"}
client.apps.disconnectDomain(id: string, domain: string): Promise<{ object: "app_domain"; domain: string; deleted: boolean }>
```

`DELETE /v1/apps/{id}/domains/{domain}` — by domain name.

## entry

```ts theme={"system"}
client.apps.entry(id: string): Promise<{ object: "app_entry"; url: string; ticket: string }>
```

`POST /v1/apps/{id}/entry`. A one-click way into an app whose operator gate the platform generated. Answers a `ticket` valid for two minutes, never the app's token: POST it to `url` as a form field from the operator's browser, and never put it in a query string.

## permissions

```ts theme={"system"}
client.apps.permissions(id: string): Promise<{ object: "app_permissions"; app_id: string; scopes: string[] }>
```

`GET /v1/apps/{id}/permissions`. What the app's own key may do: its scopes, never the key.

## access

```ts theme={"system"}
client.apps.access(id: string): Promise<{ object: "app_access"; url: string | null; password: string | null }>
```

`GET /v1/apps/{id}/access`. How a person gets into the app without the Studio: its URL and its generated `DASHBOARD_PASSWORD` — `null` until one is provisioned. An audited reveal; hand the value to a person, never put it in a URL or a log.

## rotateAccess

```ts theme={"system"}
client.apps.rotateAccess(id: string): Promise<{ object: "app_access"; url: string | null; password: string | null }>
```

`POST /v1/apps/{id}/access`. Regenerates the password **and** the `DASHBOARD_TOKEN`, and answers the new password. Rotating is revoking: every browser already signed in is signed out.

## query

```ts theme={"system"}
client.apps.query(id: string, query: string): Promise<{ object: "app_db_result"; rows: unknown[]; row_count: number }>
```

`POST /v1/apps/{id}/db/query`. `fullstack` apps only; a `frontend_only` app answers `feature_not_configured`. The database as a whole — tables, a REST facade over them, migrations, and this same query without naming the app — is [`client.database`](https://vetta.sh/docs/sdk/database).

## installs.apply

```ts theme={"system"}
client.apps.installs.apply(body: InstallApply): Promise<BlueprintInstall>
```

`POST /v1/blueprints/installs`. Records one applied declaration for a project — with what, by whom, and against which revision — and, when you name a published pair instead of sending one, performs the apply too.

Sending a `declaration` records only, and that is the right shape for this client: you reconciled it yourself, which is the upsert-by-name every other method here performs, so `report` comes back `null`. Omitting the declaration and naming a published `blueprint` and `template` asks the server to reconcile the catalog's bytes for you, as you, and `report` is what that run did — one line per resource, refusals included.

`expected_revision` is [`expected_version`](https://vetta.sh/docs/api/agents) copied: omit it for a deliberate unconditional apply, or send the revision you believe you are moving from and a mismatch is refused `revision_conflict`, whose message names the paths at which the stored declaration and yours disagree. Send `0` to create: a project that already exists is refused rather than re-applied.

`selection: { agents: string[]; apps: string[] }` names which of the template's crew this apply provisions; omit it and the whole crew is. A deselected agent is not created, its schedules are not armed and its intake does not open; one that already exists is left running, and the report names it under `deselected` — apart from `skipped`, because a choice is not a failure. A selection that leaves out a `required` agent or app is refused `validation_failed`, naming every missing one. The install stores the `selection` it was applied with (`null` for everything, and for every install written before the field existed). See [Templates](https://vetta.sh/docs/concepts/templates.md).

## installs.list

```ts theme={"system"}
client.apps.installs.list(query?: { project?: string; limit?: number; after?: string }): Promise<Page<BlueprintInstall>>
```

`GET /v1/blueprints/installs`. Every install in the organization, most recently applied first; `project` narrows it to one project's.

## installs.update

```ts theme={"system"}
client.apps.installs.update(id: string, body: { answers: Record<string, unknown> }): Promise<BlueprintInstall>
```

`PATCH /v1/blueprints/installs/{id}`. Rewrites the setup answers of an applied install — the whole map, not a merge, so send every answer you mean to keep. Each key must be a question the install's artifact declares, and each value a string or a list of strings; anything else is refused `validation_failed`. The install's `context_updated_at` moves and its `revision` does not: an answer edit is not an apply, re-provisions nothing and briefs no agent again. The crew reads the new answer through [`installs.context`](#installscontext) the next time it looks.

## installs.context

```ts theme={"system"}
client.apps.installs.context(id: string): Promise<ProjectContext>
```

`GET /v1/blueprints/installs/{id}/context`. What the crew of this install knows about the business: `{ object: "project_context", project, blueprint, template, artifact_version, answers: { key, label, value }[], apps: { name, url }[], agents: { name, role }[], updated_at }`, derived from the install and its report — the answers as the artifact's questions label them, the apps with the URL each is served at, the agents with the role each was declared with. It is the same object a template agent reads through its built-in `project_context` tool.

## installs.remove

```ts theme={"system"}
client.apps.installs.remove(id: string): Promise<{ id: string; object: string; deleted: boolean }>
```

`DELETE /v1/blueprints/installs/{id}`. Takes a template out of the company: its agents are fired (their timers stop, their open cards lose their name), its unfinished board tasks and its mini apps go, and the install is deleted. Its apps, personas, skills, files and chats stay. Nothing is refunded or charged. Only the owner's own sign-in may call it; an API key is refused `forbidden`. A second call is `not_found`.

## installs.preview

```ts theme={"system"}
client.apps.installs.preview(query: { blueprint: string; template: string; project: string }): Promise<InstallPreview>
```

`GET /v1/blueprints/preview`. What applying a published pair as a new project would call its agents, apps and personas here: `{ object: "install_preview", project, blueprint, template, artifact_version, name_prefix, agents, apps, identities }`. `name_prefix` is `"<project>-"` when any declared name is already taken in the organization, and every name then carries it. Writes nothing.

## artifacts.list

```ts theme={"system"}
client.apps.artifacts.list(query?: {
  blueprint?: string; template?: string; version?: string; limit?: number; after?: string;
}): Promise<Page<BlueprintArtifact> & { skipped: number }>
```

`GET /v1/blueprints/artifacts`. The published catalog, newest release first — every blueprint × template that can be run, carrying the setup questions to ask first, the crew and the apps it provisions, and the timers it runs. `version` narrows it to that one release.

The catalog belongs to no organization: it is the same list for everybody, and nothing a customer writes reaches it. Applying one of these rows sends its `blueprint` and `template` in place of a `declaration`, which the catalog holds server-side.

## artifacts.get

```ts theme={"system"}
client.apps.artifacts.get(blueprint: string, template: string): Promise<BlueprintArtifact>
```

`GET /v1/blueprints/artifacts/{blueprint}/{template}`. One listing, the newest listed release of that pair. It needs no key: a maker's share link shows what it sells before the buyer signs up. A pair that is not listed is `404 not_found`.

## companyTemplates.draft

```ts theme={"system"}
client.apps.companyTemplates.draft(body?: { project?: string }): Promise<CompanyTemplateDraft>
```

`POST /v1/company_templates/draft`. "Duplicate this company": exports the crew and rewrites its company specifics into a draft declaration. A metered model call.

## companyTemplates.create

```ts theme={"system"}
client.apps.companyTemplates.create(body: { name: string; project?: string; declaration: CompanyTemplateDraft["declaration"] }): Promise<BlueprintArtifact>
```

`POST /v1/company_templates`. Saves a draft a person approved as a **private** template of this organization. Install it with `installs.apply({ blueprint, template, project, expected_revision: 0 })`; no other organization can.

## companyTemplates.list

```ts theme={"system"}
client.apps.companyTemplates.list(query?: { template?: string; limit?: number; after?: string }): Promise<Page<BlueprintArtifact> & { skipped: number }>
```

`GET /v1/company_templates`. This organization's private templates, as catalog rows.

## listings.checks

```ts theme={"system"}
client.apps.listings.checks(query?: { project?: string }): Promise<ListingChecks>
```

`GET /v1/listings/checks`. What listing the company in the marketplace would send — the changes made, anything refused, and every word that would be listed. A refusal in a Playbooks doc carries the doc's `file_id` and the `line` to edit. Read only: a listing is posted from chat, not from the SDK, and a person's yes to it is refused while any refusal is left.

## listings.seller

```ts theme={"system"}
client.apps.listings.seller(): Promise<ListingSeller>
```

`GET /v1/listings/seller`. Where the signed-in person stands as a seller. Anyone may submit a listing, and Naive reviews every one; the first is the person's application. `state` is `none`, `pending` (an application in review), `rejected`, `approved` (a creator) or `suspended`. While it is `none` or `rejected`, the listing card asks for the application and its yes sends it. `message` is what a listing is refused with, set only when `suspended`. `note` is the reviewer's note on a rejected application, and `application` its `display_name`, `pitch` and `links`, so the card's fields start from them; `null` in every other state. A signed-in person only; an API key is `forbidden`.

## listings.apply

```ts theme={"system"}
client.apps.listings.apply(body: { display_name: string; pitch: string; links: string[] }): Promise<ListingSeller>
```

`POST /v1/listings/seller`. A seller with no listing, who sells services, applies with the same form as a first listing: `display_name` (1–80), a `pitch` of 80–2000 characters, and 1–5 `https://` `links`. It joins the same review, and answers where the person now stands (`pending`). Once Naive approves them, their company's profile is listed in Hire a creator while it takes on projects. `state_conflict` while one is in review, once approved and when suspended. A signed-in owner or admin only; anyone else, an API key included, is `forbidden`.

## listings.list

```ts theme={"system"}
client.apps.listings.list(): Promise<OwnListings>
```

`GET /v1/listings`. The company's own marketplace listings, newest first, each with its review `status`, whether it was `taken_down`, and its `state` in one word (`listingState`). `balance_micro_usd` is what they earned and not yet paid out, and `ready_micro_usd` the part a payout would send now; both are `null` for a key without `billing:read`.

## profile.get

```ts theme={"system"}
client.apps.profile.get(): Promise<CreatorProfile>
```

`GET /v1/listings/profile`. The company's public profile, which its listed templates credit: `handle`, `name`, `description`, `avatar_url` and `verified`.

## profile.update

```ts theme={"system"}
client.apps.profile.update(body: {
  name?: string;
  description?: string;
  avatar?: { content_type: "image/png" | "image/jpeg" | "image/webp"; data: string } | null;
  available_for_projects?: boolean;
  project_from_usd?: number | null;
  services?: { id?: string; title: string; summary: string; kind: ServiceKind; price_from_usd: number; delivery_days: number | null }[];
}): Promise<CreatorProfile>
```

`PATCH /v1/listings/profile`. `name` is 1–60 characters and `description` at most 280. `avatar` is a base64 picture of at most 512 KiB, and `null` removes it. `available_for_projects` says whether the company takes on projects, and `project_from_usd` is its starting price in whole dollars (1–100000; `null` removes it). `services` is the whole list of what it sells, at most 6, in the order shown, and replaces the one stored: `title` 1–60 characters, `summary` 1–160, `kind` one of `ads`, `websites`, `video`, `design`, `content`, `automation` or `other`, `price_from_usd` its starting price in whole dollars (1–100000), and `delivery_days` (1–365) or `null`. A service sent without an `id` is new and gets one (6–12 lowercase letters and digits); send it back with its `id` to keep it. Only a signed-in owner or admin may update the profile; anyone else, an API key included, is `forbidden`.

## profile.hire

```ts theme={"system"}
client.apps.profile.hire(handle: string, brief: {
  service?: string;
  timing: "asap" | "month" | "later";
  budget: string;
  suggest_budget?: boolean;
  description: string;
  need?: "set_up" | "customise" | "new_company" | "other";
}): Promise<ProjectRequest>
```

`POST /v1/creators/{handle}/project-requests`. Sends a short brief to a profile that takes on projects. `service` is the `id` of one of the profile's services, or absent for something else; one it does not sell is `validation_failed` on `service`. `budget` is at most 40 characters and may be empty; `suggest_budget: true` asks the creator to suggest one, and then `budget` is empty. `description` is 50–500 characters. `need` is optional, from an older form. The profile's owner sees the brief with the sender's sign-in email and replies by email; no payment passes through Naive. A signed-in person only, with a proved email: an API key or an agent is `forbidden`. `state_conflict` when the profile is not taking projects or is the sender's own, `not_found` for no such handle, and `rate_limited` past 10 briefs a day.

## profile.directory

```ts theme={"system"}
client.apps.profile.directory(): Promise<{ creators: PublicCreator[] }>
```

`GET /v1/creators`. Hire a creator: the makers a stranger may hire. Each is `handle`, `name`, `avatar_url`, `verified`, `description`, `available_for_projects`, `project_from_usd`, `services` and `template_count`, its listings in the Marketplace. A maker is listed with at least one listing, or while it takes on projects once Naive has reviewed its seller. Those taking projects come first, then by listings, then by name; at most 200. Public fields only. Any credential reads it, an API key included.

## profile.requests.list

```ts theme={"system"}
client.apps.profile.requests.list(): Promise<{ data: ProjectRequest[]; has_more: boolean; next_cursor: string | null }>
```

`GET /v1/listings/project-requests`. The briefs sent to the company's profile, newest first: `service_id` and `service_title` (the service as it was titled when sent, or `null`), `need` (`null` unless an older form sent one), `timing`, `budget`, `suggest_budget`, `description`, `sender_email`, `created_at`, and `read_at` (`null` while new). Only a signed-in owner or admin; anyone else is `forbidden`.

## profile.requests.read

```ts theme={"system"}
client.apps.profile.requests.read(id: string): Promise<ProjectRequest>
```

`POST /v1/listings/project-requests/{id}/read`. Marks one brief read. A second call keeps the first time. `not_found` when it was not sent to this company.

## freeSite.get

```ts theme={"system"}
client.apps.freeSite.get(): Promise<{ object: "free_site"; app_id: string | null; live: boolean; show_email: boolean; pending: boolean; comes_down_at: string | null; design: string | null; preview_url: string | null }>
```

`GET /v1/free-site`. The site Start put live for free (ADR-2161): its app, whether it is up, whether its page shows an owner's email, whether a change is `pending` (saved past today's deploys before the plan, or still to land), and `comes_down_at`, when it comes down unless the team starts (`null` while the company is usable). A company with none answers `app_id: null`. For an agency company whose plan is active, `design` names the pre-made design its site is filled from, and `preview_url`, while that site waits on the owner's first publish, is its unlisted preview (`GET /v1/free-site/preview/{token}/`, out of search). Once published, its contact form posts to `POST /v1/free-site/inquiries/{app_id}`, which takes messages from the site's own pages only and files each one in the CRM as a `talking` contact with the visitor's note.

## freeSite.update

```ts theme={"system"}
client.apps.freeSite.update(body: { show_email: boolean }): Promise<{ object: "free_site"; app_id: string | null; live: boolean; show_email: boolean; pending: boolean; comes_down_at: string | null; design: string | null; preview_url: string | null }>
```

`PATCH /v1/free-site`. Whether the built-in page shows the caller's own email. Only a signed-in owner may change it; anyone else is `forbidden`, and a company with no free site is `not_found`. Before the plan a company gets 5 site deploys a day, in its own timezone; past that the change is saved and `pending` is `true` until it goes live.

## freeSite.publish

```ts theme={"system"}
client.apps.freeSite.publish(): Promise<{ object: "free_site"; app_id: string | null; live: boolean; show_email: boolean; pending: boolean; comes_down_at: string | null; design: string | null; preview_url: string | null }>
```

`POST /v1/free-site/publish`. Puts the agency site live in place of the built-in page, at the same address and under the same rules. Only a signed-in owner may publish it; anyone else is `forbidden`. With no site waiting it is `not_found`, and while no email is shown it is `validation_failed` on `show_email`, since the site's buttons email the owner.

## earnings.setUpPayouts

```ts theme={"system"}
client.apps.earnings.setUpPayouts(body?: { country?: string }): Promise<{ object: "earnings_payout_account"; ready: boolean; onboarding_url: string | null }>
```

`POST /v1/earnings/payouts/account`. Where the company's marketplace earnings are paid. The owner, signed in, opens `onboarding_url` until `ready` is `true`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.