Archive opportunity

Archives an opportunity with an archive reason and can email the candidate.

POST https://cotlet.dev/api/v1/lever/opportunities/{opportunity_id}/archive

write Confirm

Archives only the opportunity you name, not the candidate's other active opportunities. With send_email the email goes out in the same step, as with Archive + Send Now in Lever, and it cannot be recalled. A reason that your account does not define fails with an error that lists the reasons. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: archive_opportunity
NameTypeDescription
opportunity_id string required string Opportunity ID from list_opportunities.
reason string required string Archive reason name from list_archive_reasons.
send_email boolean boolean true sends an email to the candidate as part of archiving. Default: false.
email_body string string Text of the email. Required when send_email is true.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/lever/opportunities/2d6f9b83-a41e-4c07-9e52-b8c3a0f17d64/archive \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason":"Underqualified","send_email":true,"email_body":"Hi Dana, thank you for your time on the phone screen for Senior Designer. We have decided not to move forward, and we wish you the best in your search."}'
Python
result = client.call("lever", "archive_opportunity", {"opportunity_id":"2d6f9b83-a41e-4c07-9e52-b8c3a0f17d64","reason":"Underqualified","send_email":True,"email_body":"Hi Dana, thank you for your time on the phone screen for Senior Designer. We have decided not to move forward, and we wish you the best in your search."})
Node.js
const result = await cotlet.call('lever', 'archive_opportunity', {"opportunity_id":"2d6f9b83-a41e-4c07-9e52-b8c3a0f17d64","reason":"Underqualified","send_email":true,"email_body":"Hi Dana, thank you for your time on the phone screen for Senior Designer. We have decided not to move forward, and we wish you the best in your search."});
CLI
cotlet call lever archive_opportunity --data '{"opportunity_id":"2d6f9b83-a41e-4c07-9e52-b8c3a0f17d64","reason":"Underqualified","send_email":true,"email_body":"Hi Dana, thank you for your time on the phone screen for Senior Designer. We have decided not to move forward, and we wish you the best in your search."}'

Example response

JSON

{
  "opportunity_id": "2d6f9b83-a41e-4c07-9e52-b8c3a0f17d64",
  "name": "Dana Whitfield",
  "previous_stage": "Phone screen",
  "archived": {
    "reason": "Underqualified",
    "archived_at": "2026-10-22T09:14:00Z"
  },
  "email_sent": true
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.