> **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/)

---

# M2M clients

Machine-to-machine clients and tokens
<div class="sdk-client-page">

Use the M2M client on `scalekit_client` to create and manage machine-to-machine OAuth clients and secrets for service-to-service auth.

Create an M2M client, store the secret securely, then obtain tokens with client credentials.

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

      Method to list organization clients

      
        Organization id to list clients for
      
      
        Optional. Page size for pagination (between 10 and 100)
      
      
        Optional. Page token for pagination
      
      
        List Organization Clients Response
      

```python wrap showLineNumbers=false
response = scalekit_client.m2m_client.list_organization_clients(
    'org_123456',
    page_size=50
)

for client in response[0].clients:
    print(f'Client: {client.id}')
```

    
  
</div>

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

      Method to get organization client

      
        organization id
      
      
        client id
      
      
        The response payload for this operation.
      

```python wrap showLineNumbers=false
response = scalekit_client.m2m_client.get_organization_client(
    'org_123456',
    'client_123456'
)
```

    
  
</div>

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

      Method to create organization client

      
        Organization Id to create client for
      
      
        OrganizationClient obj with desired client properties.
      
      
        Create Organization Client Response
      

```python wrap showLineNumbers=false
from scalekit.v1.clients.clients_pb2 import OrganizationClient

client = OrganizationClient()
client.name = "My M2M Client"

response = scalekit_client.m2m_client.create_organization_client(
    'org_123456',
    client
)
```

    
  
</div>

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

      Method to update organization client

      
        organization id
      
      
        client id
      
      
        Organization Client
      
      
        Update Organization Client Response
      

```python wrap showLineNumbers=false
from scalekit.v1.clients.clients_pb2 import OrganizationClient

client = OrganizationClient()
client.name = "Updated M2M Client"

response = scalekit_client.m2m_client.update_organization_client(
    'org_123456',
    'client_123456',
    client
)
```

    
  
</div>

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

      Method to delete organization client

      
        organization id
      
      
        client id
      
      
        Empty on success.
      

```python wrap showLineNumbers=false
scalekit_client.m2m_client.delete_organization_client(
    'org_123456',
    'client_123456'
)
```

    
  
</div>

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

      Method to add organization client secret

      
        organization id
      
      
        client id
      
      
        Create Organization Client Secret Response
      

```python wrap showLineNumbers=false
response = scalekit_client.m2m_client.add_organization_client_secret(
    'org_123456',
    'client_123456'
)
```

    
  
</div>

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

      Method to remove organization client secret

      
        organization id
      
      
        client id
      
      
        secret id
      
      
        Empty on success.
      

```python wrap showLineNumbers=false
scalekit_client.m2m_client.remove_organization_client_secret(
    'org_123456',
    'client_123456',
    'secret_123456'
)
```

    
  
</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 |
