---
editLink: false
lastUpdated: false
outline: [2, 3]
---

<!-- Generated by python/b2c-tooling-sdk/scripts/generate_api_docs.py. Do not edit. -->

# b2c_tooling_sdk.operations.orgs

Account Manager organization management operations.

Mirrors `src/operations/orgs/index.ts`. Provides high-level functions for
managing organizations in Account Manager, including retrieving organization
details.

## Core Organization Functions

- [`get_org`](/python/api/operations/orgs#get-org) -- Get organization details by ID
- [`get_org_by_name`](/python/api/operations/orgs#get-org-by-name) -- Get organization details by name
- [`list_orgs`](/python/api/operations/orgs#list-orgs) -- List organizations with pagination

## Usage

```python
from b2c_tooling_sdk.operations.orgs import get_org, get_org_by_name, list_orgs
from b2c_tooling_sdk.clients import create_account_manager_orgs_client
from b2c_tooling_sdk.auth import OAuthStrategy

auth = OAuthStrategy(client_id="your-client-id", client_secret="your-client-secret")
client = create_account_manager_orgs_client(config, auth)

# Get an organization by ID
org = await get_org(client, "org-id")

# Get an organization by name
org = await get_org_by_name(client, "My Organization")

# List organizations
orgs = await list_orgs(client, ListOrgsOptions(size=25, page=0))
```
## Authentication

Organization operations require OAuth authentication with appropriate Account Manager permissions.

## Functions

### get_org {#get-org}

```python
async def get_org(client: AccountManagerOrgsClient, org_id: str) -> AccountManagerOrganization
```

Get an organization by ID.

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `client` | `AccountManagerOrgsClient` | Account Manager Organizations client. |
| `org_id` | `str` | Organization ID. |

**Returns:** Organization details.

**Raises**

- `RuntimeError` — If the organization is not found (404), authentication fails (401), permission is denied (403), or other request failures occur.

### get_org_by_name {#get-org-by-name}

```python
async def get_org_by_name(client: AccountManagerOrgsClient, name: str) -> AccountManagerOrganization
```

Get an organization by name.

Performs a case-sensitive prefix search using `startsWith`, filters to an
exact match if multiple results are found, and raises if ambiguous.

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `client` | `AccountManagerOrgsClient` | Account Manager Organizations client. |
| `name` | `str` | Organization name. |

**Returns:** Organization details.

**Raises**

- `RuntimeError` — If the organization is not found or if multiple organizations match the name.

### list_orgs {#list-orgs}

```python
async def list_orgs(client: AccountManagerOrgsClient, options: ListOrgsOptions | None = None) -> OrganizationCollection
```

List organizations with pagination.

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `client` | `AccountManagerOrgsClient` | Account Manager Organizations client. |
| `options` | `ListOrgsOptions \| None` | Pagination options. Set `all=True` to retrieve all organizations using the max page size of 5000. |

**Returns:** Paginated organization collection with pagination metadata (totalElements, totalPages, number, size).

## Re-exports

Also exported from this module; documented elsewhere:

- [`AccountManagerOrganization`](/python/api/clients#accountmanagerorganization)
- [`ListOrgsOptions`](/python/api/clients#listorgsoptions)
- [`OrganizationCollection`](/python/api/clients#organizationcollection)
