Lever ACTION
Create Opportunity
Creates a new opportunity (candidate + application) in Lever. Use this to add a new candidate to the pipeline, optionally applying them to a specific job posting. Use List Postings to find posting IDs, List Stages to find stage IDs, and List Users to find the recruiter user ID for Perform As. Perform As is required — it sets the opportunity creator and owner. If a candidate with the same email already exists, Lever will link the new opportunity to the existing contact rather than creating a duplicate. WARNING: only one posting UID may be specified per request. Example: to add Jane Doe as a referred candidate on a posting, call with performAs="<userId>", candidateName="Jane Doe", email="jane@example.com", postingId="<postingId>", origin="referred" → returns the created opportunity with its
id. See the documentation- Action
- Writes data
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Lever account once, then configure and run Create Opportunity from your backend or agent.
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: "lever-create-opportunity",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
lever: { authProvisionId: "apn_xxxxxxx" },
performAs: "Perform As (User ID)",
candidateName: "Candidate Name",
},
})
console.log(result)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": "lever-create-opportunity",
"configured_props": {
"lever": { "authProvisionId": "apn_xxxxxxx" },
"performAs": "Perform As (User ID)",
"candidateName": "Candidate Name"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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": "lever",
},
},
},
)
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: "lever-create-opportunity",
arguments: {
performAs: "Perform As (User ID)",
candidateName: "Candidate Name",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
performAs Perform As (User ID) | string | User ID of the recruiter creating this opportunity — sets the creator and default owner. Use List Users to find user IDs. Required |
candidateName Candidate Name | string | Full name of the candidate. Required |
headline Headline | string | Current job title and company (e.g. Senior Engineer at Acme Corp). Optional |
email Email | string | Candidate's email address. Used for deduplication — if a contact with this email already exists, the opportunity will be linked to them. Optional |
phone Phone | string | Candidate's phone number. Optional |
postingId Posting ID | string | Job posting to apply this candidate to. Use List Postings to find posting IDs. Only one posting per request. Optional |
stageId Stage ID | string | Initial pipeline stage. Use List Stages to find stage IDs. Defaults to 'New Lead' if omitted. Optional |
origin Origin | string | How the candidate entered the pipeline (e.g. referred, sourced, applied). Optional |
tags Tags | string | Comma-separated list of tags to apply (e.g. python,senior,remote). Optional |
sources Sources | string | Comma-separated list of sources (e.g. LinkedIn,Referral). Optional |
links Links | string | Comma-separated list of URLs to social profiles or portfolio (e.g. https://linkedin.com/in/jane,https://github.com/jane). Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- lever-create-opportunity
- Version
- 0.0.2
- App
- Lever
- Authentication
- OAuth
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗