> ## 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.

# Organizations

> The billing entity that owns members, keys, and resources.

An **organization** is the top-level container and billing entity. It holds the [credit balance](https://vetta.sh/docs/api/credits.md), owns every agent, computer, skill, and file, and has **members** (users with a role) and **API keys** (programmatic access). Every request is scoped to exactly one organization via its [API key](https://vetta.sh/docs/api/authentication.md).

## The organization object

**id** `string`

Unique id (e.g. `org_01H...`).

**name** `string`

Display name.

**balance\_micro\_usd** `integer`

Current [credit balance](https://vetta.sh/docs/api/credits.md), in micro-USD.

**timezone** `string`

The company's timezone, an IANA name such as `America/New_York` (every company starts there). A [deployment](https://vetta.sh/docs/api/deployments.md) created without a `timezone` takes this one, and the studio says when a post goes out in it.

**logo\_svg** `string | null`

The company's logo, an SVG (see [The logo](#the-logo)); `null` until one is set. The studio shows it in its top-left corner and in its apps.

**always\_allowed** `string[]`

The company's "Always allow" rules: tools its agents run without asking, in every chat. An owner or admin adds one from an approval card (`scope: "company"` on a [tool confirmation](https://vetta.sh/docs/api/sessions.md)). Empty until then.

**always\_allowed\_by** `object`

Who added a rule, by rule, where it was not a person's card: `backfill:existing` for one kept on so a company's running schedules kept making media without asking. Empty when every rule came from a card. Removing the rule removes its entry.

**brand** `object | null`

The company's brand kit (see [The brand kit](#the-brand-kit)): `{ palette, typeface, tagline }`; `null` until one is set. Whoever makes things in the company's look reads it.

**setting\_up** `boolean`

`true` while the company is being set up: `stage` is `draft`. It turns `false` the first time the plan reads active and never back, even if the plan later lapses.

**stage** `string`

Where the company is in its life: `draft` (made in a chat with its CEO, not yet activated by a paid [plan](https://vetta.sh/docs/api/credits.md)), `unpaid` (made with a key, never activated), `active` (activated) or `lapsed` (activated, then its plan ended). A first checkout that expires unpaid leaves a `draft` a `draft`. Whether the plan can be used right now is `state` and `active`.

**state** `string`

The company's state, on a read of one organization (`GET` and `PATCH`): `setting_up`, `held`, `trialing`, `canceling`, `active`, `grace`, `stale` or `locked`. The same field, by the same rule, as on the [plan](https://vetta.sh/docs/api/credits.md#reading-the-plan). Not on lists.

**active** `boolean`

Whether the company can be used right now, beside `state`. Not on lists.

**can\_switch\_template** `boolean`

On a read of one organization (`GET` and `PATCH`): whether a `template` you name at [Set up a company](#set-up-a-company) from here fills this company in place. `true` only for the signed-in person who made it there, while it is a `draft` and they are still its `owner`; `false` for anyone else, an API key or an agent. Not on lists.

**start\_template** `string | null`

The `blueprint/template` a link named when the company was made (see [Set up a company](#set-up-a-company)); `null` otherwise.

**sells** `boolean`

Made from a creator link, to sell the creator's own playbook (see [Set up a company](#set-up-a-company)); `false` otherwise.

**ceo\_agent\_id** `string | null`

The company's CEO: the one agent whose turns are given the control plane. Made by [Get the CEO](#get-the-ceo), or when the company is activated; also recorded when an admin binds this API's `/v1/mcp` to an agent in the "Orchestrator control plane" vault (see [Vaults](https://vetta.sh/docs/api/vaults.md)). `null` while there is none, or after the CEO is deleted.

**created\_at** `string`

Creation timestamp.

## Create an organization

`POST /v1/organizations` → `201 Created`

The only write that is **not** scoped to an organization — it is how an existing caller gets *another* one. Authenticate with either an `admin` [API key](https://vetta.sh/docs/api/authentication.md) or a signed-in user session; an unauthenticated call is refused with `401`. Your first organization comes from signing up, not from this route.

**name** `string` *required*

Display name for the organization.

**referral\_code** `string`

A creator's referral code, accepted from a signed-in user session only. Attributes the new organization to that creator; a code that cannot be honoured is ignored and the organization is still created.

```bash theme={"system"}
curl -fsSL https://api.vetta.sh/v1/organizations \
  -H "authorization: Bearer sk_live_..." \
  -H "content-type: application/json" \
  -d '{ "name": "Acme" }'
```

```json Response theme={"system"}
{
  "organization": { "id": "org_01H8AA...", "object": "organization", "name": "Acme", "balance_micro_usd": 0, "created_at": "2026-08-20T17:00:00Z" },
  "api_key": { "id": "key_01H8AB...", "object": "api_key", "name": "Acme", "prefix": "sk_live_9f2c", "scopes": ["admin"], "org_id": "org_01H8AA...", "mode": "live", "secret": "sk_live_9f2c...redacted", "created_at": "2026-08-20T17:00:00Z" }
}
```

The reply carries **two** objects: the organization and the first `admin` key that opens it, whose `secret` is returned here and never again. A caller signed in as a person also becomes the founding `owner`.

For a signed-in person whose only company is the one [being set up](#set-up-a-company) for them when they confirmed their email, the first create takes that company if nothing has touched it yet (still "New company", no template, no CEO chat, no key): it is renamed to `name` and returned with whatever setup credit it was given, still `setting_up` until its plan is paid. Otherwise a new organization is made. An API key's create always makes a new one.

## Set up a company

`POST /v1/organizations/setup` → `201 Created`

A new company for a **signed-in person** to set up. It is made unnamed ("New company"), live, with them as its `owner`, and it is set up in a chat with its CEO before it is paid for. Every call makes a new company: a company the person is already setting up is never answered again, and stays in their list as it was. (The dashboard calls this for New company and for every Deploy.) One exception: a call that names a `template` from a company the person made and still owns, that is not locked and runs no team yet (paid or not; only a company still being set up takes another company's paid listing), answers that company (`200 OK`, no second setup credit), so the template is set up there. A team is an install that is not failed, not an app on its own and not that same listing held for checkout, or a hired agent beside the CEO. A company whose team is hired always gets a new one. It mints no API key. An API key, or a call with no session, is refused with `403` or `401`.

**template** `string`

The `blueprint/template` a link named, such as `media/faceless`, stored as the new company's `start_template`. Anything that is not two lower-case names joined by `/` is `400 validation_failed`.

**sells** `boolean`

`true` from a creator link: stored as `sells`, so the dashboard brings the creator back to their playbook until the company is set up.

**referral\_code** `string`

A creator's referral code, as on [create](#create-an-organization).

```json Response theme={"system"}
{ "organization": { "id": "org_01H8AA...", "object": "organization", "name": "New company", "balance_micro_usd": 1000000, "timezone": "America/New_York", "logo_svg": null, "brand": null, "setting_up": true, "start_template": "media/faceless", "sells": false, "created_at": "2026-09-30T17:00:00Z" } }
```

**Before it is activated**, the company runs on one-time free credits it is given here (5,000 credits): its CEO chat, its crew, images and the rest, every text model on `vetta/auto`. When the credits cannot cover a call, the call is refused with `subscription_required` (402). The credit is **once per person, on their first company**: any later company, under the same address or another spelling of it (a `+tag`, or Gmail's dots), gets none, whether the first is still being set up or was paid for. A company being set up cannot [top up](https://vetta.sh/docs/api/credits.md#top-up) (`402`); its next step is the plan. A template set up in that chat is built at once on the free credits; a paid listing waits for the checkout that pays for it ([installs](https://vetta.sh/docs/api/apps.md)).

## List, retrieve & update

```bash theme={"system"}
GET   /v1/organizations         # list the orgs the caller belongs to
GET   /v1/organizations/{id}    # retrieve
```

`GET /v1/organizations` is **orgless** — it answers on a user session rather than an org-scoped key, which is what makes org switching possible. See [Authentication](https://vetta.sh/docs/api/authentication.md).

```json Response theme={"system"}
{ "id": "org_01H8AA...", "object": "organization", "name": "Acme", "balance_micro_usd": 48250000, "timezone": "America/New_York", "logo_svg": null, "brand": null, "setting_up": false, "state": "active", "active": true, "start_template": null, "sells": false, "created_at": "2026-08-20T17:00:00Z" }
```

### Update an organization

`PATCH /v1/organizations/{id}`

**name** `string`

New display name.

**timezone** `string`

New timezone, an IANA name (`America/Los_Angeles`). It is stored under its canonical name (`US/Eastern` is kept as `America/New_York`). An abbreviation (`EST`), an offset (`+05:00`) or a name the platform does not know is `400 validation_failed` on `timezone`. Only the fields you send are changed: a rename leaves the timezone as it is.

**logo\_svg** `string | null`

A new logo, as SVG text; `null` removes it. It is stored trimmed, with `xmlns="http://www.w3.org/2000/svg"` added to the root when it has none. A logo the rules below refuse is `400 validation_failed` on `logo_svg`, and the message says what to change.

**always\_allowed** `object`

`{ "remove": ["apps deploy"] }`: the rules to remove, by name. A rule the company does not hold is ignored, and rules not named are kept. A rule is only ever added from its approval card.

**brand** `object | null`

A new brand kit; `null` removes it. See [The brand kit](#the-brand-kit). A kit that does not match it exactly is `400 validation_failed` on `brand`.

Send at least one of them. Only the fields you send are changed. Returns the updated organization object. A company [being set up](#set-up-a-company) can be updated too: its CEO names it and sets its logo and brand kit before it is activated.

### Delete an unused draft company

`DELETE /v1/organizations/{id}`

Soft-deletes an unused draft company (`stage = "draft"`, never activated, no subscription) owned by the signed-in caller, freeing a slot under the per-person company limit (1 unconfirmed, 3 with no paid plans, 5 with 1 active paid non-trial plan, and +1 for each additional paid company). Deleting a draft never resets one-time setup credits, free-site claims, or trial eligibility. Returns `{ "id": "org_...", "object": "organization", "deleted": true }`. Attempting to delete an activated or paid company answers `409 state_conflict`.

### Get the CEO

`POST /v1/organizations/{id}/ceo` (scope `agents:write`)

Returns the company's CEO, an [agent](https://vetta.sh/docs/api/agents.md), making it first if the company has none: its prompt, its tools and this API's own `/v1/mcp`, bound to it in the "Orchestrator control plane" vault. While the company is a `draft` its tools are setup's. A live agent tagged `metadata.role` `orchestrator`, or already bound as the CEO, is adopted rather than a second one made; an agent bought from the Marketplace never is. When an agent of yours already holds the name `CEO`, it is left alone and the new CEO is named `Company CEO`. Calling it again returns the same CEO; an `admin` caller's call also brings its wiring up to date, keeping a grant a person made. A company made with a key gets its CEO here or when its plan is activated.

### The logo

A logo is one `<svg>` element that the platform checks before it stores it. The check is an allow-list:

* At most 16 KB, and exactly one root `<svg>` with a `viewBox` of four numbers. No nested `<svg>`.
* Elements: `svg`, `g`, `path`, `rect`, `circle`, `ellipse`, `line`, `polyline`, `polygon`, `defs`, `linearGradient`, `radialGradient`, `stop`, `title`, `desc`, `clipPath`, `mask`. `<title>` and `<desc>` hold words only. Anything else is refused, including `<text>` (draw letters as paths), `<image>`, `<use>`, `<style>`, `<script>`, `<a>` and animation.
* Attributes: geometry and presentation only (`viewBox`, `xmlns`, `width`, `height`, `x`…`y2`, `cx`, `cy`, `r`, `rx`, `ry`, `d`, `points`, `fill`, `stroke` and its `stroke-*` family, `opacity`, `fill-opacity`, `fill-rule`, `clip-rule`, `transform`, `offset`, `stop-color`, `stop-opacity`, `gradientUnits`, `gradientTransform`, `id`, `clip-path`, `mask`, `preserveAspectRatio`, `fx`, `fy`, `spreadMethod`, `role`, `aria-hidden`). Every value is quoted. No `on…` handlers, `href`, `style` or `class`.
* A value holds numbers, names, `#colours` and `url(#id)` only: no other `url(…)`, no `javascript:`, `data:` or `http`, no entities, and no `<`.
* No comments, CDATA, DOCTYPE, entities or processing instructions.

An agent can set the logo too, with the [`company.set_logo`](https://vetta.sh/docs/capabilities/tools#company-settings-tools) tool. It passes the same check.

### The brand kit

The company's look, beside its logo: a palette, a typeface and a tagline.

**palette** `object[]`

3 to 6 colours, each `{ name, hex }`: a name of 1–24 characters and a lower-case `#rrggbb`.

**typeface** `string`

`grotesk`, `serif`, `rounded` or `mono`.

**tagline** `string`

One line of up to 80 characters; `""` for none.

```json theme={"system"}
{ "palette": [{ "name": "Ink", "hex": "#1b1f3a" }, { "name": "Tide", "hex": "#2f6fdf" }, { "name": "Foam", "hex": "#eef3fb" }], "typeface": "grotesk", "tagline": "Small-batch bread, daily." }
```

No other field is accepted. An agent sets it with [`company.set_brand`](https://vetta.sh/docs/capabilities/tools#company-settings-tools), which builds the palette from one colour.

## Members

Users belong to an organization with a role that controls what they can do.

| Role | Can do |
| - | - |
| `owner` | Everything, including deleting the org. Only a signed-in owner can make, change or remove an owner, and a company keeps at least one owner who has joined. |
| `admin` | Everything else: members, keys, billing, agents and computers. |
| `member` | Create and run agents within the org's resources, and connect their own agent. |

### The member object

**id** `string`

Member id (e.g. `usr_01H...`). It is the id the member routes address and the id the [audit log](https://vetta.sh/docs/api/audit-logs.md) records as the actor.

**email** `string`

The member's email address.

**role** `string`

`owner | admin | member`.

**invited\_by** `string | null`

Id of the member who invited them; `null` for the founding owner.

**created\_at** `string`

When the member joined the organization.

### List members

`GET /v1/organizations/{id}/members` — cursor-paginated. See [Pagination](https://vetta.sh/docs/api/pagination.md). Readable before the organization has a [plan](https://vetta.sh/docs/api/credits.md), so you can find its owner before paying; adding, changing and removing members need one.

```json Response theme={"system"}
{
  "data": [
    { "id": "usr_01H...", "email": "owner@acme.com", "role": "owner", "invited_by": null, "created_at": "2026-06-01T09:00:00Z" },
    { "id": "usr_01H...", "email": "alice@acme.com", "role": "admin", "invited_by": "usr_01H...", "created_at": "2026-08-20T17:00:00Z" }
  ],
  "has_more": false,
  "next_cursor": null
}
```

### Add a member

`POST /v1/organizations/{id}/members`

**email** `string` *required*

Email address to invite.

**role** `string` *required*

`owner | admin | member`.

```bash theme={"system"}
curl -fsSL https://api.vetta.sh/v1/organizations/org_01H8AA.../members \
  -H "authorization: Bearer sk_live_..." \
  -H "content-type: application/json" \
  -d '{ "email": "alice@acme.com", "role": "admin" }'
```

```json Response theme={"system"}
{ "id": "usr_01H9JJ...", "object": "member", "email": "alice@acme.com", "role": "admin", "invited_by": "usr_01H...", "joined_at": null, "invite_sent": true, "created_at": "2026-08-20T17:00:00Z" }
```

This emails them a link. `joined_at` stays `null` until they first sign in. `invite_sent: false` means the email could not go, so tell them yourself.

* Adding an `owner` needs a signed-in owner, once the company has an owner who has joined.
* An address already here with the same role answers `200` and emails again. With another role it answers `400`: use the route below.
* A company can send 50 invites a day, counting those. Past that it answers `403`.

### Update a member's role

`PATCH /v1/organizations/{id}/members/{member_id}`

**role** `string` *required*

`owner | admin | member`.

### Remove a member

`DELETE /v1/organizations/{id}/members/{member_id}`

Both mutations are recorded in the [audit log](https://vetta.sh/docs/api/audit-logs.md) as `member.role_changed` and `member.removed`, attributed to the acting principal.

> [!WARNING]
>
> **Removal revokes what answers to them.** The API keys and MCP sessions the member made stop working, including keys those keys made and keys they took over by rotating, and their [connected agents](https://vetta.sh/docs/api/mcp-sessions.md#connect-your-own-agent) go. That includes a founder's first key, so replace any key your CI uses first. Moving an owner or admin down to `member` revokes the same keys and sessions, and leaves connected agents. An app's own key stays, and so do running sessions, webhooks, deployments and vault credentials.

## API keys

Programmatic access uses org-scoped API keys, managed under `/v1/api_keys`. For creation, scopes, and rotation, see [Authentication](https://vetta.sh/docs/api/authentication.md).

```bash theme={"system"}
POST   /v1/api_keys              # create
GET    /v1/api_keys              # list (cursor-paginated)
POST   /v1/api_keys/{id}/rotate  # rotate
DELETE /v1/api_keys/{id}         # revoke
```

> [!WARNING]
>
> Only `owner` and `admin` members (or a key with the `admin` scope) can manage members and API keys.

> [card] [Credits & billing](https://vetta.sh/docs/api/credits.md)
>
> The org's credit balance, ledger, and top-ups.


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