View as Markdown
Lever icon

Lever ACTION

Archive Opportunity

Archives a candidate opportunity with a specified reason (hired or not hired). Use this when a hiring decision has been made — to mark a candidate as hired or to reject them. Use List Archive Reasons to find valid reason IDs (filter by type hired or non-hired). Use Search Opportunities to find the opportunity ID. Archiving is reversible — candidates can be unarchived in the Lever UI. Example: call with opportunityId="<id>", reasonId="<reasonId>", performAs="<userId>" → archives the candidate (reversible in the Lever UI) and returns the updated opportunity. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Lever account once, then configure and run Archive 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-archive-opportunity",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    lever: { authProvisionId: "apn_xxxxxxx" },
    opportunityId: "Opportunity ID",
    reasonId: "Archive Reason ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Archive Opportunity inputs
Property Type Description
opportunityId Opportunity ID string
The ID of the opportunity to archive. Use Search Opportunities to find opportunity IDs.
Required
reasonId Archive Reason ID string
The ID of the archive reason. Use List Archive Reasons to find valid reason IDs.
Required
performAs Perform As (User ID) string
User ID of the person archiving — recorded in the audit trail. Use List Users to find user IDs.
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-archive-opportunity
Version
0.0.2
App
Lever
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes