> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended**:
> ```bash
> npx @scalekit-inc/cli setup
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for 40+ agents.
> Features: full-stack-auth, agent-auth, mcp-auth, modular-sso, modular-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Organizations

Manage your customer organizations
<div class="sdk-client-page">

Use `scalekitClient.organizations()` to create and manage customer tenants (organizations) in your Scalekit application.

Start here when onboarding a new customer: create an organization, set external IDs and branding, then add users and SSO for that org.

### create
<div class="sdk-method-section">
  
    
      

      Runs `create` and returns the result.

      
        Fields to update.
      
      
        The created resource.
      

```java wrap showLineNumbers=false
// displayName: Display name
// metadata: Custom key-value metadata

CreateOrganization req = CreateOrganization.newBuilder()
  .setName("Acme Corporation")
  .build();

Organization org = scalekitClient.organizations().create(req);
```

    
  
</div>

### getById
<div class="sdk-method-section">
  
    
      

      Runs `getById` and returns the result.

      
        Resource ID.
      
      
        The response payload for this operation.
      

```java wrap showLineNumbers=false
scalekitClient.organizations().getById("org_123");
```

    
  
</div>

### getByExternalId
<div class="sdk-method-section">
  
    
      

      Runs `getByExternalId` and returns the result.

      
        External ID.
      
      
        The response payload for this operation.
      

```java wrap showLineNumbers=false
scalekitClient.organizations().getByExternalId("customer_123");
```

    
  
</div>

### updateById
<div class="sdk-method-section">
  
    
      

      Runs `updateById` and returns the result.

      
        Resource ID.
      
      
        Fields to update.
      
      
        The updated resource.
      

```java wrap showLineNumbers=false
// displayName: Display name
// metadata: Custom key-value metadata

UpdateOrganization req = UpdateOrganization.newBuilder()
  .setName("Acme Corp (Updated)")
  .build();

scalekitClient.organizations().updateById("org_123", req);
```

    
  
</div>

### updateByExternalId
<div class="sdk-method-section">
  
    
      

      Runs `updateByExternalId` and returns the result.

      
        External ID.
      
      
        Fields to update.
      
      
        The updated resource.
      

```java wrap showLineNumbers=false
// displayName: Display name
// metadata: Custom key-value metadata

UpdateOrganization req = UpdateOrganization.newBuilder()
  .setName("Acme Corp (Updated)")
  .build();

scalekitClient.organizations().updateByExternalId("customer_123", req);
```

    
  
</div>

### deleteById
<div class="sdk-method-section">
  
    
      

      Runs `deleteById` and returns the result.

      
        Resource ID.
      
      
        No return value
      

```java wrap showLineNumbers=false
scalekitClient.organizations().deleteById("org_123");
```

    
  
</div>

### deleteByExternalId
<div class="sdk-method-section">
  
    
      

      Runs `deleteByExternalId` and returns the result.

      
        External ID.
      
      
        No return value
      

```java wrap showLineNumbers=false
scalekitClient.organizations().deleteByExternalId("customer_123");
```

    
  
</div>

### listOrganizations
<div class="sdk-method-section">
  
    
      

      Runs `listOrganizations` and returns the result.

      
        Page size.
      
      
        Page token.
      
      
        Paginated organizations.
      

```java wrap showLineNumbers=false
scalekitClient.organizations().listOrganizations(20, "");
```

    
  
</div>

### generatePortalLink
<div class="sdk-method-section">
  
    
      

      Runs `generatePortalLink` and returns the result.

      
        Organization ID.
      
      
        Features.
      
      
        Authorization link.
      

```java wrap showLineNumbers=false

scalekitClient.organizations().generatePortalLink(
  "org_123",
  Arrays.asList(Feature.FEATURE_USERS, Feature.FEATURE_CONNECTIONS)
);
```

    
  
</div>

### updateOrganizationSettings
<div class="sdk-method-section">
  
    
      

      Runs `updateOrganizationSettings` and returns the result.

      
        Organization ID.
      
      
        Settings.
      
      
        The updated resource.
      

```java wrap showLineNumbers=false

scalekitClient.organizations().updateOrganizationSettings(
  "org_123",
  Collections.emptyList()
);
```

    
  
</div>

### upsertUserManagementSettings
<div class="sdk-method-section">
  
    
      

      Runs `upsertUserManagementSettings` and returns the result.

      
        Organization ID.
      
      
        Settings.
      
      
        Organization user management settings.
      

```java wrap showLineNumbers=false

OrganizationUserManagementSettings settings =
  OrganizationUserManagementSettings.newBuilder().build();

scalekitClient.organizations().upsertUserManagementSettings("org_123", settings);
```

    
  
</div>

### getOrganizationSessionPolicy
<div class="sdk-method-section">
  
    
      

      Runs `getOrganizationSessionPolicy` and returns the result.

      
        Organization ID.
      
      
        The response payload for this operation.
      

    
  
</div>

### updateOrganizationSessionPolicy
<div class="sdk-method-section">
  
    
      

      Runs `updateOrganizationSessionPolicy` and returns the result.

      
        Organization ID.
      
      
        Policy.
      
      
        The updated resource.
      

    
  
</div>

</div>


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
