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

# orgs

> Organizations and their members — client.orgs.

Eight methods. API detail: [Organizations](/docs/api/organizations).

## list

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

`GET /v1/organizations` — the organizations this credential reaches. Orgless: it answers on a person session, which is what makes org switching possible.

## create

```ts theme={"system"}
client.orgs.create(body: { name: string }): Promise<CreatedOrganization>
```

`POST /v1/organizations`. The reply carries **two** objects: the organization and the first `admin` API key that opens it — `api_key.secret` is returned here and never again. A caller signed in as a person also becomes the founding `owner`.

## get

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

`GET /v1/organizations/{id}` — including `balance_micro_usd`, integer micro-USD.

## update

```ts theme={"system"}
client.orgs.update(id: string, body: { name: string }): Promise<Organization>
```

`PATCH /v1/organizations/{id}`.

## members

```ts theme={"system"}
client.orgs.members(id: string, query?: ListQuery): Promise<Page<Member>>
```

`GET /v1/organizations/{id}/members`, cursor-paginated.

## addMember

```ts theme={"system"}
client.orgs.addMember(id: string, body: { email: string; role: Role }): Promise<Member>
```

`POST /v1/organizations/{id}/members`. `Role` is `"owner" | "admin" | "member"`.

## setRole

```ts theme={"system"}
client.orgs.setRole(id: string, userId: string, role: Role): Promise<Member>
```

`PATCH /v1/organizations/{id}/members/{user_id}`, body `{ role }`. Recorded in the [audit log](/docs/sdk/audit-logs) as `member.role_changed`.

## removeMember

```ts theme={"system"}
client.orgs.removeMember(id: string, userId: string): Promise<Deleted>
```

`DELETE /v1/organizations/{id}/members/{user_id}`. **Removal does not cascade**: keys that member created keep working and their sessions keep running — revoke each one with [`keys.revoke`](/docs/sdk/keys#revoke), reading [`keys.list`](/docs/sdk/keys#list) first, since a key's `created_by` is the only record of who minted it.
