# Create User Invite — Ramp (Sandbox Version)

> Invite a new person to your Ramp Sandbox organization by email — use this to onboard an employee who doesn't yet have a Ramp Sandbox account. Requires their email, first and last name, and role (e.g. BUSINESS_USER); department, location…

- Key: `ramp_sandbox-create-user-invite`
- Type: Action (Write)
- Version: 0.0.5
- App: Ramp (Sandbox Version) (`ramp_sandbox`) — https://pipedream.com/apps/ramp-sandbox.md
- This page (HTML): https://pipedream.com/apps/ramp-sandbox/actions/create-user-invite
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/ramp_sandbox/actions/create-user-invite/create-user-invite.mjs

## Description

Invite a new person to your Ramp Sandbox organization by email — use this to onboard an employee who doesn't yet have a Ramp Sandbox account. Requires their email, first and last name, and `role` (e.g. `BUSINESS_USER`); department, location, and direct manager are optional. Run **List Departments** and **List Locations** to find valid department/location IDs, and **List Users** to find a direct manager's user ID — each is a Ramp UUID, e.g. `fffe6c22-698f-4dc5-b2b1-b35f86947d90`. This is a deferred operation, so the invited user may not appear in **List Users** immediately; once they do, use **Update User** to change their role, department, location, or manager. [See the documentation](https://docs.ramp.com/developer-api/v1/reference/rest/users#post-developer-v1-users-deferred)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `email` | `string` | Yes | The employee's email address |
| `firstName` | `string` | Yes | First name of the employee |
| `lastName` | `string` | Yes | Last name of the employee |
| `role` | `string` | Yes | The employee's role |
| `departmentId` | `string` | No | Unique identifier of a department — a Ramp UUID, e.g. fffe6c22-698f-4dc5-b2b1-b35f86947d90 (not a department name). Run the List Departments action to find valid IDs. |
| `directManagerId` | `string` | No | Unique identifier of the employee's direct manager |
| `locationId` | `string` | No | Unique identifier of a location — a Ramp UUID, e.g. 961c6f01-5719-4f4c-8fef-4096a031f32a (not a location name). Run the List Locations action to find valid IDs. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "ramp_sandbox",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "ramp_sandbox-create-user-invite",
  arguments: {
    email: "Email",
    firstName: "First Name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "ramp_sandbox-create-user-invite",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    ramp_sandbox: { authProvisionId: "apn_xxxxxxx" },
    email: "Email",
    firstName: "First Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "ramp_sandbox-create-user-invite",
    "configured_props": {
      "ramp_sandbox": { "authProvisionId": "apn_xxxxxxx" },
      "email": "Email",
      "firstName": "First Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/ramp-sandbox.md · All apps: https://pipedream.com/apps
