> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute Actions via RPC

> Run any StackOne action programmatically using the unified RPC endpoint

The Actions RPC endpoint is the unified way to execute any of StackOne's 10,000+ actions. It's the same layer used by MCP servers and AI Toolset, giving you consistent programmatic access to all integrations.

<Info>
  This guide covers the **Platform API** approach to executing actions. For direct REST access to provider data, see the [Unified APIs](/guides/introduction).
</Info>

The RPC endpoint routes your request to the appropriate end-user's provider based on the `x-account-id` header, handles authentication, transforms requests to match provider APIs, and returns normalized data.

## Execute an Action

<Tabs>
  <Tab title="TypeScript SDK">
    ```typescript theme={null}
    import { StackOne } from "@stackone/stackone-client-ts";

    const stackOne = new StackOne({
      security: {
        username: process.env.STACKONE_API_KEY!,
        password: "",
      },
    });

    const result = await stackOne.actions.rpcAction({
      action: "bamboohr_list_employees",
      query: {
        pageSize: "25",
      },
      xAccountId: "customer-bamboohr",
    });

    // result.rpcActionResponse?.data = [{ id: "emp_123", ... }, ...]
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.stackone.com/actions/rpc" \
      -u "$STACKONE_API_KEY:" \
      -H "x-account-id: customer-bamboohr" \
      -H "Content-Type: application/json" \
      -d '{
        "action": "bamboohr_list_employees",
        "query": { "page_size": 25 }
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests
    import base64
    import os

    api_key = os.environ["STACKONE_API_KEY"]
    headers = {
        "Authorization": f"Basic {base64.b64encode(f'{api_key}:'.encode()).decode()}",
        "x-account-id": "customer-bamboohr",
        "Content-Type": "application/json"
    }

    response = requests.post(
        "https://api.stackone.com/actions/rpc",
        headers=headers,
        json={
            "action": "bamboohr_list_employees",
            "query": {"page_size": 25}
        }
    )

    employees = response.json()["data"]
    ```
  </Tab>
</Tabs>

***

## Request Parameters

| Parameter | Type   | Description                                                                            |
| --------- | ------ | -------------------------------------------------------------------------------------- |
| `action`  | string | The action identifier (e.g., `bamboohr_list_employees`, `greenhouse_create_candidate`) |
| `query`   | object | Query parameters for the action                                                        |
| `body`    | object | Request body for write operations                                                      |
| `path`    | object | Path parameters (e.g., `{ "id": "emp_123" }`)                                          |

### Headers

| Header          | Required | Description                                      |
| --------------- | -------- | ------------------------------------------------ |
| `x-account-id`  | Yes      | The linked account to execute the action against |
| `Authorization` | Yes      | Basic auth with your API key                     |

***

## Discover Available Actions

Use `GET /actions` to find what actions are available for a specific account or provider:

<Tabs>
  <Tab title="TypeScript SDK">
    ```typescript theme={null}
    const result = await stackOne.actions.listActionsMeta({
      filter: {
        connectors: "bamboohr",  // Filter by provider
      },
    });

    const actions = result.actionsMetaPaginated?.data?.[0]?.actions ?? [];

    // actions = [
    //   { id: "bamboohr_list_employees", label: "List Employees", ... },
    //   { id: "bamboohr_get_employee", label: "Get Employee", ... },
    //   ...
    // ]
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.stackone.com/actions?filter[connectors]=bamboohr" \
      -u "$STACKONE_API_KEY:"
    ```
  </Tab>
</Tabs>

<Tip>
  Build dynamic agent tooling by querying available actions first, then executing them via RPC. See [Actions Metadata](/api/actions-metadata) for a complete guide.
</Tip>

***

## Common Action Patterns

### Workday: List Employees

```typescript theme={null}
const result = await stackOne.actions.rpcAction({
  action: "workday_list_employees",
  query: { pageSize: "50" },
  xAccountId: "customer-workday",
});
```

### Greenhouse: Create Candidate

```typescript theme={null}
const result = await stackOne.actions.rpcAction({
  action: "greenhouse_create_candidate",
  body: {
    first_name: "Jane",
    last_name: "Doe",
    email: "jane@example.com"
  },
  xAccountId: "customer-greenhouse",
});
```

### Salesforce: Get Contact

```typescript theme={null}
const result = await stackOne.actions.rpcAction({
  action: "salesforce_get_contact",
  path: { id: "contact_abc123" },
  xAccountId: "customer-salesforce",
});
```

***

## Related

<CardGroup cols={2}>
  <Card title="Actions RPC API Reference" icon="code" href="/platform/api-reference/actions/make-an-rpc-call-to-an-action">
    Full API reference with all parameters
  </Card>

  <Card title="Actions Metadata" icon="list" href="/api/actions-metadata">
    Discover available actions and build dynamic UIs
  </Card>

  <Card title="Multi-Tenant Accounts" icon="users" href="/api/multi-tenant-accounts">
    Manage accounts by owner for multi-tenant apps
  </Card>

  <Card title="Request Logs" icon="scroll" href="/api/observability-sync">
    Monitor and debug action execution
  </Card>
</CardGroup>
