# Create Candidate — Greenhouse

> Creates a new candidate entry in Greenhouse. See the documentation

- Key: `greenhouse-create-candidate`
- Type: Action (Write)
- Version: 0.0.2
- App: Greenhouse (`greenhouse`) — https://pipedream.com/apps/greenhouse.md
- This page (HTML): https://pipedream.com/apps/greenhouse/actions/create-candidate
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/greenhouse/actions/create-candidate/create-candidate.mjs

## Description

Creates a new candidate entry in Greenhouse. [See the documentation](https://developers.greenhouse.io/harvest.html#post-add-candidate)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `userId` | `string` | Yes | The identification of the user who is registering. Options are loaded from the connected account. |
| `firstName` | `string` | Yes | The person's first name. |
| `lastName` | `string` | Yes | The person's last name. |
| `company` | `string` | No | The person's company. |
| `title` | `string` | No | The person's title. |
| `phoneNumbers` | `string[]` | No | A list of phone numbers. The phone number includes a plus sign (+), then country code, city code, and local phone number. |
| `addressses` | `string[]` | No | A list of addresses. |
| `emailAddresses` | `string[]` | No | A list of email addresses. |
| `websiteAddresses` | `string[]` | No | A list of website addresses . |
| `socialMediaAddresses` | `string[]` | No | A list of social media addresses. |
| `tags` | `string[]` | No | A list of tags as strings. |
| `customFields` | `object` | No | An object containing new custom field values. The fields are the custom field Id. |
| `recruiterId` | `string` | No | The ID of the recruiter - either id or email must be present. Options are loaded from the connected account. |
| `recruiterEmail` | `string` | No | The email of the recruiter - either id or email must be present. |
| `coordinatorId` | `string` | No | The ID of the coordinator - either id or email must be present. Options are loaded from the connected account. |
| `coordinatorEmail` | `string` | No | The email of the coordinator - either id or email must be present. |
| `educations` | `string[]` | No | A list of education records. Options are loaded from the connected account. |
| `employments` | `string[]` | No | A list of employment record objects. Format: {"company_name": "Greenhouse","title": "Engineer","start_date": "2001-09-15T00:00:00.000Z","end_date": "2004-05-15T00:00:00.000Z"} |
| `activityFeedNotes` | `string[]` | No | A list of activity feed objects. Format: {"body": "John Locke was moved into Recruiter Phone Screen for Accounting Manager on 03/27/2014 by Boone Carlyle","visibility": "admin_only"}. Visibility can be one of: admin_only, private or public |
| `jobIds` | `string[]` | Yes | An array of job ids to which the person will be assigned. Options are loaded from the connected account. |

## 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": "greenhouse",
      },
    },
  },
)

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: "greenhouse-create-candidate",
  arguments: {
    userId: "User Id",
    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: "greenhouse-create-candidate",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    greenhouse: { authProvisionId: "apn_xxxxxxx" },
    userId: "User Id",
    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": "greenhouse-create-candidate",
    "configured_props": {
      "greenhouse": { "authProvisionId": "apn_xxxxxxx" },
      "userId": "User Id",
      "firstName": "First Name"
    }
  }'
```

---

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